comparison target-utils/include/ctype.h @ 97:202b5aa009bc

target-utils/include: our own ctype.h and strings.h added
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 31 Oct 2016 23:49:11 +0000
parents
children
comparison
equal deleted inserted replaced
96:d8d03dafb9c0 97:202b5aa009bc
1 #define _U 01
2 #define _L 02
3 #define _N 04
4 #define _S 010
5 #define _P 020
6 #define _C 040
7 #define _X 0100
8 #define _B 0200
9
10 extern const char _ctype_[];
11
12 #define isalpha(c) ((_ctype_+1)[c]&(_U|_L))
13 #define isupper(c) ((_ctype_+1)[c]&_U)
14 #define islower(c) ((_ctype_+1)[c]&_L)
15 #define isdigit(c) ((_ctype_+1)[c]&_N)
16 #define isxdigit(c) ((_ctype_+1)[c]&(_N|_X))
17 #define isspace(c) ((_ctype_+1)[c]&_S)
18 #define ispunct(c) ((_ctype_+1)[c]&_P)
19 #define isalnum(c) ((_ctype_+1)[c]&(_U|_L|_N))
20 #define isprint(c) ((_ctype_+1)[c]&(_P|_U|_L|_N|_B))
21 #define isgraph(c) ((_ctype_+1)[c]&(_P|_U|_L|_N))
22 #define iscntrl(c) ((_ctype_+1)[c]&_C)
23 #define isascii(c) ((unsigned)(c)<=0177)
24 #define toupper(c) ((c)-'a'+'A')
25 #define tolower(c) ((c)-'A'+'a')
26 #define toascii(c) ((c)&0177)