Update to 2.0.0 tree from current Fremantle build
[opencv] / 3rdparty / lapack / s_cmp.c
1 #include "clapack.h"
2
3 /* compare two strings */
4
5 integer s_cmp(char *a0, char *b0, ftnlen la, ftnlen lb)
6 {
7 register unsigned char *a, *aend, *b, *bend;
8 a = (unsigned char *)a0;
9 b = (unsigned char *)b0;
10 aend = a + la;
11 bend = b + lb;
12
13 if(la <= lb)
14         {
15         while(a < aend)
16                 if(*a != *b)
17                         return( *a - *b );
18                 else
19                         { ++a; ++b; }
20
21         while(b < bend)
22                 if(*b != ' ')
23                         return( ' ' - *b );
24                 else    ++b;
25         }
26
27 else
28         {
29         while(b < bend)
30                 if(*a == *b)
31                         { ++a; ++b; }
32                 else
33                         return( *a - *b );
34         while(a < aend)
35                 if(*a != ' ')
36                         return(*a - ' ');
37                 else    ++a;
38         }
39 return(0);
40 }