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

  1. /***
  2. *ismblgl.c - Tests to see if a given character is a legal MBCS char.
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       Tests to see if a given character is a legal MBCS character.
  8. *
  9. *******************************************************************************/
  10.  
  11. #ifdef _MBCS
  12.  
  13. #include <cruntime.h>
  14. #include <mbdata.h>
  15. #include <mbctype.h>
  16. #include <mbstring.h>
  17.  
  18.  
  19. /***
  20. *int _ismbclegal(c) - tests for a valid MBCS character.
  21. *
  22. *Purpose:
  23. *       Tests to see if a given character is a legal MBCS character.
  24. *
  25. *Entry:
  26. *       unsigned int c - character to test
  27. *
  28. *Exit:
  29. *       returns non-zero if Microsoft Kanji code, else 0
  30. *
  31. *Exceptions:
  32. *
  33. ******************************************************************************/
  34.  
  35. int __cdecl _ismbclegal(c)
  36. unsigned int c;
  37. {
  38.         return((_ISLEADBYTE(c>>8)) && (_ISTRAILBYTE(c&0377)));
  39. }
  40.  
  41. #endif  /* _MBCS */
  42.