ReactOS 0.4.15-dev-7704-gc07eb9f
mbsnicmp.c File Reference
#include <mbstring.h>
Include dependency graph for mbsnicmp.c:

Go to the source code of this file.

Functions

size_t _mbclen2 (const unsigned int s)
 
unsigned int _mbbtoupper (unsigned int c)
 
int _mbsnicmp (const unsigned char *s1, const unsigned char *s2, size_t n)
 
int _mbsnbicmp (const unsigned char *s1, const unsigned char *s2, size_t n)
 

Function Documentation

◆ _mbbtoupper()

unsigned int _mbbtoupper ( unsigned int  c)

Definition at line 15 of file mbsupr.c.

16{
17 if (!_ismbblead(c) )
18 return toupper(c);
19
20 return c;
21}
int toupper(int c)
Definition: utclib.c:881
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
int __cdecl _ismbblead(unsigned int)
Definition: ismblead.c:20

Referenced by _mbsnbicmp(), and _mbsnicmp().

◆ _mbclen2()

size_t _mbclen2 ( const unsigned int  s)

Definition at line 23 of file mbclen.c.

24{
25 return (_ismbblead(s>>8) && _ismbbtrail(s&0x00FF)) ? 2 : 1;
26}
GLdouble s
Definition: gl.h:2039
_Check_return_ _CRTIMP int __cdecl _ismbbtrail(_In_ unsigned int _C)

Referenced by _mbsnbicmp(), and _mbsnicmp().

◆ _mbsnbicmp()

int _mbsnbicmp ( const unsigned char s1,
const unsigned char s2,
size_t  n 
)

Definition at line 32 of file mbsnicmp.c.

33{
34 if (n == 0)
35 return 0;
36 do {
37 if (_mbbtoupper(*s1) != _mbbtoupper(*s2))
38 return _mbbtoupper(*(unsigned const char *)s1) - _mbbtoupper(*(unsigned const char *)s2);
39 s1 += _mbclen2(*s1);
40 s2 += _mbclen2(*s2);
41
42 if (*s1 == 0)
43 break;
44 n--;
45 } while (n > 0);
46 return 0;
47}
GLdouble n
Definition: glext.h:7729
size_t _mbclen2(const unsigned int s)
Definition: mbclen.c:23
unsigned int _mbbtoupper(unsigned int c)
Definition: mbsupr.c:15
struct S1 s1
struct S2 s2

◆ _mbsnicmp()

int _mbsnicmp ( const unsigned char s1,
const unsigned char s2,
size_t  n 
)

Definition at line 11 of file mbsnicmp.c.

12{
13 if (n == 0)
14 return 0;
15 do {
16 if (_mbbtoupper(*s1) != _mbbtoupper(*s2))
17 return _mbbtoupper(*(unsigned const char *)s1) - _mbbtoupper(*(unsigned const char *)s2);
18 s1 += _mbclen2(*s1);
19 s2 += _mbclen2(*s2);
20
21 if (*s1 == 0)
22 break;
23 if (!_ismbblead(*s1))
24 n--;
25 } while (n > 0);
26 return 0;
27}