home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_07 / MARK_WC2.LZH / INCLUDE / CTYPE.H < prev    next >
C/C++ Source or Header  |  1988-04-27  |  1KB  |  39 lines

  1. /*
  2.  * ctype.h -- routines to classify character types.
  3.  *
  4.  * Copyright (c) 1981-1987, Mark Williams Company, Chicago
  5.  * This file and its contents may not be copied or distributed
  6.  * without permission.
  7.  */
  8.  
  9. #ifndef    _U
  10.  
  11. extern char _ctype[];
  12.  
  13. /* Bits classifications */
  14. #define    _U    01        /* Upper-case alphabetic */
  15. #define    _L    02        /* Lower-case alphabetic */
  16. #define    _A    (_U|_L)        /* Alphabetic */
  17. #define    _D    010        /* Digits */
  18. #define    _S    020        /* White-space character */
  19. #define    _P    040        /* Punctuation character */
  20. #define    _C    0100        /* Control character */
  21. #define    _X    0200        /* Printable, but nothing else */
  22.  
  23. #define    isalpha(c)    (_ctype[(c)+1]&_A)
  24. #define    isupper(c)    (_ctype[(c)+1]&_U)
  25. #define    islower(c)    (_ctype[(c)+1]&_L)
  26. #define    isdigit(c)    (_ctype[(c)+1]&_D)
  27. #define    isalnum(c)    (_ctype[(c)+1]&(_A|_D))
  28. #define    isspace(c)    (_ctype[(c)+1]&_S)
  29. #define    ispunct(c)    (_ctype[(c)+1]&_P)
  30. #define    isprint(c)    (_ctype[(c)+1]&(_P|_X|_A|_D))
  31. #define    iscntrl(c)    (_ctype[(c)+1]&_C)
  32. #define    isascii(c)    (((c)&~0177)==0)
  33. #define    _tolower(c)    ((c)|('a'-'A'))
  34. #define    _toupper(c)    ((c)&~('a'-'A'))
  35. #define    toascii(c)    ((c)&0177)
  36. #endif
  37.  
  38. /* End of ctype.h */
  39.