<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>bbuf.c File Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.2.18 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> <a class="qindex" href="globals.html">Globals</a> </center> <hr><h1>bbuf.c File Reference</h1><table border=0 cellpadding=0 cellspacing=0> <tr><td></td></tr> <tr><td colspan=2><br><h2>Functions</h2></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="types_8h.html#a5">wmf_error_t</a> </td><td valign=bottom><a class="el" href="bbuf_8c.html#a0">wmf_bbuf_input</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, <a class="el" href="types_8h.html#a8">wmfRead</a> fp_read, <a class="el" href="types_8h.html#a9">wmfSeek</a> fp_seek, <a class="el" href="types_8h.html#a10">wmfTell</a> fp_tell, void *user_data)</td></tr> <tr><td nowrap align=right valign=top><a class="el" href="types_8h.html#a5">wmf_error_t</a> </td><td valign=bottom><a class="el" href="bbuf_8c.html#a1">wmf_file_open</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, const char *file)</td></tr> <tr><td nowrap align=right valign=top><a class="el" href="types_8h.html#a5">wmf_error_t</a> </td><td valign=bottom><a class="el" href="bbuf_8c.html#a2">wmf_file_close</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API)</td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="bbuf_8c.html#a3">wmf_file_read</a> (void *user_data)</td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="bbuf_8c.html#a4">wmf_file_seek</a> (void *user_data, long pos)</td></tr> <tr><td nowrap align=right valign=top>long </td><td valign=bottom><a class="el" href="bbuf_8c.html#a5">wmf_file_tell</a> (void *user_data)</td></tr> <tr><td nowrap align=right valign=top><a class="el" href="types_8h.html#a5">wmf_error_t</a> </td><td valign=bottom><a class="el" href="bbuf_8c.html#a6">wmf_mem_open</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, unsigned char *mem, long length)</td></tr> <tr><td nowrap align=right valign=top><a class="el" href="types_8h.html#a5">wmf_error_t</a> </td><td valign=bottom><a class="el" href="bbuf_8c.html#a7">wmf_mem_close</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API)</td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="bbuf_8c.html#a8">wmf_mem_read</a> (void *user_data)</td></tr> <tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="bbuf_8c.html#a9">wmf_mem_seek</a> (void *user_data, long pos)</td></tr> <tr><td nowrap align=right valign=top>long </td><td valign=bottom><a class="el" href="bbuf_8c.html#a10">wmf_mem_tell</a> (void *user_data)</td></tr> </table> <hr><h2>Function Documentation</h2> <a name="a0" doxytag="bbuf.c::wmf_bbuf_input"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="types_8h.html#a5">wmf_error_t</a> wmf_bbuf_input </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="types_8h.html#a22">wmfAPI</a> * </td> <td class="mdname" nowrap> <em>API</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="types_8h.html#a8">wmfRead</a> </td> <td class="mdname" nowrap> <em>fp_read</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="types_8h.html#a9">wmfSeek</a> </td> <td class="mdname" nowrap> <em>fp_seek</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="types_8h.html#a10">wmfTell</a> </td> <td class="mdname" nowrap> <em>fp_tell</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>void * </td> <td class="mdname" nowrap> <em>user_data</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Set custom metafile input-stream handler functions.<dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>API</em> </td><td> the API handle </td></tr> <tr><td valign=top><em>fp_read</em> </td><td> function to read a byte </td></tr> <tr><td valign=top><em>fp_seek</em> </td><td> function to set position </td></tr> <tr><td valign=top><em>fp_tell</em> </td><td> function to get position </td></tr> <tr><td valign=top><em>user_data</em> </td><td> handle for user data</td></tr> </table> </dl><b>libwmf</b> has simple methods for reading either from file or from memory, but many applications will want to use customized variants of these. <a class="el" href="bbuf_8c.html#a0">wmf_bbuf_input()</a> enables this. <p> <div class="fragment"><pre> typedef int (*wmfRead) (void* user_data); typedef int (*wmfSeek) (void* user_data,long position); typedef long (*wmfTell) (void* user_data); </pre></div> <p> <b><a class="el" href="types_8h.html#a8">wmfRead</a></b> returns unsigned char cast to int, or EOF (cf. fgetc()) <p> <b><a class="el" href="types_8h.html#a9">wmfSeek</a></b> returns (-1) on error, otherwise 0 (cf. fseek()) <p> <b><a class="el" href="types_8h.html#a10">wmfTell</a></b> returns (-1) on error, otherwise current position (cf. ftell()) <p> <dl compact><dt><b>Returns: </b></dt><dd> Returns the library error state (<b>wmf_E_None</b> on success). Possible library error state of <b>wmf_E_Glitch</b>, if any of the three functions is zero. </dl> </td> </tr> </table> <a name="a2" doxytag="bbuf.c::wmf_file_close"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="types_8h.html#a5">wmf_error_t</a> wmf_file_close </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="types_8h.html#a22">wmfAPI</a> * </td> <td class="mdname1" valign="top" nowrap> <em>API</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Close metafile input file stream.<dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>API</em> </td><td> the API handle</td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> Returns the library error state (<b>wmf_E_None</b> on success). Possible library error state of <b>wmf_E_Glitch</b>. </dl> </td> </tr> </table> <a name="a1" doxytag="bbuf.c::wmf_file_open"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="types_8h.html#a5">wmf_error_t</a> wmf_file_open </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="types_8h.html#a22">wmfAPI</a> * </td> <td class="mdname" nowrap> <em>API</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>file</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Open file as metafile.<dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>API</em> </td><td> the API handle </td></tr> <tr><td valign=top><em>file</em> </td><td> file name</td></tr> </table> </dl>Simple method for reading from file. <p> <dl compact><dt><b>Returns: </b></dt><dd> Returns the library error state (<b>wmf_E_None</b> on success). Possible library error states of <b>wmf_E_Glitch</b> or <b>wmf_E_BadFile</b>. </dl> </td> </tr> </table> <a name="a3" doxytag="bbuf.c::wmf_file_read"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int wmf_file_read </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void * </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> file input (wmf_file_open): fgetc() </td> </tr> </table> <a name="a4" doxytag="bbuf.c::wmf_file_seek"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int wmf_file_seek </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void * </td> <td class="mdname" nowrap> , </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>long </td> <td class="mdname" nowrap> </td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> file input (wmf_file_open): fseek() </td> </tr> </table> <a name="a5" doxytag="bbuf.c::wmf_file_tell"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> long wmf_file_tell </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void * </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> file input (wmf_file_open): ftell() </td> </tr> </table> <a name="a7" doxytag="bbuf.c::wmf_mem_close"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="types_8h.html#a5">wmf_error_t</a> wmf_mem_close </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="types_8h.html#a22">wmfAPI</a> * </td> <td class="mdname1" valign="top" nowrap> <em>API</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Close metafile input memory stream.<dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>API</em> </td><td> the API handle</td></tr> </table> </dl><dl compact><dt><b>Returns: </b></dt><dd> Returns the library error state (<b>wmf_E_None</b> on success). </dl> </td> </tr> </table> <a name="a6" doxytag="bbuf.c::wmf_mem_open"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="types_8h.html#a5">wmf_error_t</a> wmf_mem_open </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="types_8h.html#a22">wmfAPI</a> * </td> <td class="mdname" nowrap> <em>API</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>unsigned char * </td> <td class="mdname" nowrap> <em>mem</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>long </td> <td class="mdname" nowrap> <em>length</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Open metafile in memory.<dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>API</em> </td><td> the API handle </td></tr> <tr><td valign=top><em>mem</em> </td><td> the metafile in memory </td></tr> <tr><td valign=top><em>length</em> </td><td> the length in bytes of metafile data</td></tr> </table> </dl>Simple method for reading from memory as array of unsigned char. <p> <dl compact><dt><b>Returns: </b></dt><dd> Returns the library error state (<b>wmf_E_None</b> on success). Possible library error state of <b>wmf_E_Glitch</b>. </dl> </td> </tr> </table> <a name="a8" doxytag="bbuf.c::wmf_mem_read"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int wmf_mem_read </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void * </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> memory input (wmf_mem_open): fgetc() equiv. </td> </tr> </table> <a name="a9" doxytag="bbuf.c::wmf_mem_seek"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int wmf_mem_seek </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void * </td> <td class="mdname" nowrap> , </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>long </td> <td class="mdname" nowrap> </td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> memory input (wmf_mem_open): fseek() equiv. </td> </tr> </table> <a name="a10" doxytag="bbuf.c::wmf_mem_tell"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> long wmf_mem_tell </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void * </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> memory input (wmf_mem_open): ftell() equiv. </td> </tr> </table> <hr><address style="align: right;"><small>Generated on Tue Dec 10 19:53:47 2002 for libwmf by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address> </body> </html>