* added compilers lcc and bcc (linux86)
[mascara-docs.git] / compilers / linux86-0.16.17 / libc / include / ctype.h
blob245b1c0c5bc05f1c93fd7919cd29262b77ce6820
1 /*
2 * ctype.h Character classification and conversion
3 */
5 #ifndef __CTYPE_H
6 #define __CTYPE_H
8 extern unsigned char __ctype[];
10 #define __CT_d 0x01 /* numeric digit */
11 #define __CT_u 0x02 /* upper case */
12 #define __CT_l 0x04 /* lower case */
13 #define __CT_c 0x08 /* control character */
14 #define __CT_s 0x10 /* whitespace */
15 #define __CT_p 0x20 /* punctuation */
16 #define __CT_x 0x40 /* hexadecimal */
18 /* Define these as simple old style ascii versions */
19 #define toupper(c) (((c)>='a'&&(c)<='z') ? (c)^0x20 : (c))
20 #define tolower(c) (((c)>='A'&&(c)<='Z') ? (c)^0x20 : (c))
21 #define _toupper(c) ((c)^0x20)
22 #define _tolower(c) ((c)^0x20)
23 #define toascii(c) ((c)&0x7F)
25 #define __CT(c) (__ctype[1+(unsigned char)c])
27 /* Note the '!!' is a cast to 'bool' and even BCC deletes it in an if() */
28 #define isalnum(c) (!!(__CT(c)&(__CT_u|__CT_l|__CT_d)))
29 #define isalpha(c) (!!(__CT(c)&(__CT_u|__CT_l)))
30 #define isascii(c) (!((c)&~0x7F))
31 #define iscntrl(c) (!!(__CT(c)&__CT_c))
32 #define isdigit(c) (!!(__CT(c)&__CT_d))
33 #define isgraph(c) (!(__CT(c)&(__CT_c|__CT_s)))
34 #define islower(c) (!!(__CT(c)&__CT_l))
35 #define isprint(c) (!(__CT(c)&__CT_c))
36 #define ispunct(c) (!!(__CT(c)&__CT_p))
37 #define isspace(c) (!!(__CT(c)&__CT_s))
38 #define isupper(c) (!!(__CT(c)&__CT_u))
39 #define isxdigit(c) (!!(__CT(c)&__CT_x))
41 #endif /* __CTYPE_H */