The library always uses the mspack_system structure for interaction with the file system and to allocate, free and copy all memory. It also uses it to send literal messages to the library user.
When the library is compiled normally, passing NULL to a compressor or decompressor constructor will result in a default mspack_system being used, where all methods are implemented with the standard C library. However, all constructors support being given a custom created mspack_system structure, with the library user's own methods. This allows for more abstract interaction, such as reading and writing files directly to memory, or from a network socket or pipe.
Implementors of an mspack_system structure should read all documentation entries for every structure member, and write methods which conform to those standards.
|void *(*||alloc )(struct mspack_system *this, size_t bytes)|
|void(*||close )(struct mspack_file *file)|
|void(*||copy )(void *src, void *dest, size_t bytes)|
|void(*||free )(void *ptr)|
|void(*||message )(struct mspack_file *file, char *format,...)|
|struct mspack_file *(*||open )(struct mspack_system *this, char *filename, int mode)|
|int(*||read )(struct mspack_file *file, void *buffer, int bytes)|
|int(*||seek )(struct mspack_file *file, off_t offset, int mode)|
|off_t(*||tell )(struct mspack_file *file)|
|int(*||write )(struct mspack_file *file, void *buffer, int bytes)|