HP-UX Reference (11i v3 07/02) - 3 Library Functions A-M (vol 6)
f
fwprintf(3C) fwprintf(3C)
g,G The double argument is converted in the style
f,F or e (or in the style E in the case of a
G
conversion wide-character), with the precision specifying the number of significant digits.
If an explicit precision is 0, it is taken as 1. The style used depends on the value converted;
style e (or E) will be used only if the exponent resulting from such a conversion is less than
-4 or greater than or equal to the precision. Trailing zeros are removed from the fractional
portion of the result; a radix character appears only if it is followed by a digit. The
fwprintf() family of functions may make available wide-character string representa-
tions for infinity and NaN.
a,A For Itanium-based systems only. The double arg is converted in the style [
-]0xhrhhhp±d,
where r is the radix character. There is one digit before the radix character and the
number of digits after it is equal to the precision; when the precision is missing, 13 digits
are produced for
double, 15 for
extended, and 28 for long double, which is
sufficient for an exact representation of the value; if the precision is 0, no radix character
appears. The letters
abcdef are used for a
conversion and the letters ABCDEF for A
conversion. The A conversion specifier produces a number with
X and P instead of x and
p. The exponent always contains at least one digit, and only as many more digits as neces-
sary to represent the decimal exponent of 2. If the value is zero, the exponent is zero.
c If no l qualifier is present, the int argument is converted to a wide-character as if by cal-
ling the btowc() function and the resulting wide-character is written. Otherwise the
wint_t argument is converted to wchar_t, and written.
s If no l qualifier is present, the argument must be a pointer to a character array containing
a character sequence beginning in the initial shift state. Characters from the array are con-
verted as if by repeated calls to the mbrtowc() function, with the conversion state
described by an mbstate_t object initialized to zero before the first character is converted,
and written up to (but not including) the terminating null wide-character. If the precision
is specified, no more than that many wide-characters are written. If the precision 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 terminat-
ing 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 %%.
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.
HP-UX 11i Version 3: February 2007 − 4 − Hewlett-Packard Company 479