3 <<strncasecmp>>---case insensitive character string compare
10 int strncasecmp(const char *<[a]>, const char * <[b]>, size_t <[length]>);
14 int strncasecmp(<[a]>, <[b]>, <[length]>)
20 <<strncasecmp>> compares up to <[length]> characters
21 from the string at <[a]> to the string at <[b]> in a
22 case-insensitive manner.
26 If <<*<[a]>>> sorts lexicographically after <<*<[b]>>> (after
27 both are converted to upper case), <<strncasecmp>> returns a
28 number greater than zero. If the two strings are equivalent,
29 <<strncasecmp>> returns zero. If <<*<[a]>>> sorts
30 lexicographically before <<*<[b]>>>, <<strncasecmp>> returns a
31 number less than zero.
34 <<strncasecmp>> is in the Berkeley Software Distribution.
36 <<strncasecmp>> requires no supporting OS subroutines. It uses
37 tolower() from elsewhere in this library.
47 _DEFUN (strncasecmp
, (s1
, s2
, n
),
55 while (n
-- != 0 && tolower(*s1
) == tolower(*s2
))
57 if (n
== 0 || *s1
== '\0' || *s2
== '\0')
63 return tolower(*(unsigned char *) s1
) - tolower(*(unsigned char *) s2
);