libmspack
|
A compressor for the KWAJ file format. More...
#include <mspack.h>
Data Fields | |
int(* | compress )(struct mskwaj_compressor *self, const char *input, const char *output, off_t length) |
Reads an input file and creates a compressed output file in the KWAJ compressed file format. More... | |
int(* | set_param )(struct mskwaj_compressor *self, int param, int value) |
Sets an KWAJ compression engine parameter. More... | |
int(* | set_filename )(struct mskwaj_compressor *self, const char *filename) |
Sets the original filename of the file before compression, which will be stored in the header of the output file. More... | |
int(* | set_extra_data )(struct mskwaj_compressor *self, void *data, size_t bytes) |
Sets arbitrary data that will be stored in the header of the output file, uncompressed. More... | |
int(* | last_error )(struct mschm_decompressor *self) |
Returns the error code set by the most recently called method. More... | |
A compressor for the KWAJ file format.
All fields are READ ONLY.
int(* mskwaj_compressor::compress) (struct mskwaj_compressor *self, const char *input, const char *output, off_t length) |
Reads an input file and creates a compressed output file in the KWAJ compressed file format.
The KWAJ compression format is quick but gives poor compression. It is possible for the compressed output file to be larger than the input file.
self | a self-referential pointer to the mskwaj_compressor instance being called |
input | the name of the file to compressed. This is passed passed directly to mspack_system::open() |
output | the name of the file to write compressed data to. This is passed directly to mspack_system::open(). |
length | the length of the uncompressed file, or -1 to indicate that this should be determined automatically by using mspack_system::seek() on the input file. |
int(* mskwaj_compressor::last_error) (struct mschm_decompressor *self) |
Returns the error code set by the most recently called method.
self | a self-referential pointer to the mskwaj_compressor instance being called |
int(* mskwaj_compressor::set_extra_data) (struct mskwaj_compressor *self, void *data, size_t bytes) |
Sets arbitrary data that will be stored in the header of the output file, uncompressed.
It can be up to roughly 64 kilobytes, as the overall size of the header must not exceed 65535 bytes. The data can contain null bytes if desired.
If NULL is passed as the data pointer, or zero is passed as the length, no extra data is included in the header. This is the default.
self | a self-referential pointer to the mskwaj_compressor instance being called |
data | a pointer to the data to be stored in the header |
bytes | the length of the data in bytes |
int(* mskwaj_compressor::set_filename) (struct mskwaj_compressor *self, const char *filename) |
Sets the original filename of the file before compression, which will be stored in the header of the output file.
The filename should be a null-terminated string, it must be an MS-DOS "8.3" type filename (up to 8 bytes for the filename, then optionally a "." and up to 3 bytes for a filename extension).
If NULL is passed as the filename, no filename is included in the header. This is the default.
self | a self-referential pointer to the mskwaj_compressor instance being called |
filename | the original filename to use |
int(* mskwaj_compressor::set_param) (struct mskwaj_compressor *self, int param, int value) |
Sets an KWAJ compression engine parameter.
The following parameters are defined:
self | a self-referential pointer to the mskwaj_compressor instance being called |
param | the parameter to set |
value | the value to set the parameter to |