1
2
3
4
5 #define _U 01
6 #define _L 02
7 #define _N 04
8 #define _S 010
9 #define _P 020
10 #define _C 040
11 #define _B 0100
12 #define _X 0200
13
14 #ifndef lint
15 extern char _ctype[];
16
17 #define isalpha(c) ((_ctype + 1)[c] & (_U | _L))
18 #define isupper(c) ((_ctype + 1)[c] & _U)
19 #define islower(c) ((_ctype + 1)[c] & _L)
20 #define isdigit(c) ((_ctype + 1)[c] & _N)
21 #define isxdigit(c) ((_ctype + 1)[c] & _X)
22 #define isalnum(c) ((_ctype + 1)[c] & (_U | _L | _N))
23 #define isspace(c) ((_ctype + 1)[c] & _S)
24 #define ispunct(c) ((_ctype + 1)[c] & _P)
25 #define isprint(c) ((_ctype + 1)[c] & (_P | _U | _L | _N | _B))
26 #define isgraph(c) ((_ctype + 1)[c] & (_P | _U | _L | _N))
27 #define iscntrl(c) ((_ctype + 1)[c] & _C)
28 #define isascii(c) (!((c) & ~0177))
29 #define _toupper(c) ((c) - 'a' + 'A')
30 #define _tolower(c) ((c) - 'A' + 'a')
31 #define toascii(c) ((c) & 0177)
32 #endif
33
34