home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c063 / 1.ddi / INCLUDE.ZIP / CTYPE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-18  |  2.0 KB  |  77 lines

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