Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 5a48463e56bd4803e99af0ff1341e8fe > files > 49

ecore-devel-0.9.9.49898-1.fc14.i686.rpm

<html>
<head>
    <title>Ecore: Ecore_Getopt.h File Reference</title>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8">
    <meta name="author" content="Andres Blanc" >
    
    <link rel="icon" href="img/favicon.png" type="image/x-icon">
    <link rel="shortcut icon" href="img/favicon.png" type="image/x-icon">
    <link rel="icon" href="img/favicon.png" type="image/ico">
    <link rel="shortcut icon" href="img/favicon.png" type="image/ico">

    <link rel="stylesheet" type="text/css" href="e.css">
    <link rel="stylesheet" type="text/css" href="edoxy.css">
</head>

<body>

<div id="container">

<div id="header">
<div class="layout">
    
    <h1><span>Enlightenment</span></h1>
    <h2><span>Beauty at your fingertips</span></h2>

    <table cellspacing="0" cellpadding="0" width="100%"><tr>
      <td id="header_logo">
        <a href="http://www.enlightenment.org"></a>
      </td>
      <td id="header_menu">
        <table cellspacing="0" cellpadding="0" align="right"><tr>
          <td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=home">Home</a></td> 
          <td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=news">News</a></td> 
          <td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=about">About</a></td> 
          <td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=download">Download</a></td> 
          <td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=support">Support</a></td> 
          <td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=contribute">Contribute</a></td> 
          <td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=contact">Contact</a></td> 
          <td class="nav_passive"><a class="nav_passive" href="http://trac.enlightenment.org/e">Tracker</a></td>
          <td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=docs">Docs</a></td> 
        </tr></table>          
      </td>
      <td id="header_last"></td>
    </tr></table>

    <div class="doxytitle">
        Ecore Documentation <small>at 2 Jul 2010</small>
    </div>

    <div class="menu-container">
        <div class="submenu">
            <ul class="current">
                <li><a href="files.html">Files</a></li>
                <li><a href="annotated.html">Data Structures</a></li>
                <li><a href="globals.html">Globals</a></li>
                <li><a href="modules.html">Modules</a></li>
                <li><a href="pages.html">Related Pages</a></li>
	        <li class="current"><a  href="index.html">Main Page</a></li>
            </ul>
        </div>
    </div>


    <div class="clear"></div>
</div>
</div>

