Added sprintfW and vsprintfW.

This commit is contained in:
Alexandre Julliard 2003-03-20 23:40:41 +00:00
parent 19e050eb6f
commit 7463af6b2f
3 changed files with 22 additions and 4 deletions

View File

@ -76,8 +76,10 @@ extern int strncmpiW( const WCHAR *str1, const WCHAR *str2, int n );
extern WCHAR *strstrW( const WCHAR *str, const WCHAR *sub );
extern long int strtolW( const WCHAR *nptr, WCHAR **endptr, int base );
extern unsigned long int strtoulW( const WCHAR *nptr, WCHAR **endptr, int base );
extern int snprintfW( WCHAR *str, unsigned int len, const WCHAR *format, ... );
extern int vsnprintfW( WCHAR *str, unsigned int len, const WCHAR *format, va_list valist );
extern int sprintfW( WCHAR *str, const WCHAR *format, ... );
extern int snprintfW( WCHAR *str, size_t len, const WCHAR *format, ... );
extern int vsprintfW( WCHAR *str, const WCHAR *format, va_list valist );
extern int vsnprintfW( WCHAR *str, size_t len, const WCHAR *format, va_list valist );
static inline int is_dbcs_leadbyte( const union cptable *table, unsigned char ch )
{

View File

@ -289,7 +289,7 @@ noconv:
}
int vsnprintfW(WCHAR *str, unsigned int len, const WCHAR *format, va_list valist)
int vsnprintfW(WCHAR *str, size_t len, const WCHAR *format, va_list valist)
{
unsigned int written = 0;
const WCHAR *iter = format;
@ -407,8 +407,12 @@ int vsnprintfW(WCHAR *str, unsigned int len, const WCHAR *format, va_list valist
return (int)written;
}
int vsprintfW( WCHAR *str, const WCHAR *format, va_list valist )
{
return vsnprintfW( str, INT_MAX, format, valist );
}
int snprintfW(WCHAR *str, unsigned int len, const WCHAR *format, ...)
int snprintfW( WCHAR *str, size_t len, const WCHAR *format, ...)
{
int retval;
va_list valist;
@ -417,3 +421,13 @@ int snprintfW(WCHAR *str, unsigned int len, const WCHAR *format, ...)
va_end(valist);
return retval;
}
int sprintfW( WCHAR *str, const WCHAR *format, ...)
{
int retval;
va_list valist;
va_start(valist, format);
retval = vsnprintfW(str, INT_MAX, format, valist);
va_end(valist);
return retval;
}

View File

@ -6,6 +6,7 @@ EXPORTS
cp_mbstowcs
cp_wcstombs
snprintfW
sprintfW
strcmpiW
strncmpiW
strstrW
@ -14,4 +15,5 @@ EXPORTS
utf8_mbstowcs
utf8_wcstombs
vsnprintfW
vsprintfW
wctype_table