From a71acb30764077e376d7c489994f2245308fe9ce Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Fri, 16 Nov 2012 10:53:37 +0100 Subject: [PATCH] msvcp90: Added wctrans and towctrans implementation. --- dlls/msvcp90/locale.c | 22 ++++++++++++++++++++++ dlls/msvcp90/msvcp90.spec | 4 ++-- include/msvcrt/wctype.h | 5 +++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index 31beeeeedc9..c3f48d93aee 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -26,6 +26,7 @@ #include "limits.h" #include "math.h" #include "stdio.h" +#include "wctype.h" #include "wine/list.h" @@ -8541,6 +8542,27 @@ locale* __cdecl locale_global(locale *ret, const locale *loc) return ret; } +/* wctrans */ +wctrans_t __cdecl wctrans(const char *property) +{ + static const char str_tolower[] = "tolower"; + static const char str_toupper[] = "toupper"; + + if(!strcmp(property, str_tolower)) + return 2; + if(!strcmp(property, str_toupper)) + return 1; + return 0; +} + +/* towctrans */ +wint_t __cdecl towctrans(wint_t c, wctrans_t category) +{ + if(category == 1) + return towupper(c); + return towlower(c); +} + DEFINE_RTTI_DATA0(locale_facet, 0, ".?AVfacet@locale@std@@"); DEFINE_RTTI_DATA1(collate_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@D@std@@"); DEFINE_RTTI_DATA1(collate_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@_W@std@@"); diff --git a/dlls/msvcp90/msvcp90.spec b/dlls/msvcp90/msvcp90.spec index 742f16291f8..e512acb8f17 100644 --- a/dlls/msvcp90/msvcp90.spec +++ b/dlls/msvcp90/msvcp90.spec @@ -5807,8 +5807,8 @@ @ stub _Wcsxfrm # extern _Xbig @ stub __Wcrtomb_lk -@ stub towctrans -@ stub wctrans +@ cdecl towctrans(long long) +@ cdecl wctrans(str) @ cdecl wctype(str) #Functions not exported in native dll: diff --git a/include/msvcrt/wctype.h b/include/msvcrt/wctype.h index d6bed604fe0..81c2e225e59 100644 --- a/include/msvcrt/wctype.h +++ b/include/msvcrt/wctype.h @@ -68,6 +68,11 @@ wchar_t __cdecl towlower(wchar_t); wchar_t __cdecl towupper(wchar_t); #endif /* _WCTYPE_DEFINED */ +typedef wchar_t wctrans_t; +wint_t __cdecl towctrans(wint_t,wctrans_t); +wctrans_t __cdecl wctrans(const char *); +wctype_t __cdecl wctype(const char *); + #ifdef __cplusplus } #endif