msvcrt: Added vscwprintf_{l,p_l} functions implementation.

This commit is contained in:
Piotr Caban 2011-08-01 16:08:06 +02:00 committed by Alexandre Julliard
parent 9b29faae6a
commit 0c14dc5330
5 changed files with 53 additions and 37 deletions

View File

@ -1246,9 +1246,9 @@
@ stub _vscprintf_p
@ stub _vscprintf_p_l
@ cdecl _vscwprintf(wstr ptr) msvcrt._vscwprintf
@ stub _vscwprintf_l
@ cdecl _vscwprintf_l(wstr ptr ptr) msvcrt._vscwprintf_l
@ stub _vscwprintf_p
@ stub _vscwprintf_p_l
@ cdecl _vscwprintf_p_l(wstr ptr ptr) msvcrt._vscwprintf_p_l
@ cdecl _vsnprintf(ptr long str ptr) msvcrt._vsnprintf
@ cdecl _vsnprintf_c(ptr long str ptr) msvcrt._vsnprintf_c
@ cdecl _vsnprintf_c_l(ptr long str ptr ptr) msvcrt._vsnprintf_c_l

View File

@ -1099,9 +1099,9 @@
@ stub _vscprintf_p
@ stub _vscprintf_p_l
@ cdecl _vscwprintf(wstr ptr) msvcrt._vscwprintf
@ stub _vscwprintf_l
@ cdecl _vscwprintf_l(wstr ptr ptr) msvcrt._vscwprintf_l
@ stub _vscwprintf_p
@ stub _vscwprintf_p_l
@ cdecl _vscwprintf_p_l(wstr ptr ptr) msvcrt._vscwprintf_p_l
@ cdecl _vsnprintf(ptr long str ptr) msvcrt._vsnprintf
@ cdecl _vsnprintf_c(ptr long str ptr) msvcrt._vsnprintf_c
@ cdecl _vsnprintf_c_l(ptr long str ptr ptr) msvcrt._vsnprintf_c_l

View File

@ -1086,9 +1086,9 @@
@ stub _vscprintf_p
@ stub _vscprintf_p_l
@ cdecl _vscwprintf(wstr ptr) msvcrt._vscwprintf
@ stub _vscwprintf_l
@ cdecl _vscwprintf_l(wstr ptr ptr) msvcrt._vscwprintf_l
@ stub _vscwprintf_p
@ stub _vscwprintf_p_l
@ cdecl _vscwprintf_p_l(wstr ptr ptr) msvcrt._vscwprintf_p_l
@ cdecl _vsnprintf(ptr long str ptr) msvcrt._vsnprintf
@ cdecl _vsnprintf_c(ptr long str ptr) msvcrt._vsnprintf_c
@ cdecl _vsnprintf_c_l(ptr long str ptr ptr) msvcrt._vsnprintf_c_l

View File

@ -1031,8 +1031,8 @@
# stub _vscprintf_l(str ptr ptr)
# stub _vscprintf_p_l(str ptr ptr)
@ cdecl _vscwprintf(wstr ptr) MSVCRT__vscwprintf
# stub _vscwprintf_l(wstr ptr ptr)
# stub _vscwprintf_p_l(wstr ptr ptr)
@ cdecl _vscwprintf_l(wstr ptr ptr) MSVCRT__vscwprintf_l
@ cdecl _vscwprintf_p_l(wstr ptr ptr) MSVCRT__vscwprintf_p_l
@ cdecl _vsnprintf(ptr long str ptr) MSVCRT_vsnprintf
@ cdecl _vsnprintf_c(ptr long str ptr) MSVCRT_vsnprintf
@ cdecl _vsnprintf_c_l(ptr long str ptr ptr) MSVCRT_vsnprintf_l

View File

@ -690,6 +690,35 @@ int CDECL MSVCRT_vsnwprintf_l(MSVCRT_wchar_t *str, MSVCRT_size_t len,
return ret;
}
/*********************************************************************
* _vswprintf_p_l (MSVCRT.@)
*/
int CDECL MSVCRT_vswprintf_p_l(MSVCRT_wchar_t *buffer, MSVCRT_size_t length,
const MSVCRT_wchar_t *format, MSVCRT__locale_t locale, __ms_va_list args)
{
static const MSVCRT_wchar_t nullbyte = '\0';
printf_arg args_ctx[MSVCRT__ARGMAX+1];
struct _str_ctx_w puts_ctx = {length, buffer};
int ret;
memset(args_ctx, 0, sizeof(args_ctx));
ret = create_positional_ctx_w(args_ctx, format, args);
if(ret < 0) {
MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0);
*MSVCRT__errno() = MSVCRT_EINVAL;
return ret;
} else if(ret == 0)
ret = pf_printf_w(puts_clbk_str_w, &puts_ctx, format, locale, TRUE, TRUE,
arg_clbk_valist, NULL, &args);
else
ret = pf_printf_w(puts_clbk_str_w, &puts_ctx, format, locale, TRUE, TRUE,
arg_clbk_positional, args_ctx, NULL);
puts_clbk_str_w(&puts_ctx, 1, &nullbyte);
return ret;
}
/*********************************************************************
* _vsnwprintf_s_l (MSVCRT.@)
*/
@ -859,6 +888,22 @@ int CDECL MSVCRT__vscwprintf( const MSVCRT_wchar_t *format, __ms_va_list args )
return MSVCRT_vsnwprintf( NULL, INT_MAX, format, args );
}
/*********************************************************************
* _vscwprintf_l (MSVCRT.@)
*/
int CDECL MSVCRT__vscwprintf_l( const MSVCRT_wchar_t *format, MSVCRT__locale_t locale, __ms_va_list args )
{
return MSVCRT_vsnwprintf_l( NULL, INT_MAX, format, locale, args );
}
/*********************************************************************
* _vscwprintf_p_l (MSVCRT.@)
*/
int CDECL MSVCRT__vscwprintf_p_l( const MSVCRT_wchar_t *format, MSVCRT__locale_t locale, __ms_va_list args )
{
return MSVCRT_vswprintf_p_l( NULL, INT_MAX, format, locale, args );
}
/*********************************************************************
* vswprintf_s (MSVCRT.@)
*/
@ -932,35 +977,6 @@ int CDECL MSVCRT_sprintf_p_l(char *buffer, MSVCRT_size_t length,
return r;
}
/*********************************************************************
* _vswprintf_p_l (MSVCRT.@)
*/
int CDECL MSVCRT_vswprintf_p_l(MSVCRT_wchar_t *buffer, MSVCRT_size_t length,
const MSVCRT_wchar_t *format, MSVCRT__locale_t locale, __ms_va_list args)
{
static const MSVCRT_wchar_t nullbyte = '\0';
printf_arg args_ctx[MSVCRT__ARGMAX+1];
struct _str_ctx_w puts_ctx = {length, buffer};
int ret;
memset(args_ctx, 0, sizeof(args_ctx));
ret = create_positional_ctx_w(args_ctx, format, args);
if(ret < 0) {
MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0);
*MSVCRT__errno() = MSVCRT_EINVAL;
return ret;
} else if(ret == 0)
ret = pf_printf_w(puts_clbk_str_w, &puts_ctx, format, locale, TRUE, TRUE,
arg_clbk_valist, NULL, &args);
else
ret = pf_printf_w(puts_clbk_str_w, &puts_ctx, format, locale, TRUE, TRUE,
arg_clbk_positional, args_ctx, NULL);
puts_clbk_str_w(&puts_ctx, 1, &nullbyte);
return ret;
}
/*********************************************************************
* _swprintf_p_l (MSVCRT.@)
*/