FEDEM Solver  R8.0
Source code of the dynamics solver
FFaTag.H
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2023 SAP SE
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 // This file is part of FEDEM - https://openfedem.org
7 
13 #ifndef FFA_TAG_H
14 #define FFA_TAG_H
15 
16 #include <string>
17 #include <cstdio>
18 
19 #include "FFaLib/FFaOS/FFaIO.H"
20 
22 #define LEN_TAG 30
23 
24 
25 namespace FFaTag
26 {
27 #ifdef FT_USE_LOWLEVEL_IO
30  int read(FT_FILE fd, std::string& tag, unsigned int& cs,
31  int tagLength = LEN_TAG);
32 
35  int write(FT_FILE fd, const char* tag, int nchar, unsigned int cs,
36  int tagLength = LEN_TAG);
37 #endif
38 
41  int read(FILE* fd, std::string& tag, unsigned int& cs,
42  int tagLength = LEN_TAG);
43 
46  int write(FILE* fd, const char* tag, int nchar, unsigned int cs,
47  int tagLength = LEN_TAG);
48 
50  int endian();
51 }
52 
53 #endif
Functions and data type for direct access of large binary files.
#define FT_FILE
File pointer.
Definition: FFaIO.H:136
#define LEN_TAG
Default length of a file tag.
Definition: FFaTag.H:22
Utilities for reading and writing of file tags.
Definition: FFaTag.H:26
int endian()
Returns current system endian.
Definition: FFaTag.C:161
int write(FILE *fd, const char *tag, int nchar, unsigned int cs, int tagLength=LEN_TAG)
Writes the file tag and checksum to the provided file.
Definition: FFaTag.C:325
int read(FILE *fd, std::string &tag, unsigned int &cs, int tagLength=LEN_TAG)
Reads the file tag and checksum from the provided file.
Definition: FFaTag.C:317