1: int s_cmp(a, b, la, lb) /* compare two strings */
2: char *a, *b;
3: long int la, lb;
4: {
5: char *aend, *bend;
6: aend = a + la;
7:
8: if(la <= lb)
9: {
10: while(a < aend)
11: if(*a != *b)
12: return( *a - *b );
13: else
14: { ++a; ++b; }
15:
16: }
17:
18: else
19: {
20: bend = b + lb;
21: while(b < bend)
22: if(*a == *b)
23: { ++a; ++b; }
24: else
25: return( *a - *b );
26: while(a < aend)
27: if(*a != ' ')
28: return(*a - ' ');
29: else ++a;
30: }
31: return(0);
32: }
Defined functions
s_cmp
defined in line
1; used 8 times