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 strcasecmp (const char *@var{s1}, const char *@var{s2}) |
16 |
|
|
17 |
|
A case-insensitive @code{strcmp}. |
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 |
37 |
* based upon ascii character sequences. |
* based upon ascii character sequences. |
38 |
*/ |
*/ |
39 |
typedef unsigned char uc; |
typedef unsigned char uc; |
40 |
static unsigned char charmap[] = { |
static const unsigned char charmap[] = { |
41 |
(uc)'\000',(uc)'\001',(uc)'\002',(uc)'\003',(uc)'\004',(uc)'\005',(uc)'\006',(uc)'\007', |
(uc)'\000',(uc)'\001',(uc)'\002',(uc)'\003',(uc)'\004',(uc)'\005',(uc)'\006',(uc)'\007', |
42 |
(uc)'\010',(uc)'\011',(uc)'\012',(uc)'\013',(uc)'\014',(uc)'\015',(uc)'\016',(uc)'\017', |
(uc)'\010',(uc)'\011',(uc)'\012',(uc)'\013',(uc)'\014',(uc)'\015',(uc)'\016',(uc)'\017', |
43 |
(uc)'\020',(uc)'\021',(uc)'\022',(uc)'\023',(uc)'\024',(uc)'\025',(uc)'\026',(uc)'\027', |
(uc)'\020',(uc)'\021',(uc)'\022',(uc)'\023',(uc)'\024',(uc)'\025',(uc)'\026',(uc)'\027', |