mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 12:02:02 +00:00
Create a branch for Aleksandar Andrejevic for his work on NTVDM. See http://jira.reactos.org/browse/CORE-7250 for more details.
svn path=/branches/ntvdm/; revision=59241
This commit is contained in:
parent
3e3200acef
commit
4f0b8d3db0
20620 changed files with 0 additions and 1232833 deletions
64
lib/sdk/crt/mbstring/mbsicmp.c
Normal file
64
lib/sdk/crt/mbstring/mbsicmp.c
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
* FILE: lib/msvcrt/mbstring/mbsicmp.c
|
||||
* PURPOSE: Duplicates a multi byte string
|
||||
* PROGRAMER: Ariadne
|
||||
* UPDATE HISTORY:
|
||||
* 12/04/99: Created
|
||||
*/
|
||||
#include <precomp.h>
|
||||
#include <mbstring.h>
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
int _mbsicmp(const unsigned char *str1, const unsigned char *str2)
|
||||
{
|
||||
unsigned char *s1 = (unsigned char *)str1;
|
||||
unsigned char *s2 = (unsigned char *)str2;
|
||||
|
||||
unsigned short *short_s1, *short_s2;
|
||||
|
||||
int l1, l2;
|
||||
|
||||
do {
|
||||
|
||||
if (*s1 == 0)
|
||||
break;
|
||||
|
||||
l1 = _ismbblead(*s1);
|
||||
l2 = _ismbblead(*s2);
|
||||
if ( !l1 && !l2 ) {
|
||||
|
||||
if (toupper(*s1) != toupper(*s2))
|
||||
return toupper(*s1) - toupper(*s2);
|
||||
else {
|
||||
s1 += 1;
|
||||
s2 += 1;
|
||||
}
|
||||
}
|
||||
else if ( l1 && l2 ){
|
||||
short_s1 = (unsigned short *)s1;
|
||||
short_s2 = (unsigned short *)s2;
|
||||
if ( _mbctoupper(*short_s1) != _mbctoupper(*short_s2 ))
|
||||
return _mbctoupper(*short_s1) - _mbctoupper(*short_s2);
|
||||
else {
|
||||
s1 += 2;
|
||||
s2 += 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
return *s1 - *s2;
|
||||
} while (*s1 != 0);
|
||||
return 0;
|
||||
|
||||
while (toupper(*s1) == toupper(*s2))
|
||||
{
|
||||
if (*s1 == 0)
|
||||
return 0;
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
return toupper(*(unsigned const char *)s1) - toupper(*(unsigned const char *)(s2));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue