c@427: #include "f2c.h" c@427: #ifdef __cplusplus c@427: extern "C" { c@427: #endif c@427: c@427: /* compare two strings */ c@427: c@427: #ifdef KR_headers c@427: integer s_cmp(a0, b0, la, lb) char *a0, *b0; ftnlen la, lb; c@427: #else c@427: integer s_cmp(char *a0, char *b0, ftnlen la, ftnlen lb) c@427: #endif c@427: { c@427: register unsigned char *a, *aend, *b, *bend; c@427: a = (unsigned char *)a0; c@427: b = (unsigned char *)b0; c@427: aend = a + la; c@427: bend = b + lb; c@427: c@427: if(la <= lb) c@427: { c@427: while(a < aend) c@427: if(*a != *b) c@427: return( *a - *b ); c@427: else c@427: { ++a; ++b; } c@427: c@427: while(b < bend) c@427: if(*b != ' ') c@427: return( ' ' - *b ); c@427: else ++b; c@427: } c@427: c@427: else c@427: { c@427: while(b < bend) c@427: if(*a == *b) c@427: { ++a; ++b; } c@427: else c@427: return( *a - *b ); c@427: while(a < aend) c@427: if(*a != ' ') c@427: return(*a - ' '); c@427: else ++a; c@427: } c@427: return(0); c@427: } c@427: #ifdef __cplusplus c@427: } c@427: #endif