|
TPCCLIB
|
Basic IO functions for ECAT files. More...
#include "tpcclibConfig.h"#include <stdio.h>#include <stdlib.h>#include <math.h>#include <time.h>#include <string.h>#include "tpcextensions.h"#include "tpcecat.h"Go to the source code of this file.
Functions | |
| int | ecatReadBlock (const char *filename, FILE *fp, const unsigned int blocknumber, unsigned char *data) |
| int | ecatVerifyMagic (const char *filename, FILE *fp) |
Basic IO functions for ECAT files.
Definition in file ecatio.c.
| int ecatReadBlock | ( | const char * | filename, |
| FILE * | fp, | ||
| const unsigned int | blocknumber, | ||
| unsigned char * | data ) |
Read specified data block from an ECAT file.
| filename | Name of file to open and read specified data block; file is closed after reading; enter NULL to use the file pointer (next argument) instead. |
| fp | File pointer of file, opened with fp=fopen(filename, "rb"), to read the specified data block from; enter NULL to open file (previous argument) locally. This function leaves the file pointer to the end of data block. |
| blocknumber | Block number to read; enter 0 to read the block from current file pointer position, if file pointer was given. |
| data | Pointer to write block data in; must be allocated for at least ECATBLKSIZE bytes. |
Definition at line 23 of file ecatio.c.
Referenced by ecatMListRead(), and ecatVerifyMagic().
| int ecatVerifyMagic | ( | const char * | filename, |
| FILE * | fp ) |
Verify that given file (either file name or file pointer) appears to be ECAT file, based on the magic number.
ECAT 7 has defined magic numbers, which are checked. ECAT 6 format does not a defined magic number, therefore here the file is only checked to not indicate anything else than ECAT 6.
| filename | Name of file to open and to verify for the magic number; file is closed after reading; enter NULL to use the file pointer (next argument) instead. |
| fp | File pointer of file to check, opened with fp=fopen(filename, "rb"); enter NULL to open file (previous argument) locally. This function rewinds the file pointer to start before and after reading the data. |
Definition at line 84 of file ecatio.c.