00001
00023
00024
00025
00026
00027
00028
00029
00030 #include <sent/stddefs.h>
00031
00032 #ifndef HAVE_STRCASECMP
00033
00042 int
00043 strcasecmp(char *s1, char *s2)
00044 {
00045 int c1, c2;
00046
00047 do {
00048 c1 = (*s1 >= 'a' && *s1 <= 'z') ? *s1 - 040 : *s1;
00049 c2 = (*s2 >= 'a' && *s2 <= 'z') ? *s2 - 040 : *s2;
00050 if (c1 != c2) break;
00051 } while (*(s1++) && *(s2++));
00052 return(c1 - c2);
00053 }
00054
00064 int
00065 strncasecmp(char *s1, char *s2, size_t n)
00066 {
00067 int c1, c2;
00068 do {
00069 c1 = (*s1 >= 'a' && *s1 <= 'z') ? *s1 - 040 : *s1;
00070 c2 = (*s2 >= 'a' && *s2 <= 'z') ? *s2 - 040 : *s2;
00071 if (c1 != c2) break;
00072 } while (*(s1++) && *(s2++) && (--n));
00073 return(c1 - c2);
00074 }
00075
00076 #endif