SimpleKernel
1.17.0
Loading...
Searching...
No Matches
sk_ctype.c
Go to the documentation of this file.
1
5
#include "
sk_ctype.h
"
6
7
#ifdef __cplusplus
8
extern
"C"
{
9
#endif
10
11
int
isalnum
(
int
c) {
return
(
isalpha
(c) ||
isdigit
(c)); }
12
13
int
isalpha
(
int
c) {
return
(
islower
(c) ||
isupper
(c)); }
14
15
int
isblank
(
int
c) {
return
(c ==
' '
|| c ==
'\t'
); }
16
17
int
iscntrl
(
int
c) {
return
((c >= 0 && c <= 31) || c == 127); }
18
19
int
isdigit
(
int
c) {
return
(c >=
'0'
&& c <=
'9'
); }
20
21
int
isgraph
(
int
c) {
return
(c >= 33 && c <= 126); }
22
23
int
islower
(
int
c) {
return
(c >=
'a'
&& c <=
'z'
); }
24
25
int
isprint
(
int
c) {
return
(c >= 32 && c <= 126); }
26
27
int
ispunct
(
int
c) {
return
(
isgraph
(c) && !
isalnum
(c)); }
28
29
int
isspace
(
int
c) {
30
return
(c ==
' '
|| c ==
'\f'
|| c ==
'\n'
|| c ==
'\r'
|| c ==
'\t'
||
31
c ==
'\v'
);
32
}
33
34
int
isupper
(
int
c) {
return
(c >=
'A'
&& c <=
'Z'
); }
35
36
int
isxdigit
(
int
c) {
37
return
(
isdigit
(c) || (c >=
'a'
&& c <=
'f'
) || (c >=
'A'
&& c <=
'F'
));
38
}
39
40
int
tolower
(
int
c) {
41
if
(
isupper
(c)) {
42
return
c + (
'a'
-
'A'
);
43
}
44
return
c;
45
}
46
47
int
toupper
(
int
c) {
48
if
(
islower
(c)) {
49
return
c - (
'a'
-
'A'
);
50
}
51
return
c;
52
}
53
54
#ifdef __cplusplus
55
}
56
#endif
sk_ctype.h
tolower
#define tolower
Definition
sk_ctype_test.cpp:20
isxdigit
#define isxdigit
Definition
sk_ctype_test.cpp:19
isblank
#define isblank
Definition
sk_ctype_test.cpp:10
isgraph
#define isgraph
Definition
sk_ctype_test.cpp:13
isprint
#define isprint
Definition
sk_ctype_test.cpp:15
iscntrl
#define iscntrl
Definition
sk_ctype_test.cpp:11
isdigit
#define isdigit
Definition
sk_ctype_test.cpp:12
isupper
#define isupper
Definition
sk_ctype_test.cpp:18
isalnum
#define isalnum
Definition
sk_ctype_test.cpp:8
isspace
#define isspace
Definition
sk_ctype_test.cpp:17
toupper
#define toupper
Definition
sk_ctype_test.cpp:21
isalpha
#define isalpha
Definition
sk_ctype_test.cpp:9
islower
#define islower
Definition
sk_ctype_test.cpp:14
ispunct
#define ispunct
Definition
sk_ctype_test.cpp:16
src
libc
sk_ctype.c
Generated by
1.9.8