| 41 | #include <sys/libkern.h> |
| 42 | |
| 43 | int |
| 44 | strcasecmp(const char *s1, const char *s2) |
| 45 | { |
| 46 | const u_char *us1 = (const u_char *)s1, *us2 = (const u_char *)s2; |
| 47 | |
| 48 | while (tolower(*us1) == tolower(*us2)) { |
| 49 | if (*us1++ == '\0') |
| 50 | return (0); |
| 51 | us2++; |
| 52 | } |
| 53 | return (tolower(*us1) - tolower(*us2)); |
| 54 | } |
| 55 | |
| 56 | int |
| 57 | strncasecmp(const char *s1, const char *s2, size_t n) |