#ifndef LIBMIO0_H_1#define LIBMIO0_H_23// defines45#define MIO0_HEADER_LENGTH 1667// typedefs89typedef struct10{11unsigned int dest_size;12unsigned int comp_offset;13unsigned int uncomp_offset;14} mio0_header_t;1516// function prototypes1718// decode MIO0 header19// returns 1 if valid header, 0 otherwise20int mio0_decode_header(const unsigned char *buf, mio0_header_t *head);2122// encode MIO0 header from struct23void mio0_encode_header(unsigned char *buf, const mio0_header_t *head);2425// decode MIO0 data in memory26// in: buffer containing MIO0 data27// out: buffer for output data28// end: output offset of the last byte decoded from in (set to NULL if unwanted)29// returns bytes extracted to 'out' or negative value on failure30int mio0_decode(const unsigned char *in, unsigned char *out, unsigned int *end);3132// encode MIO0 data in memory33// in: buffer containing raw data34// out: buffer for MIO0 data35// returns size of compressed data in 'out' including MIO0 header36int mio0_encode(const unsigned char *in, unsigned int length, unsigned char *out);3738// decode an entire MIO0 block at an offset from file to output file39// in_file: input filename40// offset: offset to start decoding from in_file41// out_file: output filename42int mio0_decode_file(const char *in_file, unsigned long offset, const char *out_file);4344// encode an entire file45// in_file: input filename containing raw data to be encoded46// out_file: output filename to write MIO0 compressed data to47int mio0_encode_file(const char *in_file, const char *out_file);4849#endif // LIBMIO0_H_505152