home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / _ctype.c next >
C/C++ Source or Header  |  1998-06-17  |  3KB  |  146 lines

  1. /***
  2. *_ctype.c - function versions of ctype macros
  3. *
  4. *       Copyright (c) 1989-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       This files provides function versions of the character
  8. *       classification and conversion macros in ctype.h.
  9. *
  10. *******************************************************************************/
  11.  
  12. /***
  13. *ctype - Function versions of ctype macros
  14. *
  15. *Purpose:
  16. *       Function versions of the macros in ctype.h.  In order to define
  17. *       these, we use a trick -- we undefine the macro so we can use the
  18. *       name in the function declaration, then re-include the file so
  19. *       we can use the macro in the definition part.
  20. *
  21. *       Functions defined:
  22. *           isalpha     isupper     islower
  23. *           isdigit     isxdigit    isspace
  24. *           ispunct     isalnum     isprint
  25. *           isgraph     isctrl      __isascii
  26. *           __toascii   __iscsym    __iscsymf
  27. *
  28. *Entry:
  29. *       int c = character to be tested
  30. *Exit:
  31. *       returns non-zero = character is of the requested type
  32. *                  0 = character is NOT of the requested type
  33. *
  34. *Exceptions:
  35. *       None.
  36. *
  37. *******************************************************************************/
  38.  
  39. #include <cruntime.h>
  40. #include <ctype.h>
  41.  
  42. int (__cdecl isalpha) (
  43.         int c
  44.         )
  45. {
  46.         return isalpha(c);
  47. }
  48.  
  49. int (__cdecl isupper) (
  50.         int c
  51.         )
  52. {
  53.         return isupper(c);
  54. }
  55.  
  56. int (__cdecl islower) (
  57.         int c
  58.         )
  59. {
  60.         return islower(c);
  61. }
  62.  
  63. int (__cdecl isdigit) (
  64.         int c
  65.         )
  66. {
  67.         return isdigit(c);
  68. }
  69.  
  70. int (__cdecl isxdigit) (
  71.         int c
  72.         )
  73. {
  74.         return isxdigit(c);
  75. }
  76.  
  77. int (__cdecl isspace) (
  78.         int c
  79.         )
  80. {
  81.         return isspace(c);
  82. }
  83.  
  84. int (__cdecl ispunct) (
  85.         int c
  86.         )
  87. {
  88.         return ispunct(c);
  89. }
  90.  
  91. int (__cdecl isalnum) (
  92.         int c
  93.         )
  94. {
  95.         return isalnum(c);
  96. }
  97.  
  98. int (__cdecl isprint) (
  99.         int c
  100.         )
  101. {
  102.         return isprint(c);
  103. }
  104.  
  105. int (__cdecl isgraph) (
  106.         int c
  107.         )
  108. {
  109.         return isgraph(c);
  110. }
  111.  
  112. int (__cdecl iscntrl) (
  113.         int c
  114.         )
  115. {
  116.         return iscntrl(c);
  117. }
  118.  
  119. int (__cdecl __isascii) (
  120.         int c
  121.         )
  122. {
  123.         return __isascii(c);
  124. }
  125.  
  126. int (__cdecl __toascii) (
  127.         int c
  128.         )
  129. {
  130.         return __toascii(c);
  131. }
  132.  
  133. int (__cdecl __iscsymf) (
  134.         int c
  135.         )
  136. {
  137.         return __iscsymf(c);
  138. }
  139.  
  140. int (__cdecl __iscsym) (
  141.         int c
  142.         )
  143. {
  144.         return __iscsym(c);
  145. }
  146.