File: section-iostream.xml

package info (click to toggle)
raptor 1.4.13-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 11,576 kB
  • ctags: 4,494
  • sloc: ansic: 31,845; sh: 9,278; xml: 8,589; yacc: 2,912; lex: 1,018; makefile: 817; perl: 61; cpp: 59
file content (575 lines) | stat: -rw-r--r-- 34,010 bytes parent folder | download
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
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" 
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="raptor-section-iostream">
<refmeta>
<refentrytitle role="top_of_page">I/O Stream</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>RAPTOR Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>I/O Stream</refname>
<refpurpose>Providing streaming I/O writing to files, strings or user code.</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>



typedef     <link linkend="raptor-iostream">raptor_iostream</link>;
<link linkend="int">int</link>         (<link linkend="raptor-iostream-init-func">*raptor_iostream_init_func</link>)    (<link linkend="void">void</link> *context);
<link linkend="void">void</link>        (<link linkend="raptor-iostream-finish-func">*raptor_iostream_finish_func</link>)  (<link linkend="void">void</link> *context);
<link linkend="int">int</link>         (<link linkend="raptor-iostream-write-byte-func">*raptor_iostream_write_byte_func</link>)
                                            (<link linkend="void">void</link> *context,
                                             const <link linkend="int">int</link> byte);
<link linkend="int">int</link>         (<link linkend="raptor-iostream-write-bytes-func">*raptor_iostream_write_bytes_func</link>)
                                            (<link linkend="void">void</link> *context,
                                             const <link linkend="void">void</link> *ptr,
                                             <link linkend="size-t">size_t</link> size,
                                             <link linkend="size-t">size_t</link> nmemb);
<link linkend="void">void</link>        (<link linkend="raptor-iostream-write-end-func">*raptor_iostream_write_end_func</link>)
                                            (<link linkend="void">void</link> *context);
            <link linkend="raptor-iostream-handler">raptor_iostream_handler</link>;
<link linkend="raptor-iostream">raptor_iostream</link>* <link linkend="raptor-new-iostream-from-handler">raptor_new_iostream_from_handler</link>
                                            (<link linkend="void">void</link> *context,
                                             const <link linkend="raptor-iostream-handler">raptor_iostream_handler</link> *handler);
<link linkend="raptor-iostream">raptor_iostream</link>* <link linkend="raptor-new-iostream-to-sink">raptor_new_iostream_to_sink</link>
                                            (void);
<link linkend="raptor-iostream">raptor_iostream</link>* <link linkend="raptor-new-iostream-to-filename">raptor_new_iostream_to_filename</link>
                                            (const <link linkend="char">char</link> *filename);
<link linkend="raptor-iostream">raptor_iostream</link>* <link linkend="raptor-new-iostream-to-file-handle">raptor_new_iostream_to_file_handle</link>
                                            (<link linkend="FILE:CAPS">FILE</link> *handle);
<link linkend="raptor-iostream">raptor_iostream</link>* <link linkend="raptor-new-iostream-to-string">raptor_new_iostream_to_string</link>
                                            (<link linkend="void">void</link> **string_p,
                                             <link linkend="size-t">size_t</link> *length_p,
                                             <link linkend="void">void</link>* (*malloc_handler) (size_t size));
<link linkend="void">void</link>        <link linkend="raptor-free-iostream">raptor_free_iostream</link>            (<link linkend="raptor-iostream">raptor_iostream</link> *iostr);
<link linkend="int">int</link>         <link linkend="raptor-iostream-write-bytes">raptor_iostream_write_bytes</link>     (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             const <link linkend="void">void</link> *ptr,
                                             <link linkend="size-t">size_t</link> size,
                                             <link linkend="size-t">size_t</link> nmemb);
<link linkend="int">int</link>         <link linkend="raptor-iostream-write-byte">raptor_iostream_write_byte</link>      (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             const <link linkend="int">int</link> byte);
<link linkend="void">void</link>        <link linkend="raptor-iostream-write-end">raptor_iostream_write_end</link>       (<link linkend="raptor-iostream">raptor_iostream</link> *iostr);
<link linkend="int">int</link>         <link linkend="raptor-iostream-write-string">raptor_iostream_write_string</link>    (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             const <link linkend="void">void</link> *string);
<link linkend="int">int</link>         <link linkend="raptor-iostream-write-counted-string">raptor_iostream_write_counted_string</link>
                                            (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             const <link linkend="void">void</link> *string,
                                             <link linkend="size-t">size_t</link> len);
<link linkend="size-t">size_t</link>      <link linkend="raptor-iostream-get-bytes-written-count">raptor_iostream_get_bytes_written_count</link>
                                            (<link linkend="raptor-iostream">raptor_iostream</link> *iostr);
<link linkend="int">int</link>         <link linkend="raptor-iostream-write-decimal">raptor_iostream_write_decimal</link>   (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             <link linkend="int">int</link> integer);
<link linkend="int">int</link>         <link linkend="raptor-iostream-format-hexadecimal">raptor_iostream_format_hexadecimal</link>
                                            (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             unsigned <link linkend="int">int</link> integer,
                                             <link linkend="int">int</link> width);
<link linkend="int">int</link>         <link linkend="raptor-iostream-write-stringbuffer">raptor_iostream_write_stringbuffer</link>
                                            (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             <link linkend="raptor-stringbuffer">raptor_stringbuffer</link> *sb);
<link linkend="int">int</link>         <link linkend="raptor-iostream-write-string-ntriples">raptor_iostream_write_string_ntriples</link>
                                            (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             unsigned <link linkend="char">char</link> *string,
                                             <link linkend="size-t">size_t</link> len,
                                             const <link linkend="char">char</link> delim);
<link linkend="void">void</link>        <link linkend="raptor-iostream-write-statement-ntriples">raptor_iostream_write_statement_ntriples</link>
                                            (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             const <link linkend="raptor-statement">raptor_statement</link> *statement);
</synopsis>
</refsynopsisdiv>









<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>
An class providing an I/O writer abstraction that allows generating
output that can be stored or passed on to system files, strings
allocated in memory (usually via <link linkend="raptor-stringbuffer"><type>raptor_stringbuffer</type></link>), system
file handles (<literal>FILE*</literal>) or to a user function.
</para>
</refsect1>

<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="raptor-iostream" role="typedef"/>raptor_iostream</title>
<indexterm><primary>raptor_iostream</primary></indexterm><programlisting>raptor_iostream* raptor_iostream;
</programlisting>
<para>
Raptor I/O Stream class</para>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-init-func" role="function"/>raptor_iostream_init_func ()</title>
<indexterm><primary>raptor_iostream_init_func</primary></indexterm><programlisting><link linkend="int">int</link>         (*raptor_iostream_init_func)    (<link linkend="void">void</link> *context);</programlisting>
<para>
Handler function for <link linkend="raptor-iostream"><type>raptor_iostream</type></link> initialising.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter>&nbsp;:</term>
<listitem><simpara> stream context data
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> non-0 on failure.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-finish-func" role="function"/>raptor_iostream_finish_func ()</title>
<indexterm><primary>raptor_iostream_finish_func</primary></indexterm><programlisting><link linkend="void">void</link>        (*raptor_iostream_finish_func)  (<link linkend="void">void</link> *context);</programlisting>
<para>
Handler function for <link linkend="raptor-iostream"><type>raptor_iostream</type></link> terminating.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter>&nbsp;:</term>
<listitem><simpara> stream context data
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-write-byte-func" role="function"/>raptor_iostream_write_byte_func ()</title>
<indexterm><primary>raptor_iostream_write_byte_func</primary></indexterm><programlisting><link linkend="int">int</link>         (*raptor_iostream_write_byte_func)
                                            (<link linkend="void">void</link> *context,
                                             const <link linkend="int">int</link> byte);</programlisting>
