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.

55 lines
1.3 KiB

  1. /***
  2. *mbsnextc.c - Get the next character in an MBCS string.
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * To return the value of the next character in an MBCS string.
  8. *
  9. *Revision History:
  10. * 11-19-92 KRS Ported from 16-bit sources.
  11. * 10-05-93 GJF Replaced _CRTAPI1 with __cdecl.
  12. * 04-28-98 GJF No more _ISLEADBYTE macro.
  13. *
  14. *******************************************************************************/
  15. #ifdef _MBCS
  16. #include <cruntime.h>
  17. #include <mbdata.h>
  18. #include <mbctype.h>
  19. #include <mbstring.h>
  20. /***
  21. *_mbsnextc: Returns the next character in a string.
  22. *
  23. *Purpose:
  24. * To return the value of the next character in an MBCS string.
  25. * Does not advance pointer to the next character.
  26. *
  27. *Entry:
  28. * unsigned char *s = string
  29. *
  30. *Exit:
  31. * unsigned int next = next character.
  32. *
  33. *Exceptions:
  34. *
  35. *******************************************************************************/
  36. unsigned int __cdecl _mbsnextc(
  37. const unsigned char *s
  38. )
  39. {
  40. unsigned int next = 0;
  41. if ( _ismbblead(*s) )
  42. next = ((unsigned int) *s++) << 8;
  43. next += (unsigned int) *s;
  44. return(next);
  45. }
  46. #endif /* _MBCS */