2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/msvcrt/mbstring/mbsicoll.c
6 * PROGRAMER: Boudewijn Dekker
10 #include <msvcrt/mbstring.h>
11 #include <msvcrt/mbctype.h>
12 #include <msvcrt/ctype.h>
14 int colldif(unsigned short c1, unsigned short c2);
15 int _mbsicoll(const unsigned char *str1, const unsigned char *str2)
17 unsigned char *s1 = (unsigned char *)str1;
18 unsigned char *s2 = (unsigned char *)str2;
20 unsigned short *short_s1, *short_s2;
33 if (toupper(*s1) != toupper(*s2))
34 return colldif(*s1, *s2);
41 short_s1 = (unsigned short *)s1;
42 short_s2 = (unsigned short *)s2;
43 if ( _mbctoupper(*short_s1) != _mbctoupper(*short_s2 ))
44 return colldif(*short_s1, *short_s2);
52 return colldif(*s1, *s2);