Rizin
unix-like reverse engineering framework and cli tools
|
#include <mspack.h>
Public Attributes | |
int(* | compress )(struct msszdd_compressor *self, const char *input, const char *output, off_t length) |
int(* | set_param )(struct msszdd_compressor *self, int param, int value) |
int(* | last_error )(struct mschm_decompressor *self) |
A compressor for the SZDD file format.
All fields are READ ONLY.
int(* msszdd_compressor::compress)(struct msszdd_compressor *self, const char *input, const char *output, off_t length) |
Reads an input file and creates a compressed output file in the SZDD compressed file format. The SZDD compression format is quick but gives poor compression. It is possible for the compressed output file to be larger than the input file.
Conventionally, SZDD compressed files have the final character in their filename replaced with an underscore, to show they are compressed. The missing character is stored in the compressed file itself. This is due to the restricted filename conventions of MS-DOS, most operating systems, such as UNIX, simply append another file extension to the existing filename. As mspack does not deal with filenames, this is left up to you. If you wish to set the missing character stored in the file header, use set_param() with the MSSZDDC_PARAM_MISSINGCHAR parameter.
"Stream" compression (where the length of the input data is not known) is not possible. The length of the input data is stored in the header of the SZDD file and must therefore be known before any data is compressed. Due to technical limitations of the file format, the maximum size of uncompressed file that will be accepted is 2147483647 bytes.
self | a self-referential pointer to the msszdd_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(* msszdd_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 msszdd_compressor instance being called |
int(* msszdd_compressor::set_param)(struct msszdd_compressor *self, int param, int value) |
Sets an SZDD compression engine parameter.
The following parameters are defined:
self | a self-referential pointer to the msszdd_compressor instance being called |
param | the parameter to set |
value | the value to set the parameter to |