GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LATC / V9-1-3 > QLATC_report / rhel4-32


Interface   Data Structures   File List   Data Fields   Globals  

fi_p.h File Reference

Wrapper functions to stdio calls for recovering a previously create file. More...

#include <fio_p.h>

Functions

unsigned file_open (File *file, const char *name)
 Open the file for reading and verify the version information.
unsigned file_read (File *file, void *ptr, int nword)
 Copies the next nword words into the location inidicated by ptr, refreshing the buffer if necessary.
unsigned file_vread (File *file, FileElement *vec, int n)
 Performs of sequence of n read operation using the pointer and size information in the array of file elements, vec.
unsigned file_renew (File *file)
 Checks that this is a read file then reads the next FIO_BUF_SIZE bytes from disk and byteswaps to local-endianness.
unsigned file_key (File *file)
 Return the key for this file.
unsigned file_close (File *file)
 Closes the file.


Detailed Description

Wrapper functions to stdio calls for recovering a previously create file.

Author:
James Swain -- jswain@slac.stanford.edu

Function Documentation

unsigned file_close ( File file  ) 

Closes the file.

Parameters:
file Pointer to a File structure that has been initialised with file_open_w or file_open_r
Return values:
LATC_BADWRITE if the final write of the buffer failed
LATC_BADCLOSE if the file close failed
LATC_SUCCESS if all goes well

References _File::fd.

Referenced by QLATC_consume(), and QLATC_consumeMap().

unsigned file_key ( File file  ) 

Return the key for this file.

Parameters:
file Pointer to an opened file
Returns:
The key for this file

References _File::fd.

unsigned file_open ( File file,
const char *  name 
)

Open the file for reading and verify the version information.

Parameters:
file Pointer to the structure to use for this file descriptor
name Full pathname of the file to open
Return values:
LATC_SUCCESS if the file opens for reading
LATC_BADFOEN if the file fails to open
LATC_VERSION the version information at the head of the file is inconsisten with the current LATC version

References _File::fd, _File::mode, and _File::used.

Referenced by QLATC_consume(), and QLATC_consumeMap().

unsigned file_read ( File file,
void *  ptr,
int  nword 
)

Copies the next nword words into the location inidicated by ptr, refreshing the buffer if necessary.

Parameters:
file Pointer to a file structure that his been initialised with file_open_r.
nword Number of 32-bit words in the data block to write
ptr Pointer to location to place data read
Return values:
LATC_BADREAD if file_renew is called and fails
LATC_ENDOFILE if file_renew is called and hits the end of the file (not reported)
LATC_WRITONLY if called with a file opened for writing
LATC_SUCCESS if all goes well

References _File::buffer, _File::fd, file_renew(), _File::mode, and _File::used.

Referenced by consumeAEMFile(), consumeDefaultFile(), consumeGEMFile(), consumeNormalFile(), file_vread(), QLATC_consume(), and QLATC_consumeMap().

unsigned file_renew ( File file  ) 

Checks that this is a read file then reads the next FIO_BUF_SIZE bytes from disk and byteswaps to local-endianness.

Parameters:
file Pointer to a File structure that has been initialised with file_open_r (although just returns LATC_SUCCESS if used on a file opened for writing)
Return values:
LATC_BADREAD if the file fails to read
LATC_ENDOFILE if there are no more blocks to read (not reported)
LATC_SUCCESS if all goes well or this file is not readable

References _File::buffer, _File::fd, _File::mode, and _File::used.

Referenced by file_read().

unsigned file_vread ( File file,
FileElement vec,
int  n 
)

Performs of sequence of n read operation using the pointer and size information in the array of file elements, vec.

Parameters:
file Pointer to a file structure that has been initialised with file_open_r
vec Array of FileElement structures listing fragments to read and their sizes
n Number of elements in the array
Return values:
LATC_BADREAD if file_renew is called and fails
LATC_ENDOFILE if file_renew is called and hits the end of the file (not reported)
LATC_WRITONLY if called with a file opened for writing
LATC_SUCCESS if all goes well

References _FileElement::done, and file_read().


Generated on Sat Apr 9 19:54:01 2011 by  doxygen 1.5.8