1 /* SPDX-License-Identifier: LGPL-2.0-or-later */ 2 #ifndef _CTYPE_H_ 3 #define _CTYPE_H_ 4 isblank(int c)5static inline int isblank(int c) 6 { 7 return c == ' ' || c == '\t'; 8 } 9 islower(int c)10static inline int islower(int c) 11 { 12 return c >= 'a' && c <= 'z'; 13 } 14 isupper(int c)15static inline int isupper(int c) 16 { 17 return c >= 'A' && c <= 'Z'; 18 } 19 isalpha(int c)20static inline int isalpha(int c) 21 { 22 return isupper(c) || islower(c); 23 } 24 isdigit(int c)25static inline int isdigit(int c) 26 { 27 return c >= '0' && c <= '9'; 28 } 29 isalnum(int c)30static inline int isalnum(int c) 31 { 32 return isalpha(c) || isdigit(c); 33 } 34 isspace(int c)35static inline int isspace(int c) 36 { 37 return c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\v' || c == '\f'; 38 } 39 toupper(int c)40static inline int toupper(int c) 41 { 42 return islower(c) ? c - 'a' + 'A' : c; 43 } 44 tolower(int c)45static inline int tolower(int c) 46 { 47 return isupper(c) ? c - 'A' + 'a' : c; 48 } 49 50 #endif /* _CTYPE_H_ */ 51