Top | ![]() |
![]() |
![]() |
![]() |
In Fortran binary data are written inside tags. These tags
give the size to the data that are between. The routines in this
module can read these tags and the data inside. One must know the
endianness of the file and the kind of data to be read (integer,
float, double...). If the first tag is known, one can test the
endianness of the file calling tool_fortran_testEndianness()
.
The size of the tag (32 bits or 64 bits) is not modifiable for the moment and is fixed at 32 bits. This may be changed in the futur with the same kind of things that for endianness.
gboolean tool_fortran_readCharacter (char *var
,guint nb
,FILE *flux
,GError **error
,ToolFortranEndianId endianness
,gboolean testFlag
,gboolean store
);
Read an array of characters from a fortran record. The endianness is required
to read the Fortran flag. If argument store
is FALSE, then the
file is read and consistency checked but no data is stored. In that
case, var
can be not allocated.
gboolean tool_fortran_readInteger (guint *var
,guint nb
,FILE *flux
,GError **error
,ToolFortranEndianId endianness
,gboolean testFlag
,gboolean store
);
Read an array of integers from a fortran record. If argument store
is FALSE, then the file is read and consistency checked but no data
is stored. In that case, var
can be not allocated.
gboolean tool_fortran_readReal (float *var
,guint nb
,FILE *flux
,GError **error
,ToolFortranEndianId endianness
,gboolean testFlag
,gboolean store
);
Read an array of reals from a fortran record. If argument store
is FALSE, then the
file is read and consistency checked but no data is stored. In that
case, var
can be not allocated.
gboolean tool_fortran_readDouble (double *var
,guint nb
,FILE *flux
,GError **error
,ToolFortranEndianId endianness
,gboolean testFlag
,gboolean store
);
Read an array of doubles from a fortran record. If argument store
is FALSE, then the file is read and consistency checked but no data
is stored. In that case, var
can be not allocated.
gboolean tool_fortran_readFlag (guint *nb
,FILE *flux
,GError **error
,ToolFortranEndianId endianness
);
Read the flag of a record (a 32bits integer).
gboolean tool_fortran_testEndianness (guint nb
,FILE *flux
,GError **error
,ToolFortranEndianId *endianness
);
Read a flag and compare the value with nb
for little and big endian.
It return the value of endianness to be used after. The file is rewind after the
call.