<div id="content">
<div class="layout">
<!-- Generated by Doxygen 1.6.2-20100208 -->
<div class="contents">
<h1>Ecore_Getopt.h File Reference</h1>
<p>Contains powerful getopt replacement.  
<a href="#_details">More...</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">EAPI void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="Ecore__Getopt_8h.html#a194ebe4424cf5d1ff651a15ec4e2e535">ecore_getopt_help</a> (FILE *fp, const Ecore_Getopt *info)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Show nicely formatted help message for the given parser.  <a href="#a194ebe4424cf5d1ff651a15ec4e2e535"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">EAPI unsigned char&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="Ecore__Getopt_8h.html#aeb5f2edf32182c3e721e1b9f394e8c09">ecore_getopt_parser_has_duplicates</a> (const Ecore_Getopt *parser)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Check parser for duplicate entries, print them out.  <a href="#aeb5f2edf32182c3e721e1b9f394e8c09"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">EAPI int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="Ecore__Getopt_8h.html#ab9fb5bf2f2edd9bd3a3519faa8e3ebfa">ecore_getopt_parse</a> (const Ecore_Getopt *parser, Ecore_Getopt_Value *values, int argc, char **argv)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Parse command line parameters.  <a href="#ab9fb5bf2f2edd9bd3a3519faa8e3ebfa"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">EAPI Eina_List *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="Ecore__Getopt_8h.html#afc265e44ae6e356d2b780473159cca16">ecore_getopt_list_free</a> (Eina_List *list)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Utility to free list and nodes allocated by <em>ECORE_GETOPT_ACTION_APPEND</em>.  <a href="#afc265e44ae6e356d2b780473159cca16"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Contains powerful getopt replacement. </p>
<p>This replacement handles both short (-X) or long options (--ABC) options, with various actions supported, like storing one value and already converting to required type, counting number of occurrences, setting true or false values, show help, license, copyright and even support user-defined callbacks.</p>
<p>It is provided a set of C Pre Processor macros so definition is straightforward.</p>
<p>Values will be stored elsewhere indicated by an array of pointers to values, it is given in separate to parser description so you can use multiple values with the same parser. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a194ebe4424cf5d1ff651a15ec4e2e535"></a><!-- doxytag: member="Ecore_Getopt.h::ecore_getopt_help" ref="a194ebe4424cf5d1ff651a15ec4e2e535" args="(FILE *fp, const Ecore_Getopt *info)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EAPI void ecore_getopt_help </td>
          <td>(</td>
          <td class="paramtype">FILE *&nbsp;</td>
          <td class="paramname"> <em>fp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Ecore_Getopt *&nbsp;</td>
          <td class="paramname"> <em>parser</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Show nicely formatted help message for the given parser. </p>
<p>Message will be print to stderr. </p>

<p>References <a class="el" href="ecore__app_8c_source.html#l00056">ecore_app_args_get()</a>.</p>

</div>
</div>
<a class="anchor" id="afc265e44ae6e356d2b780473159cca16"></a><!-- doxytag: member="Ecore_Getopt.h::ecore_getopt_list_free" ref="afc265e44ae6e356d2b780473159cca16" args="(Eina_List *list)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EAPI Eina_List* ecore_getopt_list_free </td>
          <td>(</td>
          <td class="paramtype">Eina_List *&nbsp;</td>
          <td class="paramname"> <em>list</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Utility to free list and nodes allocated by <em>ECORE_GETOPT_ACTION_APPEND</em>. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>list</em>&nbsp;</td><td>pointer to list to be freed. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>always NULL, so you can easily make your list head NULL. </dd></dl>

</div>
</div>
<a class="anchor" id="ab9fb5bf2f2edd9bd3a3519faa8e3ebfa"></a><!-- doxytag: member="Ecore_Getopt.h::ecore_getopt_parse" ref="ab9fb5bf2f2edd9bd3a3519faa8e3ebfa" args="(const Ecore_Getopt *parser, Ecore_Getopt_Value *values, int argc, char **argv)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EAPI int ecore_getopt_parse </td>
          <td>(</td>
          <td class="paramtype">const Ecore_Getopt *&nbsp;</td>
          <td class="paramname"> <em>parser</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Ecore_Getopt_Value *&nbsp;</td>
          <td class="paramname"> <em>values</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&nbsp;</td>
          <td class="paramname"> <em>argv</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Parse command line parameters. </p>
<p>Walks the command line parameters and parse them based on <em>parser</em> description, doing actions based on <code>parser-&gt;descs-&gt;action</code>, like showing help text, license, copyright, storing values in values and so on.</p>
<p>It is expected that values is of the same size than <code>parser-&gt;descs</code>, options that do not need a value it will be left untouched.</p>
<p>All values are expected to be initialized before use. Options with action <code>ECORE_GETOPT_ACTION_STORE</code> and non required arguments (others than <code>ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES</code>), are expected to provide a value in <code>def</code> to be used.</p>
<p>The following actions will store 1 on value as a boolean (<code>value-&gt;boolp</code>) if it's not NULL to indicate these actions were executed:</p>
<ul>
<li><code>ECORE_GETOPT_ACTION_HELP</code> </li>
<li><code>ECORE_GETOPT_ACTION_VERSION</code> </li>
<li><code>ECORE_GETOPT_ACTION_COPYRIGHT</code> </li>
<li><code>ECORE_GETOPT_ACTION_LICENSE</code> </li>
</ul>
<p>Just <code>ECORE_GETOPT_ACTION_APPEND</code> will allocate memory and thus need to be freed. For consistency between all of appended subtypes, <code>eina_list-&gt;data</code> will contain an allocated memory with the value, that is, for <code>ECORE_GETOPT_TYPE_STR</code> it will contain a copy of the argument, <code>ECORE_GETOPT_TYPE_INT</code> a pointer to an allocated integer and so on.</p>
<p>If parser is in strict mode (see <code>Ecore_Getopt-&gt;strict</code>), then any error will abort parsing and -1 is returned. Otherwise it will try to continue as far as possible.</p>
<p>This function may reorder <em>argv</em> elements.</p>
<p>Translation of help strings (description), metavar, usage, license and copyright may be translated, standard/global gettext() call will be applied on them if ecore was compiled with such support.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>parser</em>&nbsp;</td><td>description of how to work. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>value</em>&nbsp;</td><td>where to store values, it is assumed that this is a vector of the same size as <code>parser-&gt;descs</code>. Values should be previously initialized. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>argc</em>&nbsp;</td><td>how many elements in <em>argv</em>. If not provided it will be retrieved with <a class="el" href="Ecore_8h.html#aa74019a7622d9c4521e54580f50bd4cd" title="Return the programs stored command-line arguments.">ecore_app_args_get()</a>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>argv</em>&nbsp;</td><td>command line parameters.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>index of first non-option parameter or -1 on error. </dd></dl>

<p>References <a class="el" href="ecore__app_8c_source.html#l00056">ecore_app_args_get()</a>.</p>

</div>
</div>
<a class="anchor" id="aeb5f2edf32182c3e721e1b9f394e8c09"></a><!-- doxytag: member="Ecore_Getopt.h::ecore_getopt_parser_has_duplicates" ref="aeb5f2edf32182c3e721e1b9f394e8c09" args="(const Ecore_Getopt *parser)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EAPI unsigned char ecore_getopt_parser_has_duplicates </td>
          <td>(</td>
          <td class="paramtype">const Ecore_Getopt *&nbsp;</td>
          <td class="paramname"> <em>parser</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Check parser for duplicate entries, print them out. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>1 if there are duplicates, 0 otherwise. </dd></dl>

</div>
</div>
</div>
 
 <div id="push"></div>
 </div> <!-- #content -->
  </div> <!-- .layout -->
 
 </div> <!-- #container -->
 
 
  <div id="footer">
    <table><tr>
      <td class="copyright">Copyright &copy;2010 Enlightenment</td>
      <td class="generated">Docs generated Fri Jul 2 12:11:49 2010</td>
    </tr></table>
  </div>


</body>
</html>