2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/crtdll/mbstring/mbsncmp.c
5 * PURPOSE: Compares two strings to a maximum of n bytes or characters
6 * PROGRAMER: Boudewijn Dekker
11 #include <msvcrt/mbstring.h>
13 int _mbsncmp(const unsigned char *str1, const unsigned char *str2, size_t n)
15 unsigned char *s1 = (unsigned char *)str1;
16 unsigned char *s2 = (unsigned char *)str2;
18 unsigned short *short_s1, *short_s2;
42 short_s1 = (unsigned short *)s1;
43 short_s2 = (unsigned short *)s2;
44 if ( *short_s1 != *short_s2 )
45 return *short_s1 - *short_s2;
59 int _mbsnbcmp(const unsigned char *str1, const unsigned char *str2, size_t n)
61 unsigned char *s1 = (unsigned char *)str1;
62 unsigned char *s2 = (unsigned char *)str2;
64 unsigned short *short_s1, *short_s2;
88 short_s1 = (unsigned short *)s1;
89 short_s2 = (unsigned short *)s2;
90 if ( *short_s1 != *short_s2 )
91 return *short_s1 - *short_s2;