<!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>CanFestival: examples/TestMasterSlave/getopt.c File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.1 -->
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li id="current"><a href="files.html"><span>Files</span></a></li>
</ul></div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul></div>
<h1>examples/TestMasterSlave/getopt.c File Reference</h1><code>#include <stdio.h></code><br>
<code>#include "<a class="el" href="TestMasterSlave_2getopt_8h.html">getopt.h</a>"</code><br>
<code>#include <strings.h></code><br>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#5325c715897861c318d3ae312ac452cc">GETOPT_INTERFACE_VERSION</a> 2</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#86a239addea586602343007a370bf8ad">_</a>(msgid) (msgid)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#6e06e56c5fa96faaf47f3b231e015e35">SWAP_FLAGS</a>(ch1, ch2)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#71ceb8911d64b39b402041ba5ea8453c">NONOPTION_P</a> (argv[<a class="el" href="TestMasterSlave_2getopt_8h.html#d5e1c16213bbee2d5e8cc363309f418c">optind</a>][0] != '-' || argv[<a class="el" href="TestMasterSlave_2getopt_8h.html#d5e1c16213bbee2d5e8cc363309f418c">optind</a>][1] == '\0')</td></tr>
<tr><td colspan="2"><br><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom">{ <a class="el" href="TestMasterSlave_2getopt_8c.html#df764cbdea00d65edcd07bb9953ad2b70e73a0691c110b1442d8364d1d12eccc">REQUIRE_ORDER</a>,
<a class="el" href="TestMasterSlave_2getopt_8c.html#df764cbdea00d65edcd07bb9953ad2b7cfdde4b47c27f4efbd832e1ac7f8a8fc">PERMUTE</a>,
<a class="el" href="TestMasterSlave_2getopt_8c.html#df764cbdea00d65edcd07bb9953ad2b73c56550bfafe809d9214b863b69c31c5">RETURN_IN_ORDER</a>
}</td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#ee28fd8a0e40b6d958f7d20348e45368">getenv</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static char * </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#e0ac978b7775f69496c0f127ffdada9d">my_index</a> (char *str, int chr) const</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#4621659dd6377e52ac50a0869625bb6e">exchange</a> (char **argv)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#17475cbc1ffae0c12af2e0a3319d197f">_getopt_initialize</a> (int argc, char *const *argv, const char *optstring)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#0df92a0ae8fe1fd43268c738f548674f">_getopt_internal</a> (int argc, char *const *argv, const char *optstring, const struct <a class="el" href="structoption.html">option</a> *longopts, int *longind, int long_only)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#1b2ada39ab92162c6ec9c67c8093fa2e">getopt</a> (int argc, char *const *argv, const char *optstring)</td></tr>
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#db50a0eab9fed92fc3bfc7dfa4f2c410">optarg</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#d5e1c16213bbee2d5e8cc363309f418c">optind</a> = 1</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#28286be757527aeb1db951b5da9aeec1">__getopt_initialized</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static char * </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#47a40a4c365dae45f94751ad32aab530">nextchar</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#e30f05ee1e2e5652f174a35c7875d25e">opterr</a> = 1</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#475b8db98445da73e5f62a1ef6324b95">optopt</a> = '?'</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static enum { ... } </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#d6e641c007a3362710ee1c7e22c02e8c">ordering</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static char * </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#d0ccb64bbd4defe7a57dbad2045ddd14">posixly_correct</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#7b0f4f3bfbee147113f282427ce933ed">first_nonopt</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="TestMasterSlave_2getopt_8c.html#580f2c2acf35dad51ca18b427212bf15">last_nonopt</a></td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="86a239addea586602343007a370bf8ad"></a><!-- doxytag: member="getopt.c::_" ref="86a239addea586602343007a370bf8ad" args="(msgid)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define _ </td>
<td>(</td>
<td class="paramtype">msgid </td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"> (msgid)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="5325c715897861c318d3ae312ac452cc"></a><!-- doxytag: member="getopt.c::GETOPT_INTERFACE_VERSION" ref="5325c715897861c318d3ae312ac452cc" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define GETOPT_INTERFACE_VERSION 2 </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="71ceb8911d64b39b402041ba5ea8453c"></a><!-- doxytag: member="getopt.c::NONOPTION_P" ref="71ceb8911d64b39b402041ba5ea8453c" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NONOPTION_P (argv[<a class="el" href="TestMasterSlave_2getopt_8h.html#d5e1c16213bbee2d5e8cc363309f418c">optind</a>][0] != '-' || argv[<a class="el" href="TestMasterSlave_2getopt_8h.html#d5e1c16213bbee2d5e8cc363309f418c">optind</a>][1] == '\0') </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="6e06e56c5fa96faaf47f3b231e015e35"></a><!-- doxytag: member="getopt.c::SWAP_FLAGS" ref="6e06e56c5fa96faaf47f3b231e015e35" args="(ch1, ch2)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SWAP_FLAGS </td>
<td>(</td>
<td class="paramtype">ch1, <tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ch2 </td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<hr><h2>Enumeration Type Documentation</h2>
<a class="anchor" name="df764cbdea00d65edcd07bb9953ad2b7"></a><!-- doxytag: member="getopt.c::@1" ref="df764cbdea00d65edcd07bb9953ad2b7" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">anonymous enum </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" name="df764cbdea00d65edcd07bb9953ad2b70e73a0691c110b1442d8364d1d12eccc"></a><!-- doxytag: member="REQUIRE_ORDER" ref="df764cbdea00d65edcd07bb9953ad2b70e73a0691c110b1442d8364d1d12eccc" args="" -->REQUIRE_ORDER</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="df764cbdea00d65edcd07bb9953ad2b7cfdde4b47c27f4efbd832e1ac7f8a8fc"></a><!-- doxytag: member="PERMUTE" ref="df764cbdea00d65edcd07bb9953ad2b7cfdde4b47c27f4efbd832e1ac7f8a8fc" args="" -->PERMUTE</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="df764cbdea00d65edcd07bb9953ad2b73c56550bfafe809d9214b863b69c31c5"></a><!-- doxytag: member="RETURN_IN_ORDER" ref="df764cbdea00d65edcd07bb9953ad2b73c56550bfafe809d9214b863b69c31c5" args="" -->RETURN_IN_ORDER</em> </td><td>
</td></tr>
</table>
</dl>
</div>
</div><p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="17475cbc1ffae0c12af2e0a3319d197f"></a><!-- doxytag: member="getopt.c::_getopt_initialize" ref="17475cbc1ffae0c12af2e0a3319d197f" args="(int argc, char *const *argv, const char *optstring)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static const char* _getopt_initialize </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"> <em>argc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *const * </td>
<td class="paramname"> <em>argv</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>optstring</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="0df92a0ae8fe1fd43268c738f548674f"></a><!-- doxytag: member="getopt.c::_getopt_internal" ref="0df92a0ae8fe1fd43268c738f548674f" args="(int argc, char *const *argv, const char *optstring, const struct option *longopts, int *longind, int long_only)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int _getopt_internal </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"> <em>argc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *const * </td>
<td class="paramname"> <em>argv</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>optstring</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const struct <a class="el" href="structoption.html">option</a> * </td>
<td class="paramname"> <em>longopts</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>longind</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>long_only</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="4621659dd6377e52ac50a0869625bb6e"></a><!-- doxytag: member="getopt.c::exchange" ref="4621659dd6377e52ac50a0869625bb6e" args="(char **argv)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static void exchange </td>
<td>(</td>
<td class="paramtype">char ** </td>
<td class="paramname"> <em>argv</em> </td>
<td> ) </td>
<td width="100%"><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="ee28fd8a0e40b6d958f7d20348e45368"></a><!-- doxytag: member="getopt.c::getenv" ref="ee28fd8a0e40b6d958f7d20348e45368" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* getenv </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="1b2ada39ab92162c6ec9c67c8093fa2e"></a><!-- doxytag: member="getopt.c::getopt" ref="1b2ada39ab92162c6ec9c67c8093fa2e" args="(int argc, char *const *argv, const char *optstring)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int getopt </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"> <em>argc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char *const * </td>
<td class="paramname"> <em>argv</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>optstring</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="e0ac978b7775f69496c0f127ffdada9d"></a><!-- doxytag: member="getopt.c::my_index" ref="e0ac978b7775f69496c0f127ffdada9d" args="(char *str, int chr) const" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static char* my_index </td>
<td>(</td>
<td class="paramtype">char * </td>
<td class="paramname"> <em>str</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>chr</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"> const<code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<hr><h2>Variable Documentation</h2>
<a class="anchor" name="28286be757527aeb1db951b5da9aeec1"></a><!-- doxytag: member="getopt.c::__getopt_initialized" ref="28286be757527aeb1db951b5da9aeec1" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="TestMasterSlave_2getopt_8c.html#28286be757527aeb1db951b5da9aeec1">__getopt_initialized</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="7b0f4f3bfbee147113f282427ce933ed"></a><!-- doxytag: member="getopt.c::first_nonopt" ref="7b0f4f3bfbee147113f282427ce933ed" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="TestMasterSlave_2getopt_8c.html#7b0f4f3bfbee147113f282427ce933ed">first_nonopt</a><code> [static]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="580f2c2acf35dad51ca18b427212bf15"></a><!-- doxytag: member="getopt.c::last_nonopt" ref="580f2c2acf35dad51ca18b427212bf15" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="TestMasterSlave_2getopt_8c.html#580f2c2acf35dad51ca18b427212bf15">last_nonopt</a><code> [static]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="47a40a4c365dae45f94751ad32aab530"></a><!-- doxytag: member="getopt.c::nextchar" ref="47a40a4c365dae45f94751ad32aab530" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* <a class="el" href="TestMasterSlave_2getopt_8c.html#47a40a4c365dae45f94751ad32aab530">nextchar</a><code> [static]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="db50a0eab9fed92fc3bfc7dfa4f2c410"></a><!-- doxytag: member="getopt.c::optarg" ref="db50a0eab9fed92fc3bfc7dfa4f2c410" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* <a class="el" href="TestMasterSlave_2getopt_8h.html#db50a0eab9fed92fc3bfc7dfa4f2c410">optarg</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="e30f05ee1e2e5652f174a35c7875d25e"></a><!-- doxytag: member="getopt.c::opterr" ref="e30f05ee1e2e5652f174a35c7875d25e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="TestMasterSlave_2getopt_8h.html#e30f05ee1e2e5652f174a35c7875d25e">opterr</a> = 1 </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="d5e1c16213bbee2d5e8cc363309f418c"></a><!-- doxytag: member="getopt.c::optind" ref="d5e1c16213bbee2d5e8cc363309f418c" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="TestMasterSlave_2getopt_8h.html#d5e1c16213bbee2d5e8cc363309f418c">optind</a> = 1 </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="475b8db98445da73e5f62a1ef6324b95"></a><!-- doxytag: member="getopt.c::optopt" ref="475b8db98445da73e5f62a1ef6324b95" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="TestMasterSlave_2getopt_8h.html#475b8db98445da73e5f62a1ef6324b95">optopt</a> = '?' </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="d6e641c007a3362710ee1c7e22c02e8c"></a><!-- doxytag: member="getopt.c::ordering" ref="d6e641c007a3362710ee1c7e22c02e8c" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum { ... } <a class="el" href="TestMasterSlave_2getopt_8c.html#d6e641c007a3362710ee1c7e22c02e8c">ordering</a><code> [static]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<a class="anchor" name="d0ccb64bbd4defe7a57dbad2045ddd14"></a><!-- doxytag: member="getopt.c::posixly_correct" ref="d0ccb64bbd4defe7a57dbad2045ddd14" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* <a class="el" href="TestMasterSlave_2getopt_8c.html#d0ccb64bbd4defe7a57dbad2045ddd14">posixly_correct</a><code> [static]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<hr size="1"><address style="align: right;"><small>Generated on Mon Jun 4 15:50:45 2007 for CanFestival by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address>
</body>
</html>