Piotr Caban : msvcrt: Added _strlwr_s_l implementation.

Alexandre Julliard julliard at winehq.org
Thu May 12 13:57:48 CDT 2011


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu May 12 11:38:41 2011 +0200

msvcrt: Added _strlwr_s_l implementation.

---

 dlls/msvcrt/msvcrt.h    |    2 ++
 dlls/msvcrt/msvcrt.spec |    6 +++---
 dlls/msvcrt/string.c    |   33 ++++++++++++++++++++++++++++++---
 3 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h
index a243f2f..bd41bac 100644
--- a/dlls/msvcrt/msvcrt.h
+++ b/dlls/msvcrt/msvcrt.h
@@ -904,6 +904,8 @@ void __cdecl    _wsearchenv(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, MSVCRT
 MSVCRT_intptr_t __cdecl MSVCRT__spawnvpe(int, const char*, const char* const*, const char* const*);
 void __cdecl MSVCRT__invalid_parameter(const MSVCRT_wchar_t *expr, const MSVCRT_wchar_t *func,
                                        const MSVCRT_wchar_t *file, unsigned int line, MSVCRT_uintptr_t arg);
+int __cdecl      MSVCRT__toupper_l(int,MSVCRT__locale_t);
+int __cdecl      MSVCRT__tolower_l(int,MSVCRT__locale_t);
 
 /* Maybe one day we'll enable the invalid parameter handlers with the full set of information (msvcrXXd)
  *      #define MSVCRT_INVALID_PMT(x) MSVCRT_call_invalid_parameter_handler(x, __FUNCTION__, __FILE__, __LINE__, 0)
diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec
index 84b0194..678a2c9 100644
--- a/dlls/msvcrt/msvcrt.spec
+++ b/dlls/msvcrt/msvcrt.spec
@@ -930,10 +930,10 @@
 # stub _stricmp_l(str str ptr)
 @ cdecl _stricoll(str str) MSVCRT__stricoll
 # stub _stricoll_l(str str ptr)
-@ cdecl _strlwr(str) ntdll._strlwr
-# stub _strlwr_l(str ptr)
+@ cdecl _strlwr(str)
+@ cdecl _strlwr_l(str ptr)
 @ cdecl _strlwr_s(ptr long)
-# stub _strlwr_s_l(ptr long ptr)
+@ cdecl _strlwr_s_l(ptr long ptr)
 @ stub _strncoll(str str long)
 # stub _strncoll_l(str str long ptr)
 @ cdecl _strnicmp(str str long) ntdll._strnicmp
diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c
index 2b9d41e..10a86c5 100644
--- a/dlls/msvcrt/string.c
+++ b/dlls/msvcrt/string.c
@@ -51,12 +51,15 @@ char* CDECL _strdup(const char* str)
 }
 
 /*********************************************************************
- *		_strlwr_s (MSVCRT.@)
+ *		_strlwr_s_l (MSVCRT.@)
  */
-int CDECL _strlwr_s(char *str, MSVCRT_size_t len)
+int CDECL _strlwr_s_l(char *str, MSVCRT_size_t len, MSVCRT__locale_t locale)
 {
     char *ptr = str;
 
+    if(!locale)
+        locale = get_locale();
+
     if (!str || !len)
     {
         *MSVCRT__errno() = MSVCRT_EINVAL;
@@ -78,7 +81,7 @@ int CDECL _strlwr_s(char *str, MSVCRT_size_t len)
 
     while (*str)
     {
-        *str = tolower(*str);
+        *str = MSVCRT__tolower_l(*str, locale);
         str++;
     }
 
@@ -86,6 +89,30 @@ int CDECL _strlwr_s(char *str, MSVCRT_size_t len)
 }
 
 /*********************************************************************
+ *		_strlwr_s (MSVCRT.@)
+ */
+int CDECL _strlwr_s(char *str, MSVCRT_size_t len)
+{
+    return _strlwr_s_l(str, len, NULL);
+}
+
+/*********************************************************************
+ *		_strlwr_l (MSVCRT.@)
+ */
+int CDECL _strlwr_l(char *str, MSVCRT__locale_t locale)
+{
+    return _strlwr_s_l(str, -1, locale);
+}
+
+/*********************************************************************
+ *		_strlwr (MSVCRT.@)
+ */
+int CDECL _strlwr(char *str)
+{
+    return _strlwr_s_l(str, -1, NULL);
+}
+
+/*********************************************************************
  *		_strnset (MSVCRT.@)
  */
 char* CDECL MSVCRT__strnset(char* str, int value, MSVCRT_size_t len)




More information about the wine-cvs mailing list