Commit 082de781 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

msvcrt: Implement _mbsnextc_l().

parent 69ba059d
......@@ -154,7 +154,7 @@
@ stub _mbsncpy_s
@ stub _mbsncpy_s_l
@ cdecl _mbsnextc(str) ucrtbase._mbsnextc
@ stub _mbsnextc_l
@ cdecl _mbsnextc_l(str ptr) ucrtbase._mbsnextc_l
@ cdecl _mbsnicmp(str str long) ucrtbase._mbsnicmp
@ stub _mbsnicmp_l
@ cdecl _mbsnicoll(str str long) ucrtbase._mbsnicoll
......
......@@ -578,7 +578,7 @@
@ stub _o__mbsncpy_s
@ stub _o__mbsncpy_s_l
@ cdecl _o__mbsnextc(str) ucrtbase._o__mbsnextc
@ stub _o__mbsnextc_l
@ cdecl _o__mbsnextc_l(str ptr) ucrtbase._o__mbsnextc_l
@ cdecl _o__mbsnicmp(str str long) ucrtbase._o__mbsnicmp
@ stub _o__mbsnicmp_l
@ stub _o__mbsnicoll
......
......@@ -1160,7 +1160,7 @@
@ stub _mbsncpy_s
@ stub _mbsncpy_s_l
@ cdecl _mbsnextc(str)
@ stub _mbsnextc_l
@ cdecl _mbsnextc_l(str ptr)
@ cdecl _mbsnicmp(str str long)
@ stub _mbsnicmp_l
@ stub _mbsnicoll(str str long)
......
......@@ -1517,7 +1517,7 @@
@ stub _mbsncpy_s
@ stub _mbsncpy_s_l
@ cdecl _mbsnextc(str)
@ stub _mbsnextc_l
@ cdecl _mbsnextc_l(str ptr)
@ cdecl _mbsnicmp(str str long)
@ stub _mbsnicmp_l
@ stub _mbsnicoll(str str long)
......
......@@ -1527,7 +1527,7 @@
@ stub _mbsncpy_s
@ stub _mbsncpy_s_l
@ cdecl _mbsnextc(str)
@ stub _mbsnextc_l
@ cdecl _mbsnextc_l(str ptr)
@ cdecl _mbsnicmp(str str long)
@ stub _mbsnicmp_l
@ stub _mbsnicoll(str str long)
......
......@@ -832,7 +832,7 @@
@ stub _mbsncpy_s
@ stub _mbsncpy_s_l
@ cdecl _mbsnextc(str)
@ stub _mbsnextc_l
@ cdecl _mbsnextc_l(str ptr)
@ cdecl _mbsnicmp(str str long)
@ stub _mbsnicmp_l
@ stub _mbsnicoll(str str long)
......
......@@ -810,7 +810,7 @@
@ stub _mbsncpy_s
@ stub _mbsncpy_s_l
@ cdecl _mbsnextc(str)
@ stub _mbsnextc_l
@ cdecl _mbsnextc_l(str ptr)
@ cdecl _mbsnicmp(str str long)
@ stub _mbsnicmp_l
@ stub _mbsnicoll(str str long)
......
......@@ -393,16 +393,24 @@ int CDECL _getmbcp(void)
}
/*********************************************************************
* _mbsnextc(MSVCRT.@)
* _mbsnextc_l(MSVCRT.@)
*/
unsigned int CDECL _mbsnextc(const unsigned char* str)
unsigned int CDECL _mbsnextc_l(const unsigned char* str, MSVCRT__locale_t locale)
{
if(_ismbblead(*str))
if(_ismbblead_l(*str, locale))
return *str << 8 | str[1];
return *str;
}
/*********************************************************************
* _mbsnextc(MSVCRT.@)
*/
unsigned int CDECL _mbsnextc(const unsigned char* str)
{
return _mbsnextc_l(str, NULL);
}
/*********************************************************************
* _mbctolower(MSVCRT.@)
*/
unsigned int CDECL _mbctolower(unsigned int c)
......
......@@ -778,7 +778,7 @@
# stub _mbsncpy_s(ptr long str long)
# stub _mbsncpy_s_l(ptr long str long ptr)
@ cdecl _mbsnextc(str)
# stub _mbsnextc_l(str ptr)
@ cdecl _mbsnextc_l(str ptr)
@ cdecl _mbsnicmp(str str long)
# stub _mbsnicmp_l(str str long ptr)
@ stub _mbsnicoll(str str long)
......
......@@ -114,6 +114,7 @@ static int (__cdecl *p__mbccpy_s)(unsigned char*, size_t, int*, const unsigned c
static int (__cdecl *p__memicmp)(const char*, const char*, size_t);
static int (__cdecl *p__memicmp_l)(const char*, const char*, size_t, _locale_t);
static size_t (__cdecl *p___strncnt)(const char*, size_t);
static unsigned int (__cdecl *p_mbsnextc_l)(const unsigned char*, _locale_t);
int CDECL __STRINGTOLD(_LDOUBLE*, char**, const char*, int);
......@@ -351,6 +352,11 @@ static void test_mbcp(void)
expect_eq(_mbsnextc(&mbstring[2]), 0xb220, int, "%x"); /* lead + invalid tail */
expect_eq(_mbsnextc(&mbstring[3]), 0x20, int, "%x"); /* single char */
if (!p_mbsnextc_l)
win_skip("_mbsnextc_l tests\n");
else
expect_eq(p_mbsnextc_l(mbstring, NULL), 0xb0b1, int, "%x");
/* _mbclen/_mbslen */
expect_eq(_mbclen(mbstring), 2, int, "%d");
expect_eq(_mbclen(&mbstring[2]), 2, int, "%d");
......@@ -4451,6 +4457,7 @@ START_TEST(string)
p__memicmp = (void*)GetProcAddress(hMsvcrt, "_memicmp");
p__memicmp_l = (void*)GetProcAddress(hMsvcrt, "_memicmp_l");
p___strncnt = (void*)GetProcAddress(hMsvcrt, "__strncnt");
p_mbsnextc_l = (void*)GetProcAddress(hMsvcrt, "_mbsnextc_l");
/* MSVCRT memcpy behaves like memmove for overlapping moves,
MFC42 CString::Insert seems to rely on that behaviour */
......
......@@ -673,7 +673,7 @@
@ stub _mbsncpy_s
@ stub _mbsncpy_s_l
@ cdecl _mbsnextc(str)
@ stub _mbsnextc_l
@ cdecl _mbsnextc_l(str ptr)
@ cdecl _mbsnicmp(str str long)
@ stub _mbsnicmp_l
@ stub _mbsnicoll(str str long)
......@@ -1242,7 +1242,7 @@
@ stub _o__mbsncpy_s
@ stub _o__mbsncpy_s_l
@ cdecl _o__mbsnextc(str) _mbsnextc
@ stub _o__mbsnextc_l
@ cdecl _o__mbsnextc_l(str ptr) _mbsnextc_l
@ cdecl _o__mbsnicmp(str str long) _mbsnicmp
@ stub _o__mbsnicmp_l
@ stub _o__mbsnicoll
......
......@@ -90,7 +90,8 @@ size_t __cdecl _mbsnccnt(const unsigned char*,size_t);
int __cdecl _mbsncmp(const unsigned char*,const unsigned char*,size_t);
int __cdecl _mbsncoll(const unsigned char*,const unsigned char*,size_t);
unsigned char* __cdecl _mbsncpy(unsigned char*,const unsigned char*,size_t);
unsigned int __cdecl _mbsnextc (const unsigned char*);
unsigned int __cdecl _mbsnextc(const unsigned char*);
unsigned int __cdecl _mbsnextc_l(const unsigned char*,_locale_t);
int __cdecl _mbsnicmp(const unsigned char*,const unsigned char*,size_t);
int __cdecl _mbsnicoll(const unsigned char*,const unsigned char*,size_t);
unsigned char* __cdecl _mbsninc(const unsigned char*,size_t);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment