FEDEM Solver  R8.0
Source code of the dynamics solver
Functions
FFaTag_C.h File Reference

C-version of the file-tag read/write functions. More...

#include "FFaLib/FFaOS/FFaIO.H"
Include dependency graph for FFaTag_C.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int FFa_writeTag (FT_FILE fd, const char *tag, const int nchar, const unsigned int chksum)
 Writes the file tag, endian field and checksum to a specified file. More...
 
int FFa_readTag (FT_FILE fd, char *tag, const int nchar, unsigned int *chksum)
 Reads the file tag, endian field and checksum from a specified file. More...
 
int FFa_endian ()
 Returns the current system endian. More...
 

Detailed Description

C-version of the file-tag read/write functions.

Function Documentation

◆ FFa_endian()

int FFa_endian ( )

Returns the current system endian.

◆ FFa_readTag()

int FFa_readTag ( FT_FILE  fd,
char *  tag,
int  nchar,
unsigned int *  cs 
)

Reads the file tag, endian field and checksum from a specified file.

Parameters
fdFile descriptor/pointer to the investigated file
[out]tagFile tag
[in]ncharMax number of characters in the tag string
[out]csChecksum value
Returns
0 : This is an ASCII file
1 : This is a big endian binary file
2 : This is a little endian binary file
-1 : Wrong file start, first read character should be a #
-2 : Error reading file tag
-3 : Invalid or error reading endian field
-4 : Error reading checksum field

◆ FFa_writeTag()

int FFa_writeTag ( FT_FILE  fd,
const char *  tag,
int  nchar,
unsigned int  cs 
)

Writes the file tag, endian field and checksum to a specified file.

Parameters
fdFile descriptor/pointer to the written file
[in]tagFile tag
[in]ncharNumber of characters in the tag string
[in]csChecksum value
Returns
  0 : OK
-1 : Error writing file tag
-2 : Error writing endian field
-3 : Error writing checksum field