1 --- printf.3 2004-11-25 11:38:35.000000000 -0800
2 +++ printf.3.edit 2006-09-06 16:56:37.000000000 -0700
7 -.Nm printf , fprintf , sprintf , snprintf , asprintf ,
8 -.Nm vprintf , vfprintf, vsprintf , vsnprintf , vasprintf
19 .Nd formatted output conversion
25 -.Fn printf "const char * restrict format" ...
28 +.Fa "const char *format" ...
31 -.Fn fprintf "FILE * restrict stream" "const char * restrict format" ...
33 +.Fa "FILE *restrict stream"
34 +.Fa "const char *restrict format" ...
37 -.Fn sprintf "char * restrict str" "const char * restrict format" ...
39 +.Fa "const char *restrict format" ...
42 -.Fn snprintf "char * restrict str" "size_t size" "const char * restrict format" ...
44 +.Fa "char *restrict s"
46 +.Fa "const char *restrict format" ...
49 -.Fn asprintf "char **ret" "const char *format" ...
51 +.Fa "char *restrict s"
52 +.Fa "const char *restrict format" ...
57 -.Fn vprintf "const char * restrict format" "va_list ap"
60 +.Fa "const char *format"
64 -.Fn vfprintf "FILE * restrict stream" "const char * restrict format" "va_list ap"
66 +.Fa "FILE *restrict stream"
67 +.Fa "const char *restrict format"
71 -.Fn vsprintf "char * restrict str" "const char * restrict format" "va_list ap"
73 +.Fa "const char *restrict format"
77 -.Fn vsnprintf "char * restrict str" "size_t size" "const char * restrict format" "va_list ap"
79 +.Fa "char *restrict s"
81 +.Fa "const char *restrict format"
85 -.Fn vasprintf "char **ret" "const char *format" "va_list ap"
87 +.Fa "char *restrict s"
88 +.Fa "const char *restrict format"
94 family of functions produces output according to a
103 write to the character string
110 dynamically allocate a new string with
113 +Extended locale versions of these functions are documented in
117 +for more information.
119 These functions write the output under the control of a
121 string that specifies how subsequent arguments
125 which return the number of characters that would have been printed if the
129 (again, not including the final
131 @@ -149,14 +199,14 @@
137 of the characters printed into the output string
141 character then gets the terminating
143 if the return value is greater than or equal to the
146 argument, the string was too short
147 and some of the printed characters were discarded.
148 The output is always null-terminated.
152 effectively assume an infinite
156 The format string is composed of zero or more directives:
162 +An optional separator character (
163 +.Cm \ , | \; | \ : | _
164 +) used for separating multiple values when printing an AltiVec or SSE vector,
165 +or other multi-value unit.
167 +NOTE: This is an extension to the
170 +Behaviour of these values for
172 +is only defined for operating systems conforming to the
173 +AltiVec Technology Programming Interface Manual.
174 +(At time of writing this includes only Mac OS X 10.2 and later.)
176 An optional decimal digit string specifying a minimum field width.
177 If the converted value has fewer characters than the field width, it will
178 be padded with spaces on the left (or right, if the left-adjustment
180 .It Sy Modifier Ta Cm c Ta Cm s
181 .It Cm l No (ell) Ta Vt wint_t Ta Vt "wchar_t *"
184 +The AltiVec Technology Programming Interface Manual also defines five additional length modifiers
185 +which can be used (in place of the conventional length modifiers) for the printing of AltiVec or SSE vectors:
188 +Treat the argument as a vector value, unit length will be determined by the conversion
189 +specifier (default = 16 8-bit units for all integer conversions,
190 +4 32-bit units for floating point conversions).
192 +Treat the argument as a vector of 8 16-bit units.
194 +Treat the argument as a vector of 4 32-bit units.
197 +NOTE: The vector length specifiers are extensions to the
200 +Behaviour of these values for
202 +is only defined for operating systems conforming to the
203 +AltiVec Technology Programming Interface Manual.
204 +(At time of writing this includes only Mac OS X 10.2 and later.)
206 +As a further extension, for SSE2 64-bit units:
209 +Treat the argument as a vector of 2 64-bit units.
212 A character that specifies the type of conversion to be applied.
214 @@ -790,14 +882,11 @@
224 -.%T "The FreeBSD Security Architecture"
227 -.Pa "/usr/share/doc/{to be determined}" . )
229 Subject to the caveats noted in the