Piotr Caban : msvcp90: Added wctrans and towctrans implementation.

Alexandre Julliard julliard at winehq.org
Fri Nov 16 13:12:51 CST 2012


Module: wine
Branch: master
Commit: a71acb30764077e376d7c489994f2245308fe9ce
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a71acb30764077e376d7c489994f2245308fe9ce

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Fri Nov 16 10:53:37 2012 +0100

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 31beeee..c3f48d9 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 at locale@std@@");
 DEFINE_RTTI_DATA1(collate_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate at D@std@@");
 DEFINE_RTTI_DATA1(collate_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate at _W@std@@");
diff --git a/dlls/msvcp90/msvcp90.spec b/dlls/msvcp90/msvcp90.spec
index 742f162..e512acb 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 d6bed60..81c2e22 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




More information about the wine-cvs mailing list