mirror of
git://source.winehq.org/git/wine.git
synced 2024-07-22 23:14:09 +00:00
msvcrt: Add _mbsnbset_l implementation.
This commit is contained in:
parent
62ba4a8261
commit
12a00363f6
|
@ -1142,7 +1142,7 @@
|
||||||
@ cdecl _mbsnbicoll(str str long)
|
@ cdecl _mbsnbicoll(str str long)
|
||||||
@ cdecl _mbsnbicoll_l(str str long ptr)
|
@ cdecl _mbsnbicoll_l(str str long ptr)
|
||||||
@ cdecl _mbsnbset(ptr long long)
|
@ cdecl _mbsnbset(ptr long long)
|
||||||
@ stub _mbsnbset_l
|
@ cdecl _mbsnbset_l(str long long ptr)
|
||||||
@ stub _mbsnbset_s
|
@ stub _mbsnbset_s
|
||||||
@ stub _mbsnbset_s_l
|
@ stub _mbsnbset_s_l
|
||||||
@ cdecl _mbsncat(str str long)
|
@ cdecl _mbsncat(str str long)
|
||||||
|
|
|
@ -1499,7 +1499,7 @@
|
||||||
@ cdecl _mbsnbicoll(str str long)
|
@ cdecl _mbsnbicoll(str str long)
|
||||||
@ cdecl _mbsnbicoll_l(str str long ptr)
|
@ cdecl _mbsnbicoll_l(str str long ptr)
|
||||||
@ cdecl _mbsnbset(ptr long long)
|
@ cdecl _mbsnbset(ptr long long)
|
||||||
@ stub _mbsnbset_l
|
@ cdecl _mbsnbset_l(str long long ptr)
|
||||||
@ stub _mbsnbset_s
|
@ stub _mbsnbset_s
|
||||||
@ stub _mbsnbset_s_l
|
@ stub _mbsnbset_s_l
|
||||||
@ cdecl _mbsncat(str str long)
|
@ cdecl _mbsncat(str str long)
|
||||||
|
|
|
@ -1510,7 +1510,7 @@
|
||||||
@ cdecl _mbsnbicoll(str str long)
|
@ cdecl _mbsnbicoll(str str long)
|
||||||
@ cdecl _mbsnbicoll_l(str str long ptr)
|
@ cdecl _mbsnbicoll_l(str str long ptr)
|
||||||
@ cdecl _mbsnbset(ptr long long)
|
@ cdecl _mbsnbset(ptr long long)
|
||||||
@ stub _mbsnbset_l
|
@ cdecl _mbsnbset_l(str long long ptr)
|
||||||
@ stub _mbsnbset_s
|
@ stub _mbsnbset_s
|
||||||
@ stub _mbsnbset_s_l
|
@ stub _mbsnbset_s_l
|
||||||
@ cdecl _mbsncat(str str long)
|
@ cdecl _mbsncat(str str long)
|
||||||
|
|
|
@ -814,7 +814,7 @@
|
||||||
@ cdecl _mbsnbicoll(str str long)
|
@ cdecl _mbsnbicoll(str str long)
|
||||||
@ cdecl _mbsnbicoll_l(str str long ptr)
|
@ cdecl _mbsnbicoll_l(str str long ptr)
|
||||||
@ cdecl _mbsnbset(ptr long long)
|
@ cdecl _mbsnbset(ptr long long)
|
||||||
@ stub _mbsnbset_l
|
@ cdecl _mbsnbset_l(str long long ptr)
|
||||||
@ stub _mbsnbset_s
|
@ stub _mbsnbset_s
|
||||||
@ stub _mbsnbset_s_l
|
@ stub _mbsnbset_s_l
|
||||||
@ cdecl _mbsncat(str str long)
|
@ cdecl _mbsncat(str str long)
|
||||||
|
|
|
@ -792,7 +792,7 @@
|
||||||
@ cdecl _mbsnbicoll(str str long)
|
@ cdecl _mbsnbicoll(str str long)
|
||||||
@ cdecl _mbsnbicoll_l(str str long ptr)
|
@ cdecl _mbsnbicoll_l(str str long ptr)
|
||||||
@ cdecl _mbsnbset(ptr long long)
|
@ cdecl _mbsnbset(ptr long long)
|
||||||
@ stub _mbsnbset_l
|
@ cdecl _mbsnbset_l(str long long ptr)
|
||||||
@ stub _mbsnbset_s
|
@ stub _mbsnbset_s
|
||||||
@ stub _mbsnbset_s_l
|
@ stub _mbsnbset_s_l
|
||||||
@ cdecl _mbsncat(str str long)
|
@ cdecl _mbsncat(str str long)
|
||||||
|
|
|
@ -2199,34 +2199,51 @@ unsigned char* CDECL _mbsset(unsigned char* str, unsigned int c)
|
||||||
return ret;
|
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.@)
|
* _mbsnbset(MSVCRT.@)
|
||||||
*/
|
*/
|
||||||
unsigned char* CDECL _mbsnbset(unsigned char *str, unsigned int c, size_t len)
|
unsigned char* CDECL _mbsnbset(unsigned char *str, unsigned int c, size_t len)
|
||||||
{
|
{
|
||||||
unsigned char *ret = str;
|
return _mbsnbset_l(str, c, len, NULL);
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
|
|
|
@ -763,7 +763,7 @@
|
||||||
@ cdecl _mbsnbicoll(str str long)
|
@ cdecl _mbsnbicoll(str str long)
|
||||||
@ cdecl _mbsnbicoll_l(str str long ptr)
|
@ cdecl _mbsnbicoll_l(str str long ptr)
|
||||||
@ cdecl _mbsnbset(ptr long long)
|
@ 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(ptr long long long)
|
||||||
# stub _mbsnbset_s_l(ptr long long long ptr)
|
# stub _mbsnbset_s_l(ptr long long long ptr)
|
||||||
@ cdecl _mbsncat(str str long)
|
@ cdecl _mbsncat(str str long)
|
||||||
|
|
|
@ -658,7 +658,7 @@
|
||||||
@ cdecl _mbsnbicoll(str str long)
|
@ cdecl _mbsnbicoll(str str long)
|
||||||
@ cdecl _mbsnbicoll_l(str str long ptr)
|
@ cdecl _mbsnbicoll_l(str str long ptr)
|
||||||
@ cdecl _mbsnbset(ptr long long)
|
@ cdecl _mbsnbset(ptr long long)
|
||||||
@ stub _mbsnbset_l
|
@ cdecl _mbsnbset_l(str long long ptr)
|
||||||
@ stub _mbsnbset_s
|
@ stub _mbsnbset_s
|
||||||
@ stub _mbsnbset_s_l
|
@ stub _mbsnbset_s_l
|
||||||
@ cdecl _mbsncat(str str long)
|
@ cdecl _mbsncat(str str long)
|
||||||
|
@ -1227,7 +1227,7 @@
|
||||||
@ cdecl _o__mbsnbicoll(str str long) _mbsnbicoll
|
@ cdecl _o__mbsnbicoll(str str long) _mbsnbicoll
|
||||||
@ cdecl _o__mbsnbicoll_l(str str long ptr) _mbsnbicoll_l
|
@ cdecl _o__mbsnbicoll_l(str str long ptr) _mbsnbicoll_l
|
||||||
@ cdecl _o__mbsnbset(ptr long long) _mbsnbset
|
@ 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
|
||||||
@ stub _o__mbsnbset_s_l
|
@ stub _o__mbsnbset_s_l
|
||||||
@ cdecl _o__mbsncat(str str long) _mbsncat
|
@ cdecl _o__mbsncat(str str long) _mbsncat
|
||||||
|
|
Loading…
Reference in a new issue