Commit 5556eba0 authored by Bartosz Kosiorek's avatar Bartosz Kosiorek Committed by Alexandre Julliard

msvcrt: Add _mbsupr_l implementation.

parent 2b7dcfb4
......@@ -1200,7 +1200,7 @@
@ stub _mbstrnlen
@ stub _mbstrnlen_l
@ cdecl _mbsupr(str)
@ stub _mbsupr_l
@ cdecl _mbsupr_l(str ptr)
@ cdecl _mbsupr_s(str long)
@ cdecl _mbsupr_s_l(str long ptr)
@ cdecl _mbtowc_l(ptr str long ptr)
......
......@@ -1557,7 +1557,7 @@
@ stub _mbstrnlen
@ stub _mbstrnlen_l
@ cdecl _mbsupr(str)
@ stub _mbsupr_l
@ cdecl _mbsupr_l(str ptr)
@ cdecl _mbsupr_s(str long)
@ cdecl _mbsupr_s_l(str long ptr)
@ cdecl _mbtowc_l(ptr str long ptr)
......
......@@ -1568,7 +1568,7 @@
@ stub _mbstrnlen
@ stub _mbstrnlen_l
@ cdecl _mbsupr(str)
@ stub _mbsupr_l
@ cdecl _mbsupr_l(str ptr)
@ cdecl _mbsupr_s(str long)
@ cdecl _mbsupr_s_l(str long ptr)
@ cdecl _mbtowc_l(ptr str long ptr)
......
......@@ -872,7 +872,7 @@
@ stub _mbstrnlen
@ stub _mbstrnlen_l
@ cdecl _mbsupr(str)
@ stub _mbsupr_l
@ cdecl _mbsupr_l(str ptr)
@ cdecl _mbsupr_s(str long)
@ cdecl _mbsupr_s_l(str long ptr)
@ cdecl _mbtowc_l(ptr str long ptr)
......
......@@ -850,7 +850,7 @@
@ stub _mbstrnlen
@ stub _mbstrnlen_l
@ cdecl _mbsupr(str)
@ stub _mbsupr_l
@ cdecl _mbsupr_l(str ptr)
@ cdecl _mbsupr_s(str long)
@ cdecl _mbsupr_s_l(str long ptr)
@ cdecl _mbtowc_l(ptr str long ptr)
......
......@@ -2437,30 +2437,47 @@ int CDECL _mbslwr_s(unsigned char* str, size_t len)
}
/*********************************************************************
* _mbsupr(MSVCRT.@)
* _mbsupr_l(MSVCRT.@)
*/
unsigned char* CDECL _mbsupr(unsigned char* s)
unsigned char* CDECL _mbsupr_l(unsigned char* s, _locale_t locale)
{
unsigned char *ret = s;
if (!s)
return NULL;
if (get_mbcinfo()->ismbcodepage)
{
unsigned int c;
while (*s)
unsigned char *ret = s;
pthreadmbcinfo mbcinfo;
if (!MSVCRT_CHECK_PMT(s))
return NULL;
if (locale)
mbcinfo = locale->mbcinfo;
else
mbcinfo = get_mbcinfo();
if (mbcinfo->ismbcodepage)
{
c = _mbctoupper(_mbsnextc(s));
/* Note that I assume that the size of the character is unchanged */
if (c > 255)
{
*s++=(c>>8);
c=c & 0xff;
}
*s++=c;
unsigned int c;
while (*s)
{
c = _mbctoupper_l(_mbsnextc_l(s, locale), locale);
/* Note that I assume that the size of the character is unchanged */
if (c > 255)
{
*s++ = (c >> 8);
c = c & 0xff;
}
*s++ = c;
}
}
}
else for ( ; *s; s++) *s = _toupper_l(*s, NULL);
return ret;
else
for ( ; *s; s++) *s = _toupper_l(*s, locale);
return ret;
}
/*********************************************************************
* _mbsupr(MSVCRT.@)
*/
unsigned char* CDECL _mbsupr(unsigned char* s)
{
return _mbsupr_l(s, NULL);
}
/*********************************************************************
......
......@@ -821,7 +821,7 @@
# stub _mbstrnlen(str long)
# stub _mbstrnlen_l(str long ptr)
@ cdecl _mbsupr(str)
# stub _mbsupr_l(str ptr)
@ cdecl _mbsupr_l(str ptr)
@ cdecl _mbsupr_s(str long)
@ cdecl _mbsupr_s_l(str long ptr)
@ cdecl _mbtowc_l(ptr str long ptr)
......
......@@ -716,7 +716,7 @@
@ stub _mbstrnlen
@ stub _mbstrnlen_l
@ cdecl _mbsupr(str)
@ stub _mbsupr_l
@ cdecl _mbsupr_l(str ptr)
@ cdecl _mbsupr_s(str long)
@ cdecl _mbsupr_s_l(str long ptr)
@ cdecl _mbtowc_l(ptr str long ptr)
......@@ -1285,7 +1285,7 @@
@ stub _o__mbstrnlen
@ stub _o__mbstrnlen_l
@ cdecl _o__mbsupr(str) _mbsupr
@ stub _o__mbsupr_l
@ cdecl _o__mbsupr_l(str ptr) _mbsupr_l
@ cdecl _o__mbsupr_s(str long) _mbsupr_s
@ cdecl _o__mbsupr_s_l(str long ptr) _mbsupr_s_l
@ cdecl _o__mbtowc_l(ptr str long ptr) _mbtowc_l
......
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