GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QCFG / V1-1-3 > qcfg / rhel6-32
#include <RIM/RIM.h>
Classes | |
struct | _QCFG_fileParm |
Parameter block for file operations. More... | |
Typedefs | |
typedef struct _QCFG_fileParm | QCFG_fileParm |
Parameter block for file operations. | |
Enumerations | |
enum | { FIO_PERMS = 0666 } |
File permissions for output files. | |
Functions | |
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 *fParm) |
Close a file. | |
unsigned | QCFG_fioCreate (QCFG_fileParm *fParm, const char *name) |
Create a file. | |
unsigned | QCFG_fioOpen (QCFG_fileParm *fParm, const char *name) |
Open a file for reading. | |
unsigned | QCFG_fioReadData (void *parm, int iShrt, void *data, int leng, int *rLeng) |
Read record data. | |
unsigned | QCFG_fioReadRecd (void *parm, unsigned *type, int *leng) |
Read a record header. | |
unsigned | QCFG_fioWriteData (void *parm, void *data, int leng) |
Write record data. | |
unsigned | QCFG_fioWriteRecd (void *parm, unsigned type, int leng) |
Write a record header. | |
void | QCFG_genTypeMasks (RIM *rim, int type, unsigned *dMask, unsigned *eMask) |
$Id: QCFG_p.h,v 1.9 2011/03/29 21:37:55 saxton Exp $
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.
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 |
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 |
References exportMask(), QCFG_fioClose(), QCFG_fioCreate(), QCFG_fioWriteData(), and QCFG_fioWriteRecd().
Referenced by QCFG_parse().
unsigned QCFG_createMap | ( | RIM_map * | map, | |
const char * | filename | |||
) |
Write out the data of a RIM map structure.
map | Pointer to the RIM_map whose data should be written to file | |
filename | Name of the destination file |
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 |
References QCFG_fioClose(), QCFG_fioCreate(), QCFG_fioWriteData(), and QCFG_fioWriteRecd().
Referenced by QCFG_parseMap().
unsigned QCFG_fioClose | ( | QCFG_fileParm * | fParm | ) |
Close a file.
fParm | The address of the file parameter block |
QCFG_SUCCESS | Success | |
QCFG_BADCLOSE | The file close failed |
References _QCFG_fileParm::fd, and _QCFG_fileParm::name.
Referenced by QCFG_consume(), QCFG_consumeMap(), QCFG_create(), and QCFG_createMap().
unsigned QCFG_fioCreate | ( | QCFG_fileParm * | fParm, | |
const char * | name | |||
) |
Create a file.
This routine creates a new file and writes version information. If the file already exists, it is overwritten.
fParm | Pointer to the file parameter block | |
name | Full pathname of the file to open |
QCFG_SUCCESS | Success | |
QCFG_BADFOPEN | The file failed to open | |
QCFG_BADWRITE | Writing the version information failed |
References _QCFG_fileParm::fd, _QCFG_fileParm::leng, _QCFG_fileParm::name, _QCFG_fileParm::status, and _QCFG_fileParm::versn.
Referenced by QCFG_create(), and QCFG_createMap().
unsigned QCFG_fioOpen | ( | QCFG_fileParm * | fParm, | |
const char * | name | |||
) |
Open a file for reading.
This routine opens a file for reading and verifies the version information.
fParm | Pointer to the file parameter block | |
name | Full pathname of the file to open |
QCFG_SUCCESS | Success | |
QCFG_BADFOPEN | File couldn't be opened | |
QCFG_FILESHRT | Partial or no version header was read | |
QCFG_BADREAD | An error occurred while reading the version |
References _QCFG_fileParm::fd, _QCFG_fileParm::leng, _QCFG_fileParm::name, _QCFG_fileParm::status, and _QCFG_fileParm::versn.
Referenced by QCFG_consume(), and QCFG_consumeMap().
unsigned QCFG_fioReadData | ( | void * | parm, | |
int | iShrt, | |||
void * | data, | |||
int | leng, | |||
int * | rLeng | |||
) |
Read record data.
This routine, designed to work in conjunction with RIM_import, reads data from an open file, making sure that it will not overflow the current record.
parm | The address of the file parameter block | |
iShrt | If TRUE, ignore any short record error. | |
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. |
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 |
References _QCFG_fileParm::fd, _QCFG_fileParm::leng, _QCFG_fileParm::name, and _QCFG_fileParm::status.
Referenced by QCFG_consume(), and QCFG_consumeMap().
unsigned QCFG_fioReadRecd | ( | void * | parm, | |
unsigned * | type, | |||
int * | leng | |||
) |
Read a record header.
This routine, designed to work in conjunction with RIM_import, reads the next record header from an open file.
parm | 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. |
QCFG_SUCCESS | Success | |
QCFG_EOFREAD | End of file was reached | |
QCFG_FILESHRT | Partial header was read | |
QCFG_BADREAD | A read error occurred |
References _QCFG_fileParm::fd, _QCFG_fileParm::leng, _QCFG_fileParm::name, and _QCFG_fileParm::status.
Referenced by QCFG_consume(), and QCFG_consumeMap().
unsigned QCFG_fioWriteData | ( | void * | parm, | |
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.
parm | The address of the file parameter block | |
data | The address of the data to write. | |
leng | The number of bytes of data to write. |
QCFG_SUCCESS | Success | |
QCFG_RECDOFL | Requested export overflows record | |
QCFG_BADWRITE | A write error occurred |
References _QCFG_fileParm::fd, _QCFG_fileParm::leng, _QCFG_fileParm::name, and _QCFG_fileParm::status.
Referenced by QCFG_create(), and QCFG_createMap().
unsigned QCFG_fioWriteRecd | ( | void * | parm, | |
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.
parm | The address of the file parameter block | |
type | The record type (must be < 256). | |
leng | The record length, in bytes (must be < 2 ** 24). |
QCFG_SUCCESS | Success | |
QCFG_BADWRITE | A write error occurred |
References _QCFG_fileParm::fd, _QCFG_fileParm::leng, _QCFG_fileParm::name, and _QCFG_fileParm::status.
Referenced by QCFG_create(), and QCFG_createMap().