mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-15 10:37:17 +00:00
msvcrt: Add _mbsnccnt_l implementation.
This commit is contained in:
parent
a67a08895f
commit
fa2248ccf9
|
@ -1150,7 +1150,7 @@
|
|||
@ stub _mbsncat_s
|
||||
@ stub _mbsncat_s_l
|
||||
@ cdecl _mbsnccnt(str long)
|
||||
@ stub _mbsnccnt_l
|
||||
@ cdecl _mbsnccnt_l(str long ptr)
|
||||
@ cdecl _mbsncmp(str str long)
|
||||
@ stub _mbsncmp_l
|
||||
@ stub _mbsncoll(str str long)
|
||||
|
|
|
@ -1507,7 +1507,7 @@
|
|||
@ stub _mbsncat_s
|
||||
@ stub _mbsncat_s_l
|
||||
@ cdecl _mbsnccnt(str long)
|
||||
@ stub _mbsnccnt_l
|
||||
@ cdecl _mbsnccnt_l(str long ptr)
|
||||
@ cdecl _mbsncmp(str str long)
|
||||
@ stub _mbsncmp_l
|
||||
@ stub _mbsncoll(str str long)
|
||||
|
|
|
@ -1518,7 +1518,7 @@
|
|||
@ stub _mbsncat_s
|
||||
@ stub _mbsncat_s_l
|
||||
@ cdecl _mbsnccnt(str long)
|
||||
@ stub _mbsnccnt_l
|
||||
@ cdecl _mbsnccnt_l(str long ptr)
|
||||
@ cdecl _mbsncmp(str str long)
|
||||
@ stub _mbsncmp_l
|
||||
@ stub _mbsncoll(str str long)
|
||||
|
|
|
@ -822,7 +822,7 @@
|
|||
@ stub _mbsncat_s
|
||||
@ stub _mbsncat_s_l
|
||||
@ cdecl _mbsnccnt(str long)
|
||||
@ stub _mbsnccnt_l
|
||||
@ cdecl _mbsnccnt_l(str long ptr)
|
||||
@ cdecl _mbsncmp(str str long)
|
||||
@ stub _mbsncmp_l
|
||||
@ stub _mbsncoll(str str long)
|
||||
|
|
|
@ -800,7 +800,7 @@
|
|||
@ stub _mbsncat_s
|
||||
@ stub _mbsncat_s_l
|
||||
@ cdecl _mbsnccnt(str long)
|
||||
@ stub _mbsnccnt_l
|
||||
@ cdecl _mbsnccnt_l(str long ptr)
|
||||
@ cdecl _mbsncmp(str str long)
|
||||
@ stub _mbsncmp_l
|
||||
@ stub _mbsncoll(str str long)
|
||||
|
|
|
@ -2272,32 +2272,53 @@ unsigned char* CDECL _mbsnset(unsigned char* str, unsigned int c, size_t len)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _mbsnccnt_l(MSVCRT.@)
|
||||
* 'c' is for 'character'.
|
||||
*/
|
||||
size_t CDECL _mbsnccnt_l(const unsigned char* str, size_t len, _locale_t locale)
|
||||
{
|
||||
size_t ret;
|
||||
pthreadmbcinfo mbcinfo;
|
||||
|
||||
if (!len)
|
||||
return 0;
|
||||
if (!MSVCRT_CHECK_PMT(str))
|
||||
return 0;
|
||||
|
||||
if (locale)
|
||||
mbcinfo = locale->mbcinfo;
|
||||
else
|
||||
mbcinfo = get_mbcinfo();
|
||||
|
||||
if (mbcinfo->ismbcodepage)
|
||||
{
|
||||
ret = 0;
|
||||
while (*str && len-- > 0)
|
||||
{
|
||||
if (_ismbblead_l(*str, locale))
|
||||
{
|
||||
if (!len)
|
||||
break;
|
||||
len--;
|
||||
str++;
|
||||
}
|
||||
str++;
|
||||
ret++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
ret = u_strlen(str);
|
||||
return min(ret, len); /* ASCII CP */
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _mbsnccnt(MSVCRT.@)
|
||||
* 'c' is for 'character'.
|
||||
*/
|
||||
size_t CDECL _mbsnccnt(const unsigned char* str, size_t len)
|
||||
{
|
||||
size_t ret;
|
||||
if(get_mbcinfo()->ismbcodepage)
|
||||
{
|
||||
ret=0;
|
||||
while(*str && len-- > 0)
|
||||
{
|
||||
if(_ismbblead(*str))
|
||||
{
|
||||
if (!len)
|
||||
break;
|
||||
len--;
|
||||
str++;
|
||||
}
|
||||
str++;
|
||||
ret++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
ret=u_strlen(str);
|
||||
return min(ret, len); /* ASCII CP */
|
||||
return _mbsnccnt_l(str, len, NULL);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
|
|
@ -771,7 +771,7 @@
|
|||
# stub _mbsncat_s(str long str long)
|
||||
# stub _mbsncat_s_l(str long str long ptr)
|
||||
@ cdecl _mbsnccnt(str long)
|
||||
# stub _mbsnccnt_l(str long ptr)
|
||||
@ cdecl _mbsnccnt_l(str long ptr)
|
||||
@ cdecl _mbsncmp(str str long)
|
||||
# stub _mbsncmp_l(str str long ptr)
|
||||
@ stub _mbsncoll(str str long)
|
||||
|
|
|
@ -666,7 +666,7 @@
|
|||
@ stub _mbsncat_s
|
||||
@ stub _mbsncat_s_l
|
||||
@ cdecl _mbsnccnt(str long)
|
||||
@ stub _mbsnccnt_l
|
||||
@ cdecl _mbsnccnt_l(str long ptr)
|
||||
@ cdecl _mbsncmp(str str long)
|
||||
@ stub _mbsncmp_l
|
||||
@ stub _mbsncoll(str str long)
|
||||
|
@ -1235,7 +1235,7 @@
|
|||
@ stub _o__mbsncat_s
|
||||
@ stub _o__mbsncat_s_l
|
||||
@ cdecl _o__mbsnccnt(str long) _mbsnccnt
|
||||
@ stub _o__mbsnccnt_l
|
||||
@ cdecl _o__mbsnccnt_l(str long ptr) _mbsnccnt_l
|
||||
@ cdecl _o__mbsncmp(str str long) _mbsncmp
|
||||
@ stub _o__mbsncmp_l
|
||||
@ stub _o__mbsncoll
|
||||
|
|
Loading…
Reference in a new issue