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

  1. /***
  2. *mbtokata.c - Converts character to katakana.
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       Converts a character from hiragana to katakana.
  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. *unsigned short _mbctokata(c) - Converts character to katakana.
  21. *
  22. *Purpose:
  23. *       If the character c is hiragana, convert to katakana.
  24. *
  25. *Entry:
  26. *       unsigned int c - Character to convert.
  27. *
  28. *Exit:
  29. *       Returns converted character.
  30. *
  31. *Exceptions:
  32. *
  33. *******************************************************************************/
  34.  
  35. unsigned int __cdecl _mbctokata(
  36.     unsigned int c
  37.     )
  38. {
  39.         if (_ismbchira(c)) {
  40.                 c += 0xa1;
  41.                 if (c >= 0x837f)
  42.                         c++;
  43.         }
  44.         return(c);
  45. }
  46.  
  47. #endif  /* _MBCS */
  48.