Files
modules/xref/getopt.c.html
2006-01-12 19:30:05 +00:00

640 lines
25 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- This HTML file generated by cxref (version 1.6a). -->
<!-- cxref program (c) Andrew M. Bishop 1995,96,97,98,99,2000,01,02,03,04,05. -->
<!--
Cxref: cxref -block-comments -verbatim-comments -xref-all -index-all -html-src -Oxref getopt.c
CPP : cxref-cpp -lang-c -C -dD -dI
-->
<HTML>
<HEAD>
<TITLE>Cross reference for getopt.c of cxref.</TITLE>
<LINK rel="stylesheet" href="cxref.css" type="text/css">
</HEAD>
<BODY>
<h1><a name="file" href="getopt.c.src.html">File getopt.c</a></h1>
<pre>
** ** Module Header ******************************************************* **
** **
** Modules Revision 3.0 **
** Providing a flexible user environment **
** **
** File: getopt.c **
** First Edition: 1995/12/20 **
** **
** Authors: Jens Hamisch, jens@Strawberry.COM **
** **
** Description: getopt procedure for the Modules package **
** **
** Exports: getopt Recognition of commadn line options **
** **
** Notes: This is based on the 'Getopt for GNU' from the gcc-2.7.2 **
** compiler. It is preferred to the libc version, because it **
** provides 'long-options'. **
** **
** ************************************************************************ **
</pre>
<table>
<tr>
<td>References Variables:
<td><a href="getopt.c.html#var-Id">Id</a>
<td><a href="getopt.c.html#var-Id">getopt.c</a>
</tr>
</table>
<hr>
<h2>Included Files</h2>
<ul class="cxref-include">
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;stdio.h&gt;</span></tt>
</ul>
<ul class="cxref-include">
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;stdlib.h&gt;</span></tt>
</ul>
<ul class="cxref-include">
<li class="cxref-include-local"><tt><span class="cxref-include-local"><a href="getopt.h.html#file">#include "getopt.h"</a></span></tt>
</ul>
<ul class="cxref-include">
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;string.h&gt;</span></tt>
</ul>
<ul class="cxref-include">
<li class="cxref-include-local"><tt><span class="cxref-include-local"><a href="modules_def.h.html#file">#include "modules_def.h"</a></span></tt>
<ul class="cxref-include">
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;stdio.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;stdarg.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;tcl.h&gt;</span></tt>
<li class="cxref-include-local"><tt><span class="cxref-include-local"><a href="config.h.html#file">#include "config.h"</a></span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;stdlib.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;string.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;unistd.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;sys/types.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;ctype.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;sys/stat.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;sys/termios.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;fcntl.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;sys/ioctl.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;dirent.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;errno.h&gt;</span></tt>
</ul>
</ul>
<hr>
<h2>Preprocessor definitions</h2>
<tt><span class="cxref-define"><a href="getopt.c.src.html#line67">#define _NO_PROTO</a></span></tt><br>
<p>
<tt><span class="cxref-define"><a href="getopt.c.src.html#line132">#define _</a>( msgid )</span></tt><br>
<p>
<tt><span class="cxref-define"><a href="getopt.c.src.html#line163">#define my_index</a> strchr</span></tt><br>
<hr>
<h2><a name="var-optarg">Global Variable optarg</a></h2>
<tt><span class="cxref-variable"><a href="getopt.c.src.html#line252">char* optarg</a></span></tt><br>
<table>
<tr>
<td>Visible in:
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#file">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.h.html#file">getopt.h</a></span>
</tr>
<tr>
<td>&nbsp;
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="main.c.html#file">main.c</a></span>
</tr>
<tr>
<td>Used in:
<td><span class="cxref-reference-local"><a href="main.c.html#func-Check_Switches">Check_Switches()</a></span>
<td><span class="cxref-reference-local"><a href="main.c.html#func-Check_Switches">main.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">_getopt_internal()</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">getopt.c</a></span>
</tr>
</table>
<hr>
<h2><a name="var-optind">Global Variable optind</a></h2>
<tt><span class="cxref-variable"><a href="getopt.c.src.html#line272">int optind</a></span></tt><br>
<table>
<tr>
<td>Visible in:
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#file">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.h.html#file">getopt.h</a></span>
</tr>
<tr>
<td>&nbsp;
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="main.c.html#file">main.c</a></span>
</tr>
<tr>
<td>Used in:
<td><span class="cxref-reference-local"><a href="main.c.html#func-Check_Switches">Check_Switches()</a></span>
<td><span class="cxref-reference-local"><a href="main.c.html#func-Check_Switches">main.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_initialize">_getopt_initialize()</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_initialize">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">_getopt_internal()</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-exchange">exchange()</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-exchange">getopt.c</a></span>
</tr>
</table>
<hr>
<h2><a name="var-opterr">Global Variable opterr</a></h2>
<tt><span class="cxref-variable"><a href="getopt.c.src.html#line279">int opterr</a></span></tt><br>
<table>
<tr>
<td>Visible in:
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#file">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.h.html#file">getopt.h</a></span>
</tr>
<tr>
<td>&nbsp;
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="main.c.html#file">main.c</a></span>
</tr>
<tr>
<td>Used in:
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">_getopt_internal()</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">getopt.c</a></span>
</tr>
</table>
<hr>
<h2><a name="var-optopt">Global Variable optopt</a></h2>
<tt><span class="cxref-variable"><a href="getopt.c.src.html#line287">int optopt</a></span></tt><br>
<table>
<tr>
<td>Visible in:
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#file">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.h.html#file">getopt.h</a></span>
</tr>
<tr>
<td>&nbsp;
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="main.c.html#file">main.c</a></span>
</tr>
<tr>
<td>Used in:
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">_getopt_internal()</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">getopt.c</a></span>
</tr>
</table>
<hr>
<h2>Local Variables</h2>
<b><a name="var-Id">Id</a></b><br>
<tt><span class="cxref-variable"><a href="getopt.c.src.html#line54">static char Id[]</a></span></tt><br>
<table>
<tr>
<td>Used in:
<td>&nbsp; <td><span class="cxref-reference-local"><a href="getopt.c.html#file">getopt.c</a></span>
</tr>
</table>
<p>
<b><a name="var-UseId">UseId</a></b><br>
<tt><span class="cxref-variable"><a href="getopt.c.src.html#line55">static void* UseId[]</a></span></tt><br>
<p>
<b><a name="var-module_name">module_name</a></b><br>
<tt><span class="cxref-variable"><a href="getopt.c.src.html#line299">static char module_name[]</a></span></tt><br>
<table>
<tr>
<td>Used in:
<td><a href="#func-_getopt_internal">_getopt_internal()</a>
<td>&nbsp;
</tr>
</table>
<p>
<b><a name="var-nextchar">nextchar</a></b><br>
<tt><span class="cxref-variable"><a href="getopt.c.src.html#line327">static char* nextchar</a></span></tt><br>
<table>
<tr>
<td>Used in:
<td><a href="#func-_getopt_initialize">_getopt_initialize()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-_getopt_internal">_getopt_internal()</a>
<td>&nbsp;
</tr>
</table>
<p>
<b><a name="var-ordering">ordering</a></b><br>
<tt><span class="cxref-variable"><a href="getopt.c.src.html#line361">static enum {...} ordering</a></span></tt><br>
<table>
<tr>
<td>Used in:
<td><a href="#func-_getopt_initialize">_getopt_initialize()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-_getopt_internal">_getopt_internal()</a>
<td>&nbsp;
</tr>
</table>
<p>
<b><a name="var-posixly_correct">posixly_correct</a></b><br>
<tt><span class="cxref-variable"><a href="getopt.c.src.html#line367">static char* posixly_correct</a></span></tt><br>
<table>
<tr>
<td>Used in:
<td><a href="#func-_getopt_initialize">_getopt_initialize()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-_getopt_internal">_getopt_internal()</a>
<td>&nbsp;
</tr>
</table>
<p>
<b><a name="var-first_nonopt">first_nonopt</a></b><br>
<tt><span class="cxref-variable"><a href="getopt.c.src.html#line379">static int first_nonopt</a></span></tt><br>
<table>
<tr>
<td>Used in:
<td><a href="#func-_getopt_initialize">_getopt_initialize()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-_getopt_internal">_getopt_internal()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-exchange">exchange()</a>
<td>&nbsp;
</tr>
</table>
<p>
<b><a name="var-last_nonopt">last_nonopt</a></b><br>
<tt><span class="cxref-variable"><a href="getopt.c.src.html#line380">static int last_nonopt</a></span></tt><br>
<table>
<tr>
<td>Used in:
<td><a href="#func-_getopt_initialize">_getopt_initialize()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-_getopt_internal">_getopt_internal()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-exchange">exchange()</a>
<td>&nbsp;
</tr>
</table>
<hr>
<h2><a name="func-getopt">Global Function getopt()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: getopt, getopt_long, getopt_long_only **
** **
** Description: Calls _getopt_internal in order to provide a normal **
** getopt call. **
** **
** First Edition: 1995/12/20 **
** **
** Parameters: int argc, # of arguments **
** char **argv, ARGV array **
** char *optstring, String of valid short opt. **
** **
** Result: int '?' Parse error **
** 0 Long option w/o argument found **
** else short option that has been found **
** or the value of a long option **
** EOF no more arguments on ARGV **
** **
** Attached globals: optind Index of the current option in the **
** ARGV array **
** optarg Argument of an option with value **
** opterr Set in case of parse errors **
** **
** ************************************************************************ **
</pre>
<tt><span class="cxref-function"><a href="getopt.c.src.html#line1215">int getopt ( int argc, char* const* argv, const char* optstring )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="getopt.h.html#file">getopt.h</a></span>
</tr>
<tr>
<td>Calls:
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">_getopt_internal()</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">getopt.c</a></span>
</tr>
</table>
<hr>
<h2><a name="func-getopt_long">Global Function getopt_long()</a></h2>
<tt><span class="cxref-function"><a href="getopt.c.src.html#line1230">int getopt_long ( int argc, char* const* argv, const char* optstring, const struct option* longopts, int* longind )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="getopt.h.html#file">getopt.h</a></span>
</tr>
<tr>
<td>Calls:
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">_getopt_internal()</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">getopt.c</a></span>
</tr>
<tr>
<td>Called by:
<td><span class="cxref-reference-local"><a href="main.c.html#func-Check_Switches">Check_Switches()</a></span>
<td><span class="cxref-reference-local"><a href="main.c.html#func-Check_Switches">main.c</a></span>
</tr>
</table>
<hr>
<h2><a name="func-getopt_long_only">Global Function getopt_long_only()</a></h2>
<tt><span class="cxref-function"><a href="getopt.c.src.html#line1244">int getopt_long_only ( int argc, char* const* argv, const char* optstring, const struct option* longopts, int* longind )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="getopt.h.html#file">getopt.h</a></span>
</tr>
<tr>
<td>Calls:
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">_getopt_internal()</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">getopt.c</a></span>
</tr>
</table>
<hr>
<h2><a name="func-_getopt_initialize">Local Function _getopt_initialize()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: _getopt_initialize **
** **
** Description: Initialize the internal data when the first call is **
** made **
** This defines how to proceed if options and non-op- **
** tions are mixed up. See definition of the enum **
** 'ordering' for further explanation. **
** **
** First Edition: 1995/12/20 **
** **
** Parameters: char *optstring Options string **
** **
** Result: argv ARGV array with exchanged sequences **
** **
** Attached globals: first_nonopt, First an las position of **
** last_nonopt non-option arguments **
** optind Option scan index **
** nextchar Next character to scan **
** posixly_correct Value of the environment **
** variable 'POSIXLY_CORRECT' **
** ordering Ordering method ... **
** **
** ************************************************************************ **
</pre>
<tt><span class="cxref-function"><a href="getopt.c.src.html#line541">static const char* _getopt_initialize ( const char* optstring )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="getopt.c.html#file">getopt.c</a></span>
</tr>
<tr>
<td>Calls:
<td colspan=2><span class="cxref-reference-system">getenv()</span>
</tr>
<tr>
<td>Called by:
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">_getopt_internal()</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">getopt.c</a></span>
</tr>
<tr>
<td>References Variables:
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-first_nonopt">first_nonopt</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-first_nonopt">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-last_nonopt">last_nonopt</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-last_nonopt">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-nextchar">nextchar</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-nextchar">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-optind">optind</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-optind">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-ordering">ordering</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-ordering">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-posixly_correct">posixly_correct</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-posixly_correct">getopt.c</a></span>
</tr>
</table>
<hr>
<h2><a name="func-_getopt_internal">Local Function _getopt_internal()</a></h2>
<tt><span class="cxref-function"><a href="getopt.c.src.html#line679">static int _getopt_internal ( int argc, char* const* argv, const char* optstring, const struct option* longopts, int* longind, int long_only )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="getopt.c.html#file">getopt.c</a></span>
</tr>
<tr>
<td>Calls:
<td><span class="cxref-reference-local"><a href="error.c.html#func-Module_Error">Module_Error()</a></span>
<td><span class="cxref-reference-local"><a href="error.c.html#func-Module_Error">error.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_initialize">_getopt_initialize()</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_initialize">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-exchange">exchange()</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-exchange">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td colspan=2><span class="cxref-reference-system">sprintf(), strchr(), strcmp(), strlen(), strncmp()</span>
</tr>
<tr>
<td>Called by:
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-getopt">getopt()</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-getopt">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-getopt_long">getopt_long()</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-getopt_long">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-getopt_long_only">getopt_long_only()</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-getopt_long_only">getopt.c</a></span>
</tr>
<tr>
<td>References Variables:
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-first_nonopt">first_nonopt</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-first_nonopt">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-last_nonopt">last_nonopt</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-last_nonopt">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-module_name">module_name</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-module_name">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-nextchar">nextchar</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-nextchar">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-optarg">optarg</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-optarg">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-opterr">opterr</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-opterr">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-optind">optind</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-optind">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-optopt">optopt</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-optopt">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-ordering">ordering</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-ordering">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-posixly_correct">posixly_correct</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-posixly_correct">getopt.c</a></span>
</tr>
</table>
<hr>
<h2><a name="func-exchange">Local Function exchange()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: exchange **
** **
** Description: Exchange two adjacent subsequences of ARGV. **
** One subsequence is elements( first_nonopt, **
** last_nonopt) which contains all the non-options that **
** have been skipped so far. The other is elements **
** (last_nonopt,optind), which contains all the options **
** processed since those non-options were skipped. **
** **
** `first_nonopt' and `last_nonopt' are relocated so **
** that they describe the new indices of the non-options**
** in ARGV after they are moved. **
** **
** First Edition: 1995/12/20 **
** **
** Parameters: char **argv Command line arguments **
** **
** Result: argv ARGV array with exchanged sequences **
** **
** Attached Globals: first_nonopt first and last non option argument **
** last_nonopt on the stream before and after the **
** change.( I/O parameter) **
** **
** ************************************************************************ **
</pre>
<tt><span class="cxref-function"><a href="getopt.c.src.html#line424">static void exchange ( char** argv )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="getopt.c.html#file">getopt.c</a></span>
</tr>
<tr>
<td>Called by:
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">_getopt_internal()</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#func-_getopt_internal">getopt.c</a></span>
</tr>
<tr>
<td>References Variables:
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-first_nonopt">first_nonopt</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-first_nonopt">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-last_nonopt">last_nonopt</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-last_nonopt">getopt.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-optind">optind</a></span>
<td><span class="cxref-reference-local"><a href="getopt.c.html#var-optind">getopt.c</a></span>
</tr>
</table>
</BODY>
</HTML>