.\"
.\" @(#)printf.3 8.1 (Berkeley) 6/4/93
.\" FreeBSD: src/lib/libc/stdio/printf.3,v 1.47 2002/09/06 11:23:55 tjr Exp
-.\" $FreeBSD: src/lib/libc/stdio/wprintf.3,v 1.6 2007/01/09 00:28:08 imp Exp $
+.\" $FreeBSD$
.\"
.Dd July 5, 2003
.Dt WPRINTF 3
write to the wide character string
.Fa ws .
.Pp
+Extended locale versions of these functions are documented in
+.Xr wprintf_l 3 .
+See
+.Xr xlocale 3
+for more information.
+.Pp
These functions write the output under the control of a
.Fa format
string that specifies how subsequent arguments
.Pp
These functions return the number of characters printed
(not including the trailing
-.Ql \e0
+.Ql \e0 ,
used to end output to strings).
.Pp
The
.Fn swprintf
and
.Fn vswprintf
-functions will fail if
+functions return the number of characters written (not including the terminating
+null wide character).
+These functions will fail (returning a negative value and setting
+.Va errno
+appropriately) if
.Fa n
-or more wide characters were requested to be written,
+or more wide characters were requested to be written.
+.Pp
+The other functions return the number of wide characters printed on success, or
+a negative value on faiure, setting
+.Va errno
+to indicate the error.
.Pp
The format string is composed of zero or more directives:
ordinary
.Vt double
argument is rounded and converted in the style
.Sm off
-.Oo \- Oc Ar d Li \&. Ar ddd Li e \\*[Pm] Ar dd
+.Oo \- Oc Ar d Li \&. Ar ddd Li e \(+- Ar dd
.Sm on
where there is one digit before the
decimal-point character
.Vt double
argument is converted to hexadecimal notation in the style
.Sm off
-.Oo \- Oc Li 0x Ar h Li \&. Ar hhhp Oo \\*[Pm] Oc Ar d ,
+.Oo \- Oc Li 0x Ar h Li \&. Ar hhhp Oo \(+- Oc Ar d ,
.Sm on
where the number of digits after the hexadecimal-point character
is equal to the precision specification.
.Sh SECURITY CONSIDERATIONS
Refer to
.Xr printf 3 .
+.Sh ERRORS
+Refer to
+.Xr printf 3 .
.Sh SEE ALSO
.Xr btowc 3 ,
.Xr fputws 3 ,
.Xr putwc 3 ,
.Xr setlocale 3 ,
.Xr wcsrtombs 3 ,
+.Xr wprintf_l 3 ,
.Xr wscanf 3
.Sh STANDARDS
Subject to the caveats noted in the