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.

50 lines
1.2 KiB

  1. /***
  2. *mbccpy.c - Copy one character to another (MBCS)
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Copy one MBCS character to another (1 or 2 bytes)
  8. *
  9. *Revision History:
  10. * 04-12-93 KRS Created.
  11. * 06-03-93 KRS Change return type to void.
  12. * 10-05-93 GJF Replace _CRTAPI1 with __cdecl.
  13. * 04-28-98 GJF No more _ISLEADBYTE macro.
  14. *
  15. *******************************************************************************/
  16. #include <cruntime.h>
  17. #include <mbdata.h>
  18. #include <mbctype.h>
  19. #include <mbstring.h>
  20. #include <stddef.h>
  21. /***
  22. * _mbccpy - Copy one character to another (MBCS)
  23. *
  24. *Purpose:
  25. * Copies exactly one MBCS character from src to dst. Copies _mbclen(src)
  26. * bytes from src to dst.
  27. *
  28. *Entry:
  29. * unsigned char *dst = destination for copy
  30. * unsigned char *src = source for copy
  31. *
  32. *Exit:
  33. *
  34. *Exceptions:
  35. *
  36. *******************************************************************************/
  37. void __cdecl _mbccpy(
  38. unsigned char *dst,
  39. const unsigned char *src
  40. )
  41. {
  42. *dst = *src;
  43. if ( _ismbblead(*src) )
  44. {
  45. *++dst = *++src;
  46. }
  47. }