home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c021 / 7.img / INCLUDE.ZIP / CTYPE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-04  |  2.0 KB  |  83 lines

  1. /*    ctype.h
  2.  
  3.     Defines the ctype macros.
  4.  
  5.         Copyright (c) Borland International 1987,1988,1990
  6.     All Rights Reserved.
  7. */
  8.  
  9. #ifndef __CTYPE_H
  10. #define __CTYPE_H
  11.  
  12. #if __STDC__
  13. #define _Cdecl
  14. #else
  15. #define _Cdecl    cdecl
  16. #endif
  17.  
  18. #ifndef __PAS__
  19. #define _CType _Cdecl
  20. #else
  21. #define _CType pascal
  22. #endif
  23.  
  24. #define _IS_SP    1            /* is space */
  25. #define _IS_DIG    2            /* is digit indicator */
  26. #define _IS_UPP    4            /* is upper case */
  27. #define _IS_LOW    8            /* is lower case */
  28. #define _IS_HEX    16            /* [0..9] or [A-F] or [a-f] */
  29. #define _IS_CTL    32            /* Control */
  30. #define _IS_PUN    64            /* punctuation */
  31.  
  32. extern    char _CType _ctype[];     /* Character type array */
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. int _Cdecl isalnum (int __c);
  38. int _Cdecl isalpha (int __c);
  39. int _Cdecl isascii (int __c);
  40. int _Cdecl iscntrl (int __c);
  41. int _Cdecl isdigit (int __c);
  42. int _Cdecl isgraph (int __c);
  43. int _Cdecl islower (int __c);
  44. int _Cdecl isprint (int __c);
  45. int _Cdecl ispunct (int __c);
  46. int _Cdecl isspace (int __c);
  47. int _Cdecl isupper (int __c);
  48. int _Cdecl isxdigit(int __c);
  49. #ifdef __cplusplus
  50. }
  51. #endif
  52.  
  53. #define isalnum(c)    (_ctype[(c) + 1] & (_IS_DIG | _IS_UPP | _IS_LOW))
  54. #define isalpha(c)    (_ctype[(c) + 1] & (_IS_UPP | _IS_LOW))
  55. #define isascii(c)    ((unsigned)(c) < 128)
  56. #define iscntrl(c)    (_ctype[(c) + 1] & _IS_CTL)
  57. #define isdigit(c)    (_ctype[(c) + 1] & _IS_DIG)
  58. #define isgraph(c)    ((c) >= 0x21 && (c) <= 0x7e)
  59. #define islower(c)    (_ctype[(c) + 1] & _IS_LOW)
  60. #define isprint(c)    ((c) >= 0x20 && (c) <= 0x7e)
  61. #define ispunct(c)    (_ctype[(c) + 1] & _IS_PUN)
  62. #define isspace(c)    (_ctype[(c) + 1] & _IS_SP)
  63. #define isupper(c)    (_ctype[(c) + 1] & _IS_UPP)
  64. #define isxdigit(c)    (_ctype[(c) + 1] & (_IS_DIG | _IS_HEX))
  65.  
  66. #define toascii(c)    ((c) & 0x7f)
  67.  
  68. #if !__STDC__
  69. #define _toupper(c)    ((c) + 'A' - 'a')
  70. #define _tolower(c)    ((c) + 'a' - 'A')
  71. #endif
  72.  
  73. #ifdef __cplusplus
  74. extern "C" {
  75. #endif
  76. int    _CType tolower(int __ch);
  77. int    _CType toupper(int __ch);
  78. #ifdef __cplusplus
  79. }
  80. #endif
  81.  
  82. #endif 
  83.