GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QCFG / V1-1-2 > qcfg / sun-gcc


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.5 2010/04/20 18:32:25 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

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

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.

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

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

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.

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

RIM_map* QCFG_newRIMmap ( void   ) 

Allocate and construct a RIM_map structure.

Returns:
Pointer to an allocated and constructed 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.

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

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


Generated on Tue Apr 20 13:14:29 2010 by  doxygen 1.5.3