Line | Count | Source (jump to first uncovered line) |
1 | #include "f2c.h" | |
2 | #ifdef __cplusplus | |
3 | extern "C" { | |
4 | #endif | |
5 | ||
6 | /* compare two strings */ | |
7 | ||
8 | #ifdef KR_headers | |
9 | integer s_cmp(a0, b0, la, lb) char *a0, *b0; ftnlen la, lb; | |
10 | #else | |
11 | integer s_cmp(char *a0, char *b0, ftnlen la, ftnlen lb) | |
12 | #endif | |
13 | 0 | { |
14 | 0 | register unsigned char *a, *aend, *b, *bend; |
15 | 0 | a = (unsigned char *)a0; |
16 | 0 | b = (unsigned char *)b0; |
17 | 0 | aend = a + la; |
18 | 0 | bend = b + lb; |
19 | ||
20 | 0 | if(la <= lb) |
21 | 0 | { |
22 | 0 | while(a < aend) |
23 | 0 | if(*a != *b) |
24 | 0 | return( *a - *b ); |
25 | 0 | else |
26 | 0 | { ++a; ++b; } |
27 | ||
28 | 0 | while(b < bend) |
29 | 0 | if(*b != ' ') |
30 | 0 | return( ' ' - *b ); |
31 | 0 | else ++b; |
32 | 0 | } |
33 | ||
34 | 0 | else |
35 | 0 | { |
36 | 0 | while(b < bend) |
37 | 0 | if(*a == *b) |
38 | 0 | { ++a; ++b; } |
39 | 0 | else |
40 | 0 | return( *a - *b ); |
41 | 0 | while(a < aend) |
42 | 0 | if(*a != ' ') |
43 | 0 | return(*a - ' '); |
44 | 0 | else ++a; |
45 | 0 | } |
46 | 0 | return(0); |
47 | 0 | } |
48 | #ifdef __cplusplus | |
49 | } | |
50 | #endif |