home *** CD-ROM | disk | FTP | other *** search
- /*
- * ctype.h
- *
- * Copyright (C) MicroWay, Inc., 1987, 1988
- *
- */
-
- #define _UPPER 0x01
- #define _LOWER 0x02
- #define _DIGIT 0x04
- #define _SPACE 0x08
- #define _PUNCT 0x10
- #define _CONTROL 0x20
- #define _HEXDIGIT 0x40
- #define _UNDERSCORE 0x80
-
- extern unsigned char _ctype_[];
-
- #define isascii(ch) ((unsigned)(ch)<=0x7f)
- #define toascii(ch) ((ch)&0x7f)
- #define isupper(ch) (((_ctype_+1)[(ch)])&(_UPPER))
- #define _toupper(ch) ((ch)-('a'-'A'))
- #define toupper(ch) ((islower((ch)))?(_toupper((ch))):(ch))
- #define islower(ch) (((_ctype_+1)[(ch)])&(_LOWER))
- #define _tolower(ch) ((ch)+('a'-'A'))
- #define tolower(ch) ((isupper((ch)))?(_tolower((ch))):(ch))
- #define isalpha(ch) (((_ctype_+1)[(ch)])&(_UPPER|_LOWER))
- #define isdigit(ch) (((_ctype_+1)[(ch)])&(_DIGIT))
- #define isxdigit(ch) (((_ctype_+1)[(ch)])&(_DIGIT|_HEXDIGIT))
- #define isalnum(ch) (((_ctype_+1)[(ch)])&(_UPPER|_LOWER|_DIGIT))
- #define iscsym(ch) (((_ctype_+1)[(ch)])&(_UPPER|_LOWER|_DIGIT|_UNDERSCORE))
- #define iscsymf(ch) (((_ctype_+1)[(ch)])&(_UPPER|_LOWER|_UNDERSCORE))
- #define isspace(ch) (((_ctype_+1)[(ch)])&(_SPACE))
- #define ispunct(ch) (((_ctype_+1)[(ch)])&(_PUNCT))
- #define iscntl(ch) (((_ctype_+1)[(ch)])&(_CONTROL))
- #define isprint(ch) (!iscntl(ch))
- #define isgraph(ch) (((_ctype_+1)[(ch)])&(_UPPER|_LOWER|_DIGIT|_PUNCT))
-