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

  1. /***
  2. *mbclen.c - Find length of MBCS character
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       Find length of MBCS character
  8. *
  9. *******************************************************************************/
  10.  
  11. #include <cruntime.h>
  12. #include <mbdata.h>
  13. #include <mbctype.h>
  14. #include <mbstring.h>
  15. #include <stddef.h>
  16.  
  17.  
  18. /***
  19. * _mbclen - Find length of MBCS character
  20. *
  21. *Purpose:
  22. *       Find the length of the MBCS character (in bytes).
  23. *
  24. *Entry:
  25. *       unsigned char *c = MBCS character
  26. *
  27. *Exit:
  28. *       Returns the number of bytes in the MBCS character
  29. *
  30. *Exceptions:
  31. *
  32. *******************************************************************************/
  33.  
  34. size_t __cdecl _mbclen(
  35.     const unsigned char *c
  36.     )
  37.  
  38. {
  39.         return (_ISLEADBYTE(*c))  ? 2 : 1;
  40. }
  41.