msvcrt: Added _strlwr_s_l implementation.
This commit is contained in:
parent
0ea4e668f5
commit
504231ff5a
@ -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*);
|
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,
|
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);
|
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)
|
/* 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)
|
* #define MSVCRT_INVALID_PMT(x) MSVCRT_call_invalid_parameter_handler(x, __FUNCTION__, __FILE__, __LINE__, 0)
|
||||||
|
@ -930,10 +930,10 @@
|
|||||||
# stub _stricmp_l(str str ptr)
|
# stub _stricmp_l(str str ptr)
|
||||||
@ cdecl _stricoll(str str) MSVCRT__stricoll
|
@ cdecl _stricoll(str str) MSVCRT__stricoll
|
||||||
# stub _stricoll_l(str str ptr)
|
# stub _stricoll_l(str str ptr)
|
||||||
@ cdecl _strlwr(str) ntdll._strlwr
|
@ cdecl _strlwr(str)
|
||||||
# stub _strlwr_l(str ptr)
|
@ cdecl _strlwr_l(str ptr)
|
||||||
@ cdecl _strlwr_s(ptr long)
|
@ 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(str str long)
|
||||||
# stub _strncoll_l(str str long ptr)
|
# stub _strncoll_l(str str long ptr)
|
||||||
@ cdecl _strnicmp(str str long) ntdll._strnicmp
|
@ cdecl _strnicmp(str str long) ntdll._strnicmp
|
||||||
|
@ -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;
|
char *ptr = str;
|
||||||
|
|
||||||
|
if(!locale)
|
||||||
|
locale = get_locale();
|
||||||
|
|
||||||
if (!str || !len)
|
if (!str || !len)
|
||||||
{
|
{
|
||||||
*MSVCRT__errno() = MSVCRT_EINVAL;
|
*MSVCRT__errno() = MSVCRT_EINVAL;
|
||||||
@ -78,13 +81,37 @@ int CDECL _strlwr_s(char *str, MSVCRT_size_t len)
|
|||||||
|
|
||||||
while (*str)
|
while (*str)
|
||||||
{
|
{
|
||||||
*str = tolower(*str);
|
*str = MSVCRT__tolower_l(*str, locale);
|
||||||
str++;
|
str++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
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.@)
|
* _strnset (MSVCRT.@)
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user