vfwprintf(3S)vfwprintf(3S)NAME
vfwprintf: vfwprintf, vwprintf, vswprintf - wide-character formatted
output of a stdarg argument list
SYNOPSIS
#include <stdio.h>
#include <wchar.h>
int vfwprintf(FILE *stream, const wchar_t *format, ...);
int vwprintf(const wchar_t *format, ...);
int vswprintf(wchar_t *s, size_t n, const wchar_t *format, ...);
DESCRIPTION
vfwprintf places output on the named output stream.
vwprintf places output on stdout.
vswprintf places output, followed by a null wide-character in consecutive
wide-characters starting at *s; no more than n wide-characters are
written, including a terminating null wide-character, which is always
added (unless n is zero).
Each function returns the number of wide-characters transmitted (not
including the terminating null character in the case of vswprintf), or a
negative value if an output error was encountered. If n or more wide
characters were requested to be written vswprintf() returns a negative
value.
The vwprintf(), vfwprintf() and vswprintf() functions are the same as
wprintf(), fwprintf() and swprintf() respectively, except that instead of
being called with a variable number of arguments, they are called with an
argument list as defined by <stdarg.h>.
These functions do not invoke the va_end macro. However, as these
functions do invoke the va_arg macro, the value of ap after the return is
indeterminate.
EXAMPLES
The following example shows the use of the vfwprintf function in a
general error reporting routine.
#include <stdarg.h>
#include <stdio.h>
#include <wchar.h>
void error(char *function_name, wchar_t *format, ...);
{
va_list args;
va_start(args, format);
/* print out name of function causing error */
fwprintf(stderr, L"ERROR in %s: ", function_name);
/* print out remainder of message */
Page 1
vfwprintf(3S)vfwprintf(3S)
vfwprintf(stderr, format, args);
va_end(args);
}
NOTES
These functions are supported in n32 and 64 bit C Libraries for IRIX
6.5.17 and later versions.
SEE ALSOfwprintf(3S), stdarg(5), stdio(3S), widec(3S).
DIAGNOSTICS
vfwprintf, vwprintf, and vswprintf return the number of wide-characters
transmitted (not counting the terminating null character for vswprintf),
or return a negative value if an error was encountered. If n or more
wide characters were requested to be written vswprintf() returns a
negative value.
In addition, all forms of vfwprintf() may fail if:
[EILSEQ]
A wide-character code that does not correspond to a valid
character has been detected.
[EINVAL]
There are insufficient arguments.
In addition, vwprintf() and vfwprintf() may fail if:
[ENOMEM]
Insufficient storage space is available.
Page 2