| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #ifndef _MBCS
|
| #error This file should only be compiled with _MBCS defined
|
| #endif
|
|
|
| #include <corecrt_internal.h>
|
| #include <corecrt_internal_mbstring.h>
|
| #include <locale.h>
|
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
|
|
| extern "C" int __cdecl _mbsicoll_l(
|
| const unsigned char *s1,
|
| const unsigned char *s2,
|
| _locale_t plocinfo
|
| )
|
| {
|
| int ret;
|
| _LocaleUpdate _loc_update(plocinfo);
|
|
|
|
|
| _VALIDATE_RETURN(s1 != nullptr, EINVAL, _NLSCMPERROR);
|
| _VALIDATE_RETURN(s2 != nullptr, EINVAL, _NLSCMPERROR);
|
|
|
| if (_loc_update.GetLocaleT()->mbcinfo->ismbcodepage == 0)
|
| return _stricoll_l((const char *)s1, (const char *)s2, plocinfo);
|
|
|
| if ( 0 == (ret = __acrt_CompareStringA(
|
| _loc_update.GetLocaleT(),
|
| _loc_update.GetLocaleT()->mbcinfo->mblocalename,
|
| SORT_STRINGSORT | NORM_IGNORECASE,
|
| (LPCSTR)s1,
|
| -1,
|
| (LPSTR)s2,
|
| -1,
|
| _loc_update.GetLocaleT()->mbcinfo->mbcodepage )) )
|
| {
|
| errno = EINVAL;
|
| return _NLSCMPERROR;
|
| }
|
|
|
| return ret - 2;
|
|
|
| }
|
|
|
| extern "C" int (__cdecl _mbsicoll)(
|
| const unsigned char *s1,
|
| const unsigned char *s2
|
| )
|
| {
|
| return _mbsicoll_l(s1, s2, nullptr);
|
| }
|
|
|