<!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>api.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>api.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="api_8c.html#a0">wmf_lite_create</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> **API_return, unsigned long flags, <a class="el" href="types_8h.html#a21">wmfAPI_Options</a> *options)</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="api_8c.html#a1">wmf_lite_destroy</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API)</td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="api_8c.html#a2">wmf_assert</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, char *file, int line)</td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="api_8c.html#a3">wmf_error</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, char *file, int line, char *msg)</td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="api_8c.html#a4">wmf_debug</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, char *file, int line, char *msg)</td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="api_8c.html#a5">wmf_printf</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, char *msg,...)</td></tr> <tr><td nowrap align=right valign=top>void * </td><td valign=bottom><a class="el" href="api_8c.html#a6">wmf_malloc</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, size_t size)</td></tr> <tr><td nowrap align=right valign=top>void * </td><td valign=bottom><a class="el" href="api_8c.html#a7">wmf_calloc</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, size_t number, size_t size)</td></tr> <tr><td nowrap align=right valign=top>void * </td><td valign=bottom><a class="el" href="api_8c.html#a8">wmf_realloc</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, void *mem, size_t size)</td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="api_8c.html#a9">wmf_free</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, void *mem)</td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="api_8c.html#a10">wmf_detach</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, void *mem)</td></tr> <tr><td nowrap align=right valign=top>char * </td><td valign=bottom><a class="el" href="api_8c.html#a11">wmf_strdup</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, const char *str)</td></tr> <tr><td nowrap align=right valign=top>char * </td><td valign=bottom><a class="el" href="api_8c.html#a12">wmf_str_append</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, char *pre, char *post)</td></tr> <tr><td nowrap align=right valign=top>char * </td><td valign=bottom><a class="el" href="api_8c.html#a13">wmf_strstr</a> (const char *haystack, const char *needle)</td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="api_8c.html#a14">wmf_status_function</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API, void *context, <a class="el" href="types_8h.html#a13">wmfStatus</a> function)</td></tr> <tr><td nowrap align=right valign=top>unsigned long </td><td valign=bottom><a class="el" href="api_8c.html#a15">wmf_strbuf_grow</a> (<a class="el" href="types_8h.html#a22">wmfAPI</a> *API)</td></tr> </table> <hr><h2>Function Documentation</h2> <a name="a2" doxytag="api.c::wmf_assert"></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"> void wmf_assert </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>char * </td> <td class="mdname" nowrap> <em>file</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>line</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 the error state of the library to wmf_E_Assert.<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> <tr><td valign=top><em>line</em> </td><td> line number</td></tr> </table> </dl>This should only be called via the macro <a class="el" href="api_8h.html#a2">WMF_ASSERT(API,<expr>)</a> which is defined (for debug builds only) as: <div class="fragment"><pre> #define WMF_ASSERT(Z,M) if (!(M)) wmf_assert (Z,__FILE__,__LINE__) </pre></div> i.e., if <expr> evaluates to 0 then call <a class="el" href="api_8c.html#a2">wmf_assert()</a> with current file name and line number. </td> </tr> </table> <a name="a7" doxytag="api.c::wmf_calloc"></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"> void* wmf_calloc </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>size_t </td> <td class="mdname" nowrap> <em>number</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>size_t </td> <td class="mdname" nowrap> <em>size</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> Allocate memory of specified size and attach to the API's memory manager's internal list.<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>number</em> </td><td> number or elements </td></tr> <tr><td valign=top><em>size</em> </td><td> size in bytes of memory required by one element</td></tr> </table> </dl>With syntax similar to calloc(), <a class="el" href="api_8c.html#a7">wmf_calloc()</a> allocates <code>number</code> * <code>size</code> bytes of memory and adds a reference to it in the memory manager's list. To free the memory, use <a class="el" href="api_8c.html#a9">wmf_free()</a>. <p> <dl compact><dt><b>Returns: </b></dt><dd> Pointer to new memory, or zero on failure. Sets error state <b>wmf_E_InsMem</b> on failure. </dl> </td> </tr> </table> <a name="a4" doxytag="api.c::wmf_debug"></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"> void wmf_debug </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>char * </td> <td class="mdname" nowrap> <em>file</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>line</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>char * </td> <td class="mdname" nowrap> <em>msg</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> Print message to debug 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> <tr><td valign=top><em>file</em> </td><td> file name </td></tr> <tr><td valign=top><em>line</em> </td><td> line number </td></tr> <tr><td valign=top><em>msg</em> </td><td> message to print</td></tr> </table> </dl>This should only be called via the macro <a class="el" href="api_8h.html#a1">WMF_DEBUG(API,msg)</a> which (in debug builds only) calls <a class="el" href="api_8c.html#a4">wmf_debug()</a> with the current file name and line number. </td> </tr> </table> <a name="a10" doxytag="api.c::wmf_detach"></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"> void wmf_detach </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>void * </td> <td class="mdname" nowrap> <em>mem</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> Detach memory attached to the API's memory manager's internal list.<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> pointer to memory previously allocated via the API</td></tr> </table> </dl>This removes the reference in the API's memory manager's internal list, and the memory will not, therefore, be released by <a class="el" href="api_8h.html#a23">wmf_api_destroy()</a>. To free subsequently, use free(). </td> </tr> </table> <a name="a3" doxytag="api.c::wmf_error"></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"> void wmf_error </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>char * </td> <td class="mdname" nowrap> <em>file</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>line</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>char * </td> <td class="mdname" nowrap> <em>msg</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> Print message to error 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> <tr><td valign=top><em>file</em> </td><td> file name </td></tr> <tr><td valign=top><em>line</em> </td><td> line number </td></tr> <tr><td valign=top><em>msg</em> </td><td> message to print</td></tr> </table> </dl>This should only be called via the macro <a class="el" href="api_8h.html#a0">WMF_ERROR(API,msg)</a> which calls <a class="el" href="api_8c.html#a3">wmf_error()</a> with the current file name and line number. </td> </tr> </table> <a name="a9" doxytag="api.c::wmf_free"></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"> void wmf_free </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>void * </td> <td class="mdname" nowrap> <em>mem</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> Frees memory attached to the API's memory manager's internal list.<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> pointer to memory previously allocated via the API</td></tr> </table> </dl>Syntax is similar to free(). </td> </tr> </table> <a name="a0" doxytag="api.c::wmf_lite_create"></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_lite_create </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_return</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>unsigned long </td> <td class="mdname" nowrap> <em>flags</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="types_8h.html#a21">wmfAPI_Options</a> * </td> <td class="mdname" nowrap> <em>options</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> Creates and initializes an instance of the <b>libwmf</b> library (lite interface) for a specified device layer.<dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>API_return</em> </td><td> pointer to a wmfAPI* (the API handle use henceforth) </td></tr> <tr><td valign=top><em>flags</em> </td><td> bitwise OR of WMF_OPT_ options </td></tr> <tr><td valign=top><em>options</em> </td><td> pointer to wmfAPI_Options structure</td></tr> </table> </dl>This is the first and necessary step when using <b>libwmf</b>. Options are passed via the wmfAPI_Options structure and <code>flags</code>. wmf_api_create allocates the wmfAPI structure and initializes the color tables, the metafile player, and the device layer. If successful then the pointer to the wmfAPI structure is returned via <code>API_return</code>, otherwise all allocated memory is released and the library exits with an appropriate error. <p> wmf_lite_create () ignores command line arguments, if any are given, and does <b>not</b> attempt to set up font mapping. <p> The library should be closed using the corresponding wmf_lite_destroy () function. <p> <dl compact><dt><b>Returns: </b></dt><dd> The error state of the library: <b>wmf_E_None</b> indicates successful creation and initialization of the library, and <code>*API_return</code> will be non-zero. For any other error value <code>*API_return</code> will be zero. </dl> </td> </tr> </table> <a name="a1" doxytag="api.c::wmf_lite_destroy"></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_lite_destroy </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 the device layer, if open, and release all allocated memory attached to the memory manager.<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> The final error state of the library. </dl> </td> </tr> </table> <a name="a6" doxytag="api.c::wmf_malloc"></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"> void* wmf_malloc </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>size_t </td> <td class="mdname" nowrap> <em>size</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> Allocate memory of specified size and attach to the API's memory manager's internal list.<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>size</em> </td><td> size in bytes of memory required</td></tr> </table> </dl>With syntax similar to malloc(), <a class="el" href="api_8c.html#a6">wmf_malloc()</a> allocates <code>size</code> bytes of memory and adds a reference to it in the memory manager's list. To free the memory, use <a class="el" href="api_8c.html#a9">wmf_free()</a>. <p> <dl compact><dt><b>Returns: </b></dt><dd> Pointer to new memory, or zero on failure. Sets error state <b>wmf_E_InsMem</b> on failure. </dl> </td> </tr> </table> <a name="a5" doxytag="api.c::wmf_printf"></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"> void wmf_printf </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>char * </td> <td class="mdname" nowrap> <em>msg</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>... </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> Print formatted message to debug 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> <tr><td valign=top><em>msg</em> </td><td> message to print</td></tr> </table> </dl>With syntax similar to printf(), <a class="el" href="api_8c.html#a5">wmf_printf()</a> prints formatted output to the debug stream. </td> </tr> </table> <a name="a8" doxytag="api.c::wmf_realloc"></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"> void* wmf_realloc </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>void * </td> <td class="mdname" nowrap> <em>mem</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>size_t </td> <td class="mdname" nowrap> <em>size</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> (Re)Allocate memory of specified size and attach to the API's memory manager's internal list.<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> pointer to memory previously allocated via the API </td></tr> <tr><td valign=top><em>size</em> </td><td> new size in bytes of memory required</td></tr> </table> </dl>With syntax similar to realloc(), <a class="el" href="api_8c.html#a8">wmf_realloc()</a> allocates <code>size</code> bytes of memory and adds a reference to it in the memory manager's list. To free the memory, use <a class="el" href="api_8c.html#a9">wmf_free()</a>. If <code>mem</code> is zero, this is equivalent to a call to <a class="el" href="api_8c.html#a6">wmf_malloc()</a>. If <code>size</code> is zero, the memory is released via <a class="el" href="api_8c.html#a9">wmf_free()</a>. <p> <dl compact><dt><b>Returns: </b></dt><dd> Pointer to new memory, or zero on failure. Sets error state <b>wmf_E_InsMem</b> on failure. </dl> </td> </tr> </table> <a name="a14" doxytag="api.c::wmf_status_function"></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"> void wmf_status_function </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>void * </td> <td class="mdname" nowrap> <em>context</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="types_8h.html#a13">wmfStatus</a> </td> <td class="mdname" nowrap> <em>function</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 a status call-back function.<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>context</em> </td><td> handle for user data </td></tr> <tr><td valign=top><em>function</em> </td><td> call-back function</td></tr> </table> </dl>The metafile player calls the status function after each record. </td> </tr> </table> <a name="a12" doxytag="api.c::wmf_str_append"></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"> char* wmf_str_append </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>char * </td> <td class="mdname" nowrap> <em>pre</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>char * </td> <td class="mdname" nowrap> <em>post</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> Create concatenatation of two strings and attach to the API's memory manager's internal list.<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>pre</em> </td><td> a string </td></tr> <tr><td valign=top><em>post</em> </td><td> a string</td></tr> </table> </dl><a class="el" href="api_8c.html#a12">wmf_str_append()</a> allocates the necessary memory via <a class="el" href="api_8c.html#a6">wmf_malloc()</a>, copies <code>pre</code> into the string and appends <code>post</code>. Use <a class="el" href="api_8c.html#a9">wmf_free()</a> to free the string. <p> <dl compact><dt><b>Returns: </b></dt><dd> Pointer to new string, or zero on failure. Sets error state <b>wmf_E_InsMem</b> on failure, or <b>wmf_E_Glitch</b> if str is zero. </dl> </td> </tr> </table> <a name="a15" doxytag="api.c::wmf_strbuf_grow"></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"> unsigned long wmf_strbuf_grow </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> Increase the size of the internal string buffer.<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><b>libwmf</b> maintains an internal buffer for string operations. <a class="el" href="api_8c.html#a15">wmf_strbuf_grow()</a> increases the size by 64. <p> <dl compact><dt><b>Returns: </b></dt><dd> Returns the new size of the buffer. Uses <a class="el" href="api_8c.html#a8">wmf_realloc()</a>, so may set <b>wmf_E_InsMem</b> on failure. </dl> </td> </tr> </table> <a name="a11" doxytag="api.c::wmf_strdup"></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"> char* wmf_strdup </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>str</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> Duplicate string and attach to the API's memory manager's internal list.<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>str</em> </td><td> a string</td></tr> </table> </dl>With syntax similar to strdup(), <a class="el" href="api_8c.html#a11">wmf_strdup()</a> allocates the necessary memory via <a class="el" href="api_8c.html#a6">wmf_malloc()</a> and copies the string. Use <a class="el" href="api_8c.html#a9">wmf_free()</a> to free the string. <p> <dl compact><dt><b>Returns: </b></dt><dd> Pointer to new string, or zero on failure. Sets error state <b>wmf_E_InsMem</b> on failure, or <b>wmf_E_Glitch</b> if str is zero. </dl> </td> </tr> </table> <a name="a13" doxytag="api.c::wmf_strstr"></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"> char* wmf_strstr </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname" nowrap> <em>haystack</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>needle</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> Substring search.<dl compact><dt><b>Parameters: </b></dt><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>haystack</em> </td><td> a string </td></tr> <tr><td valign=top><em>needle</em> </td><td> a substring to search for in haystack</td></tr> </table> </dl>With syntax identical to strstr(), <a class="el" href="api_8c.html#a13">wmf_strstr()</a> searches for string <code>needle</code> in string <code>haystack</code>. <p> <dl compact><dt><b>Returns: </b></dt><dd> Pointer to substring <code>needle</code> found in <code>haystack</code>, or zero if not found. </dl> </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>