ReactOS 0.4.16-dev-300-g2aadf2e
mbsnicmp.c
Go to the documentation of this file.
1#include <mbstring.h>
2
3
4size_t _mbclen2(const unsigned int s);
5unsigned int _mbbtoupper(unsigned int c);
6
7
8/*
9 * @implemented
10 */
11int _mbsnicmp(const unsigned char *s1, const unsigned char *s2, size_t n)
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}
28
29/*
30 * @implemented
31 */
32int _mbsnbicmp(const unsigned char *s1, const unsigned char *s2, size_t n)
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 s
Definition: gl.h:2039
GLdouble n
Definition: glext.h:7729
const GLubyte * c
Definition: glext.h:8905
size_t _mbclen2(const unsigned int s)
Definition: mbclen.c:23
int _mbsnicmp(const unsigned char *s1, const unsigned char *s2, size_t n)
Definition: mbsnicmp.c:11
int _mbsnbicmp(const unsigned char *s1, const unsigned char *s2, size_t n)
Definition: mbsnicmp.c:32
unsigned int _mbbtoupper(unsigned int c)
Definition: mbsupr.c:15
struct S1 s1
struct S2 s2
int __cdecl _ismbblead(unsigned int)
Definition: ismblead.c:20