EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
BinIO.h
1 #ifndef BIN_IO_H
2 #define BIN_IO_H
3 
4 #include <stdio.h>
5 #include <stdint.h>
6 
9 
11 
15 
17 bool writeLong(FILE *f, uint32_t value);
18 
20 bool readLong(FILE *f, uint32_t *value);
21 
23 bool writeShort(FILE *f, uint16_t value);
24 
26 bool readShort(FILE *f, uint16_t *value);
27 
29 inline bool writeByte(FILE *f, uint8_t byte)
30 { return fwrite(&byte, 1, 1, f) == 1; }
31 
33 inline bool readByte(FILE *f, uint8_t *byte)
34 { return fread(byte, 1, 1, f) == 1; }
35 
37 
38 #endif
39 // BIN_IO_H
40 
41 
bool writeShort(FILE *f, uint16_t value)
Write &#39;value&#39; to file with fixed byte order.
bool readByte(FILE *f, uint8_t *byte)
Read byte.
Definition: BinIO.h:33
bool readLong(FILE *f, uint32_t *value)
Read &#39;value&#39; from file with fixed byte order.
bool writeByte(FILE *f, uint8_t byte)
Write byte.
Definition: BinIO.h:29
bool readShort(FILE *f, uint16_t *value)
Read &#39;value&#39; from file with fixed byte order.
bool writeLong(FILE *f, uint32_t value)
OS-independent binary I/O.