SND@LHC Software
|
Go to the source code of this file.
Functions | |
void | initC (int *nFiles) |
Initialises the 'global' variables used for file handling. | |
void | resetC (int *nFileIn) |
Rewind file. | |
void | closeC (int *nFileIn) |
Close file. | |
void | openC (const char *fileName, int *nFileIn, int *errorFlag) |
Open file. | |
void | readC (double *bufferDouble, float *bufferFloat, int *bufferInt, int *lengthBuffers, int *nFileIn, int *errorFlag) |
Read record from file. | |
Variables | |
FILE ** | files |
pointer to list of pointers to opened binary files | |
unsigned int | maxNumFiles |
max number of files | |
unsigned int | numAllFiles |
number of opened files | |
Read from C/C++ binary files.
C-methods to handle input of C/C++ binary files as input for the fortran pede program (see peread). This includes macros utilising cfortran.h
to allow direct callability from fortran.
initC()
has to be called once in the beginning, followed by one or several calls to openC()
to open one or several files. readC()
is then called to read the records sequentially. resetC()
allows to rewind files.
If compiled with preprocessor macro USE_SHIFT_RFIO
, uses libRFIO
, i.e. includes shift.h
instead of stdio.h
If compiled with preprocessor macro USE_ZLIB
, uses libz
, enables direct reading of gzipped files.
Written by Gero Flucke (gero..nosp@m.fluc.nosp@m.ke@ce.nosp@m.rn.c.nosp@m.h) in 2006/7
readC()
Major updates on April 24th, 2012 by C.Kleinwort:
Major update on February 26th, 2014 by C.Kleinwort:
Last major update on April 10th, 2019 by C.Kleinwort:
Definition in file readc.c.
void closeC | ( | int * | nFileIn | ) |
Close file.
[in] | nFileIn | File number (1 .. maxNumFiles) |
void initC | ( | int * | nFiles | ) |
Initialises the 'global' variables used for file handling.
[in] | nFiles | Maximal number of C binary files to use. |
Definition at line 86 of file readc.c.
void openC | ( | const char * | fileName, |
int * | nFileIn, | ||
int * | errorFlag | ||
) |
Open file.
[in] | fileName | File name |
[in] | nFileIn | File number (1 .. maxNumFiles) or <=0 for next one |
[out] | errorFlag | error flag:
|
Definition at line 155 of file readc.c.
void readC | ( | double * | bufferDouble, |
float * | bufferFloat, | ||
int * | bufferInt, | ||
int * | lengthBuffers, | ||
int * | nFileIn, | ||
int * | errorFlag | ||
) |
Read record from file.
[out] | bufferDouble | read buffer for doubles |
[out] | bufferFloat | read buffer for floats |
[out] | bufferInt | read buffer for integers |
[in,out] | lengthBuffers | in: buffer length, out: number of floats/ints in records (> buffer size: record skipped) |
[in] | nFileIn | File number (1 .. maxNumFiles) |
[out] | errorFlag | error flag:
|
Definition at line 220 of file readc.c.
void resetC | ( | int * | nFileIn | ) |
Rewind file.
[in] | nFileIn | File number (1 .. maxNumFiles) |
Definition at line 121 of file readc.c.
FILE** files |