3 /* This file contains macros definitions and extern declarations for a
4 * version of <ctype.h> which is aware of the o_flipcase letters used in
7 * This file uses the "uchar" data type and "UCHAR" conversion macro which
8 * are defined in "config.h". Consequently, any file that includes this
9 * header must include config.h first.
14 #define _CT_UPPER 0x01
15 #define _CT_LOWER 0x02
16 #define _CT_SPACE 0x04
17 #define _CT_DIGIT 0x08
18 #define _CT_ALNUM 0x10
19 #define _CT_CNTRL 0x20
21 #define isalnum(c) (_ct_ctypes[UCHAR(c)] & _CT_ALNUM)
22 #define isalpha(c) (_ct_ctypes[UCHAR(c)] & (_CT_LOWER|_CT_UPPER))
23 #define isdigit(c) (_ct_ctypes[UCHAR(c)] & _CT_DIGIT)
24 #define islower(c) (_ct_ctypes[UCHAR(c)] & _CT_LOWER)
25 #define isspace(c) (_ct_ctypes[UCHAR(c)] & _CT_SPACE)
26 #define isupper(c) (_ct_ctypes[UCHAR(c)] & _CT_UPPER)
27 #define iscntrl(c) (_ct_ctypes[UCHAR(c)] & _CT_CNTRL)
28 #define ispunct(c) (!_ct_ctypes[UCHAR(c)]) /* punct = "none of the above" */
30 #define isascii(c) (!((c) & 0x80))
32 #define toupper(c) _ct_toupper[UCHAR(c)]
33 #define tolower(c) _ct_tolower[UCHAR(c)]
35 extern uchar _ct_toupper
[];
36 extern uchar _ct_tolower
[];
37 extern uchar _ct_ctypes
[];
38 extern void _ct_init(/* char *flipcase */);
40 #endif /* ndef _CT_UPPER */