GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QCFG / V1-1-1 > qcfg / linux-gcc
#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 char *stem, const char *filt, 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. | |
| 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.
| rim | Pointer to the RIM to repopulate with the configuration information | |
| filelist | List of binary configuration files | |
| nFile | Number of binary configuration files |
| 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.
| map | Map structure to populate from file | |
| filename | Name of the binary map file to consume |
| 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.
| filt | The string consisting of the filter specifications. | |
| fMask | The address of a word to receive the filter mask. |
| 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.
| 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 |
| 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.
| 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. |
< The read buffer
| unsigned QCFG_makeFileList | ( | const char * | stem, | |
| const char * | filt, | |||
| int * | nFile, | |||
| const char *const ** | 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.
| 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(). |
| 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.
| 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.
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 QCFG.h 09 Dec 2008 : Added const qualifers where appropriate. 15 Dec 2008 : Added register map processing. 16 Dec 2008 : Cleaned up arguments.
| 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 |
| 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.
| 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 |
| 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 |
1.5.3