00001
00009
00010
00011 #ifndef _CTYPE_H_
00012 #define _CTYPE_H_
00013
00014 #define _U 0001
00015 #define _L 0002
00016 #define _N 0004
00017 #define _S 0010
00018 #define _P 0020
00019 #define _C 0040
00020 #define _X 0100
00021
00022 extern char _ctype_[];
00023
00024 #define isalpha(c) ((_ctype_+1)[(int)c]&(_U|_L))
00025 #define isupper(c) ((_ctype_+1)[(int)c]&_U)
00026 #define islower(c) ((_ctype_+1)[(int)c]&_L)
00027 #define isdigit(c) ((_ctype_+1)[(int)c]&_N)
00028 #define isxdigit(c) ((_ctype_+1)[(int)c]&(_N|_X))
00029 #define isspace(c) ((_ctype_+1)[(int)c]&_S)
00030 #define ispunct(c) ((_ctype_+1)[(int)c]&_P)
00031 #define isalnum(c) ((_ctype_+1)[(int)c]&(_U|_L|_N))
00032 #define isprshort(c) ((_ctype_+1)[(int)c]&(_P|_U|_L|_N))
00033 #define isprint(c) ((_ctype_+1)[(int)c]&(_P|_U|_L|_N|_S))
00034 #define iscntrl(c) ((_ctype_+1)[(int)c]&_C)
00035 #define isascii(c) ((unsigned)((int)(c))<=0177)
00036 #define toupper(c) (((int)(c))-'a'+'A')
00037 #define tolower(c) (((int)(c))-'A'+'a')
00038 #define toascii(c) (((int)(c))&0177)
00039
00040 #define ishexnumber(c) (isdigit(c) || \
00041 (isalpha(c) && c >= (isupper(c) ? 'A' : 'a') && \
00042 c <= (isupper(c) ? 'F' : 'f')))
00043
00044 #endif