<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Apache Portable Runtime: Library initialization and termination</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.3.9.1 --> <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</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> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>Library initialization and termination</h1><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__library.html#ga0">apr_initialize</a> (void)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__library.html#ga1">apr_app_initialize</a> (int *argc, char const *const **argv, char const *const **env)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__library.html#ga2">apr_terminate</a> (void)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__library.html#ga3">apr_terminate2</a> (void)</td></tr> </table> <hr><h2>Function Documentation</h2> <a class="anchor" name="ga1" doxytag="apr_general.h::apr_app_initialize"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> apr_app_initialize </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">int * </td> <td class="mdname" nowrap> <em>argc</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>char const *const ** </td> <td class="mdname" nowrap> <em>argv</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>char const *const ** </td> <td class="mdname" nowrap> <em>env</em></td> </tr> <tr> <td class="md"></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 up an application with normalized argc, argv (and optionally env) in order to deal with platform-specific oddities, such as Win32 services, code pages and signals. This must be the first function called for any APR program. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>argc</em> </td><td>Pointer to the argc that may be corrected </td></tr> <tr><td valign="top"></td><td valign="top"><em>argv</em> </td><td>Pointer to the argv that may be corrected </td></tr> <tr><td valign="top"></td><td valign="top"><em>env</em> </td><td>Pointer to the env that may be corrected, may be NULL </td></tr> </table> </dl> <dl compact><dt><b>Remarks:</b></dt><dd>See apr_initialize if this is a library consumer of apr. Otherwise, this call is identical to apr_initialize, and must be closed with a call to apr_terminate at the end of program execution. </dd></dl> </td> </tr> </table> <a class="anchor" name="ga0" doxytag="apr_general.h::apr_initialize"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a> apr_initialize </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> Setup any APR internal data structures. This MUST be the first function called for any APR library. <dl compact><dt><b>Remarks:</b></dt><dd>See apr_app_initialize if this is an application, rather than a library consumer of apr. </dd></dl> </td> </tr> </table> <a class="anchor" name="ga2" doxytag="apr_general.h::apr_terminate"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">void apr_terminate </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> Tear down any APR internal data structures which aren't torn down automatically. <dl compact><dt><b>Remarks:</b></dt><dd>An APR program must call this function at termination once it has stopped using APR services. The APR developers suggest using atexit to ensure this is called. When using APR from a language other than C that has problems with the calling convention, use <a class="el" href="group__apr__library.html#ga3">apr_terminate2()</a> instead. </dd></dl> </td> </tr> </table> <a class="anchor" name="ga3" doxytag="apr_general.h::apr_terminate2"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">void apr_terminate2 </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> Tear down any APR internal data structures which aren't torn down automatically, same as apr_terminate <dl compact><dt><b>Remarks:</b></dt><dd>An APR program must call either the apr_terminate or apr_terminate2 function once it it has finished using APR services. The APR developers suggest using atexit(apr_terminate) to ensure this is done. apr_terminate2 exists to allow non-c language apps to tear down apr, while apr_terminate is recommended from c language applications. </dd></dl> </td> </tr> </table> <hr size="1"><address style="align: right;"><small>Generated on Sun Mar 20 19:52:27 2005 for Apache Portable Runtime by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address> </body> </html>