Commit b0c31c09 authored by Bartosz Kosiorek's avatar Bartosz Kosiorek Committed by Alexandre Julliard

msvcrt: Add _mbsnset_l implementation.

parent fa2248cc
......@@ -1170,7 +1170,7 @@
@ cdecl _mbsnlen(str long)
@ cdecl _mbsnlen_l(str long ptr)
@ cdecl _mbsnset(ptr long long)
@ stub _mbsnset_l
@ cdecl _mbsnset_l(ptr long long ptr)
@ stub _mbsnset_s
@ stub _mbsnset_s_l
@ cdecl _mbspbrk(str str)
......
......@@ -1527,7 +1527,7 @@
@ cdecl _mbsnlen(str long)
@ cdecl _mbsnlen_l(str long ptr)
@ cdecl _mbsnset(ptr long long)
@ stub _mbsnset_l
@ cdecl _mbsnset_l(ptr long long ptr)
@ stub _mbsnset_s
@ stub _mbsnset_s_l
@ cdecl _mbspbrk(str str)
......
......@@ -1538,7 +1538,7 @@
@ cdecl _mbsnlen(str long)
@ cdecl _mbsnlen_l(str long ptr)
@ cdecl _mbsnset(ptr long long)
@ stub _mbsnset_l
@ cdecl _mbsnset_l(ptr long long ptr)
@ stub _mbsnset_s
@ stub _mbsnset_s_l
@ cdecl _mbspbrk(str str)
......
......@@ -842,7 +842,7 @@
@ cdecl _mbsnlen(str long)
@ cdecl _mbsnlen_l(str long ptr)
@ cdecl _mbsnset(ptr long long)
@ stub _mbsnset_l
@ cdecl _mbsnset_l(ptr long long ptr)
@ stub _mbsnset_s
@ stub _mbsnset_s_l
@ cdecl _mbspbrk(str str)
......
......@@ -820,7 +820,7 @@
@ cdecl _mbsnlen(str long)
@ cdecl _mbsnlen_l(str long ptr)
@ cdecl _mbsnset(ptr long long)
@ stub _mbsnset_l
@ cdecl _mbsnset_l(ptr long long ptr)
@ stub _mbsnset_s
@ stub _mbsnset_s_l
@ cdecl _mbspbrk(str str)
......
......@@ -2249,27 +2249,43 @@ unsigned char* CDECL _mbsnbset(unsigned char *str, unsigned int c, size_t len)
/*********************************************************************
* _mbsnset(MSVCRT.@)
*/
unsigned char* CDECL _mbsnset(unsigned char* str, unsigned int c, size_t len)
unsigned char* CDECL _mbsnset_l(unsigned char* str, unsigned int c, size_t len, _locale_t locale)
{
unsigned char *ret = str;
unsigned char *ret = str;
pthreadmbcinfo mbcinfo;
if(!len)
return ret;
if (!len)
return ret;
if (!MSVCRT_CHECK_PMT(str))
return NULL;
if(!get_mbcinfo()->ismbcodepage || c < 256)
return u__strnset(str, c, len); /* ASCII CP or SB char */
if (locale)
mbcinfo = locale->mbcinfo;
else
mbcinfo = get_mbcinfo();
c &= 0xffff; /* Strip high bits */
if (!mbcinfo->ismbcodepage || c < 256)
return u__strnset(str, c, len); /* ASCII CP or SB char */
while(str[0] && str[1] && len--)
{
*str++ = c >> 8;
*str++ = c & 0xff;
}
if(len && str[0])
str[0] = '\0'; /* FIXME: OK to shorten? */
c &= 0xffff; /* Strip high bits */
return ret;
while (str[0] && str[1] && len--)
{
*str++ = c >> 8;
*str++ = c & 0xff;
}
if (len && str[0])
str[0] = '\0'; /* FIXME: OK to shorten? */
return ret;
}
/*********************************************************************
* _mbsnset(MSVCRT.@)
*/
unsigned char* CDECL _mbsnset(unsigned char* str, unsigned int c, size_t len)
{
return _mbsnset_l(str, c, len, NULL);
}
/*********************************************************************
......
......@@ -791,7 +791,7 @@
@ cdecl _mbsnlen(str long)
@ cdecl _mbsnlen_l(str long ptr)
@ cdecl _mbsnset(ptr long long)
# stub _mbsnset_l(ptr long long ptr)
@ cdecl _mbsnset_l(ptr long long ptr)
# stub _mbsnset_s(ptr long long long)
# stub _mbsnset_s_l(ptr long long long ptr)
@ cdecl _mbspbrk(str str)
......
......@@ -686,7 +686,7 @@
@ cdecl _mbsnlen(str long)
@ cdecl _mbsnlen_l(str long ptr)
@ cdecl _mbsnset(ptr long long)
@ stub _mbsnset_l
@ cdecl _mbsnset_l(ptr long long ptr)
@ stub _mbsnset_s
@ stub _mbsnset_s_l
@ cdecl _mbspbrk(str str)
......@@ -1255,7 +1255,7 @@
@ cdecl _o__mbsnlen(str long) _mbsnlen
@ cdecl _o__mbsnlen_l(str long ptr) _mbsnlen_l
@ cdecl _o__mbsnset(ptr long long) _mbsnset
@ stub _o__mbsnset_l
@ cdecl _o__mbsnset_l(ptr long long ptr) _mbsnset_l
@ stub _o__mbsnset_s
@ stub _o__mbsnset_s_l
@ cdecl _o__mbspbrk(str str) _mbspbrk
......
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