msvcrt: Added _toupper_l implementation.
This commit is contained in:
parent
52c2976f1d
commit
1e981e5e9c
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "msvcrt.h"
|
#include "msvcrt.h"
|
||||||
#include "winnls.h"
|
#include "winnls.h"
|
||||||
|
#include "wine/unicode.h"
|
||||||
|
|
||||||
/* Some abbreviations to make the following table readable */
|
/* Some abbreviations to make the following table readable */
|
||||||
#define _C_ MSVCRT__CONTROL
|
#define _C_ MSVCRT__CONTROL
|
||||||
@ -327,6 +328,49 @@ int CDECL MSVCRT___iscsymf(int c)
|
|||||||
return (c < 127 && (isalpha(c) || c == '_'));
|
return (c < 127 && (isalpha(c) || c == '_'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
* _toupper_l (MSVCRT.@)
|
||||||
|
*/
|
||||||
|
int CDECL MSVCRT__toupper_l(int c, MSVCRT__locale_t locale)
|
||||||
|
{
|
||||||
|
if(!locale)
|
||||||
|
locale = get_locale();
|
||||||
|
|
||||||
|
if(c < 256)
|
||||||
|
return locale->locinfo->pcumap[c];
|
||||||
|
|
||||||
|
if(locale->locinfo->pctype[(c>>8)&255] & MSVCRT__LEADBYTE)
|
||||||
|
{
|
||||||
|
WCHAR wide, upper;
|
||||||
|
char str[2], *p = str;
|
||||||
|
*p++ = (c>>8) & 255;
|
||||||
|
*p++ = c & 255;
|
||||||
|
|
||||||
|
if(!MultiByteToWideChar(locale->locinfo->lc_codepage,
|
||||||
|
MB_ERR_INVALID_CHARS, str, 2, &wide, 1))
|
||||||
|
return c;
|
||||||
|
|
||||||
|
upper = toupperW(wide);
|
||||||
|
if(upper == wide)
|
||||||
|
return c;
|
||||||
|
|
||||||
|
WideCharToMultiByte(locale->locinfo->lc_codepage, 0,
|
||||||
|
&upper, 1, str, 2, NULL, NULL);
|
||||||
|
|
||||||
|
return str[0] + (str[1]<<8);
|
||||||
|
}
|
||||||
|
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
* toupper (MSVCRT.@)
|
||||||
|
*/
|
||||||
|
int CDECL MSVCRT_toupper(int c)
|
||||||
|
{
|
||||||
|
return MSVCRT__toupper_l(c, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* _toupper (MSVCRT.@)
|
* _toupper (MSVCRT.@)
|
||||||
*/
|
*/
|
||||||
|
@ -979,7 +979,7 @@
|
|||||||
@ cdecl _tolower(long) MSVCRT__tolower
|
@ cdecl _tolower(long) MSVCRT__tolower
|
||||||
# stub _tolower_l(long ptr)
|
# stub _tolower_l(long ptr)
|
||||||
@ cdecl _toupper(long) MSVCRT__toupper
|
@ cdecl _toupper(long) MSVCRT__toupper
|
||||||
# stub _toupper_l(long ptr)
|
@ cdecl _toupper_l(long ptr) MSVCRT__toupper_l
|
||||||
@ cdecl _towlower_l(long ptr) MSVCRT__towlower_l
|
@ cdecl _towlower_l(long ptr) MSVCRT__towlower_l
|
||||||
@ cdecl _towupper_l(long ptr) MSVCRT__towupper_l
|
@ cdecl _towupper_l(long ptr) MSVCRT__towupper_l
|
||||||
@ extern _tzname MSVCRT__tzname
|
@ extern _tzname MSVCRT__tzname
|
||||||
@ -1426,7 +1426,7 @@
|
|||||||
@ cdecl tmpnam(ptr) MSVCRT_tmpnam
|
@ cdecl tmpnam(ptr) MSVCRT_tmpnam
|
||||||
# stub tmpnam_s(ptr long)
|
# stub tmpnam_s(ptr long)
|
||||||
@ cdecl tolower(long) ntdll.tolower
|
@ cdecl tolower(long) ntdll.tolower
|
||||||
@ cdecl toupper(long) ntdll.toupper
|
@ cdecl toupper(long) MSVCRT_toupper
|
||||||
@ cdecl towlower(long) ntdll.towlower
|
@ cdecl towlower(long) ntdll.towlower
|
||||||
@ cdecl towupper(long) ntdll.towupper
|
@ cdecl towupper(long) ntdll.towupper
|
||||||
@ cdecl ungetc(long ptr) MSVCRT_ungetc
|
@ cdecl ungetc(long ptr) MSVCRT_ungetc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user