msvcrt: Add _mbsdec_l implementation.
This commit is contained in:
parent
2f0c0f4c38
commit
fce3311843
8 changed files with 41 additions and 22 deletions
|
@ -1110,7 +1110,7 @@
|
|||
@ cdecl _mbscspn(str str)
|
||||
@ cdecl _mbscspn_l(str str ptr)
|
||||
@ cdecl _mbsdec(ptr ptr)
|
||||
@ stub _mbsdec_l
|
||||
@ cdecl _mbsdec_l(ptr ptr ptr)
|
||||
@ cdecl _mbsicmp(str str)
|
||||
@ cdecl _mbsicmp_l(str str ptr)
|
||||
@ cdecl _mbsicoll(str str)
|
||||
|
|
|
@ -1467,7 +1467,7 @@
|
|||
@ cdecl _mbscspn(str str)
|
||||
@ cdecl _mbscspn_l(str str ptr)
|
||||
@ cdecl _mbsdec(ptr ptr)
|
||||
@ stub _mbsdec_l
|
||||
@ cdecl _mbsdec_l(ptr ptr ptr)
|
||||
@ cdecl _mbsicmp(str str)
|
||||
@ cdecl _mbsicmp_l(str str ptr)
|
||||
@ cdecl _mbsicoll(str str)
|
||||
|
|
|
@ -1478,7 +1478,7 @@
|
|||
@ cdecl _mbscspn(str str)
|
||||
@ cdecl _mbscspn_l(str str ptr)
|
||||
@ cdecl _mbsdec(ptr ptr)
|
||||
@ stub _mbsdec_l
|
||||
@ cdecl _mbsdec_l(ptr ptr ptr)
|
||||
@ cdecl _mbsicmp(str str)
|
||||
@ cdecl _mbsicmp_l(str str ptr)
|
||||
@ cdecl _mbsicoll(str str)
|
||||
|
|
|
@ -782,7 +782,7 @@
|
|||
@ cdecl _mbscspn(str str)
|
||||
@ cdecl _mbscspn_l(str str ptr)
|
||||
@ cdecl _mbsdec(ptr ptr)
|
||||
@ stub _mbsdec_l
|
||||
@ cdecl _mbsdec_l(ptr ptr ptr)
|
||||
@ cdecl _mbsicmp(str str)
|
||||
@ cdecl _mbsicmp_l(str str ptr)
|
||||
@ cdecl _mbsicoll(str str)
|
||||
|
|
|
@ -760,7 +760,7 @@
|
|||
@ cdecl _mbscspn(str str)
|
||||
@ cdecl _mbscspn_l(str str ptr)
|
||||
@ cdecl _mbsdec(ptr ptr)
|
||||
@ stub _mbsdec_l
|
||||
@ cdecl _mbsdec_l(ptr ptr ptr)
|
||||
@ cdecl _mbsicmp(str str)
|
||||
@ cdecl _mbsicmp_l(str str ptr)
|
||||
@ cdecl _mbsicoll(str str)
|
||||
|
|
|
@ -669,20 +669,6 @@ unsigned int CDECL _mbcjmstojis(unsigned int c)
|
|||
return _mbcjmstojis_l(c, NULL);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _mbsdec(MSVCRT.@)
|
||||
*/
|
||||
unsigned char* CDECL _mbsdec(const unsigned char* start, const unsigned char* cur)
|
||||
{
|
||||
if(start >= cur)
|
||||
return NULL;
|
||||
|
||||
if(get_mbcinfo()->ismbcodepage)
|
||||
return (unsigned char *)(_ismbstrail(start,cur-1) ? cur - 2 : cur -1);
|
||||
|
||||
return (unsigned char *)cur - 1; /* ASCII CP or SB char */
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _mbclen_l(MSVCRT.@)
|
||||
*/
|
||||
|
@ -1970,6 +1956,39 @@ int CDECL _ismbstrail(const unsigned char* start, const unsigned char* str)
|
|||
return _ismbstrail_l(start, str, NULL);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _mbsdec_l(MSVCRT.@)
|
||||
*/
|
||||
unsigned char* CDECL _mbsdec_l(const unsigned char *start,
|
||||
const unsigned char *cur, _locale_t locale)
|
||||
{
|
||||
pthreadmbcinfo mbcinfo;
|
||||
|
||||
if (!MSVCRT_CHECK_PMT(start && cur))
|
||||
return NULL;
|
||||
if (start >= cur)
|
||||
return NULL;
|
||||
|
||||
if (!locale)
|
||||
mbcinfo = get_mbcinfo();
|
||||
else
|
||||
mbcinfo = locale->mbcinfo;
|
||||
|
||||
if (mbcinfo->ismbcodepage)
|
||||
return (unsigned char *)(_ismbstrail_l(start, cur - 1, locale) ? cur - 2 : cur - 1);
|
||||
|
||||
return (unsigned char *)cur - 1; /* ASCII CP or SB char */
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _mbsdec(MSVCRT.@)
|
||||
*/
|
||||
unsigned char* CDECL _mbsdec(const unsigned char *start, const unsigned char *cur)
|
||||
{
|
||||
return _mbsdec_l(start, cur, NULL);
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* _mbbtype_l(MSVCRT.@)
|
||||
*/
|
||||
|
|
|
@ -729,7 +729,7 @@
|
|||
@ cdecl _mbscspn(str str)
|
||||
@ cdecl _mbscspn_l(str str ptr)
|
||||
@ cdecl _mbsdec(ptr ptr)
|
||||
# stub _mbsdec_l(ptr ptr ptr)
|
||||
@ cdecl _mbsdec_l(ptr ptr ptr)
|
||||
@ cdecl _mbsdup(str) _strdup
|
||||
# stub _strdup_dbg(str long str long)
|
||||
@ cdecl _mbsicmp(str str)
|
||||
|
|
|
@ -625,7 +625,7 @@
|
|||
@ cdecl _mbscspn(str str)
|
||||
@ cdecl _mbscspn_l(str str ptr)
|
||||
@ cdecl _mbsdec(ptr ptr)
|
||||
@ stub _mbsdec_l
|
||||
@ cdecl _mbsdec_l(ptr ptr ptr)
|
||||
@ cdecl _mbsdup(str) _strdup
|
||||
@ cdecl _mbsicmp(str str)
|
||||
@ cdecl _mbsicmp_l(str str ptr)
|
||||
|
@ -1195,7 +1195,7 @@
|
|||
@ cdecl _o__mbscspn(str str) _mbscspn
|
||||
@ cdecl _o__mbscspn_l(str str ptr) _mbscspn_l
|
||||
@ cdecl _o__mbsdec(ptr ptr) _mbsdec
|
||||
@ stub _o__mbsdec_l
|
||||
@ cdecl _o__mbsdec_l(ptr ptr ptr) _mbsdec_l
|
||||
@ cdecl _o__mbsicmp(str str) _mbsicmp
|
||||
@ cdecl _o__mbsicmp_l(str str ptr) _mbsicmp_l
|
||||
@ cdecl _o__mbsicoll(str str) _mbsicoll
|
||||
|
|
Loading…
Add table
Reference in a new issue