1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 08:38:39 +02:00
audacity/lib-src/libraptor/docs/html/raptor-section-iostream.html
2010-01-24 09:19:39 +00:00

1323 lines
61 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>I/O Stream</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="Raptor RDF Syntax Parsing and Serializing Library Manual">
<link rel="up" href="reference-manual.html" title="Part II. Raptor Reference Manual">
<link rel="prev" href="raptor-section-feature.html" title="Features">
<link rel="next" href="raptor-section-locator.html" title="Locator">
<meta name="generator" content="GTK-Doc V1.10 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="introduction.html" title="Raptor Overview">
<link rel="part" href="tutorial.html" title="Part I. Raptor Tutorial">
<link rel="chapter" href="tutorial-initialising-finishing.html" title="Initialising and Finishing using the Library">
<link rel="chapter" href="tutorial-querying-functionality.html" title="Listing built-in functionality">
<link rel="chapter" href="tutorial-parsing.html" title="Parsing syntaxes to RDF Triples">
<link rel="chapter" href="tutorial-serializing.html" title="Serializing RDF triples to a syntax">
<link rel="part" href="reference-manual.html" title="Part II. Raptor Reference Manual">
<link rel="chapter" href="raptor-parsers.html" title="Parsers in Raptor (syntax to triples)">
<link rel="chapter" href="raptor-serializers.html" title="Serializers in Raptor (triples to syntax)">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="raptor-section-feature.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference-manual.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Raptor RDF Syntax Parsing and Serializing Library Manual</th>
<td><a accesskey="n" href="raptor-section-locator.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#raptor-section-iostream.synopsis" class="shortcut">Top</a>
 | 
