Implemented _mbsnbicmp.

This commit is contained in:
François Gouget 2002-04-02 02:42:58 +00:00 committed by Alexandre Julliard
parent 79313d371a
commit 7ccf8bc87d
2 changed files with 46 additions and 1 deletions

View File

@ -411,6 +411,51 @@ int _mbsnicmp(const unsigned char* str, const unsigned char* cmp, MSVCRT_size_t
return strncasecmp(str, cmp, len); /* ASCII CP */
}
/*********************************************************************
* _mbsnbicmp(MSVCRT.@)
*/
int _mbsnbicmp(const unsigned char* str, const unsigned char* cmp, MSVCRT_size_t len)
{
if (!len)
return 0;
if(MSVCRT___mb_cur_max > 1)
{
unsigned int strc, cmpc;
while (len)
{
int clen;
if(!*str)
return *cmp ? -1 : 0;
if(!*cmp)
return 1;
if (MSVCRT_isleadbyte(*str))
{
strc=(len>=2)?_mbsnextc(str):0;
clen=2;
}
else
{
strc=*str;
clen=1;
}
if (MSVCRT_isleadbyte(*cmp))
cmpc=(len>=2)?_mbsnextc(cmp):0;
else
cmpc=*str;
strc = _mbctolower(strc);
cmpc = _mbctolower(cmpc);
if(strc != cmpc)
return strc < cmpc ? -1 : 1;
len -= clen;
str += clen;
cmp += clen;
}
return 0; /* Matched len bytes */
FIXME("%s %s %d\n",str,cmp,len);
}
return strncmp(str,cmp,len);
}
/*********************************************************************
* _mbschr(MSVCRT.@)
*

View File

@ -370,7 +370,7 @@ debug_channels (msvcrt)
@ cdecl _mbsnbcnt(ptr long) _mbsnbcnt
@ stub _mbsnbcoll #(str str long)
@ cdecl _mbsnbcpy(ptr str long) _mbsnbcpy
@ stub _mbsnbicmp #(str str long)
@ cdecl _mbsnbicmp(str str long) _mbsnbicmp
@ stub _mbsnbicoll #(str str long)
@ stub _mbsnbset #(str long long)
@ cdecl _mbsncat(str str long) _mbsncat