1<html> 2 3<head> 4<title>Tremor - datatype - ov_callbacks</title> 5<link rel=stylesheet href="style.css" type="text/css"> 6</head> 7 8<body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff"> 9<table border=0 width=100%> 10<tr> 11<td><p class=tiny>Tremor documentation</p></td> 12<td align=right><p class=tiny>Tremor version 1.0 - 20020403</p></td> 13</tr> 14</table> 15 16<h1>ov_callbacks</h1> 17 18<p><i>declared in "ivorbiscodec.h"</i></p> 19 20<p> 21The ov_callbacks structure contains file manipulation function prototypes necessary for opening, closing, seeking, and location. 22 23<p> 24The ov_callbacks structure does not need to be user-defined if you are 25working with stdio-based file manipulation; the <a 26href="ov_open.html">ov_open()</a> call provides default callbacks for 27stdio. ov_callbacks are defined and passed to <a 28href="ov_open_callbacks.html">ov_open_callbacks()</a> when 29implementing non-stdio based stream manipulation (such as playback 30from a memory buffer). 31<p> 32 33<table border=0 width=100% color=black cellspacing=0 cellpadding=7> 34<tr bgcolor=#cccccc> 35 <td> 36<pre><b>typedef struct { 37 size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource); 38 int (*seek_func) (void *datasource, ogg_int64_t offset, int whence); 39 int (*close_func) (void *datasource); 40 long (*tell_func) (void *datasource); 41} ov_callbacks;</b></pre> 42 </td> 43</tr> 44</table> 45 46<h3>Relevant Struct Members</h3> 47<dl> 48<dt><i>read_func</i></dt> 49<dd>Pointer to custom data reading function.</dd> 50<dt><i>seek_func</i></dt> 51<dd>Pointer to custom data seeking function. If the data source is not seekable (or the application wants the data source to be treated as unseekable at all times), the provided seek callback should always return -1 (failure).</dd> 52<dt><i>close_func</i></dt> 53<dd>Pointer to custom data source closure function.</dd> 54<dt><i>tell_func</i></dt> 55<dd>Pointer to custom data location function.</dd> 56</dl> 57 58<p> 59 60See <a href="callbacks.html">the callbacks and non-stdio I/O document</a> for more 61detailed information on required behavior of the various callback 62functions.<p> 63 64<br><br> 65<hr noshade> 66<table border=0 width=100%> 67<tr valign=top> 68<td><p class=tiny>copyright © 2002 Xiph.org</p></td> 69<td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a></p></td> 70</tr><tr> 71<td><p class=tiny>Tremor documentation</p></td> 72<td align=right><p class=tiny>Tremor version 1.0 - 20020403</p></td> 73</tr> 74</table> 75 76</body> 77 78</html> 79