ReactOS 0.4.15-dev-7958-gcd0bb1a
memicmp.c
Go to the documentation of this file.
1/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
2#include <precomp.h>
3
4/*
5 * @implemented
6 */
7int
9_memicmp(const void *s1, const void *s2, size_t n)
10{
11 if (NtCurrentPeb()->OSMajorVersion >= 6)
12 {
13 if (!s1 || !s2)
14 {
15 if (n != 0)
16 {
18 return _NLSCMPERROR;
19 }
20 return 0;
21 }
22 }
23
24 if (n != 0)
25 {
26 const unsigned char *p1 = s1, *p2 = s2;
27
28 do {
29 if (toupper(*p1) != toupper(*p2))
30 return (*p1 - *p2);
31 p1++;
32 p2++;
33 } while (--n != 0);
34 }
35 return 0;
36}
#define NtCurrentPeb()
Definition: FLS.c:22
#define EINVAL
Definition: acclib.h:90
int toupper(int c)
Definition: utclib.c:881
#define NULL
Definition: types.h:112
#define CDECL
Definition: compat.h:29
GLdouble n
Definition: glext.h:7729
int CDECL _memicmp(const void *s1, const void *s2, size_t n)
Definition: memicmp.c:9
struct S1 s1
struct S2 s2
#define MSVCRT_INVALID_PMT(x)
Definition: mbstowcs_s.c:25
#define _NLSCMPERROR
Definition: string.h:17