ReactOS 0.4.16-dev-816-g135a9a9
mbscmp.cpp File Reference
#include <corecrt_internal_mbstring.h>
#include <locale.h>
#include <string.h>
Include dependency graph for mbscmp.cpp:

Go to the source code of this file.

Functions

int __cdecl _mbscmp_l (const unsigned char *s1, const unsigned char *s2, _locale_t plocinfo)
 
 int (__cdecl _mbscmp)(const unsigned char *s1
 

Variables

const unsigned chars2
 

Function Documentation

◆ _mbscmp_l()

int __cdecl _mbscmp_l ( const unsigned char s1,
const unsigned char s2,
_locale_t  plocinfo 
)

Definition at line 47 of file mbscmp.cpp.

52{
53 unsigned short c1, c2;
54 _LocaleUpdate _loc_update(plocinfo);
55
56 /* validation section */
59 if (_loc_update.GetLocaleT()->mbcinfo->ismbcodepage == 0)
60 return strcmp((const char *)s1, (const char *)s2);
61
62 for (;;) {
63
64 c1 = *s1++;
65 if ( _ismbblead_l(c1, _loc_update.GetLocaleT()) )
66 c1 = ( (*s1 == '\0') ? 0 : ((c1<<8) | *s1++) );
67
68 c2 = *s2++;
69 if ( _ismbblead_l(c2, _loc_update.GetLocaleT()) )
70 c2 = ( (*s2 == '\0') ? 0 : ((c2<<8) | *s2++) );
71
72 if (c1 != c2)
73 return (c1 > c2) ? 1 : -1;
74
75 if (c1 == 0)
76 return 0;
77
78 }
79}
#define EINVAL
Definition: acclib.h:90
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define _ismbblead_l(_c, p)
#define _VALIDATE_RETURN(expr, errorcode, retexpr)
_locale_t plocinfo
Definition: ismbbyte.cpp:75
const unsigned char * s2
Definition: mbscmp.cpp:85
struct S1 s1
#define _NLSCMPERROR
Definition: string.h:19

◆ int()

int ( __cdecl  _mbscmp) const

Variable Documentation

◆ s2

Initial value:
{
return _mbscmp_l(s1, s2, nullptr)
int __cdecl _mbscmp_l(const unsigned char *s1, const unsigned char *s2, _locale_t plocinfo)
Definition: mbscmp.cpp:47

Definition at line 83 of file mbscmp.cpp.

Referenced by _mbscmp_l().