GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QCFG / V1-1-3 > qcfg / sun-gcc
#include <QCFG/QCFG.h>
#include <QCFG/QCFG_msgs.h>
#include <RIM/RIM.h>
#include <XLX/XLX.h>
#include <MSG/MSG_pubdefs.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <wordexp.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
Defines | |
#define | NL 0x0a |
Functions | |
unsigned | QCFG_filterCollect (const char *filt, unsigned int *fMask) |
Generate filter mask from list of type names. | |
void | QCFG_genTypeMasks (RIM *rim, int type, unsigned int *dMask, unsigned int *eMask) |
Generate type masks of requested present data. | |
int | QCFG_getOptns (int argc, char *const *argv, const char *optStr, QCFG_cmdOptns *optns) |
Get command line options and parameters. | |
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. |
$Id: QCFG_utils.c,v 1.11 2011/03/29 21:46:07 saxton Exp $
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. |
Referenced by QCFG_makeFileList().
void QCFG_genTypeMasks | ( | RIM * | rim, | |
int | type, | |||
unsigned int * | dMask, | |||
unsigned int * | eMask | |||
) |
Generate type masks of requested present data.
Given a file type, this routine generates two bitmasks, one each for defaults and exception, indicating which types are to be inserted into the generated output stream. If there is no data for a particular file type, the masks will both be zero.
rim | Pointer to the in-memory model data | |
type | The type of output to be generated. | |
dMask | The address of the generated defaults mask. | |
eMask | The address of the generated exception mask. |
Referenced by exportMask(), and QCFG_parse().
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 |
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_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.
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(). |
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.