home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / Emulatory / AROS / include / ctype.h next >
Encoding:
C/C++ Source or Header  |  1978-03-06  |  1.6 KB  |  52 lines

  1. #ifndef CTYPE_H
  2. #define CTYPE_H
  3.  
  4. /*
  5.     (C) 1995-96 AROS - The Amiga Replacement OS
  6.     $Id: ctype.h,v 1.2 1996/10/19 17:43:55 aros Exp $
  7.  
  8.     Desc: ANSI-C header file ctype.h
  9.     Lang: english
  10. */
  11.  
  12. #define _ISupper    0x0001  /* UPPERCASE */
  13. #define _ISlower    0x0002  /* lowercase */
  14. #define _ISalpha    0x0004  /* a-y */
  15. #define _ISdigit    0x0008  /* 0-9 */
  16. #define _ISxdigit   0x0010  /* 0-9, a-f, A-F */
  17. #define _ISspace    0x0020  /* Space, Tab, CR, LF, FF */
  18. #define _ISprint    0x0040  /* 32-126, 160-255 */
  19. #define _ISgraph    0x0080  /* [] */
  20. #define _ISblank    0x0100  /* Space, Tab */
  21. #define _IScntrl    0x0200  /* 0-31, 127 */
  22. #define _ISpunct    0x0400  /* .,:;!? */
  23. #define _ISalnum    (_ISalpha | _ISdigit)
  24.  
  25. extern const unsigned short int *__ctype_b;
  26. extern const int *__ctype_toupper;
  27. extern const int *__ctype_tolower;
  28.  
  29. #define _istype(c,type) \
  30.     (__ctype_b[(int) (c)] & (unsigned short int) (type))
  31.  
  32. #define isascii(c)      ((c) & 0x80)
  33. #define toascii(c)      ((c) & 0x7F)
  34.  
  35. #define isupper(c)      _istype(c,_ISupper)
  36. #define islower(c)      _istype(c,_ISlower)
  37. #define isalpha(c)      _istype(c,_ISalpha)
  38. #define isdigit(c)      _istype(c,_ISdigit)
  39. #define isxdigit(c)     _istype(c,_ISxdigit)
  40. #define isspace(c)      _istype(c,_ISspace)
  41. #define isprint(c)      _istype(c,_ISprint)
  42. #define isgraph(c)      _istype(c,_ISgraph)
  43. #define iscntrl(c)      _istype(c,_IScntrl)
  44. #define ispunct(c)      _istype(c,_ISpunct)
  45. #define isalnum(c)      _istype(c,_ISalnum)
  46.  
  47. #define toupper(c)      (__ctype_toupper[(int)(c)])
  48. #define tolower(c)      (__ctype_tolower[(int)(c)])
  49.  
  50. #endif /* CTYPE_H */
  51.  
  52.