]> Pileus Git - ~andy/fetchmail/blob - trio/html/group___printf.html
Import Trio 1.10 into fetchmail's trunk.
[~andy/fetchmail] / trio / html / group___printf.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <html>
3 <head>
4  <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
5  <title>TRIO</title>
6  <link href="trio.css" rel="stylesheet" type="text/css">
7 </head>
8 <body>
9 <!-- Generated by Doxygen 1.2.12 -->
10 <center>
11 <a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; </center>
12 <hr><h1>Formatted Printing Functions.</h1>Variations of formatted printing functions. 
13 <a href="#_details">More...</a><table border=0 cellpadding=0 cellspacing=0>
14 <tr><td colspan=2><br><h2>Functions</h2></td></tr>
15 <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___printf.html#a0">trio_printf</a> (const char *format,...)</td></tr>
16 <tr><td>&nbsp;</td><td><font size=-1><em>Print to standard output stream.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr>
17 <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___printf.html#a1">trio_vprintf</a> (const char *format, va_list args)</td></tr>
18 <tr><td>&nbsp;</td><td><font size=-1><em>Print to standard output stream.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr>
19 <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___printf.html#a2">trio_printfv</a> (const char *format, trio_pointer_t *args)</td></tr>
20 <tr><td>&nbsp;</td><td><font size=-1><em>Print to standard output stream.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr>
21 <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___printf.html#a3">trio_fprintf</a> (FILE *file, const char *format,...)</td></tr>
22 <tr><td>&nbsp;</td><td><font size=-1><em>Print to file.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr>
23 <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___printf.html#a4">trio_vfprintf</a> (FILE *file, const char *format, va_list args)</td></tr>
24 <tr><td>&nbsp;</td><td><font size=-1><em>Print to file.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr>
25 <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___printf.html#a5">trio_fprintfv</a> (FILE *file, const char *format, trio_pointer_t *args)</td></tr>
26 <tr><td>&nbsp;</td><td><font size=-1><em>Print to file.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr>
27 <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___printf.html#a6">trio_dprintf</a> (int fd, const char *format,...)</td></tr>
28 <tr><td>&nbsp;</td><td><font size=-1><em>Print to file descriptor.</em> <a href="#a6">More...</a><em></em></font><br><br></td></tr>
29 <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___printf.html#a7">trio_vdprintf</a> (int fd, const char *format, va_list args)</td></tr>
30 <tr><td>&nbsp;</td><td><font size=-1><em>Print to file descriptor.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr>
31 <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___printf.html#a8">trio_dprintfv</a> (int fd, const char *format, trio_pointer_t *args)</td></tr>
32 <tr><td>&nbsp;</td><td><font size=-1><em>Print to file descriptor.</em> <a href="#a8">More...</a><em></em></font><br><br></td></tr>
33 <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___printf.html#a12">trio_sprintf</a> (char *buffer, const char *format,...)</td></tr>
34 <tr><td>&nbsp;</td><td><font size=-1><em>Print to string.</em> <a href="#a12">More...</a><em></em></font><br><br></td></tr>
35 <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___printf.html#a13">trio_vsprintf</a> (char *buffer, const char *format, va_list args)</td></tr>
36 <tr><td>&nbsp;</td><td><font size=-1><em>Print to string.</em> <a href="#a13">More...</a><em></em></font><br><br></td></tr>
37 <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___printf.html#a14">trio_sprintfv</a> (char *buffer, const char *format, trio_pointer_t *args)</td></tr>
38 <tr><td>&nbsp;</td><td><font size=-1><em>Print to string.</em> <a href="#a14">More...</a><em></em></font><br><br></td></tr>
39 <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___printf.html#a15">trio_snprintf</a> (char *buffer, size_t max, const char *format,...)</td></tr>
40 <tr><td>&nbsp;</td><td><font size=-1><em>Print at most <code>max</code> characters to string.</em> <a href="#a15">More...</a><em></em></font><br><br></td></tr>
41 <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___printf.html#a16">trio_vsnprintf</a> (char *buffer, size_t max, const char *format, va_list args)</td></tr>
42 <tr><td>&nbsp;</td><td><font size=-1><em>Print at most <code>max</code> characters to string.</em> <a href="#a16">More...</a><em></em></font><br><br></td></tr>
43 <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___printf.html#a17">trio_snprintfv</a> (char *buffer, size_t max, const char *format, trio_pointer_t *args)</td></tr>
44 <tr><td>&nbsp;</td><td><font size=-1><em>Print at most <code>max</code> characters to string.</em> <a href="#a17">More...</a><em></em></font><br><br></td></tr>
45 </table>
46 <hr><a name="_details"></a><h2>Detailed Description</h2>
47 Variations of formatted printing functions.
48 <p>
49 <b>SYNOPSIS</b>
50 <p>
51 <div class="fragment"><pre>
52 cc ... -ltrio -lm
53
54 #include &lt;trio.h&gt;
55 </pre></div>
56 <p>
57 <b>DESCRIPTION</b>
58 <p>
59 This documentation is incomplete. The documentation of the printf family in [C99] and [UNIX98] also applies to the trio counterparts.
60 <p>
61 All these functions outputs a string which is formatted according to the <code>format</code> string and the consecutive arguments. The <code>format</code> string is described in the Formatting section below.
62 <p>
63 <a class="el" href="group___printf.html#a0">trio_printf</a>, <a class="el" href="group___printf.html#a1">trio_vprintf</a>, and <a class="el" href="group___printf.html#a2">trio_printfv</a> writes the output to the standard output stream (stdout).
64 <p>
65 <a class="el" href="group___printf.html#a3">trio_fprintf</a>, <a class="el" href="group___printf.html#a4">trio_vfprintf</a>, and <a class="el" href="group___printf.html#a5">trio_fprintfv</a> writes the output to a given output stream.
66 <p>
67 <a class="el" href="group___printf.html#a6">trio_dprintf</a>, <a class="el" href="group___printf.html#a7">trio_vdprintf</a>, and <a class="el" href="group___printf.html#a8">trio_dprintfv</a> writes the output to a file descriptor (this includes, for example, sockets).
68 <p>
69 <a class="el" href="group___printf.html#a12">trio_sprintf</a>, <a class="el" href="group___printf.html#a13">trio_vsprintf</a>, and <a class="el" href="group___printf.html#a14">trio_sprintfv</a> writes the output into <code>buffer</code>.
70 <p>
71 <a class="el" href="group___printf.html#a15">trio_snprintf</a>, <a class="el" href="group___printf.html#a16">trio_vsnprintf</a>, and <a class="el" href="group___printf.html#a17">trio_snprintfv</a> writes <code>max</code> - 1 characters into <code>buffer</code> followed by a terminating zero character. If <code>max</code> is 1, then <code>buffer</code> will be an empty string. If <code>max</code> is 0, then <code>buffer</code> is left untouched, and can consequently be NULL. The number of characters that would have been written to <code>buffer</code>, had there been sufficient space, is returned.
72 <p>
73 trio_snprintfcat appends the formatted text at the end of <code>buffer</code>.
74 <p>
75 trio_asprintf and trio_vasprintf allocates and returns an allocated string in <code>buffer</code> containing the formatted text.
76 <p>
77 <b>FORMATTING</b>
78 <p>
79 The <code>format</code> string can contain normal text and conversion indicators. The normal text can be any character except the nil character (\000 = '\0') and the percent character (\045 = '%'). Conversion indicators consists of an indication character (%), followed by zero or more conversion modifiers, and exactly one conversion specifier.
80 <p>
81 <b>Modifiers</b>
82 <p>
83 Some modifiers exhibit the same behaviour for all specifiers, other modifiers indicate different behaviours for different specifiers, and other modifiers are only applicable to certain specifiers. The relationship is described for each modifier. The number 9 is used to denotes an arbitrary integer.
84 <p>
85 <em>Positional</em> ( <code>9$</code> ) [UNIX98]
86 <p>
87 Normally the arguments supplied to these functions are interpreted incrementially from left to right. Arguments can be referenced specifically in the format string. The modifier n$ selects the nth argument. The first argument is referred as 1$. If this modifier is used, it must be the first modifier after the indication character. n$ can also be used for argument width, precision, and base.
88 <p>
89 The performance penalty of using positionals is almost neglible (contrary to most other printf implementations).
90 <p>
91 <ul>
92 <li> <em>Reference</em> <em>Mix</em>. Mixing normal and positional specifiers is allowed [TRIO]. For example, <div class="fragment"><pre>
93   trio_printf("%d %3$d %2$d\n", 1, 2, 3);
94 </pre></div> results in <div class="fragment"><pre>
95   1 3 2
96 </pre></div> Arguments for the printf family are passed on the stack. On most platforms it is not possible to determine the size of individual stack elements, so it is essential that the format string corresponds exactly to the passed arguments. If this is not the case, incorrect values may be put into the result.</ul>
97 <ul>
98 <li> <em>Reference</em> <em>Gap</em>. For the same reason it is also essential that the format string does not contain any "gaps" in the positional arguments. For example, <div class="fragment"><pre>
99   trio_printf("%1$d %3$d\n", 1, 2, 3);
100 </pre></div> is NOT allowed. The format string parser has no knowledge about whether the second argument is, say, an integer or a long double (which have different sizes). <div class="fragment"><pre>
101 </pre></div> [UNIX98] describes this as unspecified behaviour. [TRIO] will detect reference gaps and return an error.</ul>
102 <ul>
103 <li> <em>Double</em> <em>Reference</em>. It is also not allowed to reference an argument twice or more. For example, <div class="fragment"><pre>
104   trio_printf("%1$d %1$lf\n", 1);
105 </pre></div> is NOT allowed, because it references the first argument as two differently sized objects. <div class="fragment"><pre>
106 </pre></div> [UNIX98] describes this as unspecified behaviour. [TRIO] will detect double references and return an error.</ul>
107 The following two statements are equivalent <div class="fragment"><pre>
108   trio_printf("|%d %s\n|", 42, "meanings");
109   |42 meanings|
110
111   trio_printf("|%1$d %2$s|\n", 42, "meanings");
112   |42 meanings|
113 </pre></div>
114 <p>
115 <em>Width</em> ( <code>9</code> )
116 <p>
117 Specifies the minimum width of a field. If the fields has less characters than specified by the width, the field will be left adjusted and padded by spaces. The adjustment and padding can be changed by the Alignment ( <code>-</code> ) and Padding ( <code>0</code> ) modifiers.
118 <p>
119 The width is specified as a number. If an asterix ( <code>*</code> ) is used instead, the width will be read from the argument list.
120 <p>
121 Prefixes, such as 0x for hexadecimal integers, are part of width. <div class="fragment"><pre>
122   trio_printf("|%10i|\n", 42);
123   |        42|
124 </pre></div>
125 <p>
126 <em>Precision</em> ( .<code>9</code> )
127 <p>
128 The precision has different semantics for the various data types. The precision specifies the maximum number of printed characters for strings, the number of digits after the decimal-point for floating-point numbers, the number of significant digits for the <code>g</code> (and <code>G)</code> representation of floating-point numbers, the minimum number of printed digits for integers. <div class="fragment"><pre>
129   trio_printf("|%10.8i|%.8i|\n", 42, 42);
130   |  00000042|00000042|
131 </pre></div>
132 <p>
133 <em>Base</em> ( ..<code>9</code> ) [TRIO]
134 <p>
135 Sets the base that the associated integer must be converted to. The base can be between 2 and 36 (both included). <div class="fragment"><pre>
136   trio_printf("|%10.8.2i|%10..2i|%..2i|\n", 42, 42, 42);
137   |  00101010|    101010|101010|
138
139   trio_printf("|%*.8.*i|\n", 10, 2, 42);
140   |  00101010|
141 </pre></div>
142 <p>
143 <em>Padding</em> ( <code>0</code> )
144 <p>
145 Integer and floating point numbers are prepended by zeros. The number of leading zeros are determined by the precision. If precision is not present, width is used instead.
146 <p>
147 <em>Short</em> ( <code>h</code> )
148 <p>
149 Integer arguments are read as an ( <code>unsigned</code> ) <code>short</code> <code>int</code>. String and character arguments are read as <code>char</code> <code>*</code> and <code>char</code> respectively.
150 <p>
151 <em>Short</em> <em>short</em> ( <code>hh</code> ) [C99, GNU]
152 <p>
153 The argument is read as an ( <code>unsigned</code> ) <code>char</code>.
154 <p>
155 <em>Fixed</em> <em>Size</em> ( <code>I</code> ) [MSVC]
156 <p>
157 The argument is read as a fixed sized integer. The modifier is followed by a number, which specifies the number of bits in the integer, and can be one of the following
158 <p>
159 <ul>
160 <li> <code>I8</code> <li> <code>I16</code> <li> <code>I32</code> <li> <code>I64</code> (if 64-bits integers are supported)</ul>
161 Works only for integers (i, u, d, o, x, X)
162 <p>
163 <em>Largest</em> ( <code>j</code> ) [C99]
164 <p>
165 The argument is read as an <code>intmax_t</code> / <code>uintmax_t</code>, which is defined to be the largest signed/unsigned integer.
166 <p>
167 <em>Long</em> ( <code>l</code> )
168 <p>
169 An integral argument is read as an ( <code>unsigned</code> ) <code>long</code> <code>int</code>. A string argument is read as a <code>wchar_t</code> <code>*</code>, and output as a multi-byte character sequence.
170 <p>
171 <em>Long</em> <em>long</em> ( <code>ll</code> ) [C99, UNIX98, GNU]
172 <p>
173 The argument is read as an ( <code>unsigned</code> ) <code>long</code> <code>long</code> <code>int</code>.
174 <p>
175 <em>Long</em> <em>double</em> ( <code>L</code> ) [C99, UNIX98, GNU]
176 <p>
177 The argument is read as a <code>long</code> <code>double</code>.
178 <p>
179 <em>ptrdiff_t</em> ( <code>t</code> ) [C99]
180 <p>
181 The argument is read as a <code>ptrdiff_t</code>, which is defined to be the signed integer type of the result of subtracting two pointers.
182 <p>
183 <em>Quad</em> ( <code>q</code> ) [BSD, GNU]
184 <p>
185 Corresponds to the long long modifier ( <code>ll</code> ).
186 <p>
187 <em>Wide</em> ( <code>w</code> ) [MISC]
188 <p>
189 For a string argument this is equivalent to using the long modifier ( <code>l</code> ).
190 <p>
191 <em>size_t</em> ( <code>z</code> ) [C99]
192 <p>
193 The argument is read as a <code>size_t</code>, which is defined to be the type returned by the <code>sizeof</code> operator.
194 <p>
195 <em>size_t</em> ( <code>Z</code> ) [GNU]
196 <p>
197 Corresponds to the size_t modifier ( <code>z</code> ).
198 <p>
199 <em>Alternative</em> ( <code>#</code> )
200 <p>
201 Prepend radix indicator for hexadecimal, octal, and binary integer numbers and for pointers. Always add a decimal-pointer for floating-point numbers. Escape non-printable characters for strings.
202 <p>
203 <em>Spacing</em> ( )
204 <p>
205 Prepend leading spaces when necessary.
206 <p>
207 <em>Sign</em> ( <code>+</code> )
208 <p>
209 Always prepend a sign to numbers. Normally only the negative sign is prepended to a number. With this modifier the positive sign may also be prepended.
210 <p>
211 <em>Alignment</em> ( <code>-</code> )
212 <p>
213 The output will be left-justified in the field specified by the width.
214 <p>
215 <em>Argument</em> ( <code>*</code> )
216 <p>
217 Width, precision, or base is read from the argument list, rather than from the formatting string.
218 <p>
219 <em>Quote</em> / <em>Grouping</em> ( ' <code>)</code> [MISC]
220 <p>
221 Groups integers and the integer-part of floating-point numbers according to the locale. Quote strings and characters.
222 <p>
223 <em>Sticky</em> ( <code>!</code> ) [TRIO]
224 <p>
225 The modifiers listed for the current specifier will be reused by subsequent specifiers of the same group. The following specifier groups exists <ul>
226 <li> Integer ( <code>i</code>, <code>u</code>, <code>d</code>, <code>o</code>, <code>x</code>, <code>X</code> ) <li> Floating-point ( <code>f</code>, <code>F</code>, <code>e</code>, <code>E</code>, <code>g</code>, <code>G</code>, <code>a</code>, <code>A</code> ) <li> Character ( <code>c</code> ) <li> String ( <code>s</code> ) <li> Pointer ( <code>p</code> ) <li> Count ( <code>n</code> ) <li> Errno ( <code>m</code> ) <li> Group ( <code>[]</code> )</ul>
227 The sticky modifiers are active until superseeded by other sticky modifiers, or the end of the format string is reached. Local modifiers overrides sticky modifiers for the given specifier only. <div class="fragment"><pre>
228   trio_printf("|%!08#x|%04x|%x|\n", 42, 42, 42);
229   |0x00002a|0x2a|0x00002a|
230 </pre></div>
231 <p>
232 <b>Specifiers</b>
233 <p>
234 <em>Percent</em> ( <code>%</code> )
235 <p>
236 Produce a percent ( <code>%</code> ) character. This is used to quote the indication character. No modifiers are allowed. The full syntax is <code>%%</code>. <div class="fragment"><pre>
237   trio_printf("Percent is %%\n");
238   Percent is %
239 </pre></div>
240 <p>
241 <em>Hex</em> <em>floats</em> ( <code>a</code>, <code>A</code> ) [C99]
242 <p>
243 Output a hexadecimal (base 16) representation of a floating point number. The number is automatically preceeded by <code>0x</code> ( or <code>0X</code> ). The exponent is <code>p</code> ( or <code>P</code> ). <div class="fragment"><pre>
244   trio_printf("|%a|%A|\n", 3.1415, 3.1415e20);
245   |0x3.228bc|0X3.228BCP+14|
246 </pre></div>
247 <p>
248 <em>Binary</em> <em>numbers</em> ( <code>b</code>, <code>B</code> ) [MISC - SCO UnixWare 7]
249 <p>
250 DEPRECATED: Use Base modifier <code>%..2i</code> instead.
251 <p>
252 <em>Character</em> ( <code>c</code> )
253 <p>
254 Output a single character.
255 <p>
256 <ul>
257 <li> Quote ( ' <code>)</code> [TRIO]. Quote the character.</ul>
258 <em>Decimal</em> ( <code>d</code> )
259 <p>
260 Output a decimal (base 10) representation of a number.
261 <p>
262 <ul>
263 <li> Grouping ( ' <code>)</code> [TRIO]. The number is separated by the locale thousand separator. <div class="fragment"><pre>
264   trio_printf("|%'ld|\n", 1234567);
265   |1,234,567|
266 </pre></div></ul>
267 <em>Floating-point</em> ( <code>e</code>, <code>E)</code>
268 <p>
269 Output a decimal floating-point number. The style is <code>[-]9.99e[-]9</code>, where <ul>
270 <li> <code>[-]9.99</code> is the mantissa (as described for the <code>f</code>, <code>F</code> specifier), and <li> <code>e[-]9</code> is the exponent indicator (either <code>e</code> or <code>E</code>, depending on the floating-point specifier), followed by an optional sign and the exponent</ul>
271 If the precision is wider than the maximum number of digits that can be represented by the floating-point unit, then the number will be adequately rounded. For example, assuming DBL_DIG is 15 <div class="fragment"><pre>
272   trio_printf("|%.18e|\n", (1.0 / 3.0));
273   |3.333333333333333000e-01|
274 </pre></div>
275 <p>
276 <em>Floating-point</em> ( <code>f</code>, <code>F</code> )
277 <p>
278 Output a decimal floating-point number. The style is <code>[-]9.99</code>, where <ul>
279 <li> <code>[-]</code> is an optional sign (either <code>+</code> or <code>-)</code>, <li> <code>9</code> is the integer-part (possibly interspersed with thousand-separators), <li> . <code>is</code> the decimal-point (depending on the locale), and <li> <code>99</code> is the fractional-part.</ul>
280 If more digits are needed to output the number, than can be represented with the accuracy of the floating-point unit, then the number will be adequately rounded. For example, assuming that DBL_DIG is 15 <div class="fragment"><pre>
281   trio_printf("|%f|\n", (2.0 / 3.0) * 1E18);
282   |666666666666666700.000000|
283 </pre></div>
284 <p>
285 The following modifiers holds a special meaning for this specifier <ul>
286 <li> Alternative ( <code>#</code> ) [C99]. Add decimal point. <li> Grouping ( ' <code>)</code> [TRIO]. Group integer part of number into thousands (according to locale).</ul>
287 <em>Floating-point</em> ( <code>g</code>, <code>G)</code>
288 <p>
289 Output a decimal floating-point representation of a number. The format of either the <code>f</code>, <code>F</code> specifier or the <code>e</code>, <code>E</code> specifier is used, whatever produces the shortest result.
290 <p>
291 <em>Integer</em> ( <code>i</code> )
292 <p>
293 Output a signed integer. Default base is 10.
294 <p>
295 <em>Errno</em> ( <code>m</code> ) [GNU]
296 <p>
297 <em>Count</em> ( <code>n</code> )
298 <p>
299 Insert into the location pointed to by the argument, the number of octets written to the output so far.
300 <p>
301 <em>Octal</em> ( <code>o</code> )
302 <p>
303 Output an octal (base 8) representation of a number.
304 <p>
305 <em>Pointer</em> ( <code>p</code> )
306 <p>
307 Ouput the address of the argument. The address is printed as a hexadecimal number. If the argument is the NULL pointer the text <code>(nil)</code> will be used instead. <ul>
308 <li> Alternative ( <code>#</code> ) [TRIO]. Prepend 0x</ul>
309 <em>String</em> ( <code>s</code>, <code>S</code> )
310 <p>
311 Output a string. The argument must point to a zero terminated string. If the argument is the NULL pointer the text <code>(nil)</code> will be used instead. <code>S</code> is equivalent to <code>ls</code>. <ul>
312 <li> Alternative ( <code>#</code> ) [TRIO]. Escape non-printable characters.</ul>
313 Non-printable characters are converted into C escapes, or hexadecimal numbers where no C escapes exists for the character. The C escapes, the hexadecimal number, and all backslashes are prepended by a backslash ( <code>\</code> ). The supported C escapes are <ul>
314 <li> <code>\a</code> (\007) = alert <li> <code>\b</code> (\010) = backspace <li> <code>\f</code> (\014) = formfeed <li> <code>\n</code> (\012) = newline <li> <code>\r</code> (\015) = carriage return <li> <code>\t</code> (\011) = horizontal tab <li> <code>\v</code> (\013) = vertical tab</ul>
315 <div class="fragment"><pre>
316   trio_printf("|One %s Three|One %'s Three|\n", "Two", "Two");
317   |One Two Three|One "Two" Three|
318
319   trio_printf("|Argument missing %s|\n", NULL);
320   |Argument missing (nil)|
321
322   trio_printf("|%#s|\n", "\007 \a.");
323   |\a \a.|
324 </pre></div>
325 <p>
326 <em>Unsigned</em> ( <code>u</code> )
327 <p>
328 Output an unsigned integer. Default base is 10.
329 <p>
330 <em>Hex</em> ( <code>x</code>, <code>X</code> )
331 <p>
332 Output a hexadecimal (base 16) representation of a number.
333 <p>
334 <ul>
335 <li> Alternative ( <code>#</code> ). Preceed the number by <code>0x</code> ( or <code>0X</code> ). The two characters are counted as part of the width.</ul>
336 <em>User-defined</em> ( <code>&lt;&gt;</code> )
337 <p>
338 Invoke user-defined formatting. See <a class="el" href="group___user_defined.html#a0">trio_register</a> for further information.
339 <p>
340 <b>RETURN</b> <b>VALUES</b>
341 <p>
342 All functions returns the number of outputted characters. If an error occured then a negative error code is returned [TRIO]. Note that this is a deviation from the standard, which simply returns -1 (or EOF) and errno set appropriately. The error condition can be detected by checking whether the function returns a negative number or not, and the number can be parsed with the following macros. The error codes are primarily intended as debugging aide for the developer.
343 <p>
344 <ul>
345 <li> TRIO_EINVAL: Invalid argument. <li> TRIO_ETOOMANY: Too many arguments. <li> TRIO_EDBLREF: Double argument reference. <li> TRIO_EGAP: Argument reference gap. <li> TRIO_ENOMEM: Out of memory. <li> TRIO_ERANGE: Invalid range. <li> TRIO_ERRNO: The error is specified by the errno variable.</ul>
346 Example: <div class="fragment"><pre>
347   int rc;
348
349   rc = trio_printf("%r\n", 42);
350   if (rc &lt; 0) {
351     if (TRIO_ERROR_CODE(rc) != TRIO_EOF) {
352       trio_printf("Error: %s at position %d\n",
353                   TRIO_ERROR_NAME(rc),
354                   TRIO_ERROR_POSITION(rc));
355     }
356   }
357 </pre></div>
358 <p>
359 <b>SEE</b> <b>ALSO</b>
360 <p>
361 <em>trio_scanf</em>, <em>trio_register</em>.
362 <p>
363 <b>NOTES</b>
364 <p>
365 The printfv family uses an array rather than the stack to pass arguments. This means that <code>short</code> <code>int</code> and <code>float</code> values will not be handled by the default argument promotion in C. Instead, these values must be explicitly converted with the Short (h) modifier in both cases.
366 <p>
367 Example: <div class="fragment"><pre>
368   void *array[2];
369   float float_number = 42.0;
370   short short_number = 42;
371
372   array[0] = &amp;float_number;
373   array[1] = &amp;short_number;
374
375   trio_printfv("%hf %hd\n", array); /* CORRECT */
376   trio_printfv("%f %d\n", array); /* WRONG */
377 </pre></div>
378 <p>
379 <b>CONFORMING</b> <b>TO</b>
380 <p>
381 Throughout this document the following abbreviations have been used to indicate what standard a feature conforms to. If nothing else is indicated ANSI C (C89) is assumed.
382 <p>
383 <ul>
384 <li> [C89] ANSI X3.159-1989 <li> [C99] ISO/IEC 9899:1999 <li> [UNIX98] The Single UNIX Specification, Version 2 <li> [BSD] 4.4BSD <li> [GNU] GNU libc <li> [MSVC] Microsoft Visual C <li> [MISC] Other non-standard sources <li> [TRIO] Extensions specific for this package </ul>
385 <hr><h2>Function Documentation</h2>
386 <a name="a6" doxytag="trio.c::trio_dprintf"></a><p>
387 <table width="100%" cellpadding="2" cellspacing="0" border="0">
388   <tr>
389     <td class="md">
390       <table cellpadding="0" cellspacing="0" border="0">
391         <tr>
392           <td class="md" nowrap valign="top"> int trio_dprintf </td>
393           <td class="md" valign="top">(&nbsp;</td>
394           <td class="md" nowrap valign="top">int&nbsp;</td>
395           <td class="mdname" nowrap>&nbsp; <em>fd</em>, </td>
396         </tr>
397         <tr>
398           <td></td>
399           <td></td>
400           <td class="md" nowrap>const char *&nbsp;</td>
401           <td class="mdname" nowrap>&nbsp; <em>format</em>, </td>
402         </tr>
403         <tr>
404           <td></td>
405           <td></td>
406           <td class="md" nowrap>...&nbsp;</td>
407           <td class="mdname" nowrap>&nbsp;</td>
408         </tr>
409         <tr>
410           <td></td>
411           <td class="md">)&nbsp;</td>
412           <td class="md" colspan="2"></td>
413         </tr>
414
415       </table>
416     </td>
417   </tr>
418 </table>
419 <table cellspacing=5 cellpadding=0 border=0>
420   <tr>
421     <td>
422       &nbsp;
423     </td>
424     <td>
425
426 <p>
427 Print to file descriptor.
428 <p>
429 <dl compact><dt><b>
430 Parameters: </b><dd>
431 <table border=0 cellspacing=2 cellpadding=0>
432 <tr><td valign=top><em>fd</em>&nbsp;</td><td>
433 File descriptor. </td></tr>
434 <tr><td valign=top><em>format</em>&nbsp;</td><td>
435 Formatting string. </td></tr>
436 <tr><td valign=top><em>...</em>&nbsp;</td><td>
437 Arguments. </td></tr>
438 </table>
439 </dl><dl compact><dt><b>
440 Returns: </b><dd>
441 Number of printed characters. </dl>    </td>
442   </tr>
443 </table>
444 <a name="a8" doxytag="trio.c::trio_dprintfv"></a><p>
445 <table width="100%" cellpadding="2" cellspacing="0" border="0">
446   <tr>
447     <td class="md">
448       <table cellpadding="0" cellspacing="0" border="0">
449         <tr>
450           <td class="md" nowrap valign="top"> int trio_dprintfv </td>
451           <td class="md" valign="top">(&nbsp;</td>
452           <td class="md" nowrap valign="top">int&nbsp;</td>
453           <td class="mdname" nowrap>&nbsp; <em>fd</em>, </td>
454         </tr>
455         <tr>
456           <td></td>
457           <td></td>
458           <td class="md" nowrap>const char *&nbsp;</td>
459           <td class="mdname" nowrap>&nbsp; <em>format</em>, </td>
460         </tr>
461         <tr>
462           <td></td>
463           <td></td>
464           <td class="md" nowrap>trio_pointer_t *&nbsp;</td>
465           <td class="mdname" nowrap>&nbsp; <em>args</em></td>
466         </tr>
467         <tr>
468           <td></td>
469           <td class="md">)&nbsp;</td>
470           <td class="md" colspan="2"></td>
471         </tr>
472
473       </table>
474     </td>
475   </tr>
476 </table>
477 <table cellspacing=5 cellpadding=0 border=0>
478   <tr>
479     <td>
480       &nbsp;
481     </td>
482     <td>
483
484 <p>
485 Print to file descriptor.
486 <p>
487 <dl compact><dt><b>
488 Parameters: </b><dd>
489 <table border=0 cellspacing=2 cellpadding=0>
490 <tr><td valign=top><em>fd</em>&nbsp;</td><td>
491 File descriptor. </td></tr>
492 <tr><td valign=top><em>format</em>&nbsp;</td><td>
493 Formatting string. </td></tr>
494 <tr><td valign=top><em>args</em>&nbsp;</td><td>
495 Arguments. </td></tr>
496 </table>
497 </dl><dl compact><dt><b>
498 Returns: </b><dd>
499 Number of printed characters. </dl>    </td>
500   </tr>
501 </table>
502 <a name="a3" doxytag="trio.c::trio_fprintf"></a><p>
503 <table width="100%" cellpadding="2" cellspacing="0" border="0">
504   <tr>
505     <td class="md">
506       <table cellpadding="0" cellspacing="0" border="0">
507         <tr>
508           <td class="md" nowrap valign="top"> int trio_fprintf </td>
509           <td class="md" valign="top">(&nbsp;</td>
510           <td class="md" nowrap valign="top">FILE *&nbsp;</td>
511           <td class="mdname" nowrap>&nbsp; <em>file</em>, </td>
512         </tr>
513         <tr>
514           <td></td>
515           <td></td>
516           <td class="md" nowrap>const char *&nbsp;</td>
517           <td class="mdname" nowrap>&nbsp; <em>format</em>, </td>
518         </tr>
519         <tr>
520           <td></td>
521           <td></td>
522           <td class="md" nowrap>...&nbsp;</td>
523           <td class="mdname" nowrap>&nbsp;</td>
524         </tr>
525         <tr>
526           <td></td>
527           <td class="md">)&nbsp;</td>
528           <td class="md" colspan="2"></td>
529         </tr>
530
531       </table>
532     </td>
533   </tr>
534 </table>
535 <table cellspacing=5 cellpadding=0 border=0>
536   <tr>
537     <td>
538       &nbsp;
539     </td>
540     <td>
541
542 <p>
543 Print to file.
544 <p>
545 <dl compact><dt><b>
546 Parameters: </b><dd>
547 <table border=0 cellspacing=2 cellpadding=0>
548 <tr><td valign=top><em>file</em>&nbsp;</td><td>
549 File pointer. </td></tr>
550 <tr><td valign=top><em>format</em>&nbsp;</td><td>
551 Formatting string. </td></tr>
552 <tr><td valign=top><em>...</em>&nbsp;</td><td>
553 Arguments. </td></tr>
554 </table>
555 </dl><dl compact><dt><b>
556 Returns: </b><dd>
557 Number of printed characters. </dl>    </td>
558   </tr>
559 </table>
560 <a name="a5" doxytag="trio.c::trio_fprintfv"></a><p>
561 <table width="100%" cellpadding="2" cellspacing="0" border="0">
562   <tr>
563     <td class="md">
564       <table cellpadding="0" cellspacing="0" border="0">
565         <tr>
566           <td class="md" nowrap valign="top"> int trio_fprintfv </td>
567           <td class="md" valign="top">(&nbsp;</td>
568           <td class="md" nowrap valign="top">FILE *&nbsp;</td>
569           <td class="mdname" nowrap>&nbsp; <em>file</em>, </td>
570         </tr>
571         <tr>
572           <td></td>
573           <td></td>
574           <td class="md" nowrap>const char *&nbsp;</td>
575           <td class="mdname" nowrap>&nbsp; <em>format</em>, </td>
576         </tr>
577         <tr>
578           <td></td>
579           <td></td>
580           <td class="md" nowrap>trio_pointer_t *&nbsp;</td>
581           <td class="mdname" nowrap>&nbsp; <em>args</em></td>
582         </tr>
583         <tr>
584           <td></td>
585           <td class="md">)&nbsp;</td>
586           <td class="md" colspan="2"></td>
587         </tr>
588
589       </table>
590     </td>
591   </tr>
592 </table>
593 <table cellspacing=5 cellpadding=0 border=0>
594   <tr>
595     <td>
596       &nbsp;
597     </td>
598     <td>
599
600 <p>
601 Print to file.
602 <p>
603 <dl compact><dt><b>
604 Parameters: </b><dd>
605 <table border=0 cellspacing=2 cellpadding=0>
606 <tr><td valign=top><em>file</em>&nbsp;</td><td>
607 File pointer. </td></tr>
608 <tr><td valign=top><em>format</em>&nbsp;</td><td>
609 Formatting string. </td></tr>
610 <tr><td valign=top><em>args</em>&nbsp;</td><td>
611 Arguments. </td></tr>
612 </table>
613 </dl><dl compact><dt><b>
614 Returns: </b><dd>
615 Number of printed characters. </dl>    </td>
616   </tr>
617 </table>
618 <a name="a0" doxytag="trio.c::trio_printf"></a><p>
619 <table width="100%" cellpadding="2" cellspacing="0" border="0">
620   <tr>
621     <td class="md">
622       <table cellpadding="0" cellspacing="0" border="0">
623         <tr>
624           <td class="md" nowrap valign="top"> int trio_printf </td>
625           <td class="md" valign="top">(&nbsp;</td>
626           <td class="md" nowrap valign="top">const char *&nbsp;</td>
627           <td class="mdname" nowrap>&nbsp; <em>format</em>, </td>
628         </tr>
629         <tr>
630           <td></td>
631           <td></td>
632           <td class="md" nowrap>...&nbsp;</td>
633           <td class="mdname" nowrap>&nbsp;</td>
634         </tr>
635         <tr>
636           <td></td>
637           <td class="md">)&nbsp;</td>
638           <td class="md" colspan="2"></td>
639         </tr>
640
641       </table>
642     </td>
643   </tr>
644 </table>
645 <table cellspacing=5 cellpadding=0 border=0>
646   <tr>
647     <td>
648       &nbsp;
649     </td>
650     <td>
651
652 <p>
653 Print to standard output stream.
654 <p>
655 <dl compact><dt><b>
656 Parameters: </b><dd>
657 <table border=0 cellspacing=2 cellpadding=0>
658 <tr><td valign=top><em>format</em>&nbsp;</td><td>
659 Formatting string. </td></tr>
660 <tr><td valign=top><em>...</em>&nbsp;</td><td>
661 Arguments. </td></tr>
662 </table>
663 </dl><dl compact><dt><b>
664 Returns: </b><dd>
665 Number of printed characters. </dl>    </td>
666   </tr>
667 </table>
668 <a name="a2" doxytag="trio.c::trio_printfv"></a><p>
669 <table width="100%" cellpadding="2" cellspacing="0" border="0">
670   <tr>
671     <td class="md">
672       <table cellpadding="0" cellspacing="0" border="0">
673         <tr>
674           <td class="md" nowrap valign="top"> int trio_printfv </td>
675           <td class="md" valign="top">(&nbsp;</td>
676           <td class="md" nowrap valign="top">const char *&nbsp;</td>
677           <td class="mdname" nowrap>&nbsp; <em>format</em>, </td>
678         </tr>
679         <tr>
680           <td></td>
681           <td></td>
682           <td class="md" nowrap>trio_pointer_t *&nbsp;</td>
683           <td class="mdname" nowrap>&nbsp; <em>args</em></td>
684         </tr>
685         <tr>
686           <td></td>
687           <td class="md">)&nbsp;</td>
688           <td class="md" colspan="2"></td>
689         </tr>
690
691       </table>
692     </td>
693   </tr>
694 </table>
695 <table cellspacing=5 cellpadding=0 border=0>
696   <tr>
697     <td>
698       &nbsp;
699     </td>
700     <td>
701
702 <p>
703 Print to standard output stream.
704 <p>
705 <dl compact><dt><b>
706 Parameters: </b><dd>
707 <table border=0 cellspacing=2 cellpadding=0>
708 <tr><td valign=top><em>format</em>&nbsp;</td><td>
709 Formatting string. </td></tr>
710 <tr><td valign=top><em>args</em>&nbsp;</td><td>
711 Arguments. </td></tr>
712 </table>
713 </dl><dl compact><dt><b>
714 Returns: </b><dd>
715 Number of printed characters. </dl>    </td>
716   </tr>
717 </table>
718 <a name="a15" doxytag="trio.c::trio_snprintf"></a><p>
719 <table width="100%" cellpadding="2" cellspacing="0" border="0">
720   <tr>
721     <td class="md">
722       <table cellpadding="0" cellspacing="0" border="0">
723         <tr>
724           <td class="md" nowrap valign="top"> int trio_snprintf </td>
725           <td class="md" valign="top">(&nbsp;</td>
726           <td class="md" nowrap valign="top">char *&nbsp;</td>
727           <td class="mdname" nowrap>&nbsp; <em>buffer</em>, </td>
728         </tr>
729         <tr>
730           <td></td>
731           <td></td>
732           <td class="md" nowrap>size_t&nbsp;</td>
733           <td class="mdname" nowrap>&nbsp; <em>max</em>, </td>
734         </tr>
735         <tr>
736           <td></td>
737           <td></td>
738           <td class="md" nowrap>const char *&nbsp;</td>
739           <td class="mdname" nowrap>&nbsp; <em>format</em>, </td>
740         </tr>
741         <tr>
742           <td></td>
743           <td></td>
744           <td class="md" nowrap>...&nbsp;</td>
745           <td class="mdname" nowrap>&nbsp;</td>
746         </tr>
747         <tr>
748           <td></td>
749           <td class="md">)&nbsp;</td>
750           <td class="md" colspan="2"></td>
751         </tr>
752
753       </table>
754     </td>
755   </tr>
756 </table>
757 <table cellspacing=5 cellpadding=0 border=0>
758   <tr>
759     <td>
760       &nbsp;
761     </td>
762     <td>
763
764 <p>
765 Print at most <code>max</code> characters to string.
766 <p>
767 <dl compact><dt><b>
768 Parameters: </b><dd>
769 <table border=0 cellspacing=2 cellpadding=0>
770 <tr><td valign=top><em>buffer</em>&nbsp;</td><td>
771 Output string. </td></tr>
772 <tr><td valign=top><em>max</em>&nbsp;</td><td>
773 Maximum number of characters to print. </td></tr>
774 <tr><td valign=top><em>format</em>&nbsp;</td><td>
775 Formatting string. </td></tr>
776 <tr><td valign=top><em>...</em>&nbsp;</td><td>
777 Arguments. </td></tr>
778 </table>
779 </dl><dl compact><dt><b>
780 Returns: </b><dd>
781 Number of printed characters. </dl>    </td>
782   </tr>
783 </table>
784 <a name="a17" doxytag="trio.c::trio_snprintfv"></a><p>
785 <table width="100%" cellpadding="2" cellspacing="0" border="0">
786   <tr>
787     <td class="md">
788       <table cellpadding="0" cellspacing="0" border="0">
789         <tr>
790           <td class="md" nowrap valign="top"> int trio_snprintfv </td>
791           <td class="md" valign="top">(&nbsp;</td>
792           <td class="md" nowrap valign="top">char *&nbsp;</td>
793           <td class="mdname" nowrap>&nbsp; <em>buffer</em>, </td>
794         </tr>
795         <tr>
796           <td></td>
797           <td></td>
798           <td class="md" nowrap>size_t&nbsp;</td>
799           <td class="mdname" nowrap>&nbsp; <em>max</em>, </td>
800         </tr>
801         <tr>
802           <td></td>
803           <td></td>
804           <td class="md" nowrap>const char *&nbsp;</td>
805           <td class="mdname" nowrap>&nbsp; <em>format</em>, </td>
806         </tr>
807         <tr>
808           <td></td>
809           <td></td>
810           <td class="md" nowrap>trio_pointer_t *&nbsp;</td>
811           <td class="mdname" nowrap>&nbsp; <em>args</em></td>
812         </tr>
813         <tr>
814           <td></td>
815           <td class="md">)&nbsp;</td>
816           <td class="md" colspan="2"></td>
817         </tr>
818
819       </table>
820     </td>
821   </tr>
822 </table>
823 <table cellspacing=5 cellpadding=0 border=0>
824   <tr>
825     <td>
826       &nbsp;
827     </td>
828     <td>
829
830 <p>
831 Print at most <code>max</code> characters to string.
832 <p>
833 <dl compact><dt><b>
834 Parameters: </b><dd>
835 <table border=0 cellspacing=2 cellpadding=0>
836 <tr><td valign=top><em>buffer</em>&nbsp;</td><td>
837 Output string. </td></tr>
838 <tr><td valign=top><em>max</em>&nbsp;</td><td>
839 Maximum number of characters to print. </td></tr>
840 <tr><td valign=top><em>format</em>&nbsp;</td><td>
841 Formatting string. </td></tr>
842 <tr><td valign=top><em>args</em>&nbsp;</td><td>
843 Arguments. </td></tr>
844 </table>
845 </dl><dl compact><dt><b>
846 Returns: </b><dd>
847 Number of printed characters. </dl>    </td>
848   </tr>
849 </table>
850 <a name="a12" doxytag="trio.c::trio_sprintf"></a><p>
851 <table width="100%" cellpadding="2" cellspacing="0" border="0">
852   <tr>
853     <td class="md">
854       <table cellpadding="0" cellspacing="0" border="0">
855         <tr>
856           <td class="md" nowrap valign="top"> int trio_sprintf </td>
857           <td class="md" valign="top">(&nbsp;</td>
858           <td class="md" nowrap valign="top">char *&nbsp;</td>
859           <td class="mdname" nowrap>&nbsp; <em>buffer</em>, </td>
860         </tr>
861         <tr>
862           <td></td>
863           <td></td>
864           <td class="md" nowrap>const char *&nbsp;</td>
865           <td class="mdname" nowrap>&nbsp; <em>format</em>, </td>
866         </tr>
867         <tr>
868           <td></td>
869           <td></td>
870           <td class="md" nowrap>...&nbsp;</td>
871           <td class="mdname" nowrap>&nbsp;</td>
872         </tr>
873         <tr>
874           <td></td>
875           <td class="md">)&nbsp;</td>
876           <td class="md" colspan="2"></td>
877         </tr>
878
879       </table>
880     </td>
881   </tr>
882 </table>
883 <table cellspacing=5 cellpadding=0 border=0>
884   <tr>
885     <td>
886       &nbsp;
887     </td>
888     <td>
889
890 <p>
891 Print to string.
892 <p>
893 <dl compact><dt><b>
894 Parameters: </b><dd>
895 <table border=0 cellspacing=2 cellpadding=0>
896 <tr><td valign=top><em>buffer</em>&nbsp;</td><td>
897 Output string. </td></tr>
898 <tr><td valign=top><em>format</em>&nbsp;</td><td>
899 Formatting string. </td></tr>
900 <tr><td valign=top><em>...</em>&nbsp;</td><td>
901 Arguments. </td></tr>
902 </table>
903 </dl><dl compact><dt><b>
904 Returns: </b><dd>
905 Number of printed characters. </dl>    </td>
906   </tr>
907 </table>
908 <a name="a14" doxytag="trio.c::trio_sprintfv"></a><p>
909 <table width="100%" cellpadding="2" cellspacing="0" border="0">
910   <tr>
911     <td class="md">
912       <table cellpadding="0" cellspacing="0" border="0">
913         <tr>
914           <td class="md" nowrap valign="top"> int trio_sprintfv </td>
915           <td class="md" valign="top">(&nbsp;</td>
916           <td class="md" nowrap valign="top">char *&nbsp;</td>
917           <td class="mdname" nowrap>&nbsp; <em>buffer</em>, </td>
918         </tr>
919         <tr>
920           <td></td>
921           <td></td>
922           <td class="md" nowrap>const char *&nbsp;</td>
923           <td class="mdname" nowrap>&nbsp; <em>format</em>, </td>
924         </tr>
925         <tr>
926           <td></td>
927           <td></td>
928           <td class="md" nowrap>trio_pointer_t *&nbsp;</td>
929           <td class="mdname" nowrap>&nbsp; <em>args</em></td>
930         </tr>
931         <tr>
932           <td></td>
933           <td class="md">)&nbsp;</td>
934           <td class="md" colspan="2"></td>
935         </tr>
936
937       </table>
938     </td>
939   </tr>
940 </table>
941 <table cellspacing=5 cellpadding=0 border=0>
942   <tr>
943     <td>
944       &nbsp;
945     </td>
946     <td>
947
948 <p>
949 Print to string.
950 <p>
951 <dl compact><dt><b>
952 Parameters: </b><dd>
953 <table border=0 cellspacing=2 cellpadding=0>
954 <tr><td valign=top><em>buffer</em>&nbsp;</td><td>
955 Output string. </td></tr>
956 <tr><td valign=top><em>format</em>&nbsp;</td><td>
957 Formatting string. </td></tr>
958 <tr><td valign=top><em>args</em>&nbsp;</td><td>
959 Arguments. </td></tr>
960 </table>
961 </dl><dl compact><dt><b>
962 Returns: </b><dd>
963 Number of printed characters. </dl>    </td>
964   </tr>
965 </table>
966 <a name="a7" doxytag="trio.c::trio_vdprintf"></a><p>
967 <table width="100%" cellpadding="2" cellspacing="0" border="0">
968   <tr>
969     <td class="md">
970       <table cellpadding="0" cellspacing="0" border="0">
971         <tr>
972           <td class="md" nowrap valign="top"> int trio_vdprintf </td>
973           <td class="md" valign="top">(&nbsp;</td>
974           <td class="md" nowrap valign="top">int&nbsp;</td>
975           <td class="mdname" nowrap>&nbsp; <em>fd</em>, </td>
976         </tr>
977         <tr>
978           <td></td>
979           <td></td>
980           <td class="md" nowrap>const char *&nbsp;</td>
981           <td class="mdname" nowrap>&nbsp; <em>format</em>, </td>
982         </tr>
983         <tr>
984           <td></td>
985           <td></td>
986           <td class="md" nowrap>va_list&nbsp;</td>
987           <td class="mdname" nowrap>&nbsp; <em>args</em></td>
988         </tr>
989         <tr>
990           <td></td>
991           <td class="md">)&nbsp;</td>
992           <td class="md" colspan="2"></td>
993         </tr>
994
995       </table>
996     </td>
997   </tr>
998 </table>
999 <table cellspacing=5 cellpadding=0 border=0>
1000   <tr>
1001     <td>
1002       &nbsp;
1003     </td>
1004     <td>
1005
1006 <p>
1007 Print to file descriptor.
1008 <p>
1009 <dl compact><dt><b>
1010 Parameters: </b><dd>
1011 <table border=0 cellspacing=2 cellpadding=0>
1012 <tr><td valign=top><em>fd</em>&nbsp;</td><td>
1013 File descriptor. </td></tr>
1014 <tr><td valign=top><em>format</em>&nbsp;</td><td>
1015 Formatting string. </td></tr>
1016 <tr><td valign=top><em>args</em>&nbsp;</td><td>
1017 Arguments. </td></tr>
1018 </table>
1019 </dl><dl compact><dt><b>
1020 Returns: </b><dd>
1021 Number of printed characters. </dl>    </td>
1022   </tr>
1023 </table>
1024 <a name="a4" doxytag="trio.c::trio_vfprintf"></a><p>
1025 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1026   <tr>
1027     <td class="md">
1028       <table cellpadding="0" cellspacing="0" border="0">
1029         <tr>
1030           <td class="md" nowrap valign="top"> int trio_vfprintf </td>
1031           <td class="md" valign="top">(&nbsp;</td>
1032           <td class="md" nowrap valign="top">FILE *&nbsp;</td>
1033           <td class="mdname" nowrap>&nbsp; <em>file</em>, </td>
1034         </tr>
1035         <tr>
1036           <td></td>
1037           <td></td>
1038           <td class="md" nowrap>const char *&nbsp;</td>
1039           <td class="mdname" nowrap>&nbsp; <em>format</em>, </td>
1040         </tr>
1041         <tr>
1042           <td></td>
1043           <td></td>
1044           <td class="md" nowrap>va_list&nbsp;</td>
1045           <td class="mdname" nowrap>&nbsp; <em>args</em></td>
1046         </tr>
1047         <tr>
1048           <td></td>
1049           <td class="md">)&nbsp;</td>
1050           <td class="md" colspan="2"></td>
1051         </tr>
1052
1053       </table>
1054     </td>
1055   </tr>
1056 </table>
1057 <table cellspacing=5 cellpadding=0 border=0>
1058   <tr>
1059     <td>
1060       &nbsp;
1061     </td>
1062     <td>
1063
1064 <p>
1065 Print to file.
1066 <p>
1067 <dl compact><dt><b>
1068 Parameters: </b><dd>
1069 <table border=0 cellspacing=2 cellpadding=0>
1070 <tr><td valign=top><em>file</em>&nbsp;</td><td>
1071 File pointer. </td></tr>
1072 <tr><td valign=top><em>format</em>&nbsp;</td><td>
1073 Formatting string. </td></tr>
1074 <tr><td valign=top><em>args</em>&nbsp;</td><td>
1075 Arguments. </td></tr>
1076 </table>
1077 </dl><dl compact><dt><b>
1078 Returns: </b><dd>
1079 Number of printed characters. </dl>    </td>
1080   </tr>
1081 </table>
1082 <a name="a1" doxytag="trio.c::trio_vprintf"></a><p>
1083 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1084   <tr>
1085     <td class="md">
1086       <table cellpadding="0" cellspacing="0" border="0">
1087         <tr>
1088           <td class="md" nowrap valign="top"> int trio_vprintf </td>
1089           <td class="md" valign="top">(&nbsp;</td>
1090           <td class="md" nowrap valign="top">const char *&nbsp;</td>
1091           <td class="mdname" nowrap>&nbsp; <em>format</em>, </td>
1092         </tr>
1093         <tr>
1094           <td></td>
1095           <td></td>
1096           <td class="md" nowrap>va_list&nbsp;</td>
1097           <td class="mdname" nowrap>&nbsp; <em>args</em></td>
1098         </tr>
1099         <tr>
1100           <td></td>
1101           <td class="md">)&nbsp;</td>
1102           <td class="md" colspan="2"></td>
1103         </tr>
1104
1105       </table>
1106     </td>
1107   </tr>
1108 </table>
1109 <table cellspacing=5 cellpadding=0 border=0>
1110   <tr>
1111     <td>
1112       &nbsp;
1113     </td>
1114     <td>
1115
1116 <p>
1117 Print to standard output stream.
1118 <p>
1119 <dl compact><dt><b>
1120 Parameters: </b><dd>
1121 <table border=0 cellspacing=2 cellpadding=0>
1122 <tr><td valign=top><em>format</em>&nbsp;</td><td>
1123 Formatting string. </td></tr>
1124 <tr><td valign=top><em>args</em>&nbsp;</td><td>
1125 Arguments. </td></tr>
1126 </table>
1127 </dl><dl compact><dt><b>
1128 Returns: </b><dd>
1129 Number of printed characters. </dl>    </td>
1130   </tr>
1131 </table>
1132 <a name="a16" doxytag="trio.c::trio_vsnprintf"></a><p>
1133 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1134   <tr>
1135     <td class="md">
1136       <table cellpadding="0" cellspacing="0" border="0">
1137         <tr>
1138           <td class="md" nowrap valign="top"> int trio_vsnprintf </td>
1139           <td class="md" valign="top">(&nbsp;</td>
1140           <td class="md" nowrap valign="top">char *&nbsp;</td>
1141           <td class="mdname" nowrap>&nbsp; <em>buffer</em>, </td>
1142         </tr>
1143         <tr>
1144           <td></td>
1145           <td></td>
1146           <td class="md" nowrap>size_t&nbsp;</td>
1147           <td class="mdname" nowrap>&nbsp; <em>max</em>, </td>
1148         </tr>
1149         <tr>
1150           <td></td>
1151           <td></td>
1152           <td class="md" nowrap>const char *&nbsp;</td>
1153           <td class="mdname" nowrap>&nbsp; <em>format</em>, </td>
1154         </tr>
1155         <tr>
1156           <td></td>
1157           <td></td>
1158           <td class="md" nowrap>va_list&nbsp;</td>
1159           <td class="mdname" nowrap>&nbsp; <em>args</em></td>
1160         </tr>
1161         <tr>
1162           <td></td>
1163           <td class="md">)&nbsp;</td>
1164           <td class="md" colspan="2"></td>
1165         </tr>
1166
1167       </table>
1168     </td>
1169   </tr>
1170 </table>
1171 <table cellspacing=5 cellpadding=0 border=0>
1172   <tr>
1173     <td>
1174       &nbsp;
1175     </td>
1176     <td>
1177
1178 <p>
1179 Print at most <code>max</code> characters to string.
1180 <p>
1181 <dl compact><dt><b>
1182 Parameters: </b><dd>
1183 <table border=0 cellspacing=2 cellpadding=0>
1184 <tr><td valign=top><em>buffer</em>&nbsp;</td><td>
1185 Output string. </td></tr>
1186 <tr><td valign=top><em>max</em>&nbsp;</td><td>
1187 Maximum number of characters to print. </td></tr>
1188 <tr><td valign=top><em>format</em>&nbsp;</td><td>
1189 Formatting string. </td></tr>
1190 <tr><td valign=top><em>args</em>&nbsp;</td><td>
1191 Arguments. </td></tr>
1192 </table>
1193 </dl><dl compact><dt><b>
1194 Returns: </b><dd>
1195 Number of printed characters. </dl>    </td>
1196   </tr>
1197 </table>
1198 <a name="a13" doxytag="trio.c::trio_vsprintf"></a><p>
1199 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1200   <tr>
1201     <td class="md">
1202       <table cellpadding="0" cellspacing="0" border="0">
1203         <tr>
1204           <td class="md" nowrap valign="top"> int trio_vsprintf </td>
1205           <td class="md" valign="top">(&nbsp;</td>
1206           <td class="md" nowrap valign="top">char *&nbsp;</td>
1207           <td class="mdname" nowrap>&nbsp; <em>buffer</em>, </td>
1208         </tr>
1209         <tr>
1210           <td></td>
1211           <td></td>
1212           <td class="md" nowrap>const char *&nbsp;</td>
1213           <td class="mdname" nowrap>&nbsp; <em>format</em>, </td>
1214         </tr>
1215         <tr>
1216           <td></td>
1217           <td></td>
1218           <td class="md" nowrap>va_list&nbsp;</td>
1219           <td class="mdname" nowrap>&nbsp; <em>args</em></td>
1220         </tr>
1221         <tr>
1222           <td></td>
1223           <td class="md">)&nbsp;</td>
1224           <td class="md" colspan="2"></td>
1225         </tr>
1226
1227       </table>
1228     </td>
1229   </tr>
1230 </table>
1231 <table cellspacing=5 cellpadding=0 border=0>
1232   <tr>
1233     <td>
1234       &nbsp;
1235     </td>
1236     <td>
1237
1238 <p>
1239 Print to string.
1240 <p>
1241 <dl compact><dt><b>
1242 Parameters: </b><dd>
1243 <table border=0 cellspacing=2 cellpadding=0>
1244 <tr><td valign=top><em>buffer</em>&nbsp;</td><td>
1245 Output string. </td></tr>
1246 <tr><td valign=top><em>format</em>&nbsp;</td><td>
1247 Formatting string. </td></tr>
1248 <tr><td valign=top><em>args</em>&nbsp;</td><td>
1249 Arguments. </td></tr>
1250 </table>
1251 </dl><dl compact><dt><b>
1252 Returns: </b><dd>
1253 Number of printed characters. </dl>    </td>
1254   </tr>
1255 </table>
1256 <HR>
1257 <center class="copyright">Copyright (C) 2001 Bj&oslash;rn Reese and Daniel Stenberg.</center>
1258 </body>
1259 </html>