msvcrt: Added _strupr_s_l implementation.

This commit is contained in:
Piotr Caban 2011-05-12 11:38:52 +02:00 committed by Alexandre Julliard
parent 504231ff5a
commit 3db957e39e
2 changed files with 66 additions and 4 deletions

View file

@ -954,10 +954,10 @@
@ cdecl -ret64 _strtoui64(str ptr long) MSVCRT_strtoui64
@ cdecl -ret64 _strtoui64_l(str ptr long ptr) MSVCRT_strtoui64_l
# stub _strtoul_l(str ptr long ptr)
@ cdecl _strupr(str) ntdll._strupr
# stub _strupr_l(str ptr)
# stub _strupr_s(str long)
# stub _strupr_s_l(str long ptr)
@ cdecl _strupr(str)
@ cdecl _strupr_l(str ptr)
@ cdecl _strupr_s(str long)
@ cdecl _strupr_s_l(str long ptr)
# stub _strxfrm_l(ptr str long ptr)
@ cdecl _swab(str str long) MSVCRT__swab
@ varargs _swprintf(ptr wstr) MSVCRT_swprintf

View file

@ -112,6 +112,68 @@ int CDECL _strlwr(char *str)
return _strlwr_s_l(str, -1, NULL);
}
/*********************************************************************
* _strupr_s_l (MSVCRT.@)
*/
int CDECL _strupr_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;
return MSVCRT_EINVAL;
}
while (len && *ptr)
{
len--;
ptr++;
}
if (!len)
{
str[0] = '\0';
*MSVCRT__errno() = MSVCRT_EINVAL;
return MSVCRT_EINVAL;
}
while (*str)
{
*str = MSVCRT__toupper_l(*str, locale);
str++;
}
return 0;
}
/*********************************************************************
* _strupr_s (MSVCRT.@)
*/
int CDECL _strupr_s(char *str, MSVCRT_size_t len)
{
return _strupr_s_l(str, len, NULL);
}
/*********************************************************************
* _strupr_l (MSVCRT.@)
*/
int CDECL _strupr_l(char *str, MSVCRT__locale_t locale)
{
return _strupr_s_l(str, -1, locale);
}
/*********************************************************************
* _strupr (MSVCRT.@)
*/
int CDECL _strupr(char *str)
{
return _strupr_s_l(str, -1, NULL);
}
/*********************************************************************
* _strnset (MSVCRT.@)
*/