\hypertarget{QCFG_8h}{
\section{QCFG.h File Reference}
\label{QCFG_8h}\index{QCFG.h@{QCFG.h}}
}
Public definitions for the ground configuration (QCFG) programs. 

{\tt \#include \char`\"{}RIM/RIM.h\char`\"{}}\par


Include dependency graph for QCFG.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=104pt]{QCFG_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=119pt]{QCFG_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__QCFG__cmdOptns}{\_\-QCFG\_\-cmd\-Optns}
\begin{CompactList}\small\item\em Command line options block. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{QCFG_8h_a0}{
typedef \hyperlink{struct__QCFG__cmdOptns}{\_\-QCFG\_\-cmd\-Optns} \hyperlink{QCFG_8h_a0}{QCFG\_\-cmd\-Optns}}
\label{QCFG_8h_a0}

\begin{CompactList}\small\item\em Command line options block. \item\end{CompactList}\item 
\hypertarget{QCFG_8h_a1}{
typedef int \hyperlink{QCFG_8h_a1}{QCFG\_\-rim\-Proc\-CB} (RIM $\ast$rim, unsigned int secs, void $\ast$parm)}
\label{QCFG_8h_a1}

\begin{CompactList}\small\item\em Callback routine for processing a populated RIM. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned \hyperlink{QCFG_8h_a2}{QCFG\_\-consume} (RIM $\ast$rim, const char $\ast$const $\ast$filelist, int n\-File)
\begin{CompactList}\small\item\em Read a configuration into a RIM structure. \item\end{CompactList}\item 
unsigned \hyperlink{QCFG_8h_a3}{QCFG\_\-consume\-Map} (RIM\_\-map $\ast$map, const char $\ast$filename)
\begin{CompactList}\small\item\em Read map data into the map structure. \item\end{CompactList}\item 
unsigned \hyperlink{QCFG_8h_a4}{QCFG\_\-filter\-Collect} (const char $\ast$filt, unsigned int $\ast$f\-Mask)
\begin{CompactList}\small\item\em Generate filter mask from list of type names. \item\end{CompactList}\item 
int \hyperlink{QCFG_8h_a5}{QCFG\_\-get\-Optns} (int argc, char $\ast$const $\ast$argv, const char $\ast$opt\-Str, \hyperlink{struct__QCFG__cmdOptns}{QCFG\_\-cmd\-Optns} $\ast$optns)
\begin{CompactList}\small\item\em Get command line options and parameters. \item\end{CompactList}\item 
unsigned \hyperlink{QCFG_8h_a6}{QCFG\_\-ingest} (RIM $\ast$rim, const char $\ast$filename, \hyperlink{QCFG_8h_a1}{QCFG\_\-rim\-Proc\-CB} proc\-Rtn, void $\ast$parm)
\begin{CompactList}\small\item\em Process a file of LAT configuration datagrams. \item\end{CompactList}\item 
unsigned \hyperlink{QCFG_8h_a7}{QCFG\_\-make\-File\-List} (const char $\ast$stem, const char $\ast$filt, int $\ast$n\-File, const char $\ast$const $\ast$$\ast$p\-FList)
\begin{CompactList}\small\item\em Make file name list. \item\end{CompactList}\item 
void \hyperlink{QCFG_8h_a8}{QCFG\_\-msg\-Init} (void)
\begin{CompactList}\small\item\em Initialize the message system. \item\end{CompactList}\item 
RIM $\ast$ \hyperlink{QCFG_8h_a9}{QCFG\_\-new\-RIM} (void)
\begin{CompactList}\small\item\em Allocate and construct a RIM structure. \item\end{CompactList}\item 
RIM\_\-map $\ast$ \hyperlink{QCFG_8h_a10}{QCFG\_\-new\-RIMmap} (void)
\begin{CompactList}\small\item\em Allocate and construct a RIM\_\-map structure. \item\end{CompactList}\item 
unsigned \hyperlink{QCFG_8h_a11}{QCFG\_\-parse} (const char $\ast$const $\ast$filelist, int n\-File, const char $\ast$stub, unsigned int f\-Mask, int verb)
\begin{CompactList}\small\item\em Parse a set of XML files and create the binary configuration files. \item\end{CompactList}\item 
unsigned \hyperlink{QCFG_8h_a12}{QCFG\_\-parse\-Map} (const char $\ast$const $\ast$filelist, int n\-File, const char $\ast$outname, int verb)
\begin{CompactList}\small\item\em Read XML describing a map of the LAT components and create the equivalent binary file. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Public definitions for the ground configuration (QCFG) programs. 

