Commit beb7f9fa authored by Bartosz Kosiorek's avatar Bartosz Kosiorek Committed by Alexandre Julliard

msvcrt: Add _mbsicmp_l implementation.

parent fce3c3cc
......@@ -1112,7 +1112,7 @@
@ cdecl _mbsdec(ptr ptr)
@ stub _mbsdec_l
@ cdecl _mbsicmp(str str)
@ stub _mbsicmp_l
@ cdecl _mbsicmp_l(str str ptr)
@ cdecl _mbsicoll(str str)
@ cdecl _mbsicoll_l(str str ptr)
@ cdecl _mbsinc(str)
......
......@@ -1469,7 +1469,7 @@
@ cdecl _mbsdec(ptr ptr)
@ stub _mbsdec_l
@ cdecl _mbsicmp(str str)
@ stub _mbsicmp_l
@ cdecl _mbsicmp_l(str str ptr)
@ cdecl _mbsicoll(str str)
@ cdecl _mbsicoll_l(str str ptr)
@ cdecl _mbsinc(str)
......
......@@ -1480,7 +1480,7 @@
@ cdecl _mbsdec(ptr ptr)
@ stub _mbsdec_l
@ cdecl _mbsicmp(str str)
@ stub _mbsicmp_l
@ cdecl _mbsicmp_l(str str ptr)
@ cdecl _mbsicoll(str str)
@ cdecl _mbsicoll_l(str str ptr)
@ cdecl _mbsinc(str)
......
......@@ -784,7 +784,7 @@
@ cdecl _mbsdec(ptr ptr)
@ stub _mbsdec_l
@ cdecl _mbsicmp(str str)
@ stub _mbsicmp_l
@ cdecl _mbsicmp_l(str str ptr)
@ cdecl _mbsicoll(str str)
@ cdecl _mbsicoll_l(str str ptr)
@ cdecl _mbsinc(str)
......
......@@ -762,7 +762,7 @@
@ cdecl _mbsdec(ptr ptr)
@ stub _mbsdec_l
@ cdecl _mbsicmp(str str)
@ stub _mbsicmp_l
@ cdecl _mbsicmp_l(str str ptr)
@ cdecl _mbsicoll(str str)
@ cdecl _mbsicoll_l(str str ptr)
@ cdecl _mbsinc(str)
......
......@@ -1098,11 +1098,20 @@ int CDECL _mbscoll(const unsigned char* str, const unsigned char* cmp)
}
/*********************************************************************
* _mbsicmp(MSVCRT.@)
* _mbsicmp_l(MSVCRT.@)
*/
int CDECL _mbsicmp(const unsigned char* str, const unsigned char* cmp)
int CDECL _mbsicmp_l(const unsigned char* str, const unsigned char* cmp, _locale_t locale)
{
if(get_mbcinfo()->ismbcodepage)
pthreadmbcinfo mbcinfo;
if(!MSVCRT_CHECK_PMT(str && cmp))
return _NLSCMPERROR;
if(!locale)
mbcinfo = get_mbcinfo();
else
mbcinfo = locale->mbcinfo;
if(mbcinfo->ismbcodepage)
{
unsigned int strc, cmpc;
do {
......@@ -1110,8 +1119,8 @@ int CDECL _mbsicmp(const unsigned char* str, const unsigned char* cmp)
return *cmp ? -1 : 0;
if(!*cmp)
return 1;
strc = _mbctolower(_mbsnextc(str));
cmpc = _mbctolower(_mbsnextc(cmp));
strc = _mbctolower_l(_mbsnextc_l(str, locale), locale);
cmpc = _mbctolower_l(_mbsnextc_l(cmp, locale), locale);
if(strc != cmpc)
return strc < cmpc ? -1 : 1;
str +=(strc > 255) ? 2 : 1;
......@@ -1122,6 +1131,14 @@ int CDECL _mbsicmp(const unsigned char* str, const unsigned char* cmp)
}
/*********************************************************************
* _mbsicmp(MSVCRT.@)
*/
int CDECL _mbsicmp(const unsigned char* str, const unsigned char* cmp)
{
return _mbsicmp_l(str, cmp, NULL);
}
/*********************************************************************
* _mbsncmp(MSVCRT.@)
*/
int CDECL _mbsncmp(const unsigned char* str, const unsigned char* cmp, size_t len)
......
......@@ -733,7 +733,7 @@
@ cdecl _mbsdup(str) _strdup
# stub _strdup_dbg(str long str long)
@ cdecl _mbsicmp(str str)
# stub _mbsicmp_l(str str ptr)
@ cdecl _mbsicmp_l(str str ptr)
@ cdecl _mbsicoll(str str)
@ cdecl _mbsicoll_l(str str ptr)
@ cdecl _mbsinc(str)
......
......@@ -627,7 +627,7 @@
@ stub _mbsdec_l
@ cdecl _mbsdup(str) _strdup
@ cdecl _mbsicmp(str str)
@ stub _mbsicmp_l
@ cdecl _mbsicmp_l(str str ptr)
@ cdecl _mbsicoll(str str)
@ cdecl _mbsicoll_l(str str ptr)
@ cdecl _mbsinc(str)
......@@ -1196,7 +1196,7 @@
@ cdecl _o__mbsdec(ptr ptr) _mbsdec
@ stub _o__mbsdec_l
@ cdecl _o__mbsicmp(str str) _mbsicmp
@ stub _o__mbsicmp_l
@ cdecl _o__mbsicmp_l(str str ptr) _mbsicmp_l
@ cdecl _o__mbsicoll(str str) _mbsicoll
@ cdecl _o__mbsicoll_l(str str ptr) _mbsicoll_l
@ cdecl _o__mbsinc(str) _mbsinc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment