\hypertarget{args_8c}{
\section{args.c File Reference}
\label{args_8c}\index{args.c@{args.c}}
}
Simple functions to handle command line arguments. 

{\tt \#include \char`\"{}RIM/lrd.h\char`\"{}}\par
{\tt \#include \char`\"{}args\_\-p.h\char`\"{}}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par


Include dependency graph for args.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=92pt]{args_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned \hyperlink{args_8c_a0}{input\_\-count} (int argc, char $\ast$$\ast$argv)
\begin{CompactList}\small\item\em Count the number of input files. \item\end{CompactList}\item 
void \hyperlink{args_8c_a1}{input\_\-collect} (int argc, char $\ast$$\ast$argv, char $\ast$$\ast$list)
\begin{CompactList}\small\item\em Set the elements of the {\em list\/} array to be pointers to NULL terminated filenames. \item\end{CompactList}\item 
char $\ast$ \hyperlink{args_8c_a2}{output\_\-collect} (int argc, char $\ast$$\ast$argv)
\begin{CompactList}\small\item\em Locate the output stub string in the command line arguments. \item\end{CompactList}\item 
unsigned \hyperlink{args_8c_a3}{verbose\_\-collect} (int argc, char $\ast$$\ast$argv)
\begin{CompactList}\small\item\em Check the command line arguments for the verbose flag. \item\end{CompactList}\item 
unsigned \hyperlink{args_8c_a4}{filter\_\-collect} (int argc, char $\ast$$\ast$argv)
\begin{CompactList}\small\item\em If a filter argument is present on the command line use it to construct a bit mask of components to write out. \item\end{CompactList}\item 
unsigned \hyperlink{args_8c_a5}{get\_\-bit} (char $\ast$type)
\begin{CompactList}\small\item\em Lookup the type and return a one-bit bit mask with the corresponding bit set. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Simple functions to handle command line arguments. 

\begin{Desc}
\item[Author:]James Swain -- \href{mailto:jswain@slac.stanford.edu}{\tt jswain@slac.stanford.edu}\end{Desc}


\subsection{Function Documentation}
\hypertarget{args_8c_a4}{
\index{args.c@{args.c}!filter_collect@{filter\_\-collect}}
\index{filter_collect@{filter\_\-collect}!args.c@{args.c}}
\subsubsection[filter\_\-collect]{\setlength{\rightskip}{0pt plus 5cm}unsigned filter\_\-collect (int {\em argc}, char $\ast$$\ast$ {\em argv})}}
\label{args_8c_a4}


If a filter argument is present on the command line use it to construct a bit mask of components to write out. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em argc}]Number of command line arguments \item[{\em argv}]Array of command line arguments \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A bit mask of the components to write out\end{Desc}
\hypertarget{args_8c_a5}{
\index{args.c@{args.c}!get_bit@{get\_\-bit}}
\index{get_bit@{get\_\-bit}!args.c@{args.c}}
\subsubsection[get\_\-bit]{\setlength{\rightskip}{0pt plus 5cm}unsigned get\_\-bit (char $\ast$ {\em type})}}
\label{args_8c_a5}


Lookup the type and return a one-bit bit mask with the corresponding bit set. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]NULL terminated LATC type name \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Bit mask with the bit corresponding to {\em type\/} set.\end{Desc}
\hypertarget{args_8c_a1}{
\index{args.c@{args.c}!input_collect@{input\_\-collect}}
\index{input_collect@{input\_\-collect}!args.c@{args.c}}
\subsubsection[input\_\-collect]{\setlength{\rightskip}{0pt plus 5cm}void input\_\-collect (int {\em argc}, char $\ast$$\ast$ {\em argv}, char $\ast$$\ast$ {\em list})}}
\label{args_8c_a1}


Set the elements of the {\em list\/} array to be pointers to NULL terminated filenames. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em argc}]Number of command line arguments \item[{\em argv}]Array of command line arguments \item[{\em list}]Array of pointers to the filenames\end{description}
\end{Desc}
\hypertarget{args_8c_a0}{
\index{args.c@{args.c}!input_count@{input\_\-count}}
\index{input_count@{input\_\-count}!args.c@{args.c}}
\subsubsection[input\_\-count]{\setlength{\rightskip}{0pt plus 5cm}unsigned input\_\-count (int {\em argc}, char $\ast$$\ast$ {\em argv})}}
\label{args_8c_a0}


Count the number of input files. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em argc}]Number of command line arguments \item[{\em argv}]Array of command line arguments \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Number of comma separated filenames in the input argument\end{Desc}
\hypertarget{args_8c_a2}{
\index{args.c@{args.c}!output_collect@{output\_\-collect}}
\index{output_collect@{output\_\-collect}!args.c@{args.c}}
\subsubsection[output\_\-collect]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ output\_\-collect (int {\em argc}, char $\ast$$\ast$ {\em argv})}}
\label{args_8c_a2}


Locate the output stub string in the command line arguments. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em argc}]Number of command line arguments \item[{\em argv}]Array of command line arguments \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the output stub string\end{Desc}
\hypertarget{args_8c_a3}{
\index{args.c@{args.c}!verbose_collect@{verbose\_\-collect}}
\index{verbose_collect@{verbose\_\-collect}!args.c@{args.c}}
\subsubsection[verbose\_\-collect]{\setlength{\rightskip}{0pt plus 5cm}unsigned verbose\_\-collect (int {\em argc}, char $\ast$$\ast$ {\em argv})}}
\label{args_8c_a3}


Check the command line arguments for the verbose flag. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em argc}]Number of command line arguments \item[{\em argv}]Array of command line arguments \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0}]If -v is not one of the command line arguments \item[{\em 1}]If -v is one of the command line arguments\end{description}
\end{Desc}