<para>
Handler function for implementing <link linkend="raptor-iostream-write-byte"><function>raptor_iostream_write_byte()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter>&nbsp;:</term>
<listitem><simpara> stream context data
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>byte</parameter>&nbsp;:</term>
<listitem><simpara> byte to write
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> non-0 on failure.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-write-bytes-func" role="function"/>raptor_iostream_write_bytes_func ()</title>
<indexterm><primary>raptor_iostream_write_bytes_func</primary></indexterm><programlisting><link linkend="int">int</link>         (*raptor_iostream_write_bytes_func)
                                            (<link linkend="void">void</link> *context,
                                             const <link linkend="void">void</link> *ptr,
                                             <link linkend="size-t">size_t</link> size,
                                             <link linkend="size-t">size_t</link> nmemb);</programlisting>
<para>
Handler function for implementing <link linkend="raptor-iostream-write-bytes"><function>raptor_iostream_write_bytes()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter>&nbsp;:</term>
<listitem><simpara> stream context data
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ptr</parameter>&nbsp;:</term>
<listitem><simpara> pointer to bytes to write
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&nbsp;:</term>
<listitem><simpara> size of item
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>nmemb</parameter>&nbsp;:</term>
<listitem><simpara> number of items
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> non-0 on failure.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-write-end-func" role="function"/>raptor_iostream_write_end_func ()</title>
<indexterm><primary>raptor_iostream_write_end_func</primary></indexterm><programlisting><link linkend="void">void</link>        (*raptor_iostream_write_end_func)
                                            (<link linkend="void">void</link> *context);</programlisting>
<para>
Handler function for implementing <link linkend="raptor-iostream-write-end"><function>raptor_iostream_write_end()</function></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter>&nbsp;:</term>
<listitem><simpara> stream context data
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-handler" role="struct"/>raptor_iostream_handler</title>
<indexterm><primary>raptor_iostream_handler</primary></indexterm><programlisting>typedef struct {
  raptor_iostream_init_func         init;
  raptor_iostream_finish_func       finish;
  raptor_iostream_write_byte_func   write_byte;
  raptor_iostream_write_bytes_func  write_bytes;
  raptor_iostream_write_end_func    write_end;
} raptor_iostream_handler;
</programlisting>
<para>
I/O stream implementation handler structure.</para>
<para>

</para><variablelist role="struct">
<varlistentry>
<term><link linkend="raptor-iostream-init-func">raptor_iostream_init_func</link>&nbsp;<structfield>init</structfield>;</term>
<listitem><simpara>  initialisation handler - optional, called at most once
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="raptor-iostream-finish-func">raptor_iostream_finish_func</link>&nbsp;<structfield>finish</structfield>;</term>
<listitem><simpara> finishing handler -  optional, called at most once
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="raptor-iostream-write-byte-func">raptor_iostream_write_byte_func</link>&nbsp;<structfield>write_byte</structfield>;</term>
<listitem><simpara> write byte handler - required
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="raptor-iostream-write-bytes-func">raptor_iostream_write_bytes_func</link>&nbsp;<structfield>write_bytes</structfield>;</term>
<listitem><simpara> write bytes handler - required
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="raptor-iostream-write-end-func">raptor_iostream_write_end_func</link>&nbsp;<structfield>write_end</structfield>;</term>
<listitem><simpara> write end handler - optional, called at most once
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-new-iostream-from-handler" role="function"/>raptor_new_iostream_from_handler ()</title>
<indexterm><primary>raptor_new_iostream_from_handler</primary></indexterm><programlisting><link linkend="raptor-iostream">raptor_iostream</link>* raptor_new_iostream_from_handler
                                            (<link linkend="void">void</link> *context,
                                             const <link linkend="raptor-iostream-handler">raptor_iostream_handler</link> *handler);</programlisting>
<para>
Create a new iostream over a user-defined handler.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter>&nbsp;:</term>
<listitem><simpara> pointer to context information to pass in to calls
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>handler</parameter>&nbsp;:</term>
<listitem><simpara> pointer to handler methods
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> new <link linkend="raptor-iostream"><type>raptor_iostream</type></link> object or NULL on failure
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-new-iostream-to-sink" role="function"/>raptor_new_iostream_to_sink ()</title>
<indexterm><primary>raptor_new_iostream_to_sink</primary></indexterm><programlisting><link linkend="raptor-iostream">raptor_iostream</link>* raptor_new_iostream_to_sink
                                            (void);</programlisting>
<para>
Create a new iostream to a sink.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> new <link linkend="raptor-iostream"><type>raptor_iostream</type></link> object or NULL on failure
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-new-iostream-to-filename" role="function"/>raptor_new_iostream_to_filename ()</title>
<indexterm><primary>raptor_new_iostream_to_filename</primary></indexterm><programlisting><link linkend="raptor-iostream">raptor_iostream</link>* raptor_new_iostream_to_filename
                                            (const <link linkend="char">char</link> *filename);</programlisting>
<para>
Constructor - create a new iostream writing to a filename.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>filename</parameter>&nbsp;:</term>
<listitem><simpara> Output filename to open and write to
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> new <link linkend="raptor-iostream"><type>raptor_iostream</type></link> object or NULL on failure
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-new-iostream-to-file-handle" role="function"/>raptor_new_iostream_to_file_handle ()</title>
<indexterm><primary>raptor_new_iostream_to_file_handle</primary></indexterm><programlisting><link linkend="raptor-iostream">raptor_iostream</link>* raptor_new_iostream_to_file_handle
                                            (<link linkend="FILE:CAPS">FILE</link> *handle);</programlisting>
<para>
Constructor - create a new iostream writing to a FILE*.
</para>
<para>
The <parameter>handle</parameter> must already be open for writing.
NOTE: This does not fclose the <parameter>handle</parameter> when it is finished.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>handle</parameter>&nbsp;:</term>
<listitem><simpara> FILE* handle to write to
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> new <link linkend="raptor-iostream"><type>raptor_iostream</type></link> object or NULL on failure
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-new-iostream-to-string" role="function"/>raptor_new_iostream_to_string ()</title>
<indexterm><primary>raptor_new_iostream_to_string</primary></indexterm><programlisting><link linkend="raptor-iostream">raptor_iostream</link>* raptor_new_iostream_to_string
                                            (<link linkend="void">void</link> **string_p,
                                             <link linkend="size-t">size_t</link> *length_p,
                                             <link linkend="void">void</link>* (*malloc_handler) (size_t size));</programlisting>
<para>
Constructor - create a new iostream writing to a string.
</para>
<para>
If <parameter>malloc_handler</parameter> is null, raptor will allocate it using it's
own memory allocator.  *<parameter>string_p</parameter> is set to NULL on failure (and
*<parameter>length_p</parameter> to 0 if <parameter>length_p</parameter> is not NULL).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>string_p</parameter>&nbsp;:</term>
<listitem><simpara> pointer to location to hold string
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>length_p</parameter>&nbsp;:</term>
<listitem><simpara> pointer to location to hold length of string (or NULL)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>malloc_handler</parameter>&nbsp;:</term>
<listitem><simpara> pointer to malloc to use to make string (or NULL)
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> new <link linkend="raptor-iostream"><type>raptor_iostream</type></link> object or NULL on failure
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-free-iostream" role="function"/>raptor_free_iostream ()</title>
<indexterm><primary>raptor_free_iostream</primary></indexterm><programlisting><link linkend="void">void</link>        raptor_free_iostream            (<link linkend="raptor-iostream">raptor_iostream</link> *iostr);</programlisting>
<para>
Destructor - destroy an iostream.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iostr</parameter>&nbsp;:</term>
<listitem><simpara> iostream object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-write-bytes" role="function"/>raptor_iostream_write_bytes ()</title>
<indexterm><primary>raptor_iostream_write_bytes</primary></indexterm><programlisting><link linkend="int">int</link>         raptor_iostream_write_bytes     (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             const <link linkend="void">void</link> *ptr,
                                             <link linkend="size-t">size_t</link> size,
                                             <link linkend="size-t">size_t</link> nmemb);</programlisting>
