home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / h.z / CTYPE.H < prev    next >
C/C++ Source or Header  |  1996-07-24  |  4KB  |  116 lines

  1. /*
  2.  *  ctype.h    Character Handling
  3.  *
  4.  *  Copyright by WATCOM International Corp. 1988-1996.  All rights reserved.
  5.  */
  6. #ifndef _CTYPE_H_INCLUDED
  7. #define _CTYPE_H_INCLUDED
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11.  
  12. #ifndef _COMDEF_H_INCLUDED
  13.  #include <_comdef.h>
  14. #endif
  15.  
  16. #ifndef _WCHAR_T_DEFINED
  17. #define _WCHAR_T_DEFINED
  18. #define _WCHAR_T_DEFINED_
  19. #ifdef __cplusplus
  20. typedef long char wchar_t;
  21. #else
  22. typedef unsigned short wchar_t;
  23. #endif
  24. #endif
  25.  
  26. #ifndef _WCTYPE_T_DEFINED
  27. #define _WCTYPE_T_DEFINED
  28. #define _WCTYPE_T_DEFINED_
  29. typedef wchar_t wint_t;
  30. typedef wchar_t wctype_t;
  31. #endif
  32.  
  33. #define _LOWER    0x80
  34. #define _UPPER    0x40
  35. #define _DIGIT    0x20
  36. #define _XDIGT    0x10
  37. #define _PRINT    0x08
  38. #define _PUNCT    0x04
  39. #define _SPACE    0x02
  40. #define _CNTRL    0x01
  41.  
  42. _WCRTLINK extern int    isalnum(int);
  43. _WCRTLINK extern int    isalpha(int);
  44. _WCRTLINK extern int    iscntrl(int);
  45. _WCRTLINK extern int    isdigit(int);
  46. _WCRTLINK extern int    isgraph(int);
  47. _WCRTLINK extern int    islower(int);
  48. _WCRTLINK extern int    isprint(int);
  49. _WCRTLINK extern int    ispunct(int);
  50. _WCRTLINK extern int    isspace(int);
  51. _WCRTLINK extern int    isupper(int);
  52. _WCRTLINK extern int    isxdigit(int);
  53. _WCRTLINK extern int    isleadbyte(int);
  54. _WCRTLINK extern int    tolower(int);
  55. _WCRTLINK extern int    _tolower(int);
  56. _WCRTLINK extern int    toupper(int);
  57. _WCRTLINK extern int    _toupper(int);
  58. _WCRTLINK extern int    __iscsymf(int);
  59. _WCRTLINK extern int    __iscsym(int);
  60.  
  61. _WCRTLINK extern int    iswalpha(wint_t);
  62. _WCRTLINK extern int    iswalnum(wint_t);
  63. _WCRTLINK extern int    iswascii(wint_t);
  64. _WCRTLINK extern int    iswcntrl(wint_t);
  65. _WCRTLINK extern int    iswprint(wint_t);
  66. _WCRTLINK extern int    iswgraph(wint_t);
  67. _WCRTLINK extern int    iswdigit(wint_t);
  68. _WCRTLINK extern int    iswxdigit(wint_t);
  69. _WCRTLINK extern int    iswlower(wint_t);
  70. _WCRTLINK extern int    iswupper(wint_t);
  71. _WCRTLINK extern int    iswspace(wint_t);
  72. _WCRTLINK extern int    iswpunct(wint_t);
  73.  
  74. _WCRTLINK extern wctype_t wctype(const char *);
  75. _WCRTLINK extern int    iswctype(wint_t,wctype_t);
  76.  
  77. _WCRTLINK extern wint_t    towlower(wint_t);
  78. _WCRTLINK extern wint_t    towupper(wint_t);
  79.  
  80. #if !defined(NO_EXT_KEYS) /* extensions enabled */
  81.  _WCRTLINK extern int    isascii(int);
  82.  _WCRTLINK extern int    __isascii(int);
  83.  #define isascii(__c) ((unsigned)(__c) <= 0x7f)
  84.  #define __isascii(__c) ((unsigned)(__c) <= 0x7f)
  85. #endif
  86.  
  87. #if defined(__SW_BR) || defined(_RTDLL) 
  88.  #define _IsTable _IsTable_br
  89. #endif
  90. #ifdef M_I86HM
  91.  _WCRTLINK extern const char _WCFAR _IsTable[257];
  92. #else
  93.  _WCRTLINK extern const char _WCNEAR _IsTable[257];
  94. #endif
  95.  
  96. #define isalnum(__c)   (_IsTable[(unsigned char)((__c)+1)] & \
  97.                         (_LOWER|_UPPER|_DIGIT))
  98. #define isalpha(__c)   (_IsTable[(unsigned char)((__c)+1)] & (_LOWER|_UPPER))
  99. #define iscntrl(__c)   (_IsTable[(unsigned char)((__c)+1)] & _CNTRL)
  100. #define isdigit(__c)   (_IsTable[(unsigned char)((__c)+1)] & _DIGIT)
  101. #define isgraph(__c)  ((_IsTable[(unsigned char)((__c)+1)] & \
  102.                         (_PRINT|_SPACE))==_PRINT)
  103. #define islower(__c)   (_IsTable[(unsigned char)((__c)+1)] & _LOWER)
  104. #define isprint(__c)   (_IsTable[(unsigned char)((__c)+1)] & _PRINT)
  105. #define ispunct(__c)   (_IsTable[(unsigned char)((__c)+1)] & _PUNCT)
  106. #define isspace(__c)   (_IsTable[(unsigned char)((__c)+1)] & _SPACE)
  107. #define isupper(__c)   (_IsTable[(unsigned char)((__c)+1)] & _UPPER)
  108. #define isxdigit(__c)  (_IsTable[(unsigned char)((__c)+1)] & _XDIGT)
  109. #define __iscsymf(__c) (isalpha(__c)||((__c)=='_'))
  110. #define __iscsym(__c)  (isalnum(__c)||((__c)=='_'))
  111.  
  112. #ifdef __cplusplus
  113. };
  114. #endif
  115. #endif
  116.