3 * Routines for reading/writing (multi-)byte data from/to files. They ensure a
12 #include <stdio.h> /* for FILE typedef */
13 #include <stdint.h> /* for uint8_t, uint16_t, uint32_t */
17 /* Each function returns 0 on success and 1 on failure. "x" is the value to be
18 * written to "file" for write_* functions and for read_* functions the pointer
19 * to where the value read from "file" is to be written.
21 extern uint8_t read_uint8(FILE * file, uint8_t * x);
22 extern uint8_t read_uint16_bigendian(FILE * file, uint16_t * x);
23 extern uint8_t read_uint32_bigendian(FILE * file, uint32_t * x);
24 extern uint8_t write_uint8(uint8_t x, FILE * file);
25 extern uint8_t write_uint16_bigendian(uint16_t x, FILE * file);
26 extern uint8_t write_uint32_bigendian(uint32_t x, FILE * file);