printf(3W) (MLX Addendum) (MLX) printf(3W) (MLX Addendum)
NAME
printf, fprintf, sprintf - print formatted output (MLX addendum)
SYNOPSIS
#include <stdio.h>
#include <widec.h>
int printf (const char *format [, arg] ... );
int fprintf (FILE *stream, const char *format [, arg] ... );
int sprintf (char *s, const char *format [, arg] ... );
DESCRIPTION
(International Functions)
printf() places output on the standard output stream stdout. fprintf()
places output on the named output stream. sprintf() places output fol-
lowed by the NULL character in a character array pointed to by s.
Each function returns the number of bytes transmitted (not including
the NULL character in the case of sprintf), or a negative value if an
output error was encountered.
Each of these functions converts, formats and prints its args under
control of the format. The format is a character string that contains
two types of object: plain characters, including ASCII characters and
characters in supplementary code sets, which are simply copied to the
output stream; and conversion specifications which can contain only
ASCII characters, each of which results in the fetching of zero or
more args.
wc and ws are the conversion specifications for wchart character con-
trol. Both wc and ws may be used in all three functions.
wc The wchart character arg is transformed into EUC, and then
printed. If a field width is specified and the transformed EUC
character has fewer bytes than the field width, it will be padded
to the given width. A precision specification is ignored, if
specified.
ws The arg is taken to be a wchart string and the wchart charac-
ters from the string are transformed into EUC, and printed until
a wchart null character is encountered or the number of bytes
indicated by the precision specification is printed. If the pre-
cision specification is missing, it is taken to be infinite, and
all wchart characters up to the first wchart null character are
transformed into EUC and printed. If a field width is specified
and the transformed EUC characters have fewer bytes than the
field width, they are padded to the given width.
The ASCII space character (0x20) is used as the padding character.
DIAGNOSTICS
printf(), fprintf(), and sprintf() return the number of bytes
transmitted, or a negative value if an error was encountered.
Page 1 Reliant UNIX 5.44 12, 196
printf(3W) (MLX Addendum) (MLX) printf(3W) (MLX Addendum)
NOTES
These functions can support either typedef unsigned short wchart or
typedef long wchart conditionally, see mbchar(3W).
SEE ALSO
mbchar(3W), scanf(3W), vprintf(3W), widec(3W).
Page 2 Reliant UNIX 5.44 12, 196