_CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Wcscoll ( const wchar_t *_string1, const wchar_t *_end1, const wchar_t *_string2, const wchar_t *_end2, const _Collvec *ploc ) { int n1 = (int)(_end1 - _string1); int n2 = (int)(_end2 - _string2); int ret=0; //const wchar_t *locale_name; LCID _Locale; if (ploc == 0) { //locale_name = ___lc_locale_name_func()[LC_COLLATE]; _Locale = ___lc_handle_func()[LC_COLLATE]; } else { //locale_name = ploc->_LocaleName; _Locale = ploc->_Hand; } if (/*locale_name == NULL*/_Locale==0) { int ans; ans = _Wmemcmp(_string1, _string2, n1 < n2 ? n1 : n2); ret=(ans != 0 || n1 == n2 ? ans : n1 < n2 ? -1 : +1); } else { if (0 == (ret = __crtCompareStringW(_Locale, SORT_STRINGSORT, _string1, n1, _string2, n2))) { errno = EINVAL; ret=_NLSCMPERROR; } else { ret-=2; } } return ret; }
int __cdecl _Wcscoll ( const wchar_t *_string1, const wchar_t *_end1, const wchar_t *_string2, const wchar_t *_end2, const _Collvec *ploc ) { size_t n1 = _end1 - _string1; size_t n2 = _end2 - _string2; int ret; LCID handle; #ifdef _MT int local_lock_flag; _lock_locale( local_lock_flag ) #endif if (ploc == 0) handle = __lc_handle[LC_COLLATE]; else handle = ploc->_Hand; if (handle == _CLOCALEHANDLE) { int ans; _unlock_locale( local_lock_flag ) ans = _Wmemcmp(_string1, _string2, n1 < n2 ? n1 : n2); return ans != 0 || n1 == n2 ? ans : n1 < n2 ? -1 : +1; } if (0 == (ret = __crtCompareStringW(handle, 0, _string1, n1, _string2, n2, __lc_collate_cp))) { _unlock_locale( local_lock_flag ) errno = EINVAL; return _NLSCMPERROR; } _unlock_locale( local_lock_flag ) return (ret - 2); }
_MRTIMP2_NCEEPURE int __CLRCALL_PURE_OR_CDECL _Wcscoll ( const wchar_t *_string1, const wchar_t *_end1, const wchar_t *_string2, const wchar_t *_end2, const _Collvec *ploc ) { int n1 = (int)(_end1 - _string1); int n2 = (int)(_end2 - _string2); int ret=0; LCID handle; if (ploc == 0) handle = ___lc_handle_func()[LC_COLLATE]; else handle = ploc->_Hand; if (handle == _CLOCALEHANDLE) { int ans; ans = _Wmemcmp(_string1, _string2, n1 < n2 ? n1 : n2); ret=(ans != 0 || n1 == n2 ? ans : n1 < n2 ? -1 : +1); } else { if (0 == (ret = __crtCompareStringW(NULL, handle, SORT_STRINGSORT, _string1, n1, _string2, n2, ___lc_collate_cp_func()))) { errno = EINVAL; ret=_NLSCMPERROR; } else { ret-=2; } } return ret; }