3
3
<title>liboggz: oggz_io.h File Reference</title>
4
4
<link href="doxygen.css" rel="stylesheet" type="text/css">
6
<!-- Generated by Doxygen 1.3.5 -->
7
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a></div>
6
<!-- Generated by Doxygen 1.4.0 -->
7
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="globals.html">Globals</a></div>
9
<a class="el" href="dir_000000.html">include</a> / <a class="el" href="dir_000001.html">oggz</a></div>
8
10
<h1>oggz_io.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
9
11
Overriding the functions used for input and output of raw data.
11
13
OggzIO provides a way of overriding the functions Oggz uses to access its raw input or output data. This is required in many situations where the raw stream cannot be accessed via stdio, but can be accessed by other means. This is typically useful within media frameworks, where accessing and moving around in the data is possible only using methods provided by the framework.<p>
12
The functions you provide for overriding IO will be used by Oggz whenever you call <a class="el" href="group__read__api.html#ga2">oggz_read()</a> or <a class="el" href="group__write__api.html#ga4">oggz_write()</a>. They will also be used repeatedly by Oggz when you call <a class="el" href="group__seek__api.html#ga8">oggz_seek()</a>.<p>
13
<dl compact><dt><b>Note:</b></dt><dd>Opening a file with <a class="el" href="oggz_8h.html#a5">oggz_open()</a> or <a class="el" href="oggz_8h.html#a6">oggz_open_stdio()</a> is equivalent to calling <a class="el" href="oggz_8h.html#a4">oggz_new()</a> and setting stdio based functions for data IO.</dd></dl>
18
<a href="oggz__io_8h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0>
14
The functions you provide for overriding IO will be used by Oggz whenever you call <a class="el" href="group__read__api.html#ga4">oggz_read()</a> or <a class="el" href="group__write__api.html#ga4">oggz_write()</a>. They will also be used repeatedly by Oggz when you call <a class="el" href="group__seek__api.html#ga3">oggz_seek()</a>.<p>
15
<dl compact><dt><b>Note:</b></dt><dd>Opening a file with <a class="el" href="oggz_8h.html#a2">oggz_open()</a> or <a class="el" href="oggz_8h.html#a3">oggz_open_stdio()</a> is equivalent to calling <a class="el" href="oggz_8h.html#a1">oggz_new()</a> and setting stdio based functions for data IO.</dd></dl>
20
<a href="oggz__io_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
20
<tr><td colspan=2><br><h2>Typedefs</h2></td></tr>
21
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef size_t(* </td><td class="memItemRight" valign=bottom><a class="el" href="oggz__io_8h.html#a0">OggzIORead</a> )(void *user_handle, void *buf, size_t n)</td></tr>
23
<tr><td class="mdescLeft"> </td><td class="mdescRight">This is the signature of a function which you provide for Oggz to call when it needs to acquire raw input data. <a href="#a0"></a><br><br></td></tr>
24
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef size_t(* </td><td class="memItemRight" valign=bottom><a class="el" href="oggz__io_8h.html#a1">OggzIOWrite</a> )(void *user_handle, void *buf, size_t n)</td></tr>
26
<tr><td class="mdescLeft"> </td><td class="mdescRight">This is the signature of a function which you provide for Oggz to call when it needs to output raw data. <a href="#a1"></a><br><br></td></tr>
27
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef int(* </td><td class="memItemRight" valign=bottom><a class="el" href="oggz__io_8h.html#a2">OggzIOSeek</a> )(void *user_handle, long offset, int whence)</td></tr>
29
<tr><td class="mdescLeft"> </td><td class="mdescRight">This is the signature of a function which you provide for Oggz to call when it needs to seek on the raw input or output data. <a href="#a2"></a><br><br></td></tr>
30
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef long(* </td><td class="memItemRight" valign=bottom><a class="el" href="oggz__io_8h.html#a3">OggzIOTell</a> )(void *user_handle)</td></tr>
32
<tr><td class="mdescLeft"> </td><td class="mdescRight">This is the signature of a function which you provide for Oggz to call when it needs to determine the current offset of the raw input or output data. <a href="#a3"></a><br><br></td></tr>
33
<tr><td class="memItemLeft" nowrap align=right valign=top>typedef int(* </td><td class="memItemRight" valign=bottom><a class="el" href="oggz__io_8h.html#a4">OggzIOFlush</a> )(void *user_handle)</td></tr>
35
<tr><td class="mdescLeft"> </td><td class="mdescRight">This is the signature of a function which you provide for Oggz to call when it needs to flush the output data. <a href="#a4"></a><br><br></td></tr>
36
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
37
<tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="oggz__io_8h.html#a5">oggz_io_set_read</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz, <a class="el" href="oggz__io_8h.html#a0">OggzIORead</a> read, void *user_handle)</td></tr>
39
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set a function for Oggz to call when it needs to read input data. <a href="#a5"></a><br><br></td></tr>
40
<tr><td class="memItemLeft" nowrap align=right valign=top>void * </td><td class="memItemRight" valign=bottom><a class="el" href="oggz__io_8h.html#a6">oggz_io_get_read_user_handle</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz)</td></tr>
42
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the user_handle associated with the function you have provided for reading input data. <a href="#a6"></a><br><br></td></tr>
43
<tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="oggz__io_8h.html#a7">oggz_io_set_write</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz, <a class="el" href="oggz__io_8h.html#a1">OggzIOWrite</a> write, void *user_handle)</td></tr>
45
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set a function for Oggz to call when it needs to write output data. <a href="#a7"></a><br><br></td></tr>
46
<tr><td class="memItemLeft" nowrap align=right valign=top>void * </td><td class="memItemRight" valign=bottom><a class="el" href="oggz__io_8h.html#a8">oggz_io_get_write_user_handle</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz)</td></tr>
48
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the user_handle associated with the function you have provided for writing output data. <a href="#a8"></a><br><br></td></tr>
49
<tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="oggz__io_8h.html#a9">oggz_io_set_seek</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz, <a class="el" href="oggz__io_8h.html#a2">OggzIOSeek</a> seek, void *user_handle)</td></tr>
51
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set a function for Oggz to call when it needs to seek on its raw data. <a href="#a9"></a><br><br></td></tr>
52
<tr><td class="memItemLeft" nowrap align=right valign=top>void * </td><td class="memItemRight" valign=bottom><a class="el" href="oggz__io_8h.html#a10">oggz_io_get_seek_user_handle</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz)</td></tr>
54
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the user_handle associated with the function you have provided for seeking on input or output data. <a href="#a10"></a><br><br></td></tr>
55
<tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="oggz__io_8h.html#a11">oggz_io_set_tell</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz, <a class="el" href="oggz__io_8h.html#a3">OggzIOTell</a> tell, void *user_handle)</td></tr>
57
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set a function for Oggz to call when it needs to determine the offset within its input data (if OGGZ_READ) or output data (if OGGZ_WRITE). <a href="#a11"></a><br><br></td></tr>
58
<tr><td class="memItemLeft" nowrap align=right valign=top>void * </td><td class="memItemRight" valign=bottom><a class="el" href="oggz__io_8h.html#a12">oggz_io_get_tell_user_handle</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz)</td></tr>
60
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the user_handle associated with the function you have provided for determining the current offset in input or output data. <a href="#a12"></a><br><br></td></tr>
61
<tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="oggz__io_8h.html#a13">oggz_io_set_flush</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz, <a class="el" href="oggz__io_8h.html#a4">OggzIOFlush</a> flush, void *user_handle)</td></tr>
63
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set a function for Oggz to call when it needs to flush its output. <a href="#a13"></a><br><br></td></tr>
64
<tr><td class="memItemLeft" nowrap align=right valign=top>void * </td><td class="memItemRight" valign=bottom><a class="el" href="oggz__io_8h.html#a14">oggz_io_get_flush_user_handle</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz)</td></tr>
66
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the user_handle associated with the function you have provided for flushing output. <a href="#a14"></a><br><br></td></tr>
22
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
23
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef size_t(* </td><td class="memItemRight" valign="bottom"><a class="el" href="oggz__io_8h.html#a0">OggzIORead</a> )(void *user_handle, void *buf, size_t n)</td></tr>
25
<tr><td class="mdescLeft"> </td><td class="mdescRight">This is the signature of a function which you provide for Oggz to call when it needs to acquire raw input data. <a href="#a0"></a><br></td></tr>
26
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef size_t(* </td><td class="memItemRight" valign="bottom"><a class="el" href="oggz__io_8h.html#a1">OggzIOWrite</a> )(void *user_handle, void *buf, size_t n)</td></tr>
28
<tr><td class="mdescLeft"> </td><td class="mdescRight">This is the signature of a function which you provide for Oggz to call when it needs to output raw data. <a href="#a1"></a><br></td></tr>
29
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="oggz__io_8h.html#a2">OggzIOSeek</a> )(void *user_handle, long offset, int whence)</td></tr>
31
<tr><td class="mdescLeft"> </td><td class="mdescRight">This is the signature of a function which you provide for Oggz to call when it needs to seek on the raw input or output data. <a href="#a2"></a><br></td></tr>
32
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef long(* </td><td class="memItemRight" valign="bottom"><a class="el" href="oggz__io_8h.html#a3">OggzIOTell</a> )(void *user_handle)</td></tr>
34
<tr><td class="mdescLeft"> </td><td class="mdescRight">This is the signature of a function which you provide for Oggz to call when it needs to determine the current offset of the raw input or output data. <a href="#a3"></a><br></td></tr>
35
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="oggz__io_8h.html#a4">OggzIOFlush</a> )(void *user_handle)</td></tr>
37
<tr><td class="mdescLeft"> </td><td class="mdescRight">This is the signature of a function which you provide for Oggz to call when it needs to flush the output data. <a href="#a4"></a><br></td></tr>
38
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
39
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="oggz__io_8h.html#a5">oggz_io_set_read</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz, <a class="el" href="oggz__io_8h.html#a0">OggzIORead</a> read, void *user_handle)</td></tr>
41
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set a function for Oggz to call when it needs to read input data. <a href="#a5"></a><br></td></tr>
42
<tr><td class="memItemLeft" nowrap align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="oggz__io_8h.html#a6">oggz_io_get_read_user_handle</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz)</td></tr>
44
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the user_handle associated with the function you have provided for reading input data. <a href="#a6"></a><br></td></tr>
45
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="oggz__io_8h.html#a7">oggz_io_set_write</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz, <a class="el" href="oggz__io_8h.html#a1">OggzIOWrite</a> write, void *user_handle)</td></tr>
47
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set a function for Oggz to call when it needs to write output data. <a href="#a7"></a><br></td></tr>
48
<tr><td class="memItemLeft" nowrap align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="oggz__io_8h.html#a8">oggz_io_get_write_user_handle</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz)</td></tr>
50
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the user_handle associated with the function you have provided for writing output data. <a href="#a8"></a><br></td></tr>
51
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="oggz__io_8h.html#a9">oggz_io_set_seek</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz, <a class="el" href="oggz__io_8h.html#a2">OggzIOSeek</a> seek, void *user_handle)</td></tr>
53
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set a function for Oggz to call when it needs to seek on its raw data. <a href="#a9"></a><br></td></tr>
54
<tr><td class="memItemLeft" nowrap align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="oggz__io_8h.html#a10">oggz_io_get_seek_user_handle</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz)</td></tr>
56
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the user_handle associated with the function you have provided for seeking on input or output data. <a href="#a10"></a><br></td></tr>
57
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="oggz__io_8h.html#a11">oggz_io_set_tell</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz, <a class="el" href="oggz__io_8h.html#a3">OggzIOTell</a> tell, void *user_handle)</td></tr>
59
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set a function for Oggz to call when it needs to determine the offset within its input data (if OGGZ_READ) or output data (if OGGZ_WRITE). <a href="#a11"></a><br></td></tr>
60
<tr><td class="memItemLeft" nowrap align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="oggz__io_8h.html#a12">oggz_io_get_tell_user_handle</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz)</td></tr>
62
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the user_handle associated with the function you have provided for determining the current offset in input or output data. <a href="#a12"></a><br></td></tr>
63
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="oggz__io_8h.html#a13">oggz_io_set_flush</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz, <a class="el" href="oggz__io_8h.html#a4">OggzIOFlush</a> flush, void *user_handle)</td></tr>
65
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set a function for Oggz to call when it needs to flush its output. <a href="#a13"></a><br></td></tr>
66
<tr><td class="memItemLeft" nowrap align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="oggz__io_8h.html#a14">oggz_io_get_flush_user_handle</a> (<a class="el" href="oggz_8h.html#a0">OGGZ</a> *oggz)</td></tr>
68
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieve the user_handle associated with the function you have provided for flushing output. <a href="#a14"></a><br></td></tr>
68
70
<hr><h2>Typedef Documentation</h2>
69
<a class="anchor" name="a4" doxytag="oggz_io.h::OggzIOFlush" ></a><p>
70
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
71
<a class="anchor" name="a4" doxytag="oggz_io.h::OggzIOFlush"></a><p>
72
<table class="mdTable" cellpadding="2" cellspacing="0">
73
75
<table cellpadding="0" cellspacing="0" border="0">
75
<td class="md" nowrap valign="top"> typedef int(* <a class="el" href="oggz__io_8h.html#a4">OggzIOFlush</a>)(void * user_handle)
77
<td class="md" nowrap valign="top">typedef int(* <a class="el" href="oggz__io_8h.html#a4">OggzIOFlush</a>)(void *user_handle) </td>
80
<table cellspacing=5 cellpadding=0 border=0>
83
<table cellspacing="5" cellpadding="0" border="0">
126
130
<dl compact><dt><b>Parameters:</b></dt><dd>
127
131
<table border="0" cellspacing="2" cellpadding="0">
128
<tr><td valign=top><em>user_handle</em> </td><td>A generic pointer you have provided earlier </td></tr>
129
<tr><td valign=top><em>n</em> </td><td>The length in bytes that Oggz wants to read </td></tr>
130
<tr><td valign=top><em>buf</em> </td><td>The buffer that you read data into </td></tr>
132
<tr><td valign="top"></td><td valign="top"><em>user_handle</em> </td><td>A generic pointer you have provided earlier </td></tr>
133
<tr><td valign="top"></td><td valign="top"><em>n</em> </td><td>The length in bytes that Oggz wants to read </td></tr>
134
<tr><td valign="top"></td><td valign="top"><em>buf</em> </td><td>The buffer that you read data into </td></tr>
133
137
<dl compact><dt><b>Return values:</b></dt><dd>
134
138
<table border="0" cellspacing="2" cellpadding="0">
135
<tr><td valign=top><em>> 0</em> </td><td>The number of bytes successfully read into the buffer </td></tr>
136
<tr><td valign=top><em>0</em> </td><td>to indicate that there is no more data to read (End of file) </td></tr>
137
<tr><td valign=top><em>< 0</em> </td><td>An error condition </td></tr>
139
<tr><td valign="top"></td><td valign="top"><em>> 0</em> </td><td>The number of bytes successfully read into the buffer </td></tr>
140
<tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>to indicate that there is no more data to read (End of file) </td></tr>
141
<tr><td valign="top"></td><td valign="top"><em>< 0</em> </td><td>An error condition </td></tr>
143
<a class="anchor" name="a2" doxytag="oggz_io.h::OggzIOSeek" ></a><p>
144
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
147
<a class="anchor" name="a2" doxytag="oggz_io.h::OggzIOSeek"></a><p>
148
<table class="mdTable" cellpadding="2" cellspacing="0">
146
150
<td class="mdRow">
147
151
<table cellpadding="0" cellspacing="0" border="0">
149
<td class="md" nowrap valign="top"> typedef int(* <a class="el" href="oggz__io_8h.html#a2">OggzIOSeek</a>)(void * user_handle, long offset, int whence)
153
<td class="md" nowrap valign="top">typedef int(* <a class="el" href="oggz__io_8h.html#a2">OggzIOSeek</a>)(void *user_handle, long offset, int whence) </td>
154
<table cellspacing=5 cellpadding=0 border=0>
159
<table cellspacing="5" cellpadding="0" border="0">
164
169
<dl compact><dt><b>Parameters:</b></dt><dd>
165
170
<table border="0" cellspacing="2" cellpadding="0">
166
<tr><td valign=top><em>user_handle</em> </td><td>A generic pointer you have provided earlier </td></tr>
167
<tr><td valign=top><em>offset</em> </td><td>The offset in bytes to seek to </td></tr>
168
<tr><td valign=top><em>whence</em> </td><td>SEEK_SET, SEEK_CUR or SEEK_END (as for stdio.h) </td></tr>
171
<tr><td valign="top"></td><td valign="top"><em>user_handle</em> </td><td>A generic pointer you have provided earlier </td></tr>
172
<tr><td valign="top"></td><td valign="top"><em>offset</em> </td><td>The offset in bytes to seek to </td></tr>
173
<tr><td valign="top"></td><td valign="top"><em>whence</em> </td><td>SEEK_SET, SEEK_CUR or SEEK_END (as for stdio.h) </td></tr>
171
176
<dl compact><dt><b>Return values:</b></dt><dd>
172
177
<table border="0" cellspacing="2" cellpadding="0">
173
<tr><td valign=top><em>>= 0</em> </td><td>The offset seeked to </td></tr>
174
<tr><td valign=top><em>< 0</em> </td><td>An error condition</td></tr>
178
<tr><td valign="top"></td><td valign="top"><em>>= 0</em> </td><td>The offset seeked to </td></tr>
179
<tr><td valign="top"></td><td valign="top"><em>< 0</em> </td><td>An error condition</td></tr>
177
182
<dl compact><dt><b>Note:</b></dt><dd>If you provide an OggzIOSeek function, you MUST also provide an OggzIOTell function, or else all your seeks will fail. </dd></dl>
181
<a class="anchor" name="a3" doxytag="oggz_io.h::OggzIOTell" ></a><p>
182
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
186
<a class="anchor" name="a3" doxytag="oggz_io.h::OggzIOTell"></a><p>
187
<table class="mdTable" cellpadding="2" cellspacing="0">
184
189
<td class="mdRow">
185
190
<table cellpadding="0" cellspacing="0" border="0">
187
<td class="md" nowrap valign="top"> typedef long(* <a class="el" href="oggz__io_8h.html#a3">OggzIOTell</a>)(void * user_handle)
192
<td class="md" nowrap valign="top">typedef long(* <a class="el" href="oggz__io_8h.html#a3">OggzIOTell</a>)(void *user_handle) </td>
192
<table cellspacing=5 cellpadding=0 border=0>
198
<table cellspacing="5" cellpadding="0" border="0">
237
244
<dl compact><dt><b>Parameters:</b></dt><dd>
238
245
<table border="0" cellspacing="2" cellpadding="0">
239
<tr><td valign=top><em>user_handle</em> </td><td>A generic pointer you have provided earlier </td></tr>
240
<tr><td valign=top><em>n</em> </td><td>The length in bytes of the data </td></tr>
241
<tr><td valign=top><em>buf</em> </td><td>A buffer containing data to write </td></tr>
246
<tr><td valign="top"></td><td valign="top"><em>user_handle</em> </td><td>A generic pointer you have provided earlier </td></tr>
247
<tr><td valign="top"></td><td valign="top"><em>n</em> </td><td>The length in bytes of the data </td></tr>
248
<tr><td valign="top"></td><td valign="top"><em>buf</em> </td><td>A buffer containing data to write </td></tr>
244
251
<dl compact><dt><b>Return values:</b></dt><dd>
245
252
<table border="0" cellspacing="2" cellpadding="0">
246
<tr><td valign=top><em>>= 0</em> </td><td>The number of bytes successfully written (may be less than <em>n</em> if a write error has occurred) </td></tr>
247
<tr><td valign=top><em>< 0</em> </td><td>An error condition </td></tr>
253
<tr><td valign="top"></td><td valign="top"><em>>= 0</em> </td><td>The number of bytes successfully written (may be less than <em>n</em> if a write error has occurred) </td></tr>
254
<tr><td valign="top"></td><td valign="top"><em>< 0</em> </td><td>An error condition </td></tr>
253
260
<hr><h2>Function Documentation</h2>
254
<a class="anchor" name="a14" doxytag="oggz_io.h::oggz_io_get_flush_user_handle" ></a><p>
255
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
261
<a class="anchor" name="a14" doxytag="oggz_io.h::oggz_io_get_flush_user_handle"></a><p>
262
<table class="mdTable" cellpadding="2" cellspacing="0">
257
264
<td class="mdRow">
258
265
<table cellpadding="0" cellspacing="0" border="0">
260
<td class="md" nowrap valign="top"> void* oggz_io_get_flush_user_handle </td>
267
<td class="md" nowrap valign="top">void* oggz_io_get_flush_user_handle </td>
261
268
<td class="md" valign="top">( </td>
262
269
<td class="md" nowrap valign="top"><a class="el" href="oggz_8h.html#a0">OGGZ</a> * </td>
263
270
<td class="mdname1" valign="top" nowrap> <em>oggz</em> </td>
264
271
<td class="md" valign="top"> ) </td>
265
272
<td class="md" nowrap></td>
272
<table cellspacing=5 cellpadding=0 border=0>
278
<table cellspacing="5" cellpadding="0" border="0">
482
483
The meaning of this is similar to that of fflush() in stdio.<p>
483
484
<dl compact><dt><b>Parameters:</b></dt><dd>
484
485
<table border="0" cellspacing="2" cellpadding="0">
485
<tr><td valign=top><em>oggz</em> </td><td>An OGGZ handle </td></tr>
486
<tr><td valign=top><em>flush</em> </td><td>Your flushing function </td></tr>
487
<tr><td valign=top><em>user_handle</em> </td><td>Any arbitrary data you wish to pass to the function </td></tr>
486
<tr><td valign="top"></td><td valign="top"><em>oggz</em> </td><td>An OGGZ handle </td></tr>
487
<tr><td valign="top"></td><td valign="top"><em>flush</em> </td><td>Your flushing function </td></tr>
488
<tr><td valign="top"></td><td valign="top"><em>user_handle</em> </td><td>Any arbitrary data you wish to pass to the function </td></tr>
490
491
<dl compact><dt><b>Return values:</b></dt><dd>
491
492
<table border="0" cellspacing="2" cellpadding="0">
492
<tr><td valign=top><em>0</em> </td><td>Success </td></tr>
493
<tr><td valign=top><em>OGGZ_ERR_BAD_OGGZ</em> </td><td><em>oggz</em> does not refer to an existing OGGZ </td></tr>
494
<tr><td valign=top><em>OGGZ_ERR_INVALID</em> </td><td>Operation not suitable for this OGGZ; <em>oggz</em> not open for writing. </td></tr>
493
<tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>Success </td></tr>
494
<tr><td valign="top"></td><td valign="top"><em>OGGZ_ERR_BAD_OGGZ</em> </td><td><em>oggz</em> does not refer to an existing OGGZ </td></tr>
495
<tr><td valign="top"></td><td valign="top"><em>OGGZ_ERR_INVALID</em> </td><td>Operation not suitable for this OGGZ; <em>oggz</em> not open for writing. </td></tr>
500
<a class="anchor" name="a5" doxytag="oggz_io.h::oggz_io_set_read" ></a><p>
501
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
501
<a class="anchor" name="a5" doxytag="oggz_io.h::oggz_io_set_read"></a><p>
502
<table class="mdTable" cellpadding="2" cellspacing="0">
503
504
<td class="mdRow">
504
505
<table cellpadding="0" cellspacing="0" border="0">
506
<td class="md" nowrap valign="top"> int oggz_io_set_read </td>
507
<td class="md" nowrap valign="top">int oggz_io_set_read </td>
507
508
<td class="md" valign="top">( </td>
508
509
<td class="md" nowrap valign="top"><a class="el" href="oggz_8h.html#a0">OGGZ</a> * </td>
509
510
<td class="mdname" nowrap> <em>oggz</em>, </td>
513
<td class="md" nowrap align="right"></td>
514
515
<td class="md" nowrap><a class="el" href="oggz__io_8h.html#a0">OggzIORead</a> </td>
515
516
<td class="mdname" nowrap> <em>read</em>, </td>
519
<td class="md" nowrap align="right"></td>
520
521
<td class="md" nowrap>void * </td>
521
522
<td class="mdname" nowrap> <em>user_handle</em></td>
525
526
<td class="md">) </td>
526
527
<td class="md" colspan="2"></td>
533
<table cellspacing=5 cellpadding=0 border=0>
533
<table cellspacing="5" cellpadding="0" border="0">
543
543
<dl compact><dt><b>Parameters:</b></dt><dd>
544
544
<table border="0" cellspacing="2" cellpadding="0">
545
<tr><td valign=top><em>oggz</em> </td><td>An OGGZ handle </td></tr>
546
<tr><td valign=top><em>read</em> </td><td>Your reading function </td></tr>
547
<tr><td valign=top><em>user_handle</em> </td><td>Any arbitrary data you wish to pass to the function </td></tr>
545
<tr><td valign="top"></td><td valign="top"><em>oggz</em> </td><td>An OGGZ handle </td></tr>
546
<tr><td valign="top"></td><td valign="top"><em>read</em> </td><td>Your reading function </td></tr>
547
<tr><td valign="top"></td><td valign="top"><em>user_handle</em> </td><td>Any arbitrary data you wish to pass to the function </td></tr>
550
550
<dl compact><dt><b>Return values:</b></dt><dd>
551
551
<table border="0" cellspacing="2" cellpadding="0">
552
<tr><td valign=top><em>0</em> </td><td>Success </td></tr>
553
<tr><td valign=top><em>OGGZ_ERR_BAD_OGGZ</em> </td><td><em>oggz</em> does not refer to an existing OGGZ </td></tr>
554
<tr><td valign=top><em>OGGZ_ERR_INVALID</em> </td><td>Operation not suitable for this OGGZ; <em>oggz</em> not open for reading. </td></tr>
552
<tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>Success </td></tr>
553
<tr><td valign="top"></td><td valign="top"><em>OGGZ_ERR_BAD_OGGZ</em> </td><td><em>oggz</em> does not refer to an existing OGGZ </td></tr>
554
<tr><td valign="top"></td><td valign="top"><em>OGGZ_ERR_INVALID</em> </td><td>Operation not suitable for this OGGZ; <em>oggz</em> not open for reading. </td></tr>
560
<a class="anchor" name="a9" doxytag="oggz_io.h::oggz_io_set_seek" ></a><p>
561
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
560
<a class="anchor" name="a9" doxytag="oggz_io.h::oggz_io_set_seek"></a><p>
561
<table class="mdTable" cellpadding="2" cellspacing="0">
563
563
<td class="mdRow">
564
564
<table cellpadding="0" cellspacing="0" border="0">
566
<td class="md" nowrap valign="top"> int oggz_io_set_seek </td>
566
<td class="md" nowrap valign="top">int oggz_io_set_seek </td>
567
567
<td class="md" valign="top">( </td>
568
568
<td class="md" nowrap valign="top"><a class="el" href="oggz_8h.html#a0">OGGZ</a> * </td>
569
569
<td class="mdname" nowrap> <em>oggz</em>, </td>
572
<td class="md" nowrap align="right"></td>
574
574
<td class="md" nowrap><a class="el" href="oggz__io_8h.html#a2">OggzIOSeek</a> </td>
575
575
<td class="mdname" nowrap> <em>seek</em>, </td>
578
<td class="md" nowrap align="right"></td>
580
580
<td class="md" nowrap>void * </td>
581
581
<td class="mdname" nowrap> <em>user_handle</em></td>
585
585
<td class="md">) </td>
586
586
<td class="md" colspan="2"></td>
593
<table cellspacing=5 cellpadding=0 border=0>
592
<table cellspacing="5" cellpadding="0" border="0">
603
602
<dl compact><dt><b>Parameters:</b></dt><dd>
604
603
<table border="0" cellspacing="2" cellpadding="0">
605
<tr><td valign=top><em>oggz</em> </td><td>An OGGZ handle </td></tr>
606
<tr><td valign=top><em>seek</em> </td><td>Your seeking function </td></tr>
607
<tr><td valign=top><em>user_handle</em> </td><td>Any arbitrary data you wish to pass to the function </td></tr>
604
<tr><td valign="top"></td><td valign="top"><em>oggz</em> </td><td>An OGGZ handle </td></tr>
605
<tr><td valign="top"></td><td valign="top"><em>seek</em> </td><td>Your seeking function </td></tr>
606
<tr><td valign="top"></td><td valign="top"><em>user_handle</em> </td><td>Any arbitrary data you wish to pass to the function </td></tr>
610
609
<dl compact><dt><b>Return values:</b></dt><dd>
611
610
<table border="0" cellspacing="2" cellpadding="0">
612
<tr><td valign=top><em>0</em> </td><td>Success </td></tr>
613
<tr><td valign=top><em>OGGZ_ERR_BAD_OGGZ</em> </td><td><em>oggz</em> does not refer to an existing OGGZ </td></tr>
614
<tr><td valign=top><em>OGGZ_ERR_INVALID</em> </td><td>Operation not suitable for this OGGZ</td></tr>
611
<tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>Success </td></tr>
612
<tr><td valign="top"></td><td valign="top"><em>OGGZ_ERR_BAD_OGGZ</em> </td><td><em>oggz</em> does not refer to an existing OGGZ </td></tr>
613
<tr><td valign="top"></td><td valign="top"><em>OGGZ_ERR_INVALID</em> </td><td>Operation not suitable for this OGGZ</td></tr>
617
616
<dl compact><dt><b>Note:</b></dt><dd>If you provide an OggzIOSeek function, you MUST also provide an OggzIOTell function, or else all your seeks will fail. </dd></dl>
621
<a class="anchor" name="a11" doxytag="oggz_io.h::oggz_io_set_tell" ></a><p>
622
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
620
<a class="anchor" name="a11" doxytag="oggz_io.h::oggz_io_set_tell"></a><p>
621
<table class="mdTable" cellpadding="2" cellspacing="0">
624
623
<td class="mdRow">
625
624
<table cellpadding="0" cellspacing="0" border="0">
627
<td class="md" nowrap valign="top"> int oggz_io_set_tell </td>
626
<td class="md" nowrap valign="top">int oggz_io_set_tell </td>
628
627
<td class="md" valign="top">( </td>
629
628
<td class="md" nowrap valign="top"><a class="el" href="oggz_8h.html#a0">OGGZ</a> * </td>
630
629
<td class="mdname" nowrap> <em>oggz</em>, </td>
632
<td class="md" nowrap align="right"></td>
635
634
<td class="md" nowrap><a class="el" href="oggz__io_8h.html#a3">OggzIOTell</a> </td>
636
635
<td class="mdname" nowrap> <em>tell</em>, </td>
638
<td class="md" nowrap align="right"></td>
641
640
<td class="md" nowrap>void * </td>
642
641
<td class="mdname" nowrap> <em>user_handle</em></td>
646
645
<td class="md">) </td>
647
646
<td class="md" colspan="2"></td>
654
<table cellspacing=5 cellpadding=0 border=0>
652
<table cellspacing="5" cellpadding="0" border="0">
664
662
<dl compact><dt><b>Parameters:</b></dt><dd>
665
663
<table border="0" cellspacing="2" cellpadding="0">
666
<tr><td valign=top><em>oggz</em> </td><td>An OGGZ handle </td></tr>
667
<tr><td valign=top><em>tell</em> </td><td>Your tell function </td></tr>
668
<tr><td valign=top><em>user_handle</em> </td><td>Any arbitrary data you wish to pass to the function </td></tr>
664
<tr><td valign="top"></td><td valign="top"><em>oggz</em> </td><td>An OGGZ handle </td></tr>
665
<tr><td valign="top"></td><td valign="top"><em>tell</em> </td><td>Your tell function </td></tr>
666
<tr><td valign="top"></td><td valign="top"><em>user_handle</em> </td><td>Any arbitrary data you wish to pass to the function </td></tr>
671
669
<dl compact><dt><b>Return values:</b></dt><dd>
672
670
<table border="0" cellspacing="2" cellpadding="0">
673
<tr><td valign=top><em>0</em> </td><td>Success </td></tr>
674
<tr><td valign=top><em>OGGZ_ERR_BAD_OGGZ</em> </td><td><em>oggz</em> does not refer to an existing OGGZ </td></tr>
675
<tr><td valign=top><em>OGGZ_ERR_INVALID</em> </td><td>Operation not suitable for this OGGZ </td></tr>
671
<tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>Success </td></tr>
672
<tr><td valign="top"></td><td valign="top"><em>OGGZ_ERR_BAD_OGGZ</em> </td><td><em>oggz</em> does not refer to an existing OGGZ </td></tr>
673
<tr><td valign="top"></td><td valign="top"><em>OGGZ_ERR_INVALID</em> </td><td>Operation not suitable for this OGGZ </td></tr>
681
<a class="anchor" name="a7" doxytag="oggz_io.h::oggz_io_set_write" ></a><p>
682
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
679
<a class="anchor" name="a7" doxytag="oggz_io.h::oggz_io_set_write"></a><p>
680
<table class="mdTable" cellpadding="2" cellspacing="0">
684
682
<td class="mdRow">
685
683
<table cellpadding="0" cellspacing="0" border="0">
687
<td class="md" nowrap valign="top"> int oggz_io_set_write </td>
685
<td class="md" nowrap valign="top">int oggz_io_set_write </td>
688
686
<td class="md" valign="top">( </td>
689
687
<td class="md" nowrap valign="top"><a class="el" href="oggz_8h.html#a0">OGGZ</a> * </td>
690
688
<td class="mdname" nowrap> <em>oggz</em>, </td>
691
<td class="md" nowrap align="right"></td>
695
693
<td class="md" nowrap><a class="el" href="oggz__io_8h.html#a1">OggzIOWrite</a> </td>
696
694
<td class="mdname" nowrap> <em>write</em>, </td>
697
<td class="md" nowrap align="right"></td>
701
699
<td class="md" nowrap>void * </td>
702
700
<td class="mdname" nowrap> <em>user_handle</em></td>
706
704
<td class="md">) </td>
707
705
<td class="md" colspan="2"></td>
714
<table cellspacing=5 cellpadding=0 border=0>
711
<table cellspacing="5" cellpadding="0" border="0">