GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LATC / V9-1-3 > QLATC_report / rhel4-32
#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. |
unsigned file_close | ( | File * | file | ) |
Closes the file.
file | Pointer to a File structure that has been initialised with file_open_w or file_open_r |
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.
file | Pointer to an opened file |
References _File::fd.
unsigned file_open | ( | File * | file, | |
const char * | name | |||
) |
Open the file for reading and verify the version information.
file | Pointer to the structure to use for this file descriptor | |
name | Full pathname of the file to open |
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.
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 |
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.
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) |
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.
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 |
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().