1: /*
2: * Macros for determining character type.
3: *
4: * The table chrtype (in char.c) classifies each character
5: * in one of the categories defined below.
6: */
7:
8: #define _U 01 /* upper case */
9: #define _L 02 /* lower case */
10: #define _N 04 /* digit */
11: #define _S 010 /* space */
12: #define _P 020 /* punctuation */
13: #define _C 040 /* control */
14: #define _X 0100 /* hex digit (a-f) */
15:
16: extern char ctype[];
17:
18: #define isalpha(c) (ctype[(c)&0377]&(_U|_L))
19: #define isupper(c) (ctype[(c)&0377]&_U)
20: #define islower(c) (ctype[(c)&0377]&_L)
21: #define isdigit(c) (ctype[(c)&0377]&_N)
22: #define isxdigit(c) (ctype[(c)&0377]&(_N|_X))
23: #define isspace(c) (ctype[(c)&0377]&_S)
24: #define ispunct(c) (ctype[(c)&0377]&_P)
25: #define isalnum(c) (ctype[(c)&0377]&(_U|_L|_N))
26: #define isprint(c) (ctype[(c)&0377]&(_P|_U|_L|_N))
27: #define iscntrl(c) (ctype[(c)&0377]&_C)
28: #define isascii(c) ((unsigned)(c)<=0177)
29: #define toupper(c) (((c)&0377)-'a'+'A')
30: #define tolower(c) (((c)&0377)-'A'+'a')
31: #define toascii(c) (((c)&0177)
32: #define tonum(c) (isdigit(c)?(c)-'0':10+(((c)|(040))-'a'))
Defined macros
_C
defined in line
13; used 29 times
_L
defined in line
9; used 30 times
_N
defined in line
10; used 14 times
_P
defined in line
12; used 34 times
_S
defined in line
11; used 7 times
_U
defined in line
8; used 30 times
_X
defined in line
14; used 13 times
tonum
defined in line
32; used 1 times
Usage of this include