Commit eb7d5576 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Add _mbccpy_s_l implementation.

parent afdf7491
...@@ -67,10 +67,10 @@ ...@@ -67,10 +67,10 @@
@ cdecl _mbbtype(long long) ucrtbase._mbbtype @ cdecl _mbbtype(long long) ucrtbase._mbbtype
@ stub _mbbtype_l @ stub _mbbtype_l
@ stub _mbcasemap @ stub _mbcasemap
@ cdecl _mbccpy(ptr str) ucrtbase._mbccpy @ cdecl _mbccpy(ptr ptr) ucrtbase._mbccpy
@ stub _mbccpy_l @ cdecl _mbccpy_l(ptr ptr ptr) ucrtbase._mbccpy_l
@ stub _mbccpy_s @ cdecl _mbccpy_s(ptr long ptr ptr) ucrtbase._mbccpy_s
@ stub _mbccpy_s_l @ cdecl _mbccpy_s_l(ptr long ptr ptr ptr) ucrtbase._mbccpy_s_l
@ cdecl _mbcjistojms(long) ucrtbase._mbcjistojms @ cdecl _mbcjistojms(long) ucrtbase._mbcjistojms
@ stub _mbcjistojms_l @ stub _mbcjistojms_l
@ cdecl _mbcjmstojis(long) ucrtbase._mbcjmstojis @ cdecl _mbcjmstojis(long) ucrtbase._mbcjmstojis
......
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
@ cdecl _matherr(ptr) msvcrt._matherr @ cdecl _matherr(ptr) msvcrt._matherr
@ cdecl _mbbtombc(long) msvcrt._mbbtombc @ cdecl _mbbtombc(long) msvcrt._mbbtombc
@ cdecl _mbbtype(long long) msvcrt._mbbtype @ cdecl _mbbtype(long long) msvcrt._mbbtype
@ cdecl _mbccpy(ptr str) msvcrt._mbccpy @ cdecl _mbccpy(ptr ptr) msvcrt._mbccpy
@ cdecl _mbcjistojms(long) msvcrt._mbcjistojms @ cdecl _mbcjistojms(long) msvcrt._mbcjistojms
@ cdecl _mbcjmstojis(long) msvcrt._mbcjmstojis @ cdecl _mbcjmstojis(long) msvcrt._mbcjmstojis
@ cdecl _mbclen(ptr) msvcrt._mbclen @ cdecl _mbclen(ptr) msvcrt._mbclen
......
...@@ -1073,10 +1073,10 @@ ...@@ -1073,10 +1073,10 @@
@ cdecl _mbbtype(long long) @ cdecl _mbbtype(long long)
@ stub _mbbtype_l @ stub _mbbtype_l
# extern _mbcasemap # extern _mbcasemap
@ cdecl _mbccpy(ptr str) @ cdecl _mbccpy(ptr ptr)
@ stub _mbccpy_l @ cdecl _mbccpy_l(ptr ptr ptr)
@ stub _mbccpy_s @ cdecl _mbccpy_s(ptr long ptr ptr)
@ stub _mbccpy_s_l @ cdecl _mbccpy_s_l(ptr long ptr ptr ptr)
@ cdecl _mbcjistojms(long) @ cdecl _mbcjistojms(long)
@ stub _mbcjistojms_l @ stub _mbcjistojms_l
@ cdecl _mbcjmstojis(long) @ cdecl _mbcjmstojis(long)
......
...@@ -1430,10 +1430,10 @@ ...@@ -1430,10 +1430,10 @@
@ cdecl _mbbtype(long long) @ cdecl _mbbtype(long long)
@ stub _mbbtype_l @ stub _mbbtype_l
# extern _mbcasemap # extern _mbcasemap
@ cdecl _mbccpy(ptr str) @ cdecl _mbccpy(ptr ptr)
@ stub _mbccpy_l @ cdecl _mbccpy_l(ptr ptr ptr)
@ stub _mbccpy_s @ cdecl _mbccpy_s(ptr long ptr ptr)
@ stub _mbccpy_s_l @ cdecl _mbccpy_s_l(ptr long ptr ptr ptr)
@ cdecl _mbcjistojms(long) @ cdecl _mbcjistojms(long)
@ stub _mbcjistojms_l @ stub _mbcjistojms_l
@ cdecl _mbcjmstojis(long) @ cdecl _mbcjmstojis(long)
......
...@@ -1440,10 +1440,10 @@ ...@@ -1440,10 +1440,10 @@
@ cdecl _mbbtype(long long) @ cdecl _mbbtype(long long)
@ stub _mbbtype_l @ stub _mbbtype_l
# extern _mbcasemap # extern _mbcasemap
@ cdecl _mbccpy(ptr str) @ cdecl _mbccpy(ptr ptr)
@ stub _mbccpy_l @ cdecl _mbccpy_l(ptr ptr ptr)
@ stub _mbccpy_s @ cdecl _mbccpy_s(ptr long ptr ptr)
@ stub _mbccpy_s_l @ cdecl _mbccpy_s_l(ptr long ptr ptr ptr)
@ cdecl _mbcjistojms(long) @ cdecl _mbcjistojms(long)
@ stub _mbcjistojms_l @ stub _mbcjistojms_l
@ cdecl _mbcjmstojis(long) @ cdecl _mbcjmstojis(long)
......
...@@ -745,10 +745,10 @@ ...@@ -745,10 +745,10 @@
@ cdecl _mbbtype(long long) @ cdecl _mbbtype(long long)
@ stub _mbbtype_l @ stub _mbbtype_l
# extern _mbcasemap # extern _mbcasemap
@ cdecl _mbccpy(ptr str) @ cdecl _mbccpy(ptr ptr)
@ stub _mbccpy_l @ cdecl _mbccpy_l(ptr ptr ptr)
@ stub _mbccpy_s @ cdecl _mbccpy_s(ptr long ptr ptr)
@ stub _mbccpy_s_l @ cdecl _mbccpy_s_l(ptr long ptr ptr ptr)
@ cdecl _mbcjistojms(long) @ cdecl _mbcjistojms(long)
@ stub _mbcjistojms_l @ stub _mbcjistojms_l
@ cdecl _mbcjmstojis(long) @ cdecl _mbcjmstojis(long)
......
...@@ -723,10 +723,10 @@ ...@@ -723,10 +723,10 @@
@ cdecl _mbbtype(long long) @ cdecl _mbbtype(long long)
@ stub _mbbtype_l @ stub _mbbtype_l
# extern _mbcasemap # extern _mbcasemap
@ cdecl _mbccpy(ptr str) @ cdecl _mbccpy(ptr ptr)
@ stub _mbccpy_l @ cdecl _mbccpy_l(ptr ptr ptr)
@ stub _mbccpy_s @ cdecl _mbccpy_s(ptr long ptr ptr)
@ stub _mbccpy_s_l @ cdecl _mbccpy_s_l(ptr long ptr ptr ptr)
@ cdecl _mbcjistojms(long) @ cdecl _mbcjistojms(long)
@ stub _mbcjistojms_l @ stub _mbcjistojms_l
@ cdecl _mbcjmstojis(long) @ cdecl _mbcjmstojis(long)
......
...@@ -624,13 +624,63 @@ MSVCRT_size_t CDECL _mbsnlen(const unsigned char* str, MSVCRT_size_t maxsize) ...@@ -624,13 +624,63 @@ MSVCRT_size_t CDECL _mbsnlen(const unsigned char* str, MSVCRT_size_t maxsize)
} }
/********************************************************************* /*********************************************************************
* _mbccpy_s_l(MSVCRT.@)
*/
int CDECL _mbccpy_s_l(unsigned char* dest, MSVCRT_size_t maxsize,
int *copied, const unsigned char* src, MSVCRT__locale_t locale)
{
if(copied) *copied = 0;
if(!MSVCRT_CHECK_PMT(dest != NULL && maxsize >= 1)) return MSVCRT_EINVAL;
dest[0] = 0;
if(!MSVCRT_CHECK_PMT(src != NULL)) return MSVCRT_EINVAL;
if(_ismbblead_l(*src, locale)) {
if(!src[1]) {
if(copied) *copied = 1;
*MSVCRT__errno() = MSVCRT_EILSEQ;
return MSVCRT_EILSEQ;
}
if(maxsize < 2) {
MSVCRT_INVALID_PMT("dst buffer is too small", MSVCRT_ERANGE);
return MSVCRT_ERANGE;
}
*dest++ = *src++;
*dest = *src;
if(copied) *copied = 2;
}else {
*dest = *src;
if(copied) *copied = 1;
}
return 0;
}
/*********************************************************************
* _mbccpy(MSVCRT.@) * _mbccpy(MSVCRT.@)
*/ */
void CDECL _mbccpy(unsigned char* dest, const unsigned char* src) void CDECL _mbccpy(unsigned char* dest, const unsigned char* src)
{ {
*dest = *src; _mbccpy_s_l(dest, 2, NULL, src, NULL);
if(_ismbblead(*src)) }
*++dest = *++src; /* MB char */
/*********************************************************************
* _mbccpy_l(MSVCRT.@)
*/
void CDECL _mbccpy_l(unsigned char* dest, const unsigned char* src,
MSVCRT__locale_t locale)
{
_mbccpy_s_l(dest, 2, NULL, src, locale);
}
/*********************************************************************
* _mbccpy_s(MSVCRT.@)
*/
int CDECL _mbccpy_s(unsigned char* dest, MSVCRT_size_t maxsize,
int *copied, const unsigned char* src)
{
return _mbccpy_s_l(dest, maxsize, copied, src, NULL);
} }
/********************************************************************* /*********************************************************************
......
...@@ -688,10 +688,10 @@ ...@@ -688,10 +688,10 @@
# stub _mbbtombc_l(long ptr) # stub _mbbtombc_l(long ptr)
@ cdecl _mbbtype(long long) @ cdecl _mbbtype(long long)
# extern _mbcasemap # extern _mbcasemap
@ cdecl _mbccpy(ptr str) @ cdecl _mbccpy(ptr ptr)
# stub _mbccpy_l(ptr str ptr) @ cdecl _mbccpy_l(ptr ptr ptr)
# stub _mbccpy_s(ptr long ptr str) @ cdecl _mbccpy_s(ptr long ptr ptr)
# stub _mbccpy_s_l(ptr long ptr str ptr) @ cdecl _mbccpy_s_l(ptr long ptr ptr ptr)
@ cdecl _mbcjistojms (long) @ cdecl _mbcjistojms (long)
# stub _mbcjistojms_l(long ptr) # stub _mbcjistojms_l(long ptr)
@ cdecl _mbcjmstojis(long) @ cdecl _mbcjmstojis(long)
......
...@@ -1015,7 +1015,7 @@ ...@@ -1015,7 +1015,7 @@
@ cdecl _matherr(ptr) msvcrt._matherr @ cdecl _matherr(ptr) msvcrt._matherr
@ cdecl _mbbtombc(long) msvcrt._mbbtombc @ cdecl _mbbtombc(long) msvcrt._mbbtombc
@ cdecl _mbbtype(long long) msvcrt._mbbtype @ cdecl _mbbtype(long long) msvcrt._mbbtype
@ cdecl _mbccpy(ptr str) msvcrt._mbccpy @ cdecl _mbccpy(ptr ptr) msvcrt._mbccpy
@ cdecl _mbcjistojms(long) msvcrt._mbcjistojms @ cdecl _mbcjistojms(long) msvcrt._mbcjistojms
@ cdecl _mbcjmstojis(long) msvcrt._mbcjmstojis @ cdecl _mbcjmstojis(long) msvcrt._mbcjmstojis
@ cdecl _mbclen(ptr) msvcrt._mbclen @ cdecl _mbclen(ptr) msvcrt._mbclen
......
...@@ -1106,7 +1106,7 @@ ...@@ -1106,7 +1106,7 @@
@ cdecl _makepath(ptr str str str str) msvcrt._makepath @ cdecl _makepath(ptr str str str str) msvcrt._makepath
@ cdecl _mbbtombc(long) msvcrt._mbbtombc @ cdecl _mbbtombc(long) msvcrt._mbbtombc
@ cdecl _mbbtype(long long) msvcrt._mbbtype @ cdecl _mbbtype(long long) msvcrt._mbbtype
@ cdecl _mbccpy(ptr str) msvcrt._mbccpy @ cdecl _mbccpy(ptr ptr) msvcrt._mbccpy
@ cdecl _mbcjistojms(long) msvcrt._mbcjistojms @ cdecl _mbcjistojms(long) msvcrt._mbcjistojms
@ cdecl _mbcjmstojis(long) msvcrt._mbcjmstojis @ cdecl _mbcjmstojis(long) msvcrt._mbcjmstojis
@ cdecl _mbclen(ptr) msvcrt._mbclen @ cdecl _mbclen(ptr) msvcrt._mbclen
......
...@@ -396,7 +396,7 @@ ...@@ -396,7 +396,7 @@
@ cdecl _mbbtombc(long) msvcrt._mbbtombc @ cdecl _mbbtombc(long) msvcrt._mbbtombc
@ cdecl _mbbtype(long long) msvcrt._mbbtype @ cdecl _mbbtype(long long) msvcrt._mbbtype
# extern _mbcasemap # extern _mbcasemap
@ cdecl _mbccpy(ptr str) msvcrt._mbccpy @ cdecl _mbccpy(ptr ptr) msvcrt._mbccpy
@ cdecl _mbcjistojms(long) msvcrt._mbcjistojms @ cdecl _mbcjistojms(long) msvcrt._mbcjistojms
@ cdecl _mbcjmstojis(long) msvcrt._mbcjmstojis @ cdecl _mbcjmstojis(long) msvcrt._mbcjmstojis
@ cdecl _mbclen(ptr) msvcrt._mbclen @ cdecl _mbclen(ptr) msvcrt._mbclen
......
...@@ -586,10 +586,10 @@ ...@@ -586,10 +586,10 @@
@ cdecl _mbbtype(long long) @ cdecl _mbbtype(long long)
@ stub _mbbtype_l @ stub _mbbtype_l
@ stub _mbcasemap @ stub _mbcasemap
@ cdecl _mbccpy(ptr str) @ cdecl _mbccpy(ptr ptr)
@ stub _mbccpy_l @ cdecl _mbccpy_l(ptr ptr ptr)
@ stub _mbccpy_s @ cdecl _mbccpy_s(ptr long ptr ptr)
@ stub _mbccpy_s_l @ cdecl _mbccpy_s_l(ptr long ptr ptr ptr)
@ cdecl _mbcjistojms(long) @ cdecl _mbcjistojms(long)
@ stub _mbcjistojms_l @ stub _mbcjistojms_l
@ cdecl _mbcjmstojis(long) @ cdecl _mbcjmstojis(long)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment