10 |
* is provided ``as is'' without express or implied warranty. |
* is provided ``as is'' without express or implied warranty. |
11 |
*/ |
*/ |
12 |
|
|
13 |
|
/* |
14 |
|
|
15 |
|
@deftypefn Supplemental int strncasecmp (const char *@var{s1}, const char *@var{s2}) |
16 |
|
|
17 |
|
A case-insensitive @code{strncmp}. |
18 |
|
|
19 |
|
@end deftypefn |
20 |
|
|
21 |
|
*/ |
22 |
|
|
23 |
#if defined(LIBC_SCCS) && !defined(lint) |
#if defined(LIBC_SCCS) && !defined(lint) |
24 |
static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87"; |
static char sccsid[] = "@(#)strcasecmp.c 5.5 (Berkeley) 11/24/87"; |
25 |
#endif /* LIBC_SCCS and not lint */ |
#endif /* LIBC_SCCS and not lint */ |
26 |
|
|
27 |
#include <ansidecl.h> |
#include <ansidecl.h> |
28 |
#ifdef __STDC__ |
#ifdef ANSI_PROTOTYPES |
29 |
#include <stddef.h> |
#include <stddef.h> |
30 |
#else |
#else |
31 |
#define size_t unsigned long |
#define size_t unsigned long |
36 |
* together for a case independent comparison. The mappings are |
* together for a case independent comparison. The mappings are |
37 |
* based upon ascii character sequences. |
* based upon ascii character sequences. |
38 |
*/ |
*/ |
39 |
static unsigned char charmap[] = { |
static const unsigned char charmap[] = { |
40 |
'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', |
'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', |
41 |
'\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', |
'\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', |
42 |
'\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', |
'\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', |