\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
\subsection*{Classes}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__QCFG__cmdOptns}{\_\-QCFG\_\-cmdOptns}
\begin{CompactList}\small\item\em Command line options block. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{QCFG_8h_f5e768888a46e685a1a117c57f9c27a1}{
typedef struct \hyperlink{struct__QCFG__cmdOptns}{\_\-QCFG\_\-cmdOptns} \hyperlink{QCFG_8h_f5e768888a46e685a1a117c57f9c27a1}{QCFG\_\-cmdOptns}}
\label{QCFG_8h_f5e768888a46e685a1a117c57f9c27a1}

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

\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_95653117923f23552383488b4636d4e4}{QCFG\_\-consume} (RIM $\ast$rim, const char $\ast$const $\ast$filelist, int nFile)
\begin{CompactList}\small\item\em Read a configuration into a RIM structure. \item\end{CompactList}\item 
unsigned \hyperlink{QCFG_8h_6d0c96b66a70a190e26adc0cd02b3390}{QCFG\_\-consumeMap} (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_5d7d29fe5b5e8591593f3eac2ca8099a}{QCFG\_\-filterCollect} (const char $\ast$filt, unsigned int $\ast$fMask)
\begin{CompactList}\small\item\em Generate filter mask from list of type names. \item\end{CompactList}\item 
int \hyperlink{QCFG_8h_47a2602cf24efbb6fb1b509a33a529b0}{QCFG\_\-getOptns} (int argc, char $\ast$const $\ast$argv, const char $\ast$optStr, \hyperlink{struct__QCFG__cmdOptns}{QCFG\_\-cmdOptns} $\ast$optns)
\begin{CompactList}\small\item\em Get command line options and parameters. \item\end{CompactList}\item 
unsigned \hyperlink{QCFG_8h_b34f4369948cbaf31fc0b56f7976ee6a}{QCFG\_\-ingest} (RIM $\ast$rim, const char $\ast$filename, \hyperlink{QCFG_8h_21da9f1c61bb156a28ceacd11b8b96e8}{QCFG\_\-rimProcCB} procRtn, void $\ast$parm)
\begin{CompactList}\small\item\em Process a file of LAT configuration datagrams. \item\end{CompactList}\item 
unsigned \hyperlink{QCFG_8h_cb0bf87925d248ee13d6a81b9e54e35c}{QCFG\_\-makeFileList} (const char $\ast$stem, const char $\ast$filt, int $\ast$nFile, const char $\ast$const $\ast$$\ast$pFList)
\begin{CompactList}\small\item\em Make file name list. \item\end{CompactList}\item 
void \hyperlink{QCFG_8h_922c0f4c2ea59de01ffb9808150fa33c}{QCFG\_\-msgInit} (void)
\begin{CompactList}\small\item\em Initialize the message system. \item\end{CompactList}\item 
RIM $\ast$ \hyperlink{QCFG_8h_02e8ca02307e217f20c6a99d4c56cd7e}{QCFG\_\-newRIM} (void)
\begin{CompactList}\small\item\em Allocate and construct a RIM structure. \item\end{CompactList}\item 
RIM\_\-map $\ast$ \hyperlink{QCFG_8h_5622fdab273cedefe19e51e8f207d18e}{QCFG\_\-newRIMmap} (void)
\begin{CompactList}\small\item\em Allocate and construct a RIM\_\-map structure. \item\end{CompactList}\item 
unsigned \hyperlink{QCFG_8h_0901a63805b2e2b704709984023a37bd}{QCFG\_\-parse} (const char $\ast$const $\ast$filelist, int nFile, const char $\ast$stub, unsigned int fMask, 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_a52c96ece0f274ee6065b65169015475}{QCFG\_\-parseMap} (const char $\ast$const $\ast$filelist, int nFile, 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]\end{Desc}


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


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 nFile}]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_6d0c96b66a70a190e26adc0cd02b3390}{
\index{QCFG.h@{QCFG.h}!QCFG_consumeMap@{QCFG\_\-consumeMap}}
\index{QCFG_consumeMap@{QCFG\_\-consumeMap}!QCFG.h@{QCFG.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned QCFG\_\-consumeMap (RIM\_\-map $\ast$ {\em map}, const char $\ast$ {\em filename})}}
\label{QCFG_8h_6d0c96b66a70a190e26adc0cd02b3390}


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\_\-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_5d7d29fe5b5e8591593f3eac2ca8099a}{
\index{QCFG.h@{QCFG.h}!QCFG_filterCollect@{QCFG\_\-filterCollect}}
\index{QCFG_filterCollect@{QCFG\_\-filterCollect}!QCFG.h@{QCFG.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned QCFG\_\-filterCollect (const char $\ast$ {\em filt}, unsigned int $\ast$ {\em fMask})}}
\label{QCFG_8h_5d7d29fe5b5e8591593f3eac2ca8099a}


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 fMask}]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_47a2602cf24efbb6fb1b509a33a529b0}{
\index{QCFG.h@{QCFG.h}!QCFG_getOptns@{QCFG\_\-getOptns}}
\index{QCFG_getOptns@{QCFG\_\-getOptns}!QCFG.h@{QCFG.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int QCFG\_\-getOptns (int {\em argc}, char $\ast$const $\ast$ {\em argv}, const char $\ast$ {\em optStr}, {\bf QCFG\_\-cmdOptns} $\ast$ {\em optns})}}
\label{QCFG_8h_47a2602cf24efbb6fb1b509a33a529b0}


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 optStr}]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_b34f4369948cbaf31fc0b56f7976ee6a}{
\index{QCFG.h@{QCFG.h}!QCFG_ingest@{QCFG\_\-ingest}}
\index{QCFG_ingest@{QCFG\_\-ingest}!QCFG.h@{QCFG.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned QCFG\_\-ingest (RIM $\ast$ {\em rim}, const char $\ast$ {\em filename}, {\bf QCFG\_\-rimProcCB} {\em procRtn}, void $\ast$ {\em parm})}}
\label{QCFG_8h_b34f4369948cbaf31fc0b56f7976ee6a}


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 procRtn}]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_cb0bf87925d248ee13d6a81b9e54e35c}{
\index{QCFG.h@{QCFG.h}!QCFG_makeFileList@{QCFG\_\-makeFileList}}
\index{QCFG_makeFileList@{QCFG\_\-makeFileList}!QCFG.h@{QCFG.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned QCFG\_\-makeFileList (const char $\ast$ {\em stem}, const char $\ast$ {\em filt}, int $\ast$ {\em nFile}, const char $\ast$const $\ast$$\ast$ {\em pFList})}}
\label{QCFG_8h_cb0bf87925d248ee13d6a81b9e54e35c}


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 nFile}]The address of a word to receive the number of files in the generated list.\item[{\em pFList}]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_922c0f4c2ea59de01ffb9808150fa33c}{
\index{QCFG.h@{QCFG.h}!QCFG_msgInit@{QCFG\_\-msgInit}}
\index{QCFG_msgInit@{QCFG\_\-msgInit}!QCFG.h@{QCFG.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void QCFG\_\-msgInit (void)}}
\label{QCFG_8h_922c0f4c2ea59de01ffb9808150fa33c}


Initialize the message system. 

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


Allocate and construct a RIM structure. 

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


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_0901a63805b2e2b704709984023a37bd}{
\index{QCFG.h@{QCFG.h}!QCFG_parse@{QCFG\_\-parse}}
\index{QCFG_parse@{QCFG\_\-parse}!QCFG.h@{QCFG.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned QCFG\_\-parse (const char $\ast$const $\ast$ {\em filelist}, int {\em nFile}, const char $\ast$ {\em stub}, unsigned int {\em fMask}, int {\em verb})}}
\label{QCFG_8h_0901a63805b2e2b704709984023a37bd}


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

History:

17 Nov 2005 : Added history block : Converted to make use of the new RIM package 12 Sep 2007 : Used QCFG message codes for return values. 21 Nov 2008 : Added include of \hyperlink{QCFG_8h}{QCFG.h} 09 Dec 2008 : Added const qualifers where appropriate. 15 Dec 2008 : Added register map processing. 16 Dec 2008 : Cleaned up arguments.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em filelist}]List of strings containing the names of XML files to parse\item[{\em nFile}]Number of XML files to parse\item[{\em stub}]Filename stub to use a basis for output filenames\item[{\em fMask}]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_a52c96ece0f274ee6065b65169015475}{
\index{QCFG.h@{QCFG.h}!QCFG_parseMap@{QCFG\_\-parseMap}}
\index{QCFG_parseMap@{QCFG\_\-parseMap}!QCFG.h@{QCFG.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned QCFG\_\-parseMap (const char $\ast$const $\ast$ {\em filelist}, int {\em nFile}, const char $\ast$ {\em outname}, int {\em verb})}}
\label{QCFG_8h_a52c96ece0f274ee6065b65169015475}


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 nFile}]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}
