Sophie

Sophie

distrib > Mandriva > 10.2 > i586 > by-pkgid > 4f37b923758ceff94a2c0ccca62b4b43 > files > 176

libapr1-devel-1.1.1-1mdk.i586.rpm

<!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: Command Argument Parsing</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&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>Command Argument Parsing<br>
<small>
[<a class="el" href="group__APR.html">Apache Portability Runtime library</a>]</small>
</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structapr__getopt__t.html">apr_getopt_t</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structapr__getopt__option__t.html">apr_getopt_option_t</a></td></tr>

<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef void(&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__getopt.html#ga0">apr_getopt_err_fn_t</a> )(void *arg, const char *err,...)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="structapr__getopt__t.html">apr_getopt_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__getopt.html#ga1">apr_getopt_t</a></td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="structapr__getopt__option__t.html">apr_getopt_option_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__getopt.html#ga2">apr_getopt_option_t</a></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>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__getopt.html#ga3">apr_getopt_init</a> (<a class="el" href="structapr__getopt__t.html">apr_getopt_t</a> **os, <a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *cont, int argc, const char *const *argv)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__getopt.html#ga4">apr_getopt</a> (<a class="el" href="structapr__getopt__t.html">apr_getopt_t</a> *os, const char *opts, char *option_ch, const char **option_arg)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__apr__errno.html#ga0">apr_status_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__apr__getopt.html#ga5">apr_getopt_long</a> (<a class="el" href="structapr__getopt__t.html">apr_getopt_t</a> *os, const <a class="el" href="structapr__getopt__option__t.html">apr_getopt_option_t</a> *opts, int *option_ch, const char **option_arg)</td></tr>

</table>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="ga0" doxytag="apr_getopt.h::apr_getopt_err_fn_t"></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">typedef void( <a class="el" href="group__apr__getopt.html#ga0">apr_getopt_err_fn_t</a>)(void *arg, const char *err,...)          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
defintion of a error function     </td>
  </tr>
</table>
<a class="anchor" name="ga2" doxytag="apr_getopt.h::apr_getopt_option_t"></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">typedef struct <a class="el" href="structapr__getopt__option__t.html">apr_getopt_option_t</a> <a class="el" href="structapr__getopt__option__t.html">apr_getopt_option_t</a>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="structapr__getopt__option__t.html">apr_getopt_option_t</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga1" doxytag="apr_getopt.h::apr_getopt_t"></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">typedef struct <a class="el" href="structapr__getopt__t.html">apr_getopt_t</a> <a class="el" href="structapr__getopt__t.html">apr_getopt_t</a>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="structapr__getopt__t.html">apr_getopt_t</a> </dd></dl>
    </td>
  </tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga4" doxytag="apr_getopt.h::apr_getopt"></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_getopt           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="structapr__getopt__t.html">apr_getopt_t</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>os</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const char *&nbsp;</td>
          <td class="mdname" nowrap> <em>opts</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>char *&nbsp;</td>
          <td class="mdname" nowrap> <em>option_ch</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const char **&nbsp;</td>
          <td class="mdname" nowrap> <em>option_arg</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Parse the options initialized by <a class="el" href="group__apr__getopt.html#ga3">apr_getopt_init()</a>. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>os</em>&nbsp;</td><td>The apr_opt_t structure returned by <a class="el" href="group__apr__getopt.html#ga3">apr_getopt_init()</a> </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>opts</em>&nbsp;</td><td>A string of characters that are acceptable options to the program. Characters followed by ":" are required to have an option associated </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>option_ch</em>&nbsp;</td><td>The next option character parsed </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>option_arg</em>&nbsp;</td><td>The argument following the option character: </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>There are four potential status values on exit. They are: <pre>
             APR_EOF      --  No more options to parse
             APR_BADCH    --  Found a bad option character
             APR_BADARG   --  No argument followed the option flag
             APR_SUCCESS  --  The next option was found.
 </pre> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga3" doxytag="apr_getopt.h::apr_getopt_init"></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_getopt_init           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="structapr__getopt__t.html">apr_getopt_t</a> **&nbsp;</td>
          <td class="mdname" nowrap> <em>os</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="group__apr__pools.html#ga0">apr_pool_t</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>cont</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int&nbsp;</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>const char *const *&nbsp;</td>
          <td class="mdname" nowrap> <em>argv</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Initialize the arguments for parsing by <a class="el" href="group__apr__getopt.html#ga4">apr_getopt()</a>. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>os</em>&nbsp;</td><td>The options structure created for <a class="el" href="group__apr__getopt.html#ga4">apr_getopt()</a> </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>cont</em>&nbsp;</td><td>The pool to operate on </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>argc</em>&nbsp;</td><td>The number of arguments to parse </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>argv</em>&nbsp;</td><td>The array of arguments to parse </td></tr>
  </table>
</dl>
<dl compact><dt><b>Remarks:</b></dt><dd>Arguments 2 and 3 are most commonly argc and argv from main(argc, argv) The errfn is initialized to fprintf(stderr... but may be overridden. </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ga5" doxytag="apr_getopt.h::apr_getopt_long"></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_getopt_long           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="structapr__getopt__t.html">apr_getopt_t</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>os</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const <a class="el" href="structapr__getopt__option__t.html">apr_getopt_option_t</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>opts</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>int *&nbsp;</td>
          <td class="mdname" nowrap> <em>option_ch</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const char **&nbsp;</td>
          <td class="mdname" nowrap> <em>option_arg</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Parse the options initialized by <a class="el" href="group__apr__getopt.html#ga3">apr_getopt_init()</a>, accepting long options beginning with "--" in addition to single-character options beginning with "-". <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>os</em>&nbsp;</td><td>The <a class="el" href="structapr__getopt__t.html">apr_getopt_t</a> structure created by <a class="el" href="group__apr__getopt.html#ga3">apr_getopt_init()</a> </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>opts</em>&nbsp;</td><td>A pointer to a list of <a class="el" href="structapr__getopt__option__t.html">apr_getopt_option_t</a> structures, which can be initialized with { "name", optch, has_args }. has_args is nonzero if the option requires an argument. A structure with an optch value of 0 terminates the list. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>option_ch</em>&nbsp;</td><td>Receives the value of "optch" from the <a class="el" href="structapr__getopt__option__t.html">apr_getopt_option_t</a> structure corresponding to the next option matched. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>option_arg</em>&nbsp;</td><td>Receives the argument following the option, if any. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>There are four potential status values on exit. They are: <pre>
             APR_EOF      --  No more options to parse
             APR_BADCH    --  Found a bad option character
             APR_BADARG   --  No argument followed the option flag
             APR_SUCCESS  --  The next option was found.
 </pre> When APR_SUCCESS is returned, os-&gt;ind gives the index of the first non-option argument. On error, a message will be printed to stdout unless os-&gt;err is set to 0. If os-&gt;interleave is set to nonzero, options can come after arguments, and os-&gt;argv will be permuted to leave non-option arguments at the end (the original argv is unaffected). </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&nbsp;
<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>