xref: /reactos/sdk/lib/ucrt/mbstring/mbccpy.cpp (revision 53d808d2)
1 /***
2 *mbccpy.c - Copy one character  to another (MBCS)
3 *
4 *       Copyright (c) Microsoft Corporation. All rights reserved.
5 *
6 *Purpose:
7 *       Copy one MBCS character to another (1 or 2 bytes)
8 *
9 *******************************************************************************/
10 
11 #include <corecrt_internal_mbstring.h>
12 #include <locale.h>
13 
14 /***
15 * _mbccpy - Copy one character to another (MBCS)
16 *
17 *Purpose:
18 *       Copies exactly one MBCS character from src to dst.  Copies _mbclen(src)
19 *       bytes from src to dst.
20 *
21 *Entry:
22 *       unsigned char *dst = destination for copy
23 *       unsigned char *src = source for copy
24 *
25 *Exit:
26 *
27 *Exceptions:
28 *       Input parameters are validated. Refer to the validation section of the function.
29 *
30 *******************************************************************************/
31 
32 extern "C" void __cdecl _mbccpy_l(
33         unsigned char *dst,
34         const unsigned char *src,
35         _locale_t plocinfo
36         )
37 {
38     /* _mbccpy_s_l sets errno */
39     _mbccpy_s_l(dst, 2, nullptr, src, plocinfo);
40 }
41 
42 extern "C" void (__cdecl _mbccpy)(
43         unsigned char *dst,
44         const unsigned char *src
45         )
46 {
47     _mbccpy_s_l(dst, 2, nullptr, src, nullptr);
48 }
49