msvcrt: Added _strlwr_s_l implementation.

This commit is contained in:
Piotr Caban 2011-05-12 11:38:41 +02:00 committed by Alexandre Julliard
parent 0ea4e668f5
commit 504231ff5a
3 changed files with 35 additions and 6 deletions

View File

@ -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)

View File

@ -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

View File

@ -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,13 +81,37 @@ int CDECL _strlwr_s(char *str, MSVCRT_size_t len)
while (*str)
{
*str = tolower(*str);
*str = MSVCRT__tolower_l(*str, locale);
str++;
}
return 0;
}
/*********************************************************************
* _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.@)
*/