aboutsummaryrefslogtreecommitdiffstats
path: root/trio/html/group___dynamic_strings.html
blob: ab3492971c433d25540d1062688731c024a09416 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
 <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
 <title>TRIO</title>
 <link href="trio.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- Generated by Doxygen 1.2.12 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; </center>
<hr><h1>Dynamic String Functions.</h1>Dynamic string functions. 
<a href="#_details">More...</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td nowrap align=right valign=top>TRIO_STRING_PUBLIC trio_string_t *&nbsp;</td><td valign=bottom><a class="el" href="group___dynamic_strings.html#a3">trio_string_create</a> (int initial_size)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Create a new dynamic string.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>TRIO_STRING_PUBLIC void&nbsp;</td><td valign=bottom><a class="el" href="group___dynamic_strings.html#a4">trio_string_destroy</a> (trio_string_t *self)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Deallocate the dynamic string and its contents.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>TRIO_STRING_PUBLIC char *&nbsp;</td><td valign=bottom><a class="el" href="group___dynamic_strings.html#a5">trio_string_get</a> (trio_string_t *self, int offset)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Get a pointer to the content.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>TRIO_STRING_PUBLIC char *&nbsp;</td><td valign=bottom><a class="el" href="group___dynamic_strings.html#a6">trio_string_extract</a> (trio_string_t *self)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Extract the content.</em> <a href="#a6">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>TRIO_STRING_PUBLIC void&nbsp;</td><td valign=bottom><a class="el" href="group___dynamic_strings.html#a7">trio_xstring_set</a> (trio_string_t *self, char *buffer)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Set the content of the dynamic string.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>TRIO_STRING_PUBLIC int&nbsp;</td><td valign=bottom><a class="el" href="group___dynamic_strings.html#a10">trio_string_append</a> (trio_string_t *self, trio_string_t *other)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Append the second string to the first.</em> <a href="#a10">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>TRIO_STRING_PUBLIC int&nbsp;</td><td valign=bottom><a class="el" href="group___dynamic_strings.html#a13">trio_string_contains</a> (trio_string_t *self, trio_string_t *other)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Search for the first occurrence of second parameter in the first.</em> <a href="#a13">More...</a><em></em></font><br><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Dynamic string functions.
<p>
<b>SYNOPSIS</b>
<p>
<div class="fragment"><pre>
cc ... -ltrio -lm

#include &lt;triostr.h&gt;
</pre></div>
<p>
<b>DESCRIPTION</b> <hr><h2>Function Documentation</h2>
<a name="a10" doxytag="triostr.c::trio_string_append"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> TRIO_STRING_PUBLIC int trio_string_append </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">trio_string_t *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>self</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>trio_string_t *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>other</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Append the second string to the first.
<p>
<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>self</em>&nbsp;</td><td>
Dynamic string to be modified. </td></tr>
<tr><td valign=top><em>other</em>&nbsp;</td><td>
Dynamic string to copy from. </td></tr>
</table>
</dl><dl compact><dt><b>
Returns: </b><dd>
Boolean value indicating success or failure. </dl>    </td>
  </tr>
</table>
<a name="a13" doxytag="triostr.c::trio_string_contains"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> TRIO_STRING_PUBLIC int trio_string_contains </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">trio_string_t *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>self</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>trio_string_t *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>other</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Search for the first occurrence of second parameter in the first.
<p>
<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>self</em>&nbsp;</td><td>
Dynamic string to be modified. </td></tr>
<tr><td valign=top><em>other</em>&nbsp;</td><td>
Dynamic string to copy from. </td></tr>
</table>
</dl><dl compact><dt><b>
Returns: </b><dd>
Boolean value indicating success or failure. </dl>    </td>
  </tr>
