fwprintf.3c (2010 09)

f
fwprintf(3C) fwprintf(3C)
precision is specified, no more than that many wide-characters are written. If the preci-
sion is not specified or is greater than the size of the array, the array must contain a null
wide-character. If an
l qualifier is present, the argument must be a pointer to an array
of type wchar_t. Wide characters from the array are written up to (but not including) a
terminating null wide-character. If no precision is specified or is greater than the size of
the array, the array must contain a null wide-character. If a precision is specified, no
more than that many wide-characters are written.
p The argument must be a pointer to void. The value of the pointer is converted to a
sequence of printable wide-characters, in an implementation-dependent manner.
n The argument must be a pointer to an integer into which is written the number of wide-
characters written to the output so far by this call to one of the
fwprintf() functions.
No argument is converted.
C Same as lc.
S Same as ls.
% Output a % wide-character; no argument is converted. The entire conversion
specification must be %%.
For Itanium(R)-based systems if the optional decimal floating point feature is installed and enabled,
the behavior of the
f, F, e, E, g, and G specifiers for decimal floating point numbers is the same as
for double.
APPLICATION USAGE
After
fwprintf() or wprintf() is applied to a stream, the stream becomes wide-oriented (see orien-
tation (5)).
The prototypes of these functions are available to applications if they are:
a.
c99 conformant.
b. Compiled with
-D_XOPEN_SOURCE
macro with a value >=500.
c. Compiled with
-D_POSIX_C_SOURCE
macro with a value >= 200112.
RETURN VALUE
Upon successful completion, these functions return the number of wide-characters transmitted excluding
the terminating null wide-character in the case of
swprintf() or a negative value if an output error
was encountered.
If
n or more wide-characters were requested to be written,
swprintf() returns a negative value.
ERRORS
For the conditions under which
fwprintf() and wprintf() fails, refer to fputwc(); see putwc (3C).
In addition, all forms of
fwprintf() may fail if one of the following occurs:
[EILSEQ] A wide-character code that does not correspond to a valid character has been
detected.
[EINVAL] There are insufficient arguments.
[ENOMEM] Insufficient storage space is available.
In addition,
wprintf() may fail if:
[EILSEQ]
stdout is byte-oriented.
fwprintf() may fail if:
[EILSEQ] The stream pointed to by stream is byte-oriented.
EXAMPLES
To print the language-independent date and time format, the following statement could be used:
wprintf(format, weekday, month, day, hour, min);
For American usage, format could be a pointer to the wide-character string:
L"%s, %s %d %d:%.2d"
HP-UX 11i Version 3: September 2010 5 Hewlett-Packard Company 5