home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / qc25 / include / ctype.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-25  |  2.9 KB  |  97 lines

  1. /***
  2. *ctype.h - Makros für Zeichenumwandlung und ctype
  3. *
  4. *    Copyright (c) 1985-1990, Microsoft Corporation.  Alle Rechte vorbehalten.
  5. *
  6. * Zweck:
  7. *    Definiert Makros für Zeicheneinstufung und Umwandlung.
  8. *    [ANSI/System V]
  9. *
  10. ***/
  11.  
  12. #if defined(_DLL) && !defined(_MT)
  13. #error _DLL kann ohne _MT nicht definiert werden 
  14. #endif
  15.  
  16. #ifdef _MT
  17. #define _FAR_ _far
  18. #else
  19. #define _FAR_
  20. #endif
  21.  
  22.  
  23. /*
  24.  * Über diese Deklaration hat der Benutzer über die Include-Datei ctype.h
  25.  * Zugriff auf das in ctype.obj definierte ctype-Nachschlagedatenfeld.
  26.  */
  27.  
  28. #ifdef _DLL
  29. extern unsigned char _FAR_ _cdecl _ctype[];
  30. #else
  31. extern unsigned char _near _cdecl _ctype[];
  32. #endif
  33.  
  34. /* Bitabdeckungen (Masken) für mögliche Zeichentypen einrichten */
  35.  
  36. #define _UPPER        0x1    /* Großbuchstabe */
  37. #define _LOWER        0x2    /* Kleinbuchstabe */
  38. #define _DIGIT        0x4    /* Ziffer[0-9] */
  39. #define _SPACE        0x8    /* Tab, Wagenrücklauf, Neue-Zeile */
  40.                 /* Vertikal-Tab oder Neue-Seite */
  41. #define _PUNCT        0x10    /* Interpunktionszeichen */
  42. #define _CONTROL    0x20    /* Steuerzeichen */
  43. #define _BLANK        0x40    /* Leerzeichen */
  44. #define _HEX        0x80    /* Hexadezimalziffer */
  45.  
  46. /* Funktionsprototypen für Zeicheneinstufung */
  47.  
  48. #ifndef _CTYPE_DEFINED
  49. int _FAR_ _cdecl isalpha(int);
  50. int _FAR_ _cdecl isupper(int);
  51. int _FAR_ _cdecl islower(int);
  52. int _FAR_ _cdecl isdigit(int);
  53. int _FAR_ _cdecl isxdigit(int);
  54. int _FAR_ _cdecl isspace(int);
  55. int _FAR_ _cdecl ispunct(int);
  56. int _FAR_ _cdecl isalnum(int);
  57. int _FAR_ _cdecl isprint(int);
  58. int _FAR_ _cdecl isgraph(int);
  59. int _FAR_ _cdecl iscntrl(int);
  60. int _FAR_ _cdecl toupper(int);
  61. int _FAR_ _cdecl tolower(int);
  62. int _FAR_ _cdecl _tolower(int);
  63. int _FAR_ _cdecl _toupper(int);
  64. int _FAR_ _cdecl isascii(int);
  65. int _FAR_ _cdecl toascii(int);
  66. int _FAR_ _cdecl iscsymf(int);
  67. int _FAR_ _cdecl iscsym(int);
  68. #define _CTYPE_DEFINED
  69. #endif
  70.  
  71. /* Makrodefinitionen für Zeicheneinstufung */
  72.  
  73. #define isalpha(_c)    ( (_ctype+1)[_c] & (_UPPER|_LOWER) )
  74. #define isupper(_c)    ( (_ctype+1)[_c] & _UPPER )
  75. #define islower(_c)    ( (_ctype+1)[_c] & _LOWER )
  76. #define isdigit(_c)    ( (_ctype+1)[_c] & _DIGIT )
  77. #define isxdigit(_c)    ( (_ctype+1)[_c] & _HEX )
  78. #define isspace(_c)    ( (_ctype+1)[_c] & _SPACE )
  79. #define ispunct(_c)    ( (_ctype+1)[_c] & _PUNCT )
  80. #define isalnum(_c)    ( (_ctype+1)[_c] & (_UPPER|_LOWER|_DIGIT) )
  81. #define isprint(_c)    ( (_ctype+1)[_c] & (_BLANK|_PUNCT|_UPPER|_LOWER|_DIGIT) )
  82. #define isgraph(_c)    ( (_ctype+1)[_c] & (_PUNCT|_UPPER|_LOWER|_DIGIT) )
  83. #define iscntrl(_c)    ( (_ctype+1)[_c] & _CONTROL )
  84. #ifndef NO_EXT_KEYS
  85. #define toupper(_c)    ( (islower(_c)) ? _toupper(_c) : (_c) )
  86. #define tolower(_c)    ( (isupper(_c)) ? _tolower(_c) : (_c) )
  87. #endif
  88. #define _tolower(_c)    ( (_c)-'A'+'a' )
  89. #define _toupper(_c)    ( (_c)-'a'+'A' )
  90. #define isascii(_c)    ( (unsigned)(_c) < 0x80 )
  91. #define toascii(_c)    ( (_c) & 0x7f )
  92.  
  93. /* MS C, Version 2.0, erweiterte ctype-Makros */
  94.  
  95. #define iscsymf(_c)    (isalpha(_c) || ((_c) == '_'))
  96. #define iscsym(_c)    (isalnum(_c) || ((_c) == '_'))
  97.