~ubuntu-branches/ubuntu/trusty/libf2c2/trusty

« back to all changes in this revision

Viewing changes to h_indx.c

  • Committer: Bazaar Package Importer
  • Author(s): Alan Bain
  • Date: 2008-05-19 22:50:54 UTC
  • mfrom: (2.1.4 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080519225054-jlymia0wdvvfq7dg
Tags: 20061008-4
Remove CVS directory left in source package

Show diffs side-by-side

added added

removed removed

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