GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QCFG / V1-0-5

Constituent: qcfg     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

QCFG_p.h File Reference

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

#include "RIM/RIM.h"

Include dependency graph for QCFG_p.h:

This graph shows which files directly or indirectly include this file:


Data Structures

struct  _QCFG_cmdOptns
 Command line options block. More...
struct  _QCFG_fileParm
 Parameter block for file operations. More...

Typedefs

typedef _QCFG_cmdOptns QCFG_cmdOptns
 Command line options block.
typedef _QCFG_fileParm QCFG_fileParm
 Parameter block for file operations.
typedef int QCFG_rimProcCB (RIM *rim, void *parm)
 Callback routine for processing a populated RIM.

Functions

unsigned QCFG_consume (RIM *rim, char **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_create (RIM *rim, unsigned filter, const char *stub)
 Create a set of binary configuration files based on the contents of the rim, using stub as the stub of the output file names.
unsigned QCFG_createMap (RIM_map *map, const char *filename)
 Write out the data of a RIM map structure.
unsigned QCFG_fioClose (QCFG_fileParm *parm)
 Close a file.
unsigned QCFG_fioCreate (QCFG_fileParm *parm, const char *name)
 Create a file.
unsigned QCFG_fioOpen (QCFG_fileParm *parm, const char *name)
 Open a file for reading.
unsigned QCFG_fioReadData (void *vParm, void *data, int leng, int *rLeng)
 Read record data.
unsigned QCFG_fioReadRecd (void *vParm, unsigned *type, int *leng)
 Read a record header.
unsigned QCFG_fioWriteData (void *vParm, void *data, int leng)
 Write record data.
unsigned QCFG_fioWriteRecd (void *vParm, unsigned type, int leng)
 Write a record header.
unsigned QCFG_filterCollect (char *filt, int *fMask)
 Generate filter mask from list of type names.
int QCFG_getOptns (int argc, char **argv, 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 (char *stem, char *filt, int *nFile, char ***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 (char **filelist, unsigned filecount, char *stub, unsigned filter, unsigned verb)
 Parse a set of XML files and spit out the binary configuration files.
unsigned QCFG_parseMap (char **filelist, unsigned filecount, char *outname, unsigned verb)
 Read XML describing a map of the LAT components and create the equivalent binary file.

Detailed Description

Private definitions for the ground configuration (QCFG) programs.

Author:
James Swain & Owen Saxton
Id
QCFG_p.h,v 1.4 2007/12/15 00:11:40 saxton Exp

Function Documentation

unsigned QCFG_consume RIM *  rim,
char **  filelist,
int  nfiles
 

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
nfiles 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_BADREAD An error occured while reading the file

unsigned QCFG_create RIM *  rim,
unsigned  filter,
const char *  stub
 

Create a set of binary configuration files based on the contents of the rim, using stub as the stub of the output file names.

Parameters:
rim RIM structure used as the basis of the binary configuration
stub Stub to use as a basis for the output filenames
filter Bitmask of LAT component files to create
Return values:
QCFG_SUCCESS Success
QCFG_BADFOPEN A file could not be opened
QCFG_BADWRITE An error occured while writing a file
QCFG_BADCLOSE A file close failed
QCFG_BADALLOC No memory available for temporary name

unsigned QCFG_createMap RIM_map *  map,
const char *  filename
 

Write out the data of a RIM map structure.

Parameters:
map Pointer to the RIM_map whose data should be written to file
filename Name of the destination file
Return values:
QCFG_SUCCESS Success
QCFG_BADFOPEN The file could not be opened.
QCFG_BADWRITE An error occured while writing the file
QCFG_BADCLOSE The file close failed

unsigned QCFG_filterCollect char *  filt,
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.

unsigned QCFG_fioClose QCFG_fileParm parm  ) 
 

Close a file.

Parameters:
parm The address of the file parameter block
Return values:
QCFG_SUCCESS Success
QCFG_BADCLOSE The file close failed

unsigned QCFG_fioCreate QCFG_fileParm parm,
const char *  name
 

Create a file.

This routine creates a new file and writes version information. If the file already exists, it is overwritten.

Parameters:
parm Pointer to the file parameter block
name Full pathname of the file to open
Return values:
QCFG_SUCCESS Success
QCFG_BADFOPEN The file failed to open
QCFG_BADWRITE Writing the version information failed

unsigned QCFG_fioOpen QCFG_fileParm parm,
const char *  name
 

Open a file for reading.

This routine opens a file for reading and verifies the version information.

Parameters:
parm Pointer to the file parameter block
name Full pathname of the file to open
Return values:
QCFG_SUCCESS Success
QCFG_BADFOPEN File couldn't be opened
QCFG_BADVERSN The version in the file doesn't match current
QCFG_FILESHRT Partial or no version header was read
QCFG_BADREAD An error occurred while reading the version

unsigned QCFG_fioReadData void *  vParm,
void *  data,
int  leng,
int *  rLeng
 

Read record data.

This routine, designed to work in conjunction with RIM_export, reads data from an open file, making sure that it will not overflow the current record.

Parameters:
vParm The address of the file parameter block
data The address of the area to receive the data read.
leng The number of bytes of data to read.
rLeng The address of an integer to receive the number of bytes actually read.
Return values:
QCFG_SUCCESS Success
QCFG_RECDSHRT Requested read extends beyond end of record
QCFG_FILESHRT Requested read extends beyond EOF
QCFG_BADREAD A read error occurred

unsigned QCFG_fioReadRecd void *  vParm,
unsigned *  type,
int *  leng
 

Read a record header.

This routine, designed to work in conjunction with RIM_export, reads the next record header from an open file.

Parameters:
vParm The address of the file parameter block
type The address of an integer to receive the record type.
leng The address of an integer to receive the record length, in bytes. This is set to 0 if EOF was reached, or to -1 for other error conditions.
Return values:
QCFG_SUCCESS Success
QCFG_EOFREAD End of file was reached
QCFG_FILESHRT Partial header was read
QCFG_BADREAD A read error occurred

unsigned QCFG_fioWriteData void *  vParm,
void *  data,
int  leng
 

Write record data.

This routine, designed to work in conjunction with RIM_export, writes data to an open file, checking that it will not overflow the current record.

Parameters:
vParm The address of the file parameter block
data The address of the data to write.
leng The number of bytes of data to write.
Return values:
QCFG_SUCCESS Success
QCFG_RECDOFL Requested export overflows record
QCFG_BADWRITE A write error occurred

unsigned QCFG_fioWriteRecd void *  vParm,
unsigned  type,
int  leng
 

Write a record header.

This routine, designed to work in conjunction with RIM_export, writes a new record header to an open file, checking that the previous record was completely filled.

Parameters:
vParm The address of the file parameter block
type The record type (must be < 256).
leng The record length, in bytes (must be < 2 ** 24).
Return values:
QCFG_SUCCESS Success
QCFG_BADWRITE A write error occurred

int QCFG_getOptns int  argc,
char **  argv,
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
< The read buffer

unsigned QCFG_makeFileList char *  stem,
char *  filt,
int *  nFile,
char ***  pFList
 

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.

Parameters:
stem The address of the file name stem. This may contain a single "%" character, in which case a list of names is generated with each of the names in filt in turn being substituted for "%". If no "% character is present, it is as if the string "%.lcb" were appended to stem. If the address is NULL, no list is generated.
filt The address of the string consisting of the filter specifications separated by commas. If NULL, all valid filter names are used.
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_EXPNFAIL The search for matching files failed
QCFG_BADTYPNM The filter contains an unrecognized type.

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 constructure RIM_map structure

unsigned QCFG_parse char **  filelist,
unsigned  filecount,
char *  stub,
unsigned  filter,
unsigned  verb
 

Parse a set of XML files and spit out the binary configuration files.

Parameters:
filelist List of strings containing the names of XML files to parse
filecount Number of XML files to parse
stub Filename stub to use a basis for output filenames
filter Bit mask of the components to create output files for
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 char **  filelist,
unsigned  filecount,
char *  outname,
unsigned  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
filecount 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 Wed Oct 29 01:22:04 2008 by  doxygen 1.4.4