9 #ifndef __ZEDA_BINFILE_H__ 10 #define __ZEDA_BINFILE_H__ 18 #define ZEDA_BINFILE_DEF_FREAD_PROTOTYPE( bit ) \ 19 size_t fread_int##bit(FILE *fp, int##bit##_t *val) 20 #define ZEDA_BINFILE_DEF_FREAD_REV_PROTOTYPE( bit ) \ 21 size_t fread_int##bit##_rev(FILE *fp, int##bit##_t *val) 22 #define ZEDA_BINFILE_DEF_FWRITE_PROTOTYPE( bit ) \ 23 size_t fwrite_int##bit(FILE *fp, int##bit##_t *val) 24 #define ZEDA_BINFILE_DEF_FWRITE_REV_PROTOTYPE( bit ) \ 25 size_t fwrite_int##bit##_rev(FILE *fp, int##bit##_t *val) 45 #define ZEDA_BINFILE_DEF_FREAD_TYPE_PROTOTYPE( type ) \ 46 type fread_##type(FILE *fp) 47 #define ZEDA_BINFILE_DEF_FREAD_REV_TYPE_PROTOTYPE( type ) \ 48 type fread_##type##_rev(FILE *fp) 49 #define ZEDA_BINFILE_DEF_FWRITE_TYPE_PROTOTYPE( type ) \ 50 size_t fwrite_##type(FILE *fp, type val) 51 #define ZEDA_BINFILE_DEF_FWRITE_REV_TYPE_PROTOTYPE( type ) \ 52 size_t fwrite_##type##_rev(FILE *fp, type val) 79 #define ZBINFILE_CURRENT_VERSION 0x00000001 81 #define ZBINFILE_ID "ZBD " 82 #define ZBINFILE_ENDIAN_CHECKER 0xaabbccdd 84 #define Z_ENDIAN_LITTLE 1234 85 #define Z_ENDIAN_BIG 4321 86 #define Z_ENDIAN_UNKNOWN 9999 96 size_t (* _fread_int16)(FILE*,
int16_t*);
97 size_t (* _fread_int32)(FILE*,
int32_t*);
98 size_t (* _fread_int64)(FILE*,
int64_t*);
102 size_t (* _fwrite_int16)(FILE*,
int16_t*);
103 size_t (* _fwrite_int32)(FILE*,
int32_t*);
104 size_t (* _fwrite_int64)(FILE*,
int64_t*);
105 size_t (* _fwrite_int)(
struct _zBinFile*,int);
106 size_t (* _fwrite_long)(
struct _zBinFile*,long);
122 #define zBinFileIntFRead(bf) ( (bf)->_fread_int( (bf) ) ) 123 #define zBinFileIntFWrite(bf,val) ( (bf)->_fwrite_int( (bf), (val) ) ) 125 #define zBinFileLongFRead(bf) ( (bf)->_fread_long( (bf) ) ) 126 #define zBinFileLongFWrite(bf,val) ( (bf)->_fwrite_long( (bf), (val) ) ) int zBinFileClose(zBinFile *bf)
int8_t byte
Definition: zeda_defs.h:92
int16_t word
Definition: zeda_defs.h:93
struct _zBinFile zBinFile
int int32_t
Definition: zeda_defs.h:72
#define __END_DECLS
Definition: zeda_defs.h:30
short int int16_t
Definition: zeda_defs.h:71
size_t zBinFileHeaderFWrite(zBinFile *bf)
Definition: zeda_binfile.h:88
size_t zBinFileDoubleFWrite(zBinFile *bf, double val)
size_t zBinFileFloatFWrite(zBinFile *bf, float val)
#define ZEDA_BINFILE_DEF_FREAD_REV_TYPE_PROTOTYPE(type)
Definition: zeda_binfile.h:47
int32_t dword
Definition: zeda_defs.h:94
#define ZEDA_BINFILE_DEF_FREAD_TYPE_PROTOTYPE(type)
Definition: zeda_binfile.h:45
#define ZEDA_BINFILE_DEF_FREAD_PROTOTYPE(bit)
Definition: zeda_binfile.h:18
byte zBinFileByteFRead(zBinFile *bf)
int16_t version
Definition: zeda_binfile.h:89
bool zBinFileOpen(zBinFile *bf, char filename[], const char *mode)
bool zBinFileHeaderFRead(zBinFile *bf)
#define ZEDA_BINFILE_DEF_FWRITE_REV_PROTOTYPE(bit)
Definition: zeda_binfile.h:24
void zBinFileInfoSetThis(zBinFile *bf)
#define ZEDA_BINFILE_DEF_FWRITE_TYPE_PROTOTYPE(type)
Definition: zeda_binfile.h:49
float zBinFileFloatFRead(zBinFile *bf)
#define __BEGIN_DECLS
Definition: zeda_defs.h:26
double zBinFileDoubleFRead(zBinFile *bf)
size_t zBinFileByteFWrite(zBinFile *bf, byte val)
#define __EXPORT
Definition: zeda_compat.h:32
#define ZEDA_BINFILE_DEF_FWRITE_REV_TYPE_PROTOTYPE(type)
Definition: zeda_binfile.h:51
#define ZEDA_BINFILE_DEF_FWRITE_PROTOTYPE(bit)
Definition: zeda_binfile.h:22
long long int int64_t
Definition: zeda_defs.h:76
#define ZEDA_BINFILE_DEF_FREAD_REV_PROTOTYPE(bit)
Definition: zeda_binfile.h:20
void zBinFileInfoSet(zBinFile *bf, int16_t version, int16_t endian_type, int16_t size_int, int16_t size_long)