\section{examples/Test\-Master\-Slave/getopt.c File Reference}
\label{TestMasterSlave_2getopt_8c}\index{examples/TestMasterSlave/getopt.c@{examples/TestMasterSlave/getopt.c}}
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include \char`\"{}getopt.h\char`\"{}}\par
{\tt \#include $<$strings.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item
\#define {\bf GETOPT\_\-INTERFACE\_\-VERSION}~2
\item
\#define {\bf \_\-}(msgid)~(msgid)
\item
\#define {\bf SWAP\_\-FLAGS}(ch1, ch2)
\item
\#define {\bf NONOPTION\_\-P}~(argv[{\bf optind}][0] != '-' $|$$|$ argv[{\bf optind}][1] == '$\backslash$0')
\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item
enum \{ {\bf REQUIRE\_\-ORDER},
{\bf PERMUTE},
{\bf RETURN\_\-IN\_\-ORDER}
\}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item
char $\ast$ {\bf getenv} ()
\item
static char $\ast$ {\bf my\_\-index} (char $\ast$str, int chr) const
\item
static void {\bf exchange} (char $\ast$$\ast$argv)
\item
static const char $\ast$ {\bf \_\-getopt\_\-initialize} (int argc, char $\ast$const $\ast$argv, const char $\ast$optstring)
\item
int {\bf \_\-getopt\_\-internal} (int argc, char $\ast$const $\ast$argv, const char $\ast$optstring, const struct {\bf option} $\ast$longopts, int $\ast$longind, int long\_\-only)
\item
int {\bf getopt} (int argc, char $\ast$const $\ast$argv, const char $\ast$optstring)
\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item
char $\ast$ {\bf optarg}
\item
int {\bf optind} = 1
\item
int {\bf \_\-\_\-getopt\_\-initialized}
\item
static char $\ast$ {\bf nextchar}
\item
int {\bf opterr} = 1
\item
int {\bf optopt} = '?'
\item
static enum \{ ... \} {\bf ordering}
\item
static char $\ast$ {\bf posixly\_\-correct}
\item
static int {\bf first\_\-nonopt}
\item
static int {\bf last\_\-nonopt}
\end{CompactItemize}
\subsection{Define Documentation}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!_@{\_\-}}
\index{_@{\_\-}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define \_\-(msgid)~(msgid)}\label{TestMasterSlave_2getopt_8c_86a239addea586602343007a370bf8ad}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!GETOPT_INTERFACE_VERSION@{GETOPT\_\-INTERFACE\_\-VERSION}}
\index{GETOPT_INTERFACE_VERSION@{GETOPT\_\-INTERFACE\_\-VERSION}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define GETOPT\_\-INTERFACE\_\-VERSION~2}\label{TestMasterSlave_2getopt_8c_5325c715897861c318d3ae312ac452cc}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!NONOPTION_P@{NONOPTION\_\-P}}
\index{NONOPTION_P@{NONOPTION\_\-P}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define NONOPTION\_\-P~(argv[{\bf optind}][0] != '-' $|$$|$ argv[{\bf optind}][1] == '$\backslash$0')}\label{TestMasterSlave_2getopt_8c_71ceb8911d64b39b402041ba5ea8453c}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!SWAP_FLAGS@{SWAP\_\-FLAGS}}
\index{SWAP_FLAGS@{SWAP\_\-FLAGS}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define SWAP\_\-FLAGS(ch1, ch2)}\label{TestMasterSlave_2getopt_8c_6e06e56c5fa96faaf47f3b231e015e35}
\subsection{Enumeration Type Documentation}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}anonymous enum}\label{TestMasterSlave_2getopt_8c_df764cbdea00d65edcd07bb9953ad2b7}
\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{REQUIRE_ORDER@{REQUIRE\_\-ORDER}!TestMasterSlave/getopt.c@{TestMasterSlave/getopt.c}}\index{TestMasterSlave/getopt.c@{TestMasterSlave/getopt.c}!REQUIRE_ORDER@{REQUIRE\_\-ORDER}}\item[{\em
REQUIRE\_\-ORDER\label{TestMasterSlave_2getopt_8c_df764cbdea00d65edcd07bb9953ad2b70e73a0691c110b1442d8364d1d12eccc}
}]\index{PERMUTE@{PERMUTE}!TestMasterSlave/getopt.c@{TestMasterSlave/getopt.c}}\index{TestMasterSlave/getopt.c@{TestMasterSlave/getopt.c}!PERMUTE@{PERMUTE}}\item[{\em
PERMUTE\label{TestMasterSlave_2getopt_8c_df764cbdea00d65edcd07bb9953ad2b7cfdde4b47c27f4efbd832e1ac7f8a8fc}
}]\index{RETURN_IN_ORDER@{RETURN\_\-IN\_\-ORDER}!TestMasterSlave/getopt.c@{TestMasterSlave/getopt.c}}\index{TestMasterSlave/getopt.c@{TestMasterSlave/getopt.c}!RETURN_IN_ORDER@{RETURN\_\-IN\_\-ORDER}}\item[{\em
RETURN\_\-IN\_\-ORDER\label{TestMasterSlave_2getopt_8c_df764cbdea00d65edcd07bb9953ad2b73c56550bfafe809d9214b863b69c31c5}
}]\end{description}
\end{Desc}
\subsection{Function Documentation}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!_getopt_initialize@{\_\-getopt\_\-initialize}}
\index{_getopt_initialize@{\_\-getopt\_\-initialize}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static const char$\ast$ \_\-getopt\_\-initialize (int {\em argc}, char $\ast$const $\ast$ {\em argv}, const char $\ast$ {\em optstring})\hspace{0.3cm}{\tt [static]}}\label{TestMasterSlave_2getopt_8c_17475cbc1ffae0c12af2e0a3319d197f}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!_getopt_internal@{\_\-getopt\_\-internal}}
\index{_getopt_internal@{\_\-getopt\_\-internal}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int \_\-getopt\_\-internal (int {\em argc}, char $\ast$const $\ast$ {\em argv}, const char $\ast$ {\em optstring}, const struct {\bf option} $\ast$ {\em longopts}, int $\ast$ {\em longind}, int {\em long\_\-only})}\label{TestMasterSlave_2getopt_8c_0df92a0ae8fe1fd43268c738f548674f}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!exchange@{exchange}}
\index{exchange@{exchange}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static void exchange (char $\ast$$\ast$ {\em argv})\hspace{0.3cm}{\tt [static]}}\label{TestMasterSlave_2getopt_8c_4621659dd6377e52ac50a0869625bb6e}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!getenv@{getenv}}
\index{getenv@{getenv}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ getenv ()}\label{TestMasterSlave_2getopt_8c_ee28fd8a0e40b6d958f7d20348e45368}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!getopt@{getopt}}
\index{getopt@{getopt}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int getopt (int {\em argc}, char $\ast$const $\ast$ {\em argv}, const char $\ast$ {\em optstring})}\label{TestMasterSlave_2getopt_8c_1b2ada39ab92162c6ec9c67c8093fa2e}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!my_index@{my\_\-index}}
\index{my_index@{my\_\-index}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static char$\ast$ my\_\-index (char $\ast$ {\em str}, int {\em chr}) const\hspace{0.3cm}{\tt [static]}}\label{TestMasterSlave_2getopt_8c_e0ac978b7775f69496c0f127ffdada9d}
\subsection{Variable Documentation}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!__getopt_initialized@{\_\-\_\-getopt\_\-initialized}}
\index{__getopt_initialized@{\_\-\_\-getopt\_\-initialized}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf \_\-\_\-getopt\_\-initialized}}\label{TestMasterSlave_2getopt_8c_28286be757527aeb1db951b5da9aeec1}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!first_nonopt@{first\_\-nonopt}}
\index{first_nonopt@{first\_\-nonopt}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf first\_\-nonopt}\hspace{0.3cm}{\tt [static]}}\label{TestMasterSlave_2getopt_8c_7b0f4f3bfbee147113f282427ce933ed}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!last_nonopt@{last\_\-nonopt}}
\index{last_nonopt@{last\_\-nonopt}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf last\_\-nonopt}\hspace{0.3cm}{\tt [static]}}\label{TestMasterSlave_2getopt_8c_580f2c2acf35dad51ca18b427212bf15}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!nextchar@{nextchar}}
\index{nextchar@{nextchar}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ {\bf nextchar}\hspace{0.3cm}{\tt [static]}}\label{TestMasterSlave_2getopt_8c_47a40a4c365dae45f94751ad32aab530}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!optarg@{optarg}}
\index{optarg@{optarg}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ {\bf optarg}}\label{TestMasterSlave_2getopt_8c_db50a0eab9fed92fc3bfc7dfa4f2c410}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!opterr@{opterr}}
\index{opterr@{opterr}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf opterr} = 1}\label{TestMasterSlave_2getopt_8c_e30f05ee1e2e5652f174a35c7875d25e}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!optind@{optind}}
\index{optind@{optind}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf optind} = 1}\label{TestMasterSlave_2getopt_8c_d5e1c16213bbee2d5e8cc363309f418c}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!optopt@{optopt}}
\index{optopt@{optopt}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf optopt} = '?'}\label{TestMasterSlave_2getopt_8c_475b8db98445da73e5f62a1ef6324b95}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!ordering@{ordering}}
\index{ordering@{ordering}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \{ ... \} {\bf ordering}\hspace{0.3cm}{\tt [static]}}\label{TestMasterSlave_2getopt_8c_d6e641c007a3362710ee1c7e22c02e8c}
\index{TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}!posixly_correct@{posixly\_\-correct}}
\index{posixly_correct@{posixly\_\-correct}!TestMasterSlave/getopt.c@{Test\-Master\-Slave/getopt.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ {\bf posixly\_\-correct}\hspace{0.3cm}{\tt [static]}}\label{TestMasterSlave_2getopt_8c_d0ccb64bbd4defe7a57dbad2045ddd14}