\begin{Desc}
\item[Author:]James Swain \& Owen Saxton\end{Desc}
\begin{Desc}
\item[Id]\hyperlink{QCFG_8h}{QCFG.h},v 1.3 2008/12/16 21:11:54 saxton Exp \end{Desc}


\subsection{Function Documentation}
\hypertarget{QCFG_8h_a2}{
\index{QCFG.h@{QCFG.h}!QCFG_consume@{QCFG\_\-consume}}
\index{QCFG_consume@{QCFG\_\-consume}!QCFG.h@{QCFG.h}}
\subsubsection[QCFG\_\-consume]{\setlength{\rightskip}{0pt plus 5cm}unsigned QCFG\_\-consume (RIM $\ast$ {\em rim}, const char $\ast$const $\ast$ {\em filelist}, int {\em n\-File})}}
\label{QCFG_8h_a2}


Read a configuration into a RIM structure. 

The supplied list of binary configuration files is read into the supplied RIM structure.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]Pointer to the RIM to repopulate with the configuration information\item[{\em filelist}]List of binary configuration files\item[{\em n\-File}]Number of binary configuration files\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em QCFG\_\-SUCCESS}]Success \item[{\em QCFG\_\-BADFOPEN}]The file could not be opened. \item[{\em QCFG\_\-BADVERSN}]The file contained a bad version number \item[{\em QCFG\_\-BADREAD}]An error occured while reading the file\end{description}
\end{Desc}
\hypertarget{QCFG_8h_a3}{
\index{QCFG.h@{QCFG.h}!QCFG_consumeMap@{QCFG\_\-consumeMap}}
\index{QCFG_consumeMap@{QCFG\_\-consumeMap}!QCFG.h@{QCFG.h}}
\subsubsection[QCFG\_\-consumeMap]{\setlength{\rightskip}{0pt plus 5cm}unsigned QCFG\_\-consume\-Map (RIM\_\-map $\ast$ {\em map}, const char $\ast$ {\em filename})}}
\label{QCFG_8h_a3}


Read map data into the map structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em map}]Map structure to populate from file\item[{\em filename}]Name of the binary map file to consume\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em QCFG\_\-SUCCESS}]Success \item[{\em QCFG\_\-BADFOPEN}]The file could not be opened. \item[{\em QCFG\_\-BADREAD}]An error occured while reading the file\end{description}
\end{Desc}
\hypertarget{QCFG_8h_a4}{
\index{QCFG.h@{QCFG.h}!QCFG_filterCollect@{QCFG\_\-filterCollect}}
\index{QCFG_filterCollect@{QCFG\_\-filterCollect}!QCFG.h@{QCFG.h}}
\subsubsection[QCFG\_\-filterCollect]{\setlength{\rightskip}{0pt plus 5cm}unsigned QCFG\_\-filter\-Collect (const char $\ast$ {\em filt}, unsigned int $\ast$ {\em f\-Mask})}}
\label{QCFG_8h_a4}


Generate filter mask from list of type names. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em filt}]The string consisting of the filter specifications.\item[{\em f\-Mask}]The address of a word to receive the filter mask.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em QCFG\_\-SUCCESS}]The string is valid \item[{\em QCFG\_\-BADTYPNM}]The string contains an unrecognized type.\end{description}
\end{Desc}
\hypertarget{QCFG_8h_a5}{
\index{QCFG.h@{QCFG.h}!QCFG_getOptns@{QCFG\_\-getOptns}}
\index{QCFG_getOptns@{QCFG\_\-getOptns}!QCFG.h@{QCFG.h}}
\subsubsection[QCFG\_\-getOptns]{\setlength{\rightskip}{0pt plus 5cm}int QCFG\_\-get\-Optns (int {\em argc}, char $\ast$const $\ast$ {\em argv}, const char $\ast$ {\em opt\-Str}, \hyperlink{struct__QCFG__cmdOptns}{QCFG\_\-cmd\-Optns} $\ast$ {\em optns})}}
\label{QCFG_8h_a5}


