Millepede-II V04-17-03
|
Read from C/C++ binary files. More...
#include <stdio.h>
#include <stdlib.h>
Go to the source code of this file.
Functions | |
void | initc (int nFiles) |
Initialises the 'global' variables used for file handling. More... | |
void | openc (const char *fileName, int lfn, int nFileIn, int *errorFlag) |
Open file. More... | |
void | closec (int nFileIn) |
Close file. More... | |
void | resetc (int nFileIn) |
Rewind file. More... | |
void | readc (double *bufferDouble, float *bufferFloat, int *bufferInt, int *lengthBuffers, int nFileIn, int *errorFlag) |
Read record from file. More... | |
Variables | |
FILE ** | files |
pointer to list of pointers to opened binary files More... | |
unsigned int | maxNumFiles |
max number of files More... | |
unsigned int | numAllFiles |
number of opened files More... | |
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).
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:
Major update on April 10th, 2019 by C.Kleinwort:
Last major update on March 21th, 2023 by C.Kleinwort:
Definition in file readc.c.
void closec | ( | int | nFileIn | ) |
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 91 of file readc.c.
References files, readMilleBinary::i, maxNumFiles, and numAllFiles.
Referenced by filetc().
void openc | ( | const char * | fileName, |
int | lfn, | ||
int | nFileIn, | ||
int * | errorFlag | ||
) |
Open file.
[in] | fileName | File name |
[in] | lfn | Length of file name |
[in] | nFileIn | File number (1 .. maxNumFiles) or <=0 for next one |
[out] | errorFlag | error flag:
|
Definition at line 110 of file readc.c.
References files, readMilleBinary::i, maxNumFiles, and numAllFiles.
Referenced by binopn().
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 219 of file readc.c.
References files, and readMilleBinary::i.
Referenced by peread().
void resetc | ( | int | nFileIn | ) |
FILE** files |
unsigned int maxNumFiles |