<para>
Write bytes to the iostream.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iostr</parameter>&nbsp;:</term>
<listitem><simpara> raptor iostream
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ptr</parameter>&nbsp;:</term>
<listitem><simpara> start of objects to write
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&nbsp;:</term>
<listitem><simpara> size of object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>nmemb</parameter>&nbsp;:</term>
<listitem><simpara> number of objects
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> number of objects written or less than nmemb or 0 on failure
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-write-byte" role="function"/>raptor_iostream_write_byte ()</title>
<indexterm><primary>raptor_iostream_write_byte</primary></indexterm><programlisting><link linkend="int">int</link>         raptor_iostream_write_byte      (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             const <link linkend="int">int</link> byte);</programlisting>
<para>
Write a byte to the iostream.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iostr</parameter>&nbsp;:</term>
<listitem><simpara> raptor iostream
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>byte</parameter>&nbsp;:</term>
<listitem><simpara> byte to write
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> non-0 on failure
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-write-end" role="function"/>raptor_iostream_write_end ()</title>
<indexterm><primary>raptor_iostream_write_end</primary></indexterm><programlisting><link linkend="void">void</link>        raptor_iostream_write_end       (<link linkend="raptor-iostream">raptor_iostream</link> *iostr);</programlisting>
<para>
End writing to the iostream.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iostr</parameter>&nbsp;:</term>
<listitem><simpara> raptor iostream
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-write-string" role="function"/>raptor_iostream_write_string ()</title>
<indexterm><primary>raptor_iostream_write_string</primary></indexterm><programlisting><link linkend="int">int</link>         raptor_iostream_write_string    (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             const <link linkend="void">void</link> *string);</programlisting>
<para>
Write a NULL-terminated string to the iostream.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iostr</parameter>&nbsp;:</term>
<listitem><simpara> raptor iostream
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>string</parameter>&nbsp;:</term>
<listitem><simpara> string
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> non-0 on failure
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-write-counted-string" role="function"/>raptor_iostream_write_counted_string ()</title>
<indexterm><primary>raptor_iostream_write_counted_string</primary></indexterm><programlisting><link linkend="int">int</link>         raptor_iostream_write_counted_string
                                            (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             const <link linkend="void">void</link> *string,
                                             <link linkend="size-t">size_t</link> len);</programlisting>
<para>
Write a counted string to the iostream.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iostr</parameter>&nbsp;:</term>
<listitem><simpara> raptor iostream
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>string</parameter>&nbsp;:</term>
<listitem><simpara> string
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&nbsp;:</term>
<listitem><simpara> string length
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> non-0 on failure
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-get-bytes-written-count" role="function"/>raptor_iostream_get_bytes_written_count ()</title>
<indexterm><primary>raptor_iostream_get_bytes_written_count</primary></indexterm><programlisting><link linkend="size-t">size_t</link>      raptor_iostream_get_bytes_written_count
                                            (<link linkend="raptor-iostream">raptor_iostream</link> *iostr);</programlisting>