Get command line options and parameters. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em argc}]Number of command-line arguments\item[{\em argv}]List of command line arguments\item[{\em opt\-Str}]Address of string of valid options\item[{\em optns}]Address of options block to be filled\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0}]Success \item[{\em 1}]Help requested \item[{\em -1}]An error occurred\end{description}
\end{Desc}
\hypertarget{QCFG_8h_a6}{
\index{QCFG.h@{QCFG.h}!QCFG_ingest@{QCFG\_\-ingest}}
\index{QCFG_ingest@{QCFG\_\-ingest}!QCFG.h@{QCFG.h}}
\subsubsection[QCFG\_\-ingest]{\setlength{\rightskip}{0pt plus 5cm}unsigned QCFG\_\-ingest (RIM $\ast$ {\em rim}, const char $\ast$ {\em filename}, \hyperlink{QCFG_8h_a1}{QCFG\_\-rim\-Proc\-CB} {\em proc\-Rtn}, void $\ast$ {\em parm})}}
\label{QCFG_8h_a6}


Process a file of LAT configuration datagrams. 

This routine reads a file of LAT configuration datagrams and populates a RIM structure with each datagram. An optional callback routine may be called to process the contents of the RIM each time.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]In-memory model to populate\item[{\em filename}]Name of the file to use as the source of dgms\item[{\em proc\-Rtn}]Routine to call to process the RIM each time it is populated from a new datagram. May be NULL.\item[{\em parm}]User parameter to pass to the callback routine.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Overall status\end{Desc}
$<$ The read buffer \hypertarget{QCFG_8h_a7}{
\index{QCFG.h@{QCFG.h}!QCFG_makeFileList@{QCFG\_\-makeFileList}}
\index{QCFG_makeFileList@{QCFG\_\-makeFileList}!QCFG.h@{QCFG.h}}
\subsubsection[QCFG\_\-makeFileList]{\setlength{\rightskip}{0pt plus 5cm}unsigned QCFG\_\-make\-File\-List (const char $\ast$ {\em stem}, const char $\ast$ {\em filt}, int $\ast$ {\em n\-File}, const char $\ast$const $\ast$$\ast$ {\em p\-FList})}}
\label{QCFG_8h_a7}


Make file name list. 

A list of file names is generated from a file name stem and a comma- separated list of three-letter configuration filter type names. Only files that exist are include in the list.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em stem}]The address of the file name stem. This may contain a single \char`\"{}\%\char`\"{} character, in which case a list of names is generated with each of the names in filt in turn being substituted for \char`\"{}\%\char`\"{}. If no \char`\"{}\% character is present, it is as if the string \char`\"{}\%.lcb\char`\"{} were appended to stem. If the address is NULL, no list is generated.\item[{\em filt}]The address of the string consisting of the filter specifications separated by commas. If NULL, all valid filter names are used.\item[{\em n\-File}]The address of a word to receive the number of files in the generated list.\item[{\em p\-FList}]The address of a pointer to receive the address of the generated file name list, allocated from the heap. This should be freed when no longer needed, using free().\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em QCFG\_\-SUCCESS}]Success \item[{\em QCFG\_\-EXPNFAIL}]The search for matching files failed \item[{\em QCFG\_\-BADTYPNM}]The filter contains an unrecognized type.\end{description}
\end{Desc}
\hypertarget{QCFG_8h_a8}{
\index{QCFG.h@{QCFG.h}!QCFG_msgInit@{QCFG\_\-msgInit}}
\index{QCFG_msgInit@{QCFG\_\-msgInit}!QCFG.h@{QCFG.h}}
\subsubsection[QCFG\_\-msgInit]{\setlength{\rightskip}{0pt plus 5cm}void QCFG\_\-msg\-Init (void)}}
\label{QCFG_8h_a8}


Initialize the message system. 