</table>
<a name="a3" doxytag="triostr.c::trio_string_create"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> TRIO_STRING_PUBLIC trio_string_t* trio_string_create </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">int&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp; <em>initial_size</em>          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Create a new dynamic string.
<p>
<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>initial_size</em>&nbsp;</td><td>
Initial size of the buffer. </td></tr>
</table>
</dl><dl compact><dt><b>
Returns: </b><dd>
Newly allocated dynamic string, or NULL if memory allocation failed. </dl>    </td>
  </tr>
</table>
<a name="a4" doxytag="triostr.c::trio_string_destroy"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> TRIO_STRING_PUBLIC void trio_string_destroy </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">trio_string_t *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp; <em>self</em>          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Deallocate the dynamic string and its contents.
<p>
<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>self</em>&nbsp;</td><td>
Dynamic string </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="a6" doxytag="triostr.c::trio_string_extract"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> TRIO_STRING_PUBLIC char* trio_string_extract </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">trio_string_t *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp; <em>self</em>          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Extract the content.
<p>
<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>self</em>&nbsp;</td><td>
Dynamic String </td></tr>
</table>
</dl><dl compact><dt><b>
Returns: </b><dd>
Content of dynamic string.</dl>The content is removed from the dynamic string. This enables destruction of the dynamic string without deallocation of the content.     </td>
  </tr>
</table>
<a name="a5" doxytag="triostr.c::trio_string_get"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> TRIO_STRING_PUBLIC char* trio_string_get </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">trio_string_t *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>self</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>int&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>offset</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get a pointer to the content.
<p>
<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>self</em>&nbsp;</td><td>
Dynamic string. </td></tr>
<tr><td valign=top><em>offset</em>&nbsp;</td><td>
Offset into content. </td></tr>
</table>
</dl><dl compact><dt><b>
Returns: </b><dd>
Pointer to the content.</dl><code>Offset</code> can be zero, positive, or negative. If <code>offset</code> is zero, then the start of the content will be returned. If <code>offset</code> is positive, then a pointer to <code>offset</code> number of characters from the beginning of the content is returned. If <code>offset</code> is negative, then a pointer to <code>offset</code> number of characters from the ending of the string, starting at the terminating zero, is returned.     </td>
  </tr>
</table>
<a name="a7" doxytag="triostr.c::trio_xstring_set"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> TRIO_STRING_PUBLIC void trio_xstring_set </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">trio_string_t *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>self</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>char *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>buffer</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Set the content of the dynamic string.
<p>
<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>self</em>&nbsp;</td><td>
Dynamic String </td></tr>
<tr><td valign=top><em>buffer</em>&nbsp;</td><td>
The new content.</td></tr>
</table>
</dl>Sets the content of the dynamic string to a copy <code>buffer</code>. An existing content will be deallocated first, if necessary.
<p>
<dl compact><dt><b>
Remarks: </b><dd>
 This function will make a copy of <code>buffer</code>. You are responsible for deallocating <code>buffer</code> yourself. </dl>    </td>
  </tr>
