msvcr120: Add wctype implementation.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
307e5e8f6a
commit
42ccd8d9ec
|
@ -173,6 +173,6 @@
|
|||
@ cdecl wcstok(wstr wstr) ucrtbase.wcstok
|
||||
@ cdecl wcstok_s(ptr wstr ptr) ucrtbase.wcstok_s
|
||||
@ cdecl wcsxfrm(ptr wstr long) ucrtbase.wcsxfrm
|
||||
@ stub wctype
|
||||
@ cdecl wctype(str) ucrtbase.wctype
|
||||
@ cdecl wmemcpy_s(ptr long ptr long) ucrtbase.wmemcpy_s
|
||||
@ cdecl wmemmove_s(ptr long ptr long) ucrtbase.wmemmove_s
|
||||
|
|
|
@ -2487,7 +2487,7 @@
|
|||
@ cdecl wctomb(ptr long) MSVCRT_wctomb
|
||||
@ cdecl wctomb_s(ptr ptr long long) MSVCRT_wctomb_s
|
||||
@ stub wctrans
|
||||
@ stub wctype
|
||||
@ cdecl wctype(str)
|
||||
@ cdecl wmemcpy_s(ptr long ptr long)
|
||||
@ cdecl wmemmove_s(ptr long ptr long)
|
||||
@ varargs wprintf(wstr) MSVCRT_wprintf
|
||||
|
|
|
@ -182,6 +182,7 @@ static int (CDECL *p_fegetenv)(fenv_t*);
|
|||
static int (CDECL *p__clearfp)(void);
|
||||
static _locale_t (__cdecl *p_wcreate_locale)(int, const wchar_t *);
|
||||
static void (__cdecl *p_free_locale)(_locale_t);
|
||||
static unsigned short (__cdecl *p_wctype)(const char*);
|
||||
|
||||
/* make sure we use the correct errno */
|
||||
#undef errno
|
||||
|
@ -236,6 +237,7 @@ static BOOL init(void)
|
|||
p_errno = (void*)GetProcAddress(module, "_errno");
|
||||
p_wcreate_locale = (void*)GetProcAddress(module, "_wcreate_locale");
|
||||
p_free_locale = (void*)GetProcAddress(module, "_free_locale");
|
||||
SET(p_wctype, "wctype");
|
||||
SET(p_fegetenv, "fegetenv");
|
||||
SET(p__clearfp, "_clearfp");
|
||||
if(sizeof(void*) == 8) { /* 64-bit initialization */
|
||||
|
@ -880,6 +882,35 @@ static void test__Condition_variable(void)
|
|||
CloseHandle(thread_initialized);
|
||||
}
|
||||
|
||||
static void test_wctype(void)
|
||||
{
|
||||
static const struct {
|
||||
const char *name;
|
||||
unsigned short mask;
|
||||
} properties[] = {
|
||||
{ "alnum", 0x107 },
|
||||
{ "alpha", 0x103 },
|
||||
{ "cntrl", 0x020 },
|
||||
{ "digit", 0x004 },
|
||||
{ "graph", 0x117 },
|
||||
{ "lower", 0x002 },
|
||||
{ "print", 0x157 },
|
||||
{ "punct", 0x010 },
|
||||
{ "space", 0x008 },
|
||||
{ "upper", 0x001 },
|
||||
{ "xdigit", 0x080 },
|
||||
{ "ALNUM", 0x000 },
|
||||
{ "Alnum", 0x000 },
|
||||
{ "", 0x000 }
|
||||
};
|
||||
int i, ret;
|
||||
|
||||
for(i=0; i<sizeof(properties)/sizeof(properties[0]); i++) {
|
||||
ret = p_wctype(properties[i].name);
|
||||
ok(properties[i].mask == ret, "%d - Expected %x, got %x\n", i, properties[i].mask, ret);
|
||||
}
|
||||
}
|
||||
|
||||
START_TEST(msvcr120)
|
||||
{
|
||||
if (!init()) return;
|
||||
|
@ -896,4 +927,5 @@ START_TEST(msvcr120)
|
|||
test_fegetenv();
|
||||
test__wcreate_locale();
|
||||
test__Condition_variable();
|
||||
test_wctype();
|
||||
}
|
||||
|
|
|
@ -2149,7 +2149,7 @@
|
|||
@ cdecl wctomb(ptr long) msvcr120.wctomb
|
||||
@ cdecl wctomb_s(ptr ptr long long) msvcr120.wctomb_s
|
||||
@ stub wctrans
|
||||
@ stub wctype
|
||||
@ cdecl wctype(str) msvcr120.wctype
|
||||
@ cdecl wmemcpy_s(ptr long ptr long) msvcr120.wmemcpy_s
|
||||
@ cdecl wmemmove_s(ptr long ptr long) msvcr120.wmemmove_s
|
||||
@ varargs wprintf(wstr) msvcr120.wprintf
|
||||
|
|
|
@ -468,3 +468,33 @@ int CDECL MSVCRT__tolower(int c)
|
|||
{
|
||||
return c + 0x20; /* sic */
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* wctype (MSVCR120.@)
|
||||
*/
|
||||
unsigned short __cdecl wctype(const char *property)
|
||||
{
|
||||
static const struct {
|
||||
const char *name;
|
||||
unsigned short mask;
|
||||
} properties[] = {
|
||||
{ "alnum", MSVCRT__DIGIT|MSVCRT__ALPHA },
|
||||
{ "alpha", MSVCRT__ALPHA },
|
||||
{ "cntrl", MSVCRT__CONTROL },
|
||||
{ "digit", MSVCRT__DIGIT },
|
||||
{ "graph", MSVCRT__DIGIT|MSVCRT__PUNCT|MSVCRT__ALPHA },
|
||||
{ "lower", MSVCRT__LOWER },
|
||||
{ "print", MSVCRT__DIGIT|MSVCRT__PUNCT|MSVCRT__BLANK|MSVCRT__ALPHA },
|
||||
{ "punct", MSVCRT__PUNCT },
|
||||
{ "space", MSVCRT__SPACE },
|
||||
{ "upper", MSVCRT__UPPER },
|
||||
{ "xdigit", MSVCRT__HEX }
|
||||
};
|
||||
unsigned int i;
|
||||
|
||||
for(i=0; i<sizeof(properties)/sizeof(properties[0]); i++)
|
||||
if(!strcmp(property, properties[i].name))
|
||||
return properties[i].mask;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2594,6 +2594,6 @@
|
|||
@ cdecl wctomb(ptr long) MSVCRT_wctomb
|
||||
@ cdecl wctomb_s(ptr ptr long long) MSVCRT_wctomb_s
|
||||
@ stub wctrans
|
||||
@ stub wctype
|
||||
@ cdecl wctype(str)
|
||||
@ cdecl wmemcpy_s(ptr long ptr long)
|
||||
@ cdecl wmemmove_s(ptr long ptr long)
|
||||
|
|
Loading…
Reference in New Issue