This routine initializes the message system so that it can be used.\hypertarget{QCFG_8h_a9}{
\index{QCFG.h@{QCFG.h}!QCFG_newRIM@{QCFG\_\-newRIM}}
\index{QCFG_newRIM@{QCFG\_\-newRIM}!QCFG.h@{QCFG.h}}
\subsubsection[QCFG\_\-newRIM]{\setlength{\rightskip}{0pt plus 5cm}RIM$\ast$ QCFG\_\-new\-RIM (void)}}
\label{QCFG_8h_a9}


Allocate and construct a RIM structure. 

\begin{Desc}
\item[Returns:]Pointer to an allocated and constructed RIM structure\end{Desc}
\hypertarget{QCFG_8h_a10}{
\index{QCFG.h@{QCFG.h}!QCFG_newRIMmap@{QCFG\_\-newRIMmap}}
\index{QCFG_newRIMmap@{QCFG\_\-newRIMmap}!QCFG.h@{QCFG.h}}
\subsubsection[QCFG\_\-newRIMmap]{\setlength{\rightskip}{0pt plus 5cm}RIM\_\-map$\ast$ QCFG\_\-new\-RIMmap (void)}}
\label{QCFG_8h_a10}


Allocate and construct a RIM\_\-map structure. 

\begin{Desc}
\item[Returns:]Pointer to an allocated and constructure RIM\_\-map structure\end{Desc}
\hypertarget{QCFG_8h_a11}{
\index{QCFG.h@{QCFG.h}!QCFG_parse@{QCFG\_\-parse}}
\index{QCFG_parse@{QCFG\_\-parse}!QCFG.h@{QCFG.h}}
\subsubsection[QCFG\_\-parse]{\setlength{\rightskip}{0pt plus 5cm}unsigned QCFG\_\-parse (const char $\ast$const $\ast$ {\em filelist}, int {\em n\-File}, const char $\ast$ {\em stub}, unsigned int {\em f\-Mask}, int {\em verb})}}
\label{QCFG_8h_a11}


Parse a set of XML files and create the binary configuration files. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em filelist}]List of strings containing the names of XML files to parse\item[{\em n\-File}]Number of XML files to parse\item[{\em stub}]Filename stub to use a basis for output filenames\item[{\em f\-Mask}]Bit mask of the components for which to create output files\item[{\em verb}]1 for verbose, 0 for quiet\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em QCFG\_\-SUCCESS}]If all goes well \item[{\em QCFG\_\-BADALLOC}]If there is an error allocating memory \item[{\em QCFG\_\-BADWRITE}]if one of the file write operations failed \item[{\em QCFG\_\-BADOPEN}]if the file fails to open \item[{\em QCFG\_\-BADCLOSE}]if the file close failed \item[{\em QCFG\_\-XMLPARSE}]if there is an error parsing the XML\end{description}
\end{Desc}
\hypertarget{QCFG_8h_a12}{
\index{QCFG.h@{QCFG.h}!QCFG_parseMap@{QCFG\_\-parseMap}}
\index{QCFG_parseMap@{QCFG\_\-parseMap}!QCFG.h@{QCFG.h}}
\subsubsection[QCFG\_\-parseMap]{\setlength{\rightskip}{0pt plus 5cm}unsigned QCFG\_\-parse\-Map (const char $\ast$const $\ast$ {\em filelist}, int {\em n\-File}, const char $\ast$ {\em outname}, int {\em verb})}}
\label{QCFG_8h_a12}


Read XML describing a map of the LAT components and create the equivalent binary file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em filelist}]List of strings containing the names of XML files to parse\item[{\em n\-File}]Number of XML files to parse\item[{\em outname}]Name of the output file\item[{\em verb}]1 for verbose, 0 for quiet\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em QCFG\_\-SUCCESS}]if all goes well \item[{\em QCFG\_\-BADALLOC}]If there is an error allocating memory \item[{\em QCFG\_\-BADWRITE}]if writing to the file failed \item[{\em QCFG\_\-BADOPEN}]if the file fails to open \item[{\em QCFG\_\-BADCLOSE}]if the file close failed \item[{\em QCFG\_\-XMLPARSE}]if there is an error parsing the XML\end{description}
\end{Desc}
