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_fio.c File Reference

Wrapper functions to FBS calls for opening/creating a file. More...

#include "QCFG_p.h"
#include "QCFG/QCFG_msgs.h"
#include "RIM/RIM.h"
#include "MSG/MSG_pubdefs.h"
#include "FBS/FBS_pubrtos.h"
#include "PBS/BSWP.h"
#include <fcntl.h>
#include <unistd.h>

Include dependency graph for QCFG_fio.c:


Functions

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_fioClose (QCFG_fileParm *parm)
 Close a file.
unsigned QCFG_fioReadRecd (void *vParm, unsigned *type, int *leng)
 Read a record header.
unsigned QCFG_fioReadData (void *vParm, void *data, int leng, int *rLeng)
 Read record data.
unsigned QCFG_fioWriteRecd (void *vParm, unsigned type, int leng)
 Write a record header.
unsigned QCFG_fioWriteData (void *vParm, void *data, int leng)
 Write record data.

Detailed Description

Wrapper functions to FBS calls for opening/creating a file.

Author:
James Swain & Owen Saxton
Id
QCFG_fio.c,v 1.2 2007/11/12 20:12:30 saxton Exp

Function Documentation

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


Generated on Wed Oct 29 01:22:01 2008 by  doxygen 1.4.4