<para>
Get the number of bytes written to the iostream.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iostr</parameter>&nbsp;:</term>
<listitem><simpara> raptor iostream
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> number of bytes written or 0 if non written so far
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-write-decimal" role="function"/>raptor_iostream_write_decimal ()</title>
<indexterm><primary>raptor_iostream_write_decimal</primary></indexterm><programlisting><link linkend="int">int</link>         raptor_iostream_write_decimal   (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             <link linkend="int">int</link> integer);</programlisting>
<para>
Write an integer in decimal to the iostream.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iostr</parameter>&nbsp;:</term>
<listitem><simpara> raptor iostream
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>integer</parameter>&nbsp;:</term>
<listitem><simpara> integer to format as decimal
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> non-0 on failure
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-format-hexadecimal" role="function"/>raptor_iostream_format_hexadecimal ()</title>
<indexterm><primary>raptor_iostream_format_hexadecimal</primary></indexterm><programlisting><link linkend="int">int</link>         raptor_iostream_format_hexadecimal
                                            (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             unsigned <link linkend="int">int</link> integer,
                                             <link linkend="int">int</link> width);</programlisting>
<para>
Write an integer in hexadecimal to the iostream.
</para>
<para>
Always 0-fills the entire field and writes in uppercase A-F</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iostr</parameter>&nbsp;:</term>
<listitem><simpara> raptor iostream
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>integer</parameter>&nbsp;:</term>
<listitem><simpara> unsigned integer to format as hexadecimal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara> field width
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> non-0 on failure
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-write-stringbuffer" role="function"/>raptor_iostream_write_stringbuffer ()</title>
<indexterm><primary>raptor_iostream_write_stringbuffer</primary></indexterm><programlisting><link linkend="int">int</link>         raptor_iostream_write_stringbuffer
                                            (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             <link linkend="raptor-stringbuffer">raptor_stringbuffer</link> *sb);</programlisting>
<para>
Write a stringbuffer to an iostream.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iostr</parameter>&nbsp;:</term>
<listitem><simpara> raptor iostream
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>sb</parameter>&nbsp;:</term>
<listitem><simpara> <link linkend="raptor-stringbuffer"><type>raptor_stringbuffer</type></link> to write
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> non-0 on failure
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-write-string-ntriples" role="function"/>raptor_iostream_write_string_ntriples ()</title>
<indexterm><primary>raptor_iostream_write_string_ntriples</primary></indexterm><programlisting><link linkend="int">int</link>         raptor_iostream_write_string_ntriples
                                            (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             unsigned <link linkend="char">char</link> *string,
                                             <link linkend="size-t">size_t</link> len,
                                             const <link linkend="char">char</link> delim);</programlisting>
<para>
Write an UTF-8 string using N-Triples escapes to an iostream.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iostr</parameter>&nbsp;:</term>
<listitem><simpara> <link linkend="raptor-iostream"><type>raptor_iostream</type></link> to write to
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>string</parameter>&nbsp;:</term>
<listitem><simpara> UTF-8 string to write
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&nbsp;:</term>
<listitem><simpara> length of UTF-8 string
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>delim</parameter>&nbsp;:</term>
<listitem><simpara> Terminating delimiter character for string (such as " or &gt;)
or \0 for no escaping.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> non-0 on failure such as bad UTF-8 encoding.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="raptor-iostream-write-statement-ntriples" role="function"/>raptor_iostream_write_statement_ntriples ()</title>
<indexterm><primary>raptor_iostream_write_statement_ntriples</primary></indexterm><programlisting><link linkend="void">void</link>        raptor_iostream_write_statement_ntriples
                                            (<link linkend="raptor-iostream">raptor_iostream</link> *iostr,
                                             const <link linkend="raptor-statement">raptor_statement</link> *statement);</programlisting>
<para>
Write a <link linkend="raptor-statement"><type>raptor_statement</type></link> formatted in N-Triples format to a <link linkend="raptor-iostream"><type>raptor_iostream</type></link></para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>iostr</parameter>&nbsp;:</term>
<listitem><simpara> raptor iosteram
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>statement</parameter>&nbsp;:</term>
<listitem><simpara> statement to write
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>