~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to routines/f2c/libf2c/h_indx.c

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "f2c.h"
 
2
 
 
3
#ifdef KR_headers
 
4
shortint h_indx(a, b, la, lb) char *a, *b; ftnlen la, lb;
 
5
#else
 
6
shortint h_indx(char *a, char *b, ftnlen la, ftnlen lb)
 
7
#endif
 
8
{
 
9
ftnlen i, n;
 
10
char *s, *t, *bend;
 
11
 
 
12
n = la - lb + 1;
 
13
bend = b + lb;
 
14
 
 
15
for(i = 0 ; i < n ; ++i)
 
16
        {
 
17
        s = a + i;
 
18
        t = b;
 
19
        while(t < bend)
 
20
                if(*s++ != *t++)
 
21
                        goto no;
 
22
        return((shortint)i+1);
 
23
        no: ;
 
24
        }
 
25
return(0);
 
26
}