libmspack
|
A decompressor for KWAJ compressed files. More...
#include <mspack.h>
Data Fields | |
struct mskwajd_header *(* | open )(struct mskwaj_decompressor *self, const char *filename) |
Opens a KWAJ file and reads the header. More... | |
void(* | close )(struct mskwaj_decompressor *self, struct mskwajd_header *kwaj) |
Closes a previously opened KWAJ file. More... | |
int(* | extract )(struct mskwaj_decompressor *self, struct mskwajd_header *kwaj, const char *filename) |
Extracts the compressed data from a KWAJ file. More... | |
int(* | decompress )(struct mskwaj_decompressor *self, const char *input, const char *output) |
Decompresses an KWAJ file to an output file in one step. More... | |
int(* | last_error )(struct mskwaj_decompressor *self) |
Returns the error code set by the most recently called method. More... | |
A decompressor for KWAJ compressed files.
All fields are READ ONLY.
void(* mskwaj_decompressor::close) (struct mskwaj_decompressor *self, struct mskwajd_header *kwaj) |
Closes a previously opened KWAJ file.
This closes a KWAJ file and frees the mskwajd_header associated with it. The KWAJ header pointer is now invalid and cannot be used again.
self | a self-referential pointer to the mskwaj_decompressor instance being called |
kwaj | the KWAJ file to close |
int(* mskwaj_decompressor::decompress) (struct mskwaj_decompressor *self, const char *input, const char *output) |
Decompresses an KWAJ file to an output file in one step.
This opens an KWAJ file as input, reads the header, then decompresses the compressed data immediately to an output file, finally closing both the input and output file. It is more convenient to use than open() then extract() then close(), if you do not need to know the KWAJ output size or output filename.
self | a self-referential pointer to the mskwaj_decompressor instance being called |
input | the filename of the input KWAJ file. This is passed directly to mspack_system::open(). |
output | the filename to write the decompressed data to. This is passed directly to mspack_system::open(). |
int(* mskwaj_decompressor::extract) (struct mskwaj_decompressor *self, struct mskwajd_header *kwaj, const char *filename) |
Extracts the compressed data from a KWAJ file.
This decompresses the compressed KWAJ data stream and writes it to an output file.
self | a self-referential pointer to the mskwaj_decompressor instance being called |
kwaj | the KWAJ file to extract data from |
filename | the filename to write the decompressed data to. This is passed directly to mspack_system::open(). |
int(* mskwaj_decompressor::last_error) (struct mskwaj_decompressor *self) |
Returns the error code set by the most recently called method.
This is useful for open() which does not return an error code directly.
self | a self-referential pointer to the mskwaj_decompressor instance being called |
struct mskwajd_header*(* mskwaj_decompressor::open) (struct mskwaj_decompressor *self, const char *filename) |
Opens a KWAJ file and reads the header.
If the file opened is a valid KWAJ file, all headers will be read and a mskwajd_header structure will be returned.
In the case of an error occuring, NULL is returned and the error code is available from last_error().
The filename pointer should be considered "in use" until close() is called on the KWAJ file.
self | a self-referential pointer to the mskwaj_decompressor instance being called |
filename | the filename of the KWAJ compressed file. This is passed directly to mspack_system::open(). |