mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 18:27:17 +00:00
msvcrt: Add _mblen_l implementation.
This commit is contained in:
parent
8bb0692ff6
commit
707198babe
|
@ -1094,7 +1094,7 @@
|
||||||
@ cdecl _mbctoupper(long)
|
@ cdecl _mbctoupper(long)
|
||||||
@ cdecl _mbctoupper_l(long ptr)
|
@ cdecl _mbctoupper_l(long ptr)
|
||||||
@ extern _mbctype MSVCRT_mbctype
|
@ extern _mbctype MSVCRT_mbctype
|
||||||
@ stub _mblen_l
|
@ cdecl _mblen_l(str long ptr)
|
||||||
@ cdecl _mbsbtype(str long)
|
@ cdecl _mbsbtype(str long)
|
||||||
@ cdecl _mbsbtype_l(str long ptr)
|
@ cdecl _mbsbtype_l(str long ptr)
|
||||||
@ cdecl _mbscat_s(ptr long str)
|
@ cdecl _mbscat_s(ptr long str)
|
||||||
|
|
|
@ -1451,7 +1451,7 @@
|
||||||
@ cdecl _mbctoupper(long)
|
@ cdecl _mbctoupper(long)
|
||||||
@ cdecl _mbctoupper_l(long ptr)
|
@ cdecl _mbctoupper_l(long ptr)
|
||||||
@ extern _mbctype MSVCRT_mbctype
|
@ extern _mbctype MSVCRT_mbctype
|
||||||
@ stub _mblen_l
|
@ cdecl _mblen_l(str long ptr)
|
||||||
@ cdecl _mbsbtype(str long)
|
@ cdecl _mbsbtype(str long)
|
||||||
@ cdecl _mbsbtype_l(str long ptr)
|
@ cdecl _mbsbtype_l(str long ptr)
|
||||||
@ cdecl _mbscat_s(ptr long str)
|
@ cdecl _mbscat_s(ptr long str)
|
||||||
|
|
|
@ -1462,7 +1462,7 @@
|
||||||
@ cdecl _mbctoupper(long)
|
@ cdecl _mbctoupper(long)
|
||||||
@ cdecl _mbctoupper_l(long ptr)
|
@ cdecl _mbctoupper_l(long ptr)
|
||||||
@ extern _mbctype MSVCRT_mbctype
|
@ extern _mbctype MSVCRT_mbctype
|
||||||
@ stub _mblen_l
|
@ cdecl _mblen_l(str long ptr)
|
||||||
@ cdecl _mbsbtype(str long)
|
@ cdecl _mbsbtype(str long)
|
||||||
@ cdecl _mbsbtype_l(str long ptr)
|
@ cdecl _mbsbtype_l(str long ptr)
|
||||||
@ cdecl _mbscat_s(ptr long str)
|
@ cdecl _mbscat_s(ptr long str)
|
||||||
|
|
|
@ -1302,7 +1302,7 @@
|
||||||
@ cdecl _malloc_crt(long) msvcr120._malloc_crt
|
@ cdecl _malloc_crt(long) msvcr120._malloc_crt
|
||||||
# extern _mbcasemap
|
# extern _mbcasemap
|
||||||
@ extern _mbctype msvcr120._mbctype
|
@ extern _mbctype msvcr120._mbctype
|
||||||
@ stub _mblen_l
|
@ cdecl _mblen_l(str long ptr) msvcr120._mblen_l
|
||||||
@ cdecl _mbstowcs_l(ptr str long ptr) msvcr120._mbstowcs_l
|
@ cdecl _mbstowcs_l(ptr str long ptr) msvcr120._mbstowcs_l
|
||||||
@ cdecl _mbstowcs_s_l(ptr ptr long str long ptr) msvcr120._mbstowcs_s_l
|
@ cdecl _mbstowcs_s_l(ptr ptr long str long ptr) msvcr120._mbstowcs_s_l
|
||||||
@ cdecl _mbstrlen(str) msvcr120._mbstrlen
|
@ cdecl _mbstrlen(str) msvcr120._mbstrlen
|
||||||
|
|
|
@ -766,7 +766,7 @@
|
||||||
@ cdecl _mbctoupper(long)
|
@ cdecl _mbctoupper(long)
|
||||||
@ cdecl _mbctoupper_l(long ptr)
|
@ cdecl _mbctoupper_l(long ptr)
|
||||||
@ extern _mbctype MSVCRT_mbctype
|
@ extern _mbctype MSVCRT_mbctype
|
||||||
@ stub _mblen_l
|
@ cdecl _mblen_l(str long ptr)
|
||||||
@ cdecl _mbsbtype(str long)
|
@ cdecl _mbsbtype(str long)
|
||||||
@ cdecl _mbsbtype_l(str long ptr)
|
@ cdecl _mbsbtype_l(str long ptr)
|
||||||
@ cdecl _mbscat_s(ptr long str)
|
@ cdecl _mbscat_s(ptr long str)
|
||||||
|
|
|
@ -744,7 +744,7 @@
|
||||||
@ cdecl _mbctoupper(long)
|
@ cdecl _mbctoupper(long)
|
||||||
@ cdecl _mbctoupper_l(long ptr)
|
@ cdecl _mbctoupper_l(long ptr)
|
||||||
@ extern _mbctype MSVCRT_mbctype
|
@ extern _mbctype MSVCRT_mbctype
|
||||||
@ stub _mblen_l
|
@ cdecl _mblen_l(str long ptr)
|
||||||
@ cdecl _mbsbtype(str long)
|
@ cdecl _mbsbtype(str long)
|
||||||
@ cdecl _mbsbtype_l(str long ptr)
|
@ cdecl _mbsbtype_l(str long ptr)
|
||||||
@ cdecl _mbscat_s(ptr long str)
|
@ cdecl _mbscat_s(ptr long str)
|
||||||
|
|
|
@ -2984,21 +2984,34 @@ unsigned char* CDECL _mbspbrk(const unsigned char *str, const unsigned char *acc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* mblen(MSVCRT.@)
|
* _mblen_l(MSVCRT.@)
|
||||||
* REMARKS
|
* REMARKS
|
||||||
* Unlike most of the multibyte string functions this function uses
|
* Unlike most of the multibyte string functions this function uses
|
||||||
* the locale codepage, not the codepage set by _setmbcp
|
* the locale codepage, not the codepage set by _setmbcp
|
||||||
*/
|
*/
|
||||||
|
int CDECL _mblen_l(const char* str, size_t size, _locale_t locale)
|
||||||
|
{
|
||||||
|
pthreadlocinfo locinfo;
|
||||||
|
|
||||||
|
if (!str || !*str || !size)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (locale)
|
||||||
|
locinfo = locale->locinfo;
|
||||||
|
else
|
||||||
|
locinfo = get_locinfo();
|
||||||
|
|
||||||
|
if (locinfo->mb_cur_max == 1)
|
||||||
|
return 1; /* ASCII CP */
|
||||||
|
return !_isleadbyte_l((unsigned char)*str, locale) ? 1 : (size > 1 ? 2 : -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
* mblen(MSVCRT.@)
|
||||||
|
*/
|
||||||
int CDECL mblen(const char* str, size_t size)
|
int CDECL mblen(const char* str, size_t size)
|
||||||
{
|
{
|
||||||
if (str && *str && size)
|
return _mblen_l(str, size, NULL);
|
||||||
{
|
|
||||||
if(get_locinfo()->mb_cur_max == 1)
|
|
||||||
return 1; /* ASCII CP */
|
|
||||||
|
|
||||||
return !isleadbyte((unsigned char)*str) ? 1 : (size>1 ? 2 : -1);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
|
|
|
@ -711,7 +711,7 @@
|
||||||
@ cdecl _mbctoupper(long)
|
@ cdecl _mbctoupper(long)
|
||||||
@ cdecl _mbctoupper_l(long ptr)
|
@ cdecl _mbctoupper_l(long ptr)
|
||||||
@ extern _mbctype MSVCRT_mbctype
|
@ extern _mbctype MSVCRT_mbctype
|
||||||
# stub _mblen_l(str long ptr)
|
@ cdecl _mblen_l(str long ptr)
|
||||||
@ cdecl _mbsbtype(str long)
|
@ cdecl _mbsbtype(str long)
|
||||||
@ cdecl _mbsbtype_l(str long ptr)
|
@ cdecl _mbsbtype_l(str long ptr)
|
||||||
@ cdecl _mbscat(str str)
|
@ cdecl _mbscat(str str)
|
||||||
|
|
|
@ -609,7 +609,7 @@
|
||||||
@ cdecl _mbctombb_l(long ptr)
|
@ cdecl _mbctombb_l(long ptr)
|
||||||
@ cdecl _mbctoupper(long)
|
@ cdecl _mbctoupper(long)
|
||||||
@ cdecl _mbctoupper_l(long ptr)
|
@ cdecl _mbctoupper_l(long ptr)
|
||||||
@ stub _mblen_l
|
@ cdecl _mblen_l(str long ptr)
|
||||||
@ cdecl _mbsbtype(str long)
|
@ cdecl _mbsbtype(str long)
|
||||||
@ cdecl _mbsbtype_l(str long ptr)
|
@ cdecl _mbsbtype_l(str long ptr)
|
||||||
@ cdecl _mbscat_s(ptr long str)
|
@ cdecl _mbscat_s(ptr long str)
|
||||||
|
@ -1179,7 +1179,7 @@
|
||||||
@ cdecl _o__mbctombb_l(long ptr) _mbctombb_l
|
@ cdecl _o__mbctombb_l(long ptr) _mbctombb_l
|
||||||
@ cdecl _o__mbctoupper(long) _mbctoupper
|
@ cdecl _o__mbctoupper(long) _mbctoupper
|
||||||
@ cdecl _o__mbctoupper_l(long ptr) _mbctoupper_l
|
@ cdecl _o__mbctoupper_l(long ptr) _mbctoupper_l
|
||||||
@ stub _o__mblen_l
|
@ cdecl _o__mblen_l(str long ptr) _mblen_l
|
||||||
@ cdecl _o__mbsbtype(str long) _mbsbtype
|
@ cdecl _o__mbsbtype(str long) _mbsbtype
|
||||||
@ cdecl _o__mbsbtype_l(str long ptr) _mbsbtype_l
|
@ cdecl _o__mbsbtype_l(str long ptr) _mbsbtype_l
|
||||||
@ cdecl _o__mbscat_s(ptr long str) _mbscat_s
|
@ cdecl _o__mbscat_s(ptr long str) _mbscat_s
|
||||||
|
|
Loading…
Reference in a new issue