home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / DC-POS24.LZX / pOS / IncPOS.lzx / ctype.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-18  |  1.4 KB  |  65 lines

  1. #ifndef __CTYPE_H
  2. #define __CTYPE_H
  3.  
  4. #ifndef __INC_POS_PEXEC_TYPES_H
  5. #include <pExec/Types.h>
  6. #endif
  7.  
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11.  
  12. extern char _ctype[];
  13.  
  14. #define    _U    0x01    /* Upper-case    */
  15. #define    _L    0x02    /* Lower-case    */
  16. #define    _D    0x04    /* Decimal-digit */
  17. #define    _H    0x08    /* Hex-digit    */
  18. #define    _W    0x10    /* White-space    */
  19. #define    _C    0x20    /* Control char    */
  20. #define    _P    0x40    /* Punctuation    */
  21. #define    _B    0x80    /* Blank        */
  22.  
  23. int isalpha(int _c);
  24. int isupper(int _c);
  25. int islower(int _c);
  26. int isdigit(int _c);
  27. int isxdigit(int _c);
  28. int isalnum(int _c);
  29. int isspace(int _c);
  30. int ispunct(int _c);
  31. int iscntrl(int _c);
  32. int isprint(int _c);
  33. int isgraph(int _c);
  34. int isascii(int _c);
  35. int tolower(int _c);
  36. int toupper(int _c);
  37.  
  38. #ifdef __C_MACROS__
  39. #define isalpha(x)    ((_ctype+1)[x]&(_L|_U))
  40. #define isupper(x)    ((_ctype+1)[x]&(_U))
  41. #define islower(x)    ((_ctype+1)[x]&(_L))
  42. #define isdigit(x)    ((_ctype+1)[x]&(_D))
  43. #define isxdigit(x)    ((_ctype+1)[x]&(_H))
  44. #define isalnum(x)    ((_ctype+1)[x]&(_L|_U|_D))
  45. #define isspace(x)    ((_ctype+1)[x]&(_W))
  46. #define ispunct(x)    ((_ctype+1)[x]&(_P))
  47. #define iscntrl(x)    ((_ctype+1)[x]&(_C))
  48. #define isprint(x)    ((_ctype+1)[x]&(_P|_L|_U|_D|_B))
  49. #define isgraph(x)    ((_ctype+1)[x]&(_P|_L|_U|_D))
  50. #define isascii(x)    (((x)&0x80)==0)
  51. #endif
  52.  
  53. #define toascii(x) ((x)&0x7f)
  54. #define _tolower(x) ((x)|0x20)
  55. #define _toupper(x) ((x)&0x5f)
  56.  
  57.  
  58. #ifdef __cplusplus
  59. }
  60. #endif
  61.  
  62.  
  63. #endif /* _CTYPE_H */
  64.  
  65.