From af39862fe376a12c323b6cd4003078880b001330 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Fri, 31 Jan 2003 03:20:25 +0000 Subject: [PATCH] Implemented mbsicoll (without locale handling). --- dlls/msvcrt/mbcs.c | 26 ++++++++++++++++++++++++++ dlls/msvcrt/msvcrt.spec | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index bbf3d841bed..a2168308d5f 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -307,6 +307,32 @@ int _mbscmp(const unsigned char* str, const unsigned char* cmp) } /********************************************************************* + * _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.@) */ int _mbsicmp(const unsigned char* str, const unsigned char* cmp) diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 47197d0dc3f..b8dc2771087 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -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 -- 2.11.4.GIT