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

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