Commit 8bb0692f authored by Bartosz Kosiorek's avatar Bartosz Kosiorek Committed by Alexandre Julliard

msvcrt: Add _mbsset_l implementation.

parent 08c603a4
......@@ -1180,7 +1180,7 @@
@ cdecl _mbsrev(str)
@ cdecl _mbsrev_l(str ptr)
@ cdecl _mbsset(ptr long)
@ stub _mbsset_l
@ cdecl _mbsset_l(ptr long ptr)
@ stub _mbsset_s
@ stub _mbsset_s_l
@ cdecl _mbsspn(str str)
......
......@@ -1537,7 +1537,7 @@
@ cdecl _mbsrev(str)
@ cdecl _mbsrev_l(str ptr)
@ cdecl _mbsset(ptr long)
@ stub _mbsset_l
@ cdecl _mbsset_l(ptr long ptr)
@ stub _mbsset_s
@ stub _mbsset_s_l
@ cdecl _mbsspn(str str)
......
......@@ -1548,7 +1548,7 @@
@ cdecl _mbsrev(str)
@ cdecl _mbsrev_l(str ptr)
@ cdecl _mbsset(ptr long)
@ stub _mbsset_l
@ cdecl _mbsset_l(ptr long ptr)
@ stub _mbsset_s
@ stub _mbsset_s_l
@ cdecl _mbsspn(str str)
......
......@@ -852,7 +852,7 @@
@ cdecl _mbsrev(str)
@ cdecl _mbsrev_l(str ptr)
@ cdecl _mbsset(ptr long)
@ stub _mbsset_l
@ cdecl _mbsset_l(ptr long ptr)
@ stub _mbsset_s
@ stub _mbsset_s_l
@ cdecl _mbsspn(str str)
......
......@@ -830,7 +830,7 @@
@ cdecl _mbsrev(str)
@ cdecl _mbsrev_l(str ptr)
@ cdecl _mbsset(ptr long)
@ stub _mbsset_l
@ cdecl _mbsset_l(ptr long ptr)
@ stub _mbsset_s
@ stub _mbsset_s_l
@ cdecl _mbsspn(str str)
......
......@@ -2205,27 +2205,45 @@ int CDECL _mbsbtype(const unsigned char *str, size_t count)
return _mbsbtype_l(str, count, NULL);
}
/*********************************************************************
* _mbsset(MSVCRT.@)
* _mbsset_l(MSVCRT.@)
*/
unsigned char* CDECL _mbsset(unsigned char* str, unsigned int c)
unsigned char* CDECL _mbsset_l(unsigned char* str, unsigned int c, _locale_t locale)
{
unsigned char* ret = str;
unsigned char* ret = str;
pthreadmbcinfo mbcinfo;
if(!get_mbcinfo()->ismbcodepage || c < 256)
return u__strset(str, c); /* ASCII CP or SB char */
if (!MSVCRT_CHECK_PMT(str))
return NULL;
c &= 0xffff; /* Strip high bits */
if (locale)
mbcinfo = locale->mbcinfo;
else
mbcinfo = get_mbcinfo();
while(str[0] && str[1])
{
*str++ = c >> 8;
*str++ = c & 0xff;
}
if(str[0])
str[0] = '\0'; /* FIXME: OK to shorten? */
if (!mbcinfo->ismbcodepage || c < 256)
return u__strset(str, c); /* ASCII CP or SB char */
c &= 0xffff; /* Strip high bits */
return ret;
while (str[0] && str[1])
{
*str++ = c >> 8;
*str++ = c & 0xff;
}
if (str[0])
str[0] = '\0'; /* FIXME: OK to shorten? */
return ret;
}
/*********************************************************************
* _mbsset(MSVCRT.@)
*/
unsigned char* CDECL _mbsset(unsigned char* str, unsigned int c)
{
return _mbsset_l(str, c, NULL);
}
/*********************************************************************
......
......@@ -801,7 +801,7 @@
@ cdecl _mbsrev(str)
@ cdecl _mbsrev_l(str ptr)
@ cdecl _mbsset(ptr long)
# stub _mbsset_l(ptr long ptr)
@ cdecl _mbsset_l(ptr long ptr)
# stub _mbsset_s(ptr long long)
# stub _mbsset_s_l(ptr long long ptr)
@ cdecl _mbsspn(str str)
......
......@@ -696,7 +696,7 @@
@ cdecl _mbsrev(str)
@ cdecl _mbsrev_l(str ptr)
@ cdecl _mbsset(ptr long)
@ stub _mbsset_l
@ cdecl _mbsset_l(ptr long ptr)
@ stub _mbsset_s
@ stub _mbsset_s_l
@ cdecl _mbsspn(str str)
......@@ -1265,7 +1265,7 @@
@ cdecl _o__mbsrev(str) _mbsrev
@ cdecl _o__mbsrev_l(str ptr) _mbsrev_l
@ cdecl _o__mbsset(ptr long) _mbsset
@ stub _o__mbsset_l
@ cdecl _o__mbsset_l(ptr long ptr) _mbsset_l
@ stub _o__mbsset_s
@ stub _o__mbsset_s_l
@ cdecl _o__mbsspn(str str) _mbsspn
......
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