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

  1. /***
  2. *mbccpy.c - Copy one character  to another (MBCS)
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       Copy one MBCS character to another (1 or 2 bytes)
  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. * _mbccpy - Copy one character to another (MBCS)
  19. *
  20. *Purpose:
  21. *       Copies exactly one MBCS character from src to dst.  Copies _mbclen(src)
  22. *       bytes from src to dst.
  23. *
  24. *Entry:
  25. *       unsigned char *dst = destination for copy
  26. *       unsigned char *src = source for copy
  27. *
  28. *Exit:
  29. *
  30. *Exceptions:
  31. *
  32. *******************************************************************************/
  33.  
  34. void __cdecl _mbccpy(
  35.     unsigned char *dst,
  36.     const unsigned char *src
  37.     )
  38. {
  39.         *dst = *src;
  40.         if (_ISLEADBYTE(*src))
  41.                 {
  42.                 *++dst = *++src;
  43.                 }
  44. }
  45.