Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1021 B

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