PatchworkOS
Loading...
Searching...
No Matches
strcasecmp.c
Go to the documentation of this file.
1
#include <
ctype.h
>
2
#include <
strings.h
>
3
4
int
strcasecmp
(
const
char
* s1,
const
char
* s2)
5
{
6
unsigned
char
c1, c2;
7
8
if
(s1 == s2)
9
{
10
return
0;
11
}
12
13
do
14
{
15
c1 =
tolower
((
unsigned
char
)*s1++);
16
c2 =
tolower
((
unsigned
char
)*s2++);
17
18
if
(c1 != c2)
19
{
20
return
c1 - c2;
21
}
22
23
if
(c1 ==
'\0'
)
24
{
25
return
0;
26
}
27
}
while
(1);
28
}
ctype.h
tolower
_PUBLIC int tolower(int c)
Definition
tolower.c:5
strcasecmp
int strcasecmp(const char *s1, const char *s2)
Definition
strcasecmp.c:4
strings.h
src
libstd
functions
strings
strcasecmp.c
Generated by
1.9.8