</table>
<HR>
<center class="copyright">Copyright (C) 2001 Bj&oslash;rn Reese and Daniel Stenberg.</center>
</body>
</html>
pre> </pre></div> [UNIX98] describes this as unspecified behaviour. [TRIO] will detect reference gaps and return an error.</ul> <ul> <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> trio_printf("%1$d %1$lf\n", 1); </pre></div> is NOT allowed, because it references the first argument as two differently sized objects. <div class="fragment"><pre> </pre></div> [UNIX98] describes this as unspecified behaviour. [TRIO] will detect double references and return an error.</ul> The following two statements are equivalent <div class="fragment"><pre> trio_printf("|%d %s\n|", 42, "meanings"); |42 meanings| trio_printf("|%1$d %2$s|\n", 42, "meanings"); |42 meanings| </pre></div> <p> <em>Width</em> ( <code>9</code> ) <p> 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. <p> The width is specified as a number. If an asterix ( <code>*</code> ) is used instead, the width will be read from the argument list. <p> Prefixes, such as 0x for hexadecimal integers, are part of width. <div class="fragment"><pre> trio_printf("|%10i|\n", 42); | 42| </pre></div> <p> <em>Precision</em> ( .<code>9</code> ) <p> 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> trio_printf("|%10.8i|%.8i|\n", 42, 42); | 00000042|00000042| </pre></div> <p> <em>Base</em> ( ..<code>9</code> ) [TRIO] <p> 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> trio_printf("|%10.8.2i|%10..2i|%..2i|\n", 42, 42, 42); | 00101010| 101010|101010| trio_printf("|%*.8.*i|\n", 10, 2, 42); | 00101010| </pre></div> <p> <em>Padding</em> ( <code>0</code> ) <p> 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. <p> <em>Short</em> ( <code>h</code> ) <p> 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. <p> <em>Short</em> <em>short</em> ( <code>hh</code> ) [C99, GNU] <p> The argument is read as an ( <code>unsigned</code> ) <code>char</code>. <p> <em>Fixed</em> <em>Size</em> ( <code>I</code> ) [MSVC] <p> 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 <p> <ul> <li> <code>I8</code> <li> <code>I16</code> <li> <code>I32</code> <li> <code>I64</code> (if 64-bits integers are supported)</ul> Works only for integers (i, u, d, o, x, X) <p> <em>Largest</em> ( <code>j</code> ) [C99] <p> The argument is read as an <code>intmax_t</code> / <code>uintmax_t</code>, which is defined to be the largest signed/unsigned integer. <p> <em>Long</em> ( <code>l</code> ) <p> 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. <p> <em>Long</em> <em>long</em> ( <code>ll</code> ) [C99, UNIX98, GNU] <p> The argument is read as an ( <code>unsigned</code> ) <code>long</code> <code>long</code> <code>int</code>. <p> <em>Long</em> <em>double</em> ( <code>L</code> ) [C99, UNIX98, GNU] <p> The argument is read as a <code>long</code> <code>double</code>. <p> <em>ptrdiff_t</em> ( <code>t</code> ) [C99] <p> 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. <p> <em>Quad</em> ( <code>q</code> ) [BSD, GNU] <p> Corresponds to the long long modifier ( <code>ll</code> ). <p> <em>Wide</em> ( <code>w</code> ) [MISC] <p> For a string argument this is equivalent to using the long modifier ( <code>l</code> ). <p> <em>size_t</em> ( <code>z</code> ) [C99] <p> The argument is read as a <code>size_t</code>, which is defined to be the type returned by the <code>sizeof</code> operator. <p> <em>size_t</em> ( <code>Z</code> ) [GNU] <p> Corresponds to the size_t modifier ( <code>z</code> ). <p> <em>Alternative</em> ( <code>#</code> ) <p> 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. <p> <em>Spacing</em> ( ) <p> Prepend leading spaces when necessary. <p> <em>Sign</em> ( <code>+</code> ) <p> 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. <p> <em>Alignment</em> ( <code>-</code> ) <p> The output will be left-justified in the field specified by the width. <p> <em>Argument</em> ( <code>*</code> ) <p> Width, precision, or base is read from the argument list, rather than from the formatting string. <p> <em>Quote</em> / <em>Grouping</em> ( ' <code>)</code> [MISC] <p> Groups integers and the integer-part of floating-point numbers according to the locale. Quote strings and characters. <p> <em>Sticky</em> ( <code>!</code> ) [TRIO] <p> The modifiers listed for the current specifier will be reused by subsequent specifiers of the same group. The following specifier groups exists <ul> <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> 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> trio_printf("|%!08#x|%04x|%x|\n", 42, 42, 42); |0x00002a|0x2a|0x00002a| </pre></div> <p> <b>Specifiers</b> <p> <em>Percent</em> ( <code>%</code> ) <p> 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> trio_printf("Percent is %%\n"); Percent is % </pre></div> <p> <em>Hex</em> <em>floats</em> ( <code>a</code>, <code>A</code> ) [C99] <p> 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> trio_printf("|%a|%A|\n", 3.1415, 3.1415e20); |0x3.228bc|0X3.228BCP+14| </pre></div> <p> <em>Binary</em> <em>numbers</em> ( <code>b</code>, <code>B</code> ) [MISC - SCO UnixWare 7] <p> DEPRECATED: Use Base modifier <code>%..2i</code> instead. <p> <em>Character</em> ( <code>c</code> ) <p> Output a single character. <p> <ul> <li> Quote ( ' <code>)</code> [TRIO]. Quote the character.</ul> <em>Decimal</em> ( <code>d</code> ) <p> Output a decimal (base 10) representation of a number. <p> <ul> <li> Grouping ( ' <code>)</code> [TRIO]. The number is separated by the locale thousand separator. <div class="fragment"><pre> trio_printf("|%'ld|\n", 1234567); |1,234,567| </pre></div></ul> <em>Floating-point</em> ( <code>e</code>, <code>E)</code> <p> Output a decimal floating-point number. The style is <code>[-]9.99e[-]9</code>, where <ul> <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> 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> trio_printf("|%.18e|\n", (1.0 / 3.0)); |3.333333333333333000e-01| </pre></div> <p> <em>Floating-point</em> ( <code>f</code>, <code>F</code> ) <p> Output a decimal floating-point number. The style is <code>[-]9.99</code>, where <ul> <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> 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> trio_printf("|%f|\n", (2.0 / 3.0) * 1E18); |666666666666666700.000000| </pre></div> <p> The following modifiers holds a special meaning for this specifier <ul> <li> Alternative ( <code>#</code> ) [C99]. Add decimal point. <li> Grouping ( ' <code>)</code> [TRIO]. Group integer part of number into thousands (according to locale).</ul> <em>Floating-point</em> ( <code>g</code>, <code>G)</code> <p> 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. <p> <em>Integer</em> ( <code>i</code> ) <p> Output a signed integer. Default base is 10. <p> <em>Errno</em> ( <code>m</code> ) [GNU] <p> <em>Count</em> ( <code>n</code> ) <p> Insert into the location pointed to by the argument, the number of octets written to the output so far. <p> <em>Octal</em> ( <code>o</code> ) <p> Output an octal (base 8) representation of a number. <p> <em>Pointer</em> ( <code>p</code> ) <p> 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> <li> Alternative ( <code>#</code> ) [TRIO]. Prepend 0x</ul> <em>String</em> ( <code>s</code>, <code>S</code> ) <p> 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> <li> Alternative ( <code>#</code> ) [TRIO]. Escape non-printable characters.</ul> 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> <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> <div class="fragment"><pre> trio_printf("|One %s Three|One %'s Three|\n", "Two", "Two"); |One Two Three|One "Two" Three| trio_printf("|Argument missing %s|\n", NULL); |Argument missing (nil)| trio_printf("|%#s|\n", "\007 \a."); |\a \a.| </pre></div> <p> <em>Unsigned</em> ( <code>u</code> ) <p> Output an unsigned integer. Default base is 10. <p> <em>Hex</em> ( <code>x</code>, <code>X</code> ) <p> Output a hexadecimal (base 16) representation of a number. <p> <ul> <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> <em>User-defined</em> ( <code>&lt;&gt;</code> ) <p> Invoke user-defined formatting. See <a class="el" href="group___user_defined.html#a0">trio_register</a> for further information. <p> <b>RETURN</b> <b>VALUES</b> <p> 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. <p> <ul> <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> Example: <div class="fragment"><pre> int rc; rc = trio_printf("%r\n", 42); if (rc &lt; 0) { if (TRIO_ERROR_CODE(rc) != TRIO_EOF) { trio_printf("Error: %s at position %d\n", TRIO_ERROR_NAME(rc), TRIO_ERROR_POSITION(rc)); } } </pre></div> <p> <b>SEE</b> <b>ALSO</b> <p> <em>trio_scanf</em>, <em>trio_register</em>. <p> <b>NOTES</b> <p> 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. <p> Example: <div class="fragment"><pre> void *array[2]; float float_number = 42.0; short short_number = 42; array[0] = &amp;float_number; array[1] = &amp;short_number; trio_printfv("%hf %hd\n", array); /* CORRECT */ trio_printfv("%f %d\n", array); /* WRONG */ </pre></div> <p> <b>CONFORMING</b> <b>TO</b> <p> 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. <p> <ul> <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> <hr><h2>Function Documentation</h2> <a name="a6" doxytag="trio.c::trio_dprintf"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int trio_dprintf </td> <td class="md" valign="top">(&nbsp;</td> <td class="md" nowrap valign="top">int&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>fd</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>...&nbsp;</td> <td class="mdname" nowrap>&nbsp;</td> </tr> <tr> <td></td> <td class="md">)&nbsp;</td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> &nbsp; </td> <td> <p> Print to file descriptor. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>fd</em>&nbsp;</td><td> File descriptor. </td></tr> <tr><td valign=top><em>format</em>&nbsp;</td><td> Formatting string. </td></tr> <tr><td valign=top><em>...</em>&nbsp;</td><td> Arguments. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> Number of printed characters. </dl> </td> </tr> </table> <a name="a8" doxytag="trio.c::trio_dprintfv"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int trio_dprintfv </td> <td class="md" valign="top">(&nbsp;</td> <td class="md" nowrap valign="top">int&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>fd</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>trio_pointer_t *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>args</em></td> </tr> <tr> <td></td> <td class="md">)&nbsp;</td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> &nbsp; </td> <td> <p> Print to file descriptor. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>fd</em>&nbsp;</td><td> File descriptor. </td></tr> <tr><td valign=top><em>format</em>&nbsp;</td><td> Formatting string. </td></tr> <tr><td valign=top><em>args</em>&nbsp;</td><td> Arguments. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> Number of printed characters. </dl> </td> </tr> </table> <a name="a3" doxytag="trio.c::trio_fprintf"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int trio_fprintf </td> <td class="md" valign="top">(&nbsp;</td> <td class="md" nowrap valign="top">FILE *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>file</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>...&nbsp;</td> <td class="mdname" nowrap>&nbsp;</td> </tr> <tr> <td></td> <td class="md">)&nbsp;</td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> &nbsp; </td> <td> <p> Print to file. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>file</em>&nbsp;</td><td> File pointer. </td></tr> <tr><td valign=top><em>format</em>&nbsp;</td><td> Formatting string. </td></tr> <tr><td valign=top><em>...</em>&nbsp;</td><td> Arguments. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> Number of printed characters. </dl> </td> </tr> </table> <a name="a5" doxytag="trio.c::trio_fprintfv"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int trio_fprintfv </td> <td class="md" valign="top">(&nbsp;</td> <td class="md" nowrap valign="top">FILE *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>file</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>trio_pointer_t *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>args</em></td> </tr> <tr> <td></td> <td class="md">)&nbsp;</td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> &nbsp; </td> <td> <p> Print to file. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>file</em>&nbsp;</td><td> File pointer. </td></tr> <tr><td valign=top><em>format</em>&nbsp;</td><td> Formatting string. </td></tr> <tr><td valign=top><em>args</em>&nbsp;</td><td> Arguments. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> Number of printed characters. </dl> </td> </tr> </table> <a name="a0" doxytag="trio.c::trio_printf"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int trio_printf </td> <td class="md" valign="top">(&nbsp;</td> <td class="md" nowrap valign="top">const char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>...&nbsp;</td> <td class="mdname" nowrap>&nbsp;</td> </tr> <tr> <td></td> <td class="md">)&nbsp;</td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> &nbsp; </td> <td> <p> Print to standard output stream. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>format</em>&nbsp;</td><td> Formatting string. </td></tr> <tr><td valign=top><em>...</em>&nbsp;</td><td> Arguments. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> Number of printed characters. </dl> </td> </tr> </table> <a name="a2" doxytag="trio.c::trio_printfv"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int trio_printfv </td> <td class="md" valign="top">(&nbsp;</td> <td class="md" nowrap valign="top">const char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>trio_pointer_t *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>args</em></td> </tr> <tr> <td></td> <td class="md">)&nbsp;</td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> &nbsp; </td> <td> <p> Print to standard output stream. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>format</em>&nbsp;</td><td> Formatting string. </td></tr> <tr><td valign=top><em>args</em>&nbsp;</td><td> Arguments. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> Number of printed characters. </dl> </td> </tr> </table> <a name="a15" doxytag="trio.c::trio_snprintf"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int trio_snprintf </td> <td class="md" valign="top">(&nbsp;</td> <td class="md" nowrap valign="top">char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>buffer</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>size_t&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>max</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>...&nbsp;</td> <td class="mdname" nowrap>&nbsp;</td> </tr> <tr> <td></td> <td class="md">)&nbsp;</td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> &nbsp; </td> <td> <p> Print at most <code>max</code> characters to string. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>buffer</em>&nbsp;</td><td> Output string. </td></tr> <tr><td valign=top><em>max</em>&nbsp;</td><td> Maximum number of characters to print. </td></tr> <tr><td valign=top><em>format</em>&nbsp;</td><td> Formatting string. </td></tr> <tr><td valign=top><em>...</em>&nbsp;</td><td> Arguments. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> Number of printed characters. </dl> </td> </tr> </table> <a name="a17" doxytag="trio.c::trio_snprintfv"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int trio_snprintfv </td> <td class="md" valign="top">(&nbsp;</td> <td class="md" nowrap valign="top">char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>buffer</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>size_t&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>max</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>trio_pointer_t *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>args</em></td> </tr> <tr> <td></td> <td class="md">)&nbsp;</td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> &nbsp; </td> <td> <p> Print at most <code>max</code> characters to string. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>buffer</em>&nbsp;</td><td> Output string. </td></tr> <tr><td valign=top><em>max</em>&nbsp;</td><td> Maximum number of characters to print. </td></tr> <tr><td valign=top><em>format</em>&nbsp;</td><td> Formatting string. </td></tr> <tr><td valign=top><em>args</em>&nbsp;</td><td> Arguments. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> Number of printed characters. </dl> </td> </tr> </table> <a name="a12" doxytag="trio.c::trio_sprintf"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int trio_sprintf </td> <td class="md" valign="top">(&nbsp;</td> <td class="md" nowrap valign="top">char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>buffer</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>...&nbsp;</td> <td class="mdname" nowrap>&nbsp;</td> </tr> <tr> <td></td> <td class="md">)&nbsp;</td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> &nbsp; </td> <td> <p> Print to string. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>buffer</em>&nbsp;</td><td> Output string. </td></tr> <tr><td valign=top><em>format</em>&nbsp;</td><td> Formatting string. </td></tr> <tr><td valign=top><em>...</em>&nbsp;</td><td> Arguments. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> Number of printed characters. </dl> </td> </tr> </table> <a name="a14" doxytag="trio.c::trio_sprintfv"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int trio_sprintfv </td> <td class="md" valign="top">(&nbsp;</td> <td class="md" nowrap valign="top">char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>buffer</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>trio_pointer_t *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>args</em></td> </tr> <tr> <td></td> <td class="md">)&nbsp;</td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> &nbsp; </td> <td> <p> Print to string. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>buffer</em>&nbsp;</td><td> Output string. </td></tr> <tr><td valign=top><em>format</em>&nbsp;</td><td> Formatting string. </td></tr> <tr><td valign=top><em>args</em>&nbsp;</td><td> Arguments. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> Number of printed characters. </dl> </td> </tr> </table> <a name="a7" doxytag="trio.c::trio_vdprintf"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int trio_vdprintf </td> <td class="md" valign="top">(&nbsp;</td> <td class="md" nowrap valign="top">int&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>fd</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>va_list&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>args</em></td> </tr> <tr> <td></td> <td class="md">)&nbsp;</td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> &nbsp; </td> <td> <p> Print to file descriptor. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>fd</em>&nbsp;</td><td> File descriptor. </td></tr> <tr><td valign=top><em>format</em>&nbsp;</td><td> Formatting string. </td></tr> <tr><td valign=top><em>args</em>&nbsp;</td><td> Arguments. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> Number of printed characters. </dl> </td> </tr> </table> <a name="a4" doxytag="trio.c::trio_vfprintf"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int trio_vfprintf </td> <td class="md" valign="top">(&nbsp;</td> <td class="md" nowrap valign="top">FILE *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>file</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>va_list&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>args</em></td> </tr> <tr> <td></td> <td class="md">)&nbsp;</td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> &nbsp; </td> <td> <p> Print to file. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>file</em>&nbsp;</td><td> File pointer. </td></tr> <tr><td valign=top><em>format</em>&nbsp;</td><td> Formatting string. </td></tr> <tr><td valign=top><em>args</em>&nbsp;</td><td> Arguments. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> Number of printed characters. </dl> </td> </tr> </table> <a name="a1" doxytag="trio.c::trio_vprintf"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int trio_vprintf </td> <td class="md" valign="top">(&nbsp;</td> <td class="md" nowrap valign="top">const char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>va_list&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>args</em></td> </tr> <tr> <td></td> <td class="md">)&nbsp;</td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> &nbsp; </td> <td> <p> Print to standard output stream. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>format</em>&nbsp;</td><td> Formatting string. </td></tr> <tr><td valign=top><em>args</em>&nbsp;</td><td> Arguments. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> Number of printed characters. </dl> </td> </tr> </table> <a name="a16" doxytag="trio.c::trio_vsnprintf"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int trio_vsnprintf </td> <td class="md" valign="top">(&nbsp;</td> <td class="md" nowrap valign="top">char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>buffer</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>size_t&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>max</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>va_list&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>args</em></td> </tr> <tr> <td></td> <td class="md">)&nbsp;</td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> &nbsp; </td> <td> <p> Print at most <code>max</code> characters to string. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>buffer</em>&nbsp;</td><td> Output string. </td></tr> <tr><td valign=top><em>max</em>&nbsp;</td><td> Maximum number of characters to print. </td></tr> <tr><td valign=top><em>format</em>&nbsp;</td><td> Formatting string. </td></tr> <tr><td valign=top><em>args</em>&nbsp;</td><td> Arguments. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> Number of printed characters. </dl> </td> </tr> </table> <a name="a13" doxytag="trio.c::trio_vsprintf"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int trio_vsprintf </td> <td class="md" valign="top">(&nbsp;</td> <td class="md" nowrap valign="top">char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>buffer</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>va_list&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>args</em></td> </tr> <tr> <td></td> <td class="md">)&nbsp;</td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> &nbsp; </td> <td> <p> Print to string. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>buffer</em>&nbsp;</td><td> Output string. </td></tr> <tr><td valign=top><em>format</em>&nbsp;</td><td> Formatting string. </td></tr> <tr><td valign=top><em>args</em>&nbsp;</td><td> Arguments. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> Number of printed characters. </dl> </td> </tr> </table> <HR> <center class="copyright">Copyright (C) 2001 Bj&oslash;rn Reese and Daniel Stenberg.</center> </body> </html>