<a href="#raptor-section-iostream.description" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="raptor-section-iostream"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="raptor-section-iostream.top_of_page"></a>I/O Stream</span></h2>
<p>I/O Stream — Providing streaming I/O writing to files, strings or user code.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="raptor-section-iostream.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
typedef <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>;
int (<a class="link" href="raptor-section-iostream.html#raptor-iostream-init-func" title="raptor_iostream_init_func ()">*raptor_iostream_init_func</a>) (void *context);
void (<a class="link" href="raptor-section-iostream.html#raptor-iostream-finish-func" title="raptor_iostream_finish_func ()">*raptor_iostream_finish_func</a>) (void *context);
int (<a class="link" href="raptor-section-iostream.html#raptor-iostream-write-byte-func" title="raptor_iostream_write_byte_func ()">*raptor_iostream_write_byte_func</a>) (void *context,
const int byte);
int (<a class="link" href="raptor-section-iostream.html#raptor-iostream-write-bytes-func" title="raptor_iostream_write_bytes_func ()">*raptor_iostream_write_bytes_func</a>) (void *context,
const void *ptr,
size_t size,
size_t nmemb);
void (<a class="link" href="raptor-section-iostream.html#raptor-iostream-write-end-func" title="raptor_iostream_write_end_func ()">*raptor_iostream_write_end_func</a>) (void *context);
int (<a class="link" href="raptor-section-iostream.html#raptor-iostream-read-bytes-func" title="raptor_iostream_read_bytes_func ()">*raptor_iostream_read_bytes_func</a>) (void *context,
void *ptr,
size_t size,
size_t nmemb);
int (<a class="link" href="raptor-section-iostream.html#raptor-iostream-read-eof-func" title="raptor_iostream_read_eof_func ()">*raptor_iostream_read_eof_func</a>) (void *context);
<a class="link" href="raptor-section-iostream.html#raptor-iostream-handler" title="raptor_iostream_handler">raptor_iostream_handler</a>;
<a class="link" href="raptor-section-iostream.html#raptor-iostream-handler2" title="raptor_iostream_handler2">raptor_iostream_handler2</a>;
<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* <a class="link" href="raptor-section-iostream.html#raptor-new-iostream-from-handler2" title="raptor_new_iostream_from_handler2 ()">raptor_new_iostream_from_handler2</a> (void *user_data,
const <a class="link" href="raptor-section-iostream.html#raptor-iostream-handler2" title="raptor_iostream_handler2">raptor_iostream_handler2</a> * const handler2);
<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* <a class="link" href="raptor-section-iostream.html#raptor-new-iostream-from-handler" title="raptor_new_iostream_from_handler ()">raptor_new_iostream_from_handler</a> (void *context,
const <a class="link" href="raptor-section-iostream.html#raptor-iostream-handler" title="raptor_iostream_handler">raptor_iostream_handler</a> *handler);
<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* <a class="link" href="raptor-section-iostream.html#raptor-new-iostream-from-sink" title="raptor_new_iostream_from_sink ()">raptor_new_iostream_from_sink</a> (void);
<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* <a class="link" href="raptor-section-iostream.html#raptor-new-iostream-from-filename" title="raptor_new_iostream_from_filename ()">raptor_new_iostream_from_filename</a> (const char *filename);
<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* <a class="link" href="raptor-section-iostream.html#raptor-new-iostream-from-file-handle" title="raptor_new_iostream_from_file_handle ()">raptor_new_iostream_from_file_handle</a>
(FILE *handle);
<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* <a class="link" href="raptor-section-iostream.html#raptor-new-iostream-from-string" title="raptor_new_iostream_from_string ()">raptor_new_iostream_from_string</a> (void *string,
size_t length);
<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* <a class="link" href="raptor-section-iostream.html#raptor-new-iostream-to-sink" title="raptor_new_iostream_to_sink ()">raptor_new_iostream_to_sink</a> (void);
<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* <a class="link" href="raptor-section-iostream.html#raptor-new-iostream-to-filename" title="raptor_new_iostream_to_filename ()">raptor_new_iostream_to_filename</a> (const char *filename);
<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* <a class="link" href="raptor-section-iostream.html#raptor-new-iostream-to-file-handle" title="raptor_new_iostream_to_file_handle ()">raptor_new_iostream_to_file_handle</a> (FILE *handle);
<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* <a class="link" href="raptor-section-iostream.html#raptor-new-iostream-to-string" title="raptor_new_iostream_to_string ()">raptor_new_iostream_to_string</a> (void **string_p,
size_t *length_p,
void* (malloc_handlersize_t size) ());
void <a class="link" href="raptor-section-iostream.html#raptor-free-iostream" title="raptor_free_iostream ()">raptor_free_iostream</a> (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr);
int <a class="link" href="raptor-section-iostream.html#raptor-iostream-format-hexadecimal" title="raptor_iostream_format_hexadecimal ()">raptor_iostream_format_hexadecimal</a> (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
unsigned int integer,
int width);
size_t <a class="link" href="raptor-section-iostream.html#raptor-iostream-get-bytes-written-count" title="raptor_iostream_get_bytes_written_count ()">raptor_iostream_get_bytes_written_count</a>
(<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr);
int <a class="link" href="raptor-section-iostream.html#raptor-iostream-read-bytes" title="raptor_iostream_read_bytes ()">raptor_iostream_read_bytes</a> (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
void *ptr,
size_t size,
size_t nmemb);
int <a class="link" href="raptor-section-iostream.html#raptor-iostream-read-eof" title="raptor_iostream_read_eof ()">raptor_iostream_read_eof</a> (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr);
unsigned long <a class="link" href="raptor-section-iostream.html#raptor-iostream-tell" title="raptor_iostream_tell ()">raptor_iostream_tell</a> (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr);
int <a class="link" href="raptor-section-iostream.html#raptor-iostream-write-byte" title="raptor_iostream_write_byte ()">raptor_iostream_write_byte</a> (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
const int byte);
int <a class="link" href="raptor-section-iostream.html#raptor-iostream-write-bytes" title="raptor_iostream_write_bytes ()">raptor_iostream_write_bytes</a> (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
const void *ptr,
size_t size,
size_t nmemb);
int <a class="link" href="raptor-section-iostream.html#raptor-iostream-write-counted-string" title="raptor_iostream_write_counted_string ()">raptor_iostream_write_counted_string</a>
(<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
const void *string,
size_t len);
int <a class="link" href="raptor-section-iostream.html#raptor-iostream-write-decimal" title="raptor_iostream_write_decimal ()">raptor_iostream_write_decimal</a> (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
int integer);
void <a class="link" href="raptor-section-iostream.html#raptor-iostream-write-end" title="raptor_iostream_write_end ()">raptor_iostream_write_end</a> (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr);
void <a class="link" href="raptor-section-iostream.html#raptor-iostream-write-statement-ntriples" title="raptor_iostream_write_statement_ntriples ()">raptor_iostream_write_statement_ntriples</a>
(<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
const <a class="link" href="raptor-section-triples.html#raptor-statement" title="raptor_statement">raptor_statement</a> *statement);
int <a class="link" href="raptor-section-iostream.html#raptor-iostream-write-string" title="raptor_iostream_write_string ()">raptor_iostream_write_string</a> (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
const void *string);
int <a class="link" href="raptor-section-iostream.html#raptor-iostream-write-string-ntriples" title="raptor_iostream_write_string_ntriples ()">raptor_iostream_write_string_ntriples</a>
(<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
unsigned char *string,
size_t len,
const char delim);
int <a class="link" href="raptor-section-iostream.html#raptor-iostream-write-string-python" title="raptor_iostream_write_string_python ()">raptor_iostream_write_string_python</a> (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
unsigned char *string,
size_t len,
const char delim,
int flags);
void <a class="link" href="raptor-section-iostream.html#raptor-iostream-write-string-turtle" title="raptor_iostream_write_string_turtle ()">raptor_iostream_write_string_turtle</a> (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
unsigned char *string,
size_t len);
int <a class="link" href="raptor-section-iostream.html#raptor-iostream-write-stringbuffer" title="raptor_iostream_write_stringbuffer ()">raptor_iostream_write_stringbuffer</a> (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
<a class="link" href="raptor-section-stringbuffer.html#raptor-stringbuffer" title="raptor_stringbuffer">raptor_stringbuffer</a> *sb);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="raptor-section-iostream.description"></a><h2>Description</h2>
<p>
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 <a class="link" href="raptor-section-stringbuffer.html#raptor-stringbuffer" title="raptor_stringbuffer"><span class="type">raptor_stringbuffer</span></a>), system
file handles (<code class="literal">FILE*</code>) or to a user function.
</p>
</div>
<div class="refsect1" lang="en">
<a name="raptor-section-iostream.details"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="raptor-iostream"></a><h3>raptor_iostream</h3>
<pre class="programlisting">raptor_iostream* raptor_iostream;
</pre>
<p>
Raptor I/O Stream class</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-init-func"></a><h3>raptor_iostream_init_func ()</h3>
<pre class="programlisting">int (*raptor_iostream_init_func) (void *context);</pre>
<p>
Handler function for <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> initialising.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
<td> stream context data
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non-0 on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-finish-func"></a><h3>raptor_iostream_finish_func ()</h3>
<pre class="programlisting">void (*raptor_iostream_finish_func) (void *context);</pre>
<p>
Handler function for <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> terminating.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
<td> stream context data
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-write-byte-func"></a><h3>raptor_iostream_write_byte_func ()</h3>
<pre class="programlisting">int (*raptor_iostream_write_byte_func) (void *context,
const int byte);</pre>
<p>
Handler function for implementing <a class="link" href="raptor-section-iostream.html#raptor-iostream-write-byte" title="raptor_iostream_write_byte ()"><code class="function">raptor_iostream_write_byte()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
<td> stream context data
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>byte</code></em> :</span></p></td>
<td> byte to write
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non-0 on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-write-bytes-func"></a><h3>raptor_iostream_write_bytes_func ()</h3>
<pre class="programlisting">int (*raptor_iostream_write_bytes_func) (void *context,
const void *ptr,
size_t size,
size_t nmemb);</pre>
<p>
Handler function for implementing <a class="link" href="raptor-section-iostream.html#raptor-iostream-write-bytes" title="raptor_iostream_write_bytes ()"><code class="function">raptor_iostream_write_bytes()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
<td> stream context data
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ptr</code></em> :</span></p></td>
<td> pointer to bytes to write
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
<td> size of item
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>nmemb</code></em> :</span></p></td>
<td> number of items
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non-0 on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-write-end-func"></a><h3>raptor_iostream_write_end_func ()</h3>
<pre class="programlisting">void (*raptor_iostream_write_end_func) (void *context);</pre>
<p>
Handler function for implementing <a class="link" href="raptor-section-iostream.html#raptor-iostream-write-end" title="raptor_iostream_write_end ()"><code class="function">raptor_iostream_write_end()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
<td> stream context data
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-read-bytes-func"></a><h3>raptor_iostream_read_bytes_func ()</h3>
<pre class="programlisting">int (*raptor_iostream_read_bytes_func) (void *context,
void *ptr,
size_t size,
size_t nmemb);</pre>
<p>
Handler function for implementing <a class="link" href="raptor-section-iostream.html#raptor-iostream-read-bytes" title="raptor_iostream_read_bytes ()"><code class="function">raptor_iostream_read_bytes()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
<td> stream context data
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ptr</code></em> :</span></p></td>
<td> pointer to buffer to read into
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
<td> size of buffer
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>nmemb</code></em> :</span></p></td>
<td> number of items
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> number of items read, 0 or &lt; <em class="parameter"><code>size</code></em> on EOF, &lt;0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-read-eof-func"></a><h3>raptor_iostream_read_eof_func ()</h3>
<pre class="programlisting">int (*raptor_iostream_read_eof_func) (void *context);</pre>
<p>
Handler function for implementing <a class="link" href="raptor-section-iostream.html#raptor-iostream-read-eof" title="raptor_iostream_read_eof ()"><code class="function">raptor_iostream_read_eof()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
<td> stream context data
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non-0 if EOF
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-handler"></a><h3>raptor_iostream_handler</h3>
<pre class="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;
</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">raptor_iostream_handler</code> is deprecated and should not be used in newly-written code. Use <a class="link" href="raptor-section-iostream.html#raptor-iostream-handler2" title="raptor_iostream_handler2"><span class="type">raptor_iostream_handler2</span></a></p>
</div>
<p>
I/O stream implementation handler structure.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a class="link" href="raptor-section-iostream.html#raptor-iostream-init-func" title="raptor_iostream_init_func ()">raptor_iostream_init_func</a> <em class="structfield"><code>init</code></em>;</span></p></td>
<td> initialisation handler - optional, called at most once
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="raptor-section-iostream.html#raptor-iostream-finish-func" title="raptor_iostream_finish_func ()">raptor_iostream_finish_func</a> <em class="structfield"><code>finish</code></em>;</span></p></td>
<td> finishing handler - optional, called at most once
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="raptor-section-iostream.html#raptor-iostream-write-byte-func" title="raptor_iostream_write_byte_func ()">raptor_iostream_write_byte_func</a> <em class="structfield"><code>write_byte</code></em>;</span></p></td>
<td> write byte handler - required (for writing)
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="raptor-section-iostream.html#raptor-iostream-write-bytes-func" title="raptor_iostream_write_bytes_func ()">raptor_iostream_write_bytes_func</a> <em class="structfield"><code>write_bytes</code></em>;</span></p></td>
<td> write bytes handler - required (for writing)
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="raptor-section-iostream.html#raptor-iostream-write-end-func" title="raptor_iostream_write_end_func ()">raptor_iostream_write_end_func</a> <em class="structfield"><code>write_end</code></em>;</span></p></td>
<td> write end handler - optional (for writing), called at most once
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-handler2"></a><h3>raptor_iostream_handler2</h3>
<pre class="programlisting">typedef struct {
int version;
/* V1 functions */
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;
/* V2 functions */
raptor_iostream_read_bytes_func read_bytes;
raptor_iostream_read_eof_func read_eof;
} raptor_iostream_handler2;
</pre>
<p>
I/O stream implementation handler structure.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">int <em class="structfield"><code>version</code></em>;</span></p></td>
<td> interface version. Presently 1 or 2.
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="raptor-section-iostream.html#raptor-iostream-init-func" title="raptor_iostream_init_func ()">raptor_iostream_init_func</a> <em class="structfield"><code>init</code></em>;</span></p></td>
<td> initialisation handler - optional, called at most once (V1)
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="raptor-section-iostream.html#raptor-iostream-finish-func" title="raptor_iostream_finish_func ()">raptor_iostream_finish_func</a> <em class="structfield"><code>finish</code></em>;</span></p></td>
<td> finishing handler - optional, called at most once (V1)
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="raptor-section-iostream.html#raptor-iostream-write-byte-func" title="raptor_iostream_write_byte_func ()">raptor_iostream_write_byte_func</a> <em class="structfield"><code>write_byte</code></em>;</span></p></td>
<td> write byte handler - required (for writing) (V1)
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="raptor-section-iostream.html#raptor-iostream-write-bytes-func" title="raptor_iostream_write_bytes_func ()">raptor_iostream_write_bytes_func</a> <em class="structfield"><code>write_bytes</code></em>;</span></p></td>
<td> write bytes handler - required (for writing) (V1)
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="raptor-section-iostream.html#raptor-iostream-write-end-func" title="raptor_iostream_write_end_func ()">raptor_iostream_write_end_func</a> <em class="structfield"><code>write_end</code></em>;</span></p></td>
<td> write end handler - optional (for writing), called at most once (V1)
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="raptor-section-iostream.html#raptor-iostream-read-bytes-func" title="raptor_iostream_read_bytes_func ()">raptor_iostream_read_bytes_func</a> <em class="structfield"><code>read_bytes</code></em>;</span></p></td>
<td> read bytes handler - required (for reading) (V2)
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="raptor-section-iostream.html#raptor-iostream-read-eof-func" title="raptor_iostream_read_eof_func ()">raptor_iostream_read_eof_func</a> <em class="structfield"><code>read_eof</code></em>;</span></p></td>
<td> read EOF handler - required (for reading) (V2)
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-new-iostream-from-handler2"></a><h3>raptor_new_iostream_from_handler2 ()</h3>
<pre class="programlisting"><a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* raptor_new_iostream_from_handler2 (void *user_data,
const <a class="link" href="raptor-section-iostream.html#raptor-iostream-handler2" title="raptor_iostream_handler2">raptor_iostream_handler2</a> * const handler2);</pre>
<p>
Create a new iostream over a user-defined handler</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td> pointer to context information to pass in to calls
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>handler2</code></em> :</span></p></td>
<td> pointer to handler methods
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> new <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> object or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-new-iostream-from-handler"></a><h3>raptor_new_iostream_from_handler ()</h3>
<pre class="programlisting"><a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* raptor_new_iostream_from_handler (void *context,
const <a class="link" href="raptor-section-iostream.html#raptor-iostream-handler" title="raptor_iostream_handler">raptor_iostream_handler</a> *handler);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">raptor_new_iostream_from_handler</code> is deprecated and should not be used in newly-written code. Use <code class="function">raptor_new_iosteram_from_handler2()</code></p>
</div>
<p>
Create a new iostream over a user-defined handler.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
<td> pointer to context information to pass in to calls
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>handler</code></em> :</span></p></td>
<td> pointer to handler methods
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> new <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> object or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-new-iostream-from-sink"></a><h3>raptor_new_iostream_from_sink ()</h3>
<pre class="programlisting"><a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* raptor_new_iostream_from_sink (void);</pre>
<p>
Create a new read iostream from a sink.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> new <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> object or NULL on failure
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-new-iostream-from-filename"></a><h3>raptor_new_iostream_from_filename ()</h3>
<pre class="programlisting"><a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* raptor_new_iostream_from_filename (const char *filename);</pre>
<p>
Constructor - create a new iostream reading from a filename.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
<td> Input filename to open and read from
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> new <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> object or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-new-iostream-from-file-handle"></a><h3>raptor_new_iostream_from_file_handle ()</h3>
<pre class="programlisting"><a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* raptor_new_iostream_from_file_handle
(FILE *handle);</pre>
<p>
Constructor - create a new iostream reading from a file_handle.
</p>
<p>
The <em class="parameter"><code>handle</code></em> must already be open for reading.
NOTE: This does not fclose the <em class="parameter"><code>handle</code></em> when it is finished.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> Input file_handle to open and read from
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> new <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> object or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-new-iostream-from-string"></a><h3>raptor_new_iostream_from_string ()</h3>
<pre class="programlisting"><a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* raptor_new_iostream_from_string (void *string,
size_t length);</pre>
<p>
Constructor - create a new iostream reading from a string.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td> pointer to string
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td> length of string
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> new <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> object or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-new-iostream-to-sink"></a><h3>raptor_new_iostream_to_sink ()</h3>
<pre class="programlisting"><a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* raptor_new_iostream_to_sink (void);</pre>
<p>
Create a new write iostream to a sink.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> new <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> object or NULL on failure
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-new-iostream-to-filename"></a><h3>raptor_new_iostream_to_filename ()</h3>
<pre class="programlisting"><a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* raptor_new_iostream_to_filename (const char *filename);</pre>
<p>
Constructor - create a new iostream writing to a filename.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
<td> Output filename to open and write to
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> new <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> object or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-new-iostream-to-file-handle"></a><h3>raptor_new_iostream_to_file_handle ()</h3>
<pre class="programlisting"><a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* raptor_new_iostream_to_file_handle (FILE *handle);</pre>
<p>
Constructor - create a new iostream writing to a FILE*.
</p>
<p>
The <em class="parameter"><code>handle</code></em> must already be open for writing.
NOTE: This does not fclose the <em class="parameter"><code>handle</code></em> when it is finished.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>handle</code></em> :</span></p></td>
<td> FILE* handle to write to
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> new <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> object or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-new-iostream-to-string"></a><h3>raptor_new_iostream_to_string ()</h3>
<pre class="programlisting"><a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a>* raptor_new_iostream_to_string (void **string_p,
size_t *length_p,
void* (malloc_handlersize_t size) ());</pre>
<p>
Constructor - create a new iostream writing to a string.
</p>
<p>
If <em class="parameter"><code>malloc_handler</code></em> is null, raptor will allocate it using it's
own memory allocator. *<em class="parameter"><code>string_p</code></em> is set to NULL on failure (and
*<em class="parameter"><code>length_p</code></em> to 0 if <em class="parameter"><code>length_p</code></em> is not NULL).</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>string_p</code></em> :</span></p></td>
<td> pointer to location to hold string
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length_p</code></em> :</span></p></td>
<td> pointer to location to hold length of string (or NULL)
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>malloc_handler</code></em> :</span></p></td>
<td> pointer to malloc to use to make string (or NULL)
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> new <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> object or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-free-iostream"></a><h3>raptor_free_iostream ()</h3>
<pre class="programlisting">void raptor_free_iostream (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr);</pre>
<p>
Destructor - destroy an iostream.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> iostream object
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-format-hexadecimal"></a><h3>raptor_iostream_format_hexadecimal ()</h3>
<pre class="programlisting">int raptor_iostream_format_hexadecimal (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
unsigned int integer,
int width);</pre>
<p>
Write an integer in hexadecimal to the iostream.
</p>
<p>
Always 0-fills the entire field and writes in uppercase A-F</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>integer</code></em> :</span></p></td>
<td> unsigned integer to format as hexadecimal
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td> field width
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-get-bytes-written-count"></a><h3>raptor_iostream_get_bytes_written_count ()</h3>
<pre class="programlisting">size_t raptor_iostream_get_bytes_written_count
(<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">raptor_iostream_get_bytes_written_count</code> is deprecated and should not be used in newly-written code. Use <a class="link" href="raptor-section-iostream.html#raptor-iostream-tell" title="raptor_iostream_tell ()"><code class="function">raptor_iostream_tell()</code></a></p>
</div>
<p>
Get the number of bytes written to the iostream.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> number of bytes written or 0 if none written so far
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-read-bytes"></a><h3>raptor_iostream_read_bytes ()</h3>
<pre class="programlisting">int raptor_iostream_read_bytes (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
void *ptr,
size_t size,
size_t nmemb);</pre>
<p>
Read bytes to the iostream.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ptr</code></em> :</span></p></td>
<td> start of buffer to read objects into
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
<td> size of object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>nmemb</code></em> :</span></p></td>
<td> number of objects to read
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> number of objects read, 0 or less than nmemb on EOF, &lt;0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-read-eof"></a><h3>raptor_iostream_read_eof ()</h3>
<pre class="programlisting">int raptor_iostream_read_eof (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr);</pre>
<p>
Check if an read iostream has ended</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> raptor read iostream
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non-0 if EOF (or not a read iostream)
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-tell"></a><h3>raptor_iostream_tell ()</h3>
<pre class="programlisting">unsigned long raptor_iostream_tell (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr);</pre>
<p>
Get the offset in the iostream.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> offset in iostream
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-write-byte"></a><h3>raptor_iostream_write_byte ()</h3>
<pre class="programlisting">int raptor_iostream_write_byte (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
const int byte);</pre>
<p>
Write a byte to the iostream.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>byte</code></em> :</span></p></td>
<td> byte to write
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-write-bytes"></a><h3>raptor_iostream_write_bytes ()</h3>
<pre class="programlisting">int raptor_iostream_write_bytes (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
const void *ptr,
size_t size,
size_t nmemb);</pre>
<p>
Write bytes to the iostream.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ptr</code></em> :</span></p></td>
<td> start of objects to write
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em> :</span></p></td>
<td> size of object
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>nmemb</code></em> :</span></p></td>
<td> number of objects
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> number of objects written or less than nmemb or 0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-write-counted-string"></a><h3>raptor_iostream_write_counted_string ()</h3>
<pre class="programlisting">int raptor_iostream_write_counted_string
(<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
const void *string,
size_t len);</pre>
<p>
Write a counted string to the iostream.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td> string
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
<td> string length
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-write-decimal"></a><h3>raptor_iostream_write_decimal ()</h3>
<pre class="programlisting">int raptor_iostream_write_decimal (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
int integer);</pre>
<p>
Write an integer in decimal to the iostream.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>integer</code></em> :</span></p></td>
<td> integer to format as decimal
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-write-end"></a><h3>raptor_iostream_write_end ()</h3>
<pre class="programlisting">void raptor_iostream_write_end (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr);</pre>
<p>
End writing to the iostream.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> raptor iostream
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-write-statement-ntriples"></a><h3>raptor_iostream_write_statement_ntriples ()</h3>
<pre class="programlisting">void raptor_iostream_write_statement_ntriples
(<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
const <a class="link" href="raptor-section-triples.html#raptor-statement" title="raptor_statement">raptor_statement</a> *statement);</pre>
<p>
Write a <a class="link" href="raptor-section-triples.html#raptor-statement" title="raptor_statement"><span class="type">raptor_statement</span></a> formatted in N-Triples format to a <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a></p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> raptor iosteram
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>statement</code></em> :</span></p></td>
<td> statement to write
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-write-string"></a><h3>raptor_iostream_write_string ()</h3>
<pre class="programlisting">int raptor_iostream_write_string (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
const void *string);</pre>
<p>
Write a NULL-terminated string to the iostream.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td> string
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-write-string-ntriples"></a><h3>raptor_iostream_write_string_ntriples ()</h3>
<pre class="programlisting">int raptor_iostream_write_string_ntriples
(<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
unsigned char *string,
size_t len,
const char delim);</pre>
<p>
Write an UTF-8 string using N-Triples escapes to an iostream.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> to write to
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td> UTF-8 string to write
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
<td> length of UTF-8 string
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>delim</code></em> :</span></p></td>
<td> Terminating delimiter character for string (such as " or &gt;)
or \0 for no escaping.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non-0 on failure such as bad UTF-8 encoding.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-write-string-python"></a><h3>raptor_iostream_write_string_python ()</h3>
<pre class="programlisting">int raptor_iostream_write_string_python (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
unsigned char *string,
size_t len,
const char delim,
int flags);</pre>
<p>
Write a UTF-8 string using Python-style escapes (N-Triples, Turtle, JSON) to an iostream.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> to write to
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td> UTF-8 string to write
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
<td> length of UTF-8 string
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>delim</code></em> :</span></p></td>
<td> Terminating delimiter character for string (such as " or &gt;)
or \0 for no escaping.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td> flags 0=N-Triples mode, 1=Turtle (allow raw UTF-8), 2=Turtle long string (allow raw UTF-8), 3=JSON
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non-0 on failure such as bad UTF-8 encoding.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-write-string-turtle"></a><h3>raptor_iostream_write_string_turtle ()</h3>
<pre class="programlisting">void raptor_iostream_write_string_turtle (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
unsigned char *string,
size_t len);</pre>
<p>
Write an UTF-8 string using Turtle "longString" triple quoting to
an iostream.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> <a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream"><span class="type">raptor_iostream</span></a> to write to
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td> UTF-8 string to write
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
<td> length of UTF-8 string
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="raptor-iostream-write-stringbuffer"></a><h3>raptor_iostream_write_stringbuffer ()</h3>
<pre class="programlisting">int raptor_iostream_write_stringbuffer (<a class="link" href="raptor-section-iostream.html#raptor-iostream" title="raptor_iostream">raptor_iostream</a> *iostr,
<a class="link" href="raptor-section-stringbuffer.html#raptor-stringbuffer" title="raptor_stringbuffer">raptor_stringbuffer</a> *sb);</pre>
<p>
Write a stringbuffer to an iostream.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>iostr</code></em> :</span></p></td>
<td> raptor iostream
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sb</code></em> :</span></p></td>
<td> <a class="link" href="raptor-section-stringbuffer.html#raptor-stringbuffer" title="raptor_stringbuffer"><span class="type">raptor_stringbuffer</span></a> to write
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.10</div>
</body>
</html>