GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QCFG / V1-1-3 > qcfg / rhel6-64


Interface   Data Structures   File List   Data Fields   Globals  

QCFG.h File Reference

Public definitions for the ground configuration (QCFG) programs. More...

#include <RIM/RIM.h>

Classes

struct  _QCFG_cmdOptns
 Command line options block. More...

Typedefs

typedef struct _QCFG_cmdOptns QCFG_cmdOptns
 Command line options block.
typedef int QCFG_rimProcCB (RIM *rim, unsigned int secs, void *parm)
 Callback routine for processing a populated RIM.

Functions

unsigned QCFG_consume (RIM *rim, const char *const *filelist, int nFile)
 Read a configuration into a RIM structure.
unsigned QCFG_consumeMap (RIM_map *map, const char *filename)
 Read map data into the map structure.
unsigned QCFG_filterCollect (const char *filt, unsigned int *fMask)
 Generate filter mask from list of type names.
int QCFG_getOptns (int argc, char *const *argv, const char *optStr, QCFG_cmdOptns *optns)
 Get command line options and parameters.
unsigned QCFG_ingest (RIM *rim, const char *filename, QCFG_rimProcCB procRtn, void *parm)
 Process a file of LAT configuration datagrams.
unsigned QCFG_makeFileList (const QCFG_cmdOptns *optns, int *nFile, const char *const **pFList)
 Make file name list.
void QCFG_msgInit (void)
 Initialize the message system.
RIM * QCFG_newRIM (void)
 Allocate and construct a RIM structure.
RIM_map * QCFG_newRIMmap (void)
 Allocate and construct a RIM_map structure.
unsigned QCFG_parse (const char *const *filelist, int nFile, const char *stub, unsigned int fMask, int verb)
 Parse a set of XML files and create the binary configuration files.
unsigned QCFG_parseMap (const char *const *filelist, int nFile, const char *outname, int verb)
 Read XML describing a map of the LAT components and create the equivalent binary file.


Detailed Description

Public definitions for the ground configuration (QCFG) programs.

Author:
James Swain & Owen Saxton
$Id: QCFG.h,v 1.6 2011/03/29 21:42:58 saxton Exp $

Function Documentation

unsigned QCFG_consume ( RIM *  rim,
const char *const *  filelist,
int  nFile 
)

Read a configuration into a RIM structure.

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

Parameters:
rim Pointer to the RIM to repopulate with the configuration information
filelist List of binary configuration files
nFile Number of binary configuration files
Return values:
QCFG_SUCCESS Success
QCFG_BADFOPEN The file could not be opened.
QCFG_BADVERSN The file contained a bad version number
QCFG_BADREAD An error occured while reading the file

References _QCFG_fileParm::name, QCFG_fioClose(), QCFG_fioOpen(), QCFG_fioReadData(), QCFG_fioReadRecd(), and _QCFG_fileParm::versn.

unsigned QCFG_consumeMap ( RIM_map *  map,
const char *  filename 
)

Read map data into the map structure.

Parameters:
map Map structure to populate from file
filename Name of the binary map file to consume
Return values:
QCFG_SUCCESS Success
QCFG_BADFOPEN The file could not be opened.
QCFG_BADVERSN The file contained a bad version number
QCFG_BADREAD An error occured while reading the file

References QCFG_fioClose(), QCFG_fioOpen(), QCFG_fioReadData(), QCFG_fioReadRecd(), and _QCFG_fileParm::versn.

unsigned QCFG_filterCollect ( const char *  filt,
unsigned int *  fMask 
)

Generate filter mask from list of type names.

Parameters:
filt The string consisting of the filter specifications.
fMask The address of a word to receive the filter mask.
Return values:
QCFG_SUCCESS The string is valid
QCFG_BADTYPNM The string contains an unrecognized type.

Referenced by QCFG_makeFileList().

int QCFG_getOptns ( int  argc,
char *const *  argv,
const char *  optStr,
QCFG_cmdOptns optns 
)

Get command line options and parameters.

Parameters:
argc Number of command-line arguments
argv List of command line arguments
optStr Address of string of valid options
optns Address of options block to be filled
Return values:
0 Success
1 Help requested
-1 An error occurred

References _QCFG_cmdOptns::fileList, _QCFG_cmdOptns::filt, _QCFG_cmdOptns::genXml, _QCFG_cmdOptns::ignFile, _QCFG_cmdOptns::index1, _QCFG_cmdOptns::index2, _QCFG_cmdOptns::inpBase, _QCFG_cmdOptns::inpList, _QCFG_cmdOptns::inpPatt, _QCFG_cmdOptns::nFile, _QCFG_cmdOptns::noPrint, _QCFG_cmdOptns::outFile, and _QCFG_cmdOptns::verbose.

unsigned QCFG_ingest ( RIM *  rim,
const char *  filename,
QCFG_rimProcCB  procRtn,
void *  parm 
)

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.

Parameters:
rim In-memory model to populate
filename Name of the file to use as the source of dgms
procRtn Routine to call to process the RIM each time it is populated from a new datagram. May be NULL.
parm User parameter to pass to the callback routine.
Returns:
Overall status

References procDgm().

unsigned QCFG_makeFileList ( const QCFG_cmdOptns optns,
int *  nFile,
const char *const **  pFList 
)

Make file name list.

A list of file names is generated from various components of the options structure. Only one of the three possible methods of specifying the list may be present: either a list of names, the name of a file containing a list of names, or a file name pattern accompanied by a comma-separated list of three-letter configuration filter type names.

Parameters:
optns The address of the options structure.
nFile The address of a word to receive the number of files in the generated list.
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().
Return values:
QCFG_SUCCESS Success.
QCFG_NOCFGFIL No configuration files were specified.
QCFG_DUPLCFGS More than one input method specified.
QCFG_NOMATCHC No matching files found.
QCFG_EXPNFAIL The search for matching files failed
QCFG_BADTYPNM The filter contains an unrecognized type.
QCFG_BADALLOC Insufficient memory available.
QCFG_BADFOPEN Error opening the file list file.
QCFG_BADFREAD Error reading the file list file.

References _QCFG_cmdOptns::fileList, _QCFG_cmdOptns::filt, _QCFG_cmdOptns::inpBase, _QCFG_cmdOptns::inpList, _QCFG_cmdOptns::inpPatt, _QCFG_cmdOptns::nFile, and QCFG_filterCollect().

void QCFG_msgInit ( void   ) 

Initialize the message system.

This routine initializes the message system so that it can be used.

RIM* QCFG_newRIM ( void   ) 

Allocate and construct a RIM structure.

Returns:
Pointer to an allocated and constructed RIM structure

Referenced by QCFG_parse().

RIM_map* QCFG_newRIMmap ( void   ) 

Allocate and construct a RIM_map structure.

Returns:
Pointer to an allocated and constructed RIM_map structure

Referenced by QCFG_parseMap().

unsigned QCFG_parse ( const char *const *  filelist,
int  nFile,
const char *  stub,
unsigned int  fMask,
int  verb 
)

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

Parameters:
filelist List of strings containing the names of XML files to parse
nFile Number of XML files to parse
stub Filename stub to use a basis for output filenames
fMask Bit mask of the components for which to create output files
verb 1 for verbose, 0 for quiet
Return values:
QCFG_SUCCESS If all goes well
QCFG_BADALLOC If there is an error allocating memory
QCFG_BADWRITE if one of the file write operations failed
QCFG_BADOPEN if the file fails to open
QCFG_BADCLOSE if the file close failed
QCFG_XMLPARSE if there is an error parsing the XML

References QCFG_create(), QCFG_genTypeMasks(), and QCFG_newRIM().

unsigned QCFG_parseMap ( const char *const *  filelist,
int  nFile,
const char *  outname,
int  verb 
)

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

Parameters:
filelist List of strings containing the names of XML files to parse
nFile Number of XML files to parse
outname Name of the output file
verb 1 for verbose, 0 for quiet
Return values:
QCFG_SUCCESS if all goes well
QCFG_BADALLOC If there is an error allocating memory
QCFG_BADWRITE if writing to the file failed
QCFG_BADOPEN if the file fails to open
QCFG_BADCLOSE if the file close failed
QCFG_XMLPARSE if there is an error parsing the XML

References QCFG_createMap(), and QCFG_newRIMmap().


Generated on Tue Nov 29 17:06:37 2011 by  doxygen 1.5.8