1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-09 04:16:08 +00:00

msvcrt: Add _mbsnbset_l implementation.

This commit is contained in:
Bartosz Kosiorek 2023-11-06 20:35:53 +01:00 committed by Alexandre Julliard
parent 62ba4a8261
commit 12a00363f6
8 changed files with 48 additions and 31 deletions

View File

@ -1142,7 +1142,7 @@
@ cdecl _mbsnbicoll(str str long)
@ cdecl _mbsnbicoll_l(str str long ptr)
@ cdecl _mbsnbset(ptr long long)
@ stub _mbsnbset_l
@ cdecl _mbsnbset_l(str long long ptr)
@ stub _mbsnbset_s
@ stub _mbsnbset_s_l
@ cdecl _mbsncat(str str long)

View File

@ -1499,7 +1499,7 @@
@ cdecl _mbsnbicoll(str str long)
@ cdecl _mbsnbicoll_l(str str long ptr)
@ cdecl _mbsnbset(ptr long long)
@ stub _mbsnbset_l
@ cdecl _mbsnbset_l(str long long ptr)
@ stub _mbsnbset_s
@ stub _mbsnbset_s_l
@ cdecl _mbsncat(str str long)

View File

@ -1510,7 +1510,7 @@
@ cdecl _mbsnbicoll(str str long)
@ cdecl _mbsnbicoll_l(str str long ptr)
@ cdecl _mbsnbset(ptr long long)
@ stub _mbsnbset_l
@ cdecl _mbsnbset_l(str long long ptr)
@ stub _mbsnbset_s
@ stub _mbsnbset_s_l
@ cdecl _mbsncat(str str long)

View File

@ -814,7 +814,7 @@
@ cdecl _mbsnbicoll(str str long)
@ cdecl _mbsnbicoll_l(str str long ptr)
@ cdecl _mbsnbset(ptr long long)
@ stub _mbsnbset_l
@ cdecl _mbsnbset_l(str long long ptr)
@ stub _mbsnbset_s
@ stub _mbsnbset_s_l
@ cdecl _mbsncat(str str long)

View File

@ -792,7 +792,7 @@
@ cdecl _mbsnbicoll(str str long)
@ cdecl _mbsnbicoll_l(str str long ptr)
@ cdecl _mbsnbset(ptr long long)
@ stub _mbsnbset_l
@ cdecl _mbsnbset_l(str long long ptr)
@ stub _mbsnbset_s
@ stub _mbsnbset_s_l
@ cdecl _mbsncat(str str long)

View File

@ -2199,34 +2199,51 @@ unsigned char* CDECL _mbsset(unsigned char* str, unsigned int c)
return ret;
}
/*********************************************************************
* _mbsnbset_l(MSVCRT.@)
*/
unsigned char* CDECL _mbsnbset_l(unsigned char *str, unsigned int c, size_t len, _locale_t locale)
{
unsigned char *ret = str;
pthreadmbcinfo mbcinfo;
if (!len)
return ret;
if (!MSVCRT_CHECK_PMT(str))
return NULL;
if (locale)
mbcinfo = locale->mbcinfo;
else
mbcinfo = get_mbcinfo();
if (!mbcinfo->ismbcodepage || c < 256)
return u__strnset(str, c, len); /* ASCII CP or SB char */
c &= 0xffff; /* Strip high bits */
while (str[0] && str[1] && (len > 1))
{
*str++ = c >> 8;
len--;
*str++ = c & 0xff;
len--;
}
if (len && str[0])
{
/* as per msdn pad with a blank character */
str[0] = ' ';
}
return ret;
}
/*********************************************************************
* _mbsnbset(MSVCRT.@)
*/
unsigned char* CDECL _mbsnbset(unsigned char *str, unsigned int c, size_t len)
{
unsigned char *ret = str;
if(!len)
return ret;
if(!get_mbcinfo()->ismbcodepage || c < 256)
return u__strnset(str, c, len); /* ASCII CP or SB char */
c &= 0xffff; /* Strip high bits */
while(str[0] && str[1] && (len > 1))
{
*str++ = c >> 8;
len--;
*str++ = c & 0xff;
len--;
}
if(len && str[0]) {
/* as per msdn pad with a blank character */
str[0] = ' ';
}
return ret;
return _mbsnbset_l(str, c, len, NULL);
}
/*********************************************************************

View File

@ -763,7 +763,7 @@
@ cdecl _mbsnbicoll(str str long)
@ cdecl _mbsnbicoll_l(str str long ptr)
@ cdecl _mbsnbset(ptr long long)
# stub _mbsnbset_l(str long long ptr)
@ cdecl _mbsnbset_l(str long long ptr)
# stub _mbsnbset_s(ptr long long long)
# stub _mbsnbset_s_l(ptr long long long ptr)
@ cdecl _mbsncat(str str long)

View File

@ -658,7 +658,7 @@
@ cdecl _mbsnbicoll(str str long)
@ cdecl _mbsnbicoll_l(str str long ptr)
@ cdecl _mbsnbset(ptr long long)
@ stub _mbsnbset_l
@ cdecl _mbsnbset_l(str long long ptr)
@ stub _mbsnbset_s
@ stub _mbsnbset_s_l
@ cdecl _mbsncat(str str long)
@ -1227,7 +1227,7 @@
@ cdecl _o__mbsnbicoll(str str long) _mbsnbicoll
@ cdecl _o__mbsnbicoll_l(str str long ptr) _mbsnbicoll_l
@ cdecl _o__mbsnbset(ptr long long) _mbsnbset
@ stub _o__mbsnbset_l
@ cdecl _o__mbsnbset_l(str long long ptr) _mbsnbset_l
@ stub _o__mbsnbset_s
@ stub _o__mbsnbset_s_l
@ cdecl _o__mbsncat(str str long) _mbsncat