2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/crtdll/mbstring/mbsicmp.c
5 * PURPOSE: Duplicates a multi byte string
6 * PROGRAMER: Boudewijn Dekker
10 #include <msvcrt/mbstring.h>
11 #include <msvcrt/mbctype.h>
12 #include <msvcrt/ctype.h>
14 int _mbsicmp(const unsigned char *str1, const unsigned char *str2)
16 unsigned char *s1 = (unsigned char *)str1;
17 unsigned char *s2 = (unsigned char *)str2;
19 unsigned short *short_s1, *short_s2;
32 if (toupper(*s1) != toupper(*s2))
33 return toupper(*s1) - toupper(*s2);
40 short_s1 = (unsigned short *)s1;
41 short_s2 = (unsigned short *)s2;
42 if ( _mbctoupper(*short_s1) != _mbctoupper(*short_s2 ))
43 return _mbctoupper(*short_s1) - _mbctoupper(*short_s2);
54 while (toupper(*s1) == toupper(*s2))
61 return toupper(*(unsigned const char *)s1) - toupper(*(unsigned const char *)(s2));