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

  1. /***
  2. *ismbcknj.c - contains the Kanji specific is* functions.
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       Provide non-portable Kanji support for MBCS libs.
  8. *
  9. *******************************************************************************/
  10.  
  11. #ifdef _MBCS
  12.  
  13. #include <cruntime.h>
  14. #include <mbdata.h>
  15. #include <mbstring.h>
  16. #include <mbctype.h>
  17.  
  18.  
  19. /***
  20. *int _ismbchira(c) - test character for hiragana (Japanese)
  21. *
  22. *Purpose:
  23. *       Test if the character c is a hiragana character.
  24. *
  25. *Entry:
  26. *       unsigned int c - character to test
  27. *
  28. *Exit:
  29. *       returns TRUE if CP == KANJI and character is hiragana, else FALSE
  30. *
  31. *Exceptions:
  32. *
  33. *******************************************************************************/
  34.  
  35. int __cdecl _ismbchira(c)
  36. unsigned int c;
  37. {
  38.         return(__mbcodepage == _KANJI_CP && c >= 0x829f && c <= 0x82f1);
  39. }
  40.  
  41.  
  42. /***
  43. *int _ismbckata(c) - test character for katakana (Japanese)
  44. *
  45. *Purpose:
  46. *       Tests to see if the character c is a katakana character.
  47. *
  48. *Entry:
  49. *       unsigned int c - character to test
  50. *
  51. *Exit:
  52. *       Returns TRUE if CP == KANJI and c is a katakana character, else FALSE.
  53. *
  54. *Exceptions:
  55. *
  56. *******************************************************************************/
  57.  
  58. int __cdecl _ismbckata(c)
  59. unsigned int c;
  60. {
  61.         return(__mbcodepage == _KANJI_CP && c >= 0x8340 && c <= 0x8396 && c != 0x837f);
  62. }
  63.  
  64.  
  65. /***
  66. *int _ismbcsymbol(c) - Tests if char is punctuation or symbol of Microsoft Kanji
  67. *                  code.
  68. *
  69. *Purpose:
  70. *       Returns non-zero if the character is kanji punctuation.
  71. *
  72. *Entry:
  73. *       unsigned int c - character to be tested
  74. *
  75. *Exit:
  76. *       Returns non-zero if CP == KANJI and the specified char is punctuation or symbol of
  77. *               Microsoft Kanji code, else 0.
  78. *
  79. *Exceptions:
  80. *
  81. *******************************************************************************/
  82.  
  83. int __cdecl _ismbcsymbol(c)
  84. unsigned int c;
  85. {
  86.         return(__mbcodepage == _KANJI_CP && c >= 0x8141 && c <= 0x81ac && c != 0x817f);
  87. }
  88.  
  89. #endif  /* _MBCS */
  90.