Implemented mbsicoll (without locale handling).
This commit is contained in:
parent
c1a4cead2f
commit
af39862fe3
|
@ -306,6 +306,32 @@ int _mbscmp(const unsigned char* str, const unsigned char* cmp)
|
|||
return strcmp(str, cmp); /* ASCII CP */
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _mbsicoll(MSVCRT.@)
|
||||
* FIXME: handle locales.
|
||||
*/
|
||||
int _mbsicoll(const unsigned char* str, const unsigned char* cmp)
|
||||
{
|
||||
if(MSVCRT___mb_cur_max > 1)
|
||||
{
|
||||
unsigned int strc, cmpc;
|
||||
do {
|
||||
if(!*str)
|
||||
return *cmp ? -1 : 0;
|
||||
if(!*cmp)
|
||||
return 1;
|
||||
strc = _mbctolower(_mbsnextc(str));
|
||||
cmpc = _mbctolower(_mbsnextc(cmp));
|
||||
if(strc != cmpc)
|
||||
return strc < cmpc ? -1 : 1;
|
||||
str +=(strc > 255) ? 2 : 1;
|
||||
cmp +=(strc > 255) ? 2 : 1; /* equal, use same increment */
|
||||
} while(1);
|
||||
}
|
||||
return strcasecmp(str, cmp); /* ASCII CP */
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* _mbsicmp(MSVCRT.@)
|
||||
*/
|
||||
|
|
|
@ -355,7 +355,7 @@
|
|||
@ cdecl _mbsdec(ptr ptr) _mbsdec
|
||||
@ cdecl _mbsdup(str) _strdup
|
||||
@ cdecl _mbsicmp(str str) _mbsicmp
|
||||
@ stub _mbsicoll #(str str)
|
||||
@ cdecl _mbsicoll(str str) _mbsicoll
|
||||
@ cdecl _mbsinc(str) _mbsinc
|
||||
@ cdecl _mbslen(str) _mbslen
|
||||
@ cdecl _mbslwr(str) _mbslwr
|
||||
|
|
Loading…
Reference in New Issue