xref: /kvm-unit-tests/lib/ctype.h (revision 6afb94812d924a754e2d44f6c5de9e1859b2df28)
1 /* SPDX-License-Identifier: LGPL-2.0-or-later */
2 #ifndef _CTYPE_H_
3 #define _CTYPE_H_
4 
5 static inline int isblank(int c)
6 {
7 	return c == ' ' || c == '\t';
8 }
9 
10 static inline int islower(int c)
11 {
12 	return c >= 'a' && c <= 'z';
13 }
14 
15 static inline int isupper(int c)
16 {
17 	return c >= 'A' && c <= 'Z';
18 }
19 
20 static inline int isalpha(int c)
21 {
22 	return isupper(c) || islower(c);
23 }
24 
25 static inline int isdigit(int c)
26 {
27 	return c >= '0' && c <= '9';
28 }
29 
30 static inline int isalnum(int c)
31 {
32 	return isalpha(c) || isdigit(c);
33 }
34 
35 static inline int isspace(int c)
36 {
37         return c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\v' || c == '\f';
38 }
39 
40 #endif /* _CTYPE_H_ */
41