#include <sys/types.h>
#include <unistd.h>
Go to the source code of this file.
Data Structures | |
struct | mscab_compressor |
TODO. More... | |
struct | mscab_decompressor |
A decompressor for .CAB (Microsoft Cabinet) files. More... | |
struct | mscabd_cabinet |
A structure which represents a single cabinet file. More... | |
struct | mscabd_file |
A structure which represents a single file in a cabinet or cabinet set. More... | |
struct | mscabd_folder |
A structure which represents a single folder in a cabinet or cabinet set. More... | |
struct | mschm_compressor |
TODO. More... | |
struct | mschm_decompressor |
A decompressor for .CHM (Microsoft HTMLHelp) files. More... | |
struct | mschmd_file |
A structure which represents a file stored in a CHM helpfile. More... | |
struct | mschmd_header |
A structure which represents a CHM helpfile. More... | |
struct | mschmd_sec_mscompressed |
A structure which represents the compressed section of a CHM helpfile. More... | |
struct | mschmd_sec_uncompressed |
A structure which represents the uncompressed section of a CHM helpfile. More... | |
struct | mschmd_section |
A structure which represents a section of a CHM helpfile. More... | |
struct | mshlp_compressor |
TODO. More... | |
struct | mshlp_decompressor |
TODO. More... | |
struct | mskwaj_compressor |
TODO. More... | |
struct | mskwaj_decompressor |
TODO. More... | |
struct | mslit_compressor |
TODO. More... | |
struct | mslit_decompressor |
TODO. More... | |
struct | mspack_file |
A structure which represents an open file handle. More... | |
struct | mspack_system |
A structure which abstracts file I/O and memory management. More... | |
struct | msszdd_compressor |
TODO. More... | |
struct | msszdd_decompressor |
TODO. More... | |
Defines | |
#define | LIB_MSPACK_H 1 |
#define | MSPACK_SYS_SELFTEST(result) |
System self-test function, to ensure both library and calling program can use one another. | |
#define | MSPACK_VER_LIBRARY (0) |
Pass to mspack_version() to get the overall library version. | |
#define | MSPACK_VER_SYSTEM (1) |
Pass to mspack_version() to get the mspack_system version. | |
#define | MSPACK_VER_MSCABD (2) |
Pass to mspack_version() to get the mscab_decompressor version. | |
#define | MSPACK_VER_MSCABC (3) |
Pass to mspack_version() to get the mscab_compressor version. | |
#define | MSPACK_VER_MSCHMD (4) |
Pass to mspack_version() to get the mschm_decompressor version. | |
#define | MSPACK_VER_MSCHMC (5) |
Pass to mspack_version() to get the mschm_compressor version. | |
#define | MSPACK_VER_MSLITD (6) |
Pass to mspack_version() to get the mslit_decompressor version. | |
#define | MSPACK_VER_MSLITC (7) |
Pass to mspack_version() to get the mslit_compressor version. | |
#define | MSPACK_VER_MSHLPD (8) |
Pass to mspack_version() to get the mshlp_decompressor version. | |
#define | MSPACK_VER_MSHLPC (9) |
Pass to mspack_version() to get the mshlp_compressor version. | |
#define | MSPACK_VER_MSSZDDD (10) |
Pass to mspack_version() to get the msszdd_decompressor version. | |
#define | MSPACK_VER_MSSZDDC (11) |
Pass to mspack_version() to get the msszdd_compressor version. | |
#define | MSPACK_VER_MSKWAJD (12) |
Pass to mspack_version() to get the mskwaj_decompressor version. | |
#define | MSPACK_VER_MSKWAJC (13) |
Pass to mspack_version() to get the mskwaj_compressor version. | |
#define | MSPACK_SYS_OPEN_READ (0) |
mspack_system::open() mode: open existing file for reading. | |
#define | MSPACK_SYS_OPEN_WRITE (1) |
mspack_system::open() mode: open new file for writing | |
#define | MSPACK_SYS_OPEN_UPDATE (2) |
mspack_system::open() mode: open existing file for writing | |
#define | MSPACK_SYS_OPEN_APPEND (3) |
mspack_system::open() mode: open existing file for writing | |
#define | MSPACK_SYS_SEEK_START (0) |
mspack_system::seek() mode: seek relative to start of file | |
#define | MSPACK_SYS_SEEK_CUR (1) |
mspack_system::seek() mode: seek relative to current offset | |
#define | MSPACK_SYS_SEEK_END (2) |
mspack_system::seek() mode: seek relative to end of file | |
#define | MSPACK_ERR_OK (0) |
Error code: no error. | |
#define | MSPACK_ERR_ARGS (1) |
Error code: bad arguments to method. | |
#define | MSPACK_ERR_OPEN (2) |
Error code: error opening file. | |
#define | MSPACK_ERR_READ (3) |
Error code: error reading file. | |
#define | MSPACK_ERR_WRITE (4) |
Error code: error writing file. | |
#define | MSPACK_ERR_SEEK (5) |
Error code: seek error. | |
#define | MSPACK_ERR_NOMEMORY (6) |
Error code: out of memory. | |
#define | MSPACK_ERR_SIGNATURE (7) |
Error code: bad "magic id" in file. | |
#define | MSPACK_ERR_DATAFORMAT (8) |
Error code: bad or corrupt file format. | |
#define | MSPACK_ERR_CHECKSUM (9) |
Error code: bad checksum or CRC. | |
#define | MSPACK_ERR_CRUNCH (10) |
Error code: error during compression. | |
#define | MSPACK_ERR_DECRUNCH (11) |
Error code: error during decompression. | |
#define | MSCAB_HDR_RESV_OFFSET (0x28) |
Offset from start of cabinet to the reserved header data (if present). | |
#define | MSCAB_HDR_PREVCAB (0x01) |
Cabinet header flag: cabinet has a predecessor. | |
#define | MSCAB_HDR_NEXTCAB (0x02) |
Cabinet header flag: cabinet has a successor. | |
#define | MSCAB_HDR_RESV (0x04) |
Cabinet header flag: cabinet has reserved header space. | |
#define | MSCABD_COMP_METHOD(comp_type) ((comp_type) & 0x0F) |
Returns the compression method used by a folder. | |
#define | MSCABD_COMP_LEVEL(comp_type) (((comp_type) >> 8) & 0x1F) |
Returns the compression level used by a folder. | |
#define | MSCAB_COMP_NONE (0) |
Compression mode: no compression. | |
#define | MSCAB_COMP_MSZIP (1) |
Compression mode: MSZIP (deflate) compression. | |
#define | MSCAB_COMP_QUANTUM (2) |
Compression mode: Quantum compression. | |
#define | MSCAB_COMP_LZX (3) |
Compression mode: LZX compression. | |
#define | MSCAB_ATTRIB_RDONLY (0x01) |
mscabd_file::attribs attribute: file is read-only. | |
#define | MSCAB_ATTRIB_HIDDEN (0x02) |
mscabd_file::attribs attribute: file is hidden. | |
#define | MSCAB_ATTRIB_SYSTEM (0x04) |
mscabd_file::attribs attribute: file is an operating system file. | |
#define | MSCAB_ATTRIB_ARCH (0x20) |
mscabd_file::attribs attribute: file is "archived". | |
#define | MSCAB_ATTRIB_EXEC (0x40) |
mscabd_file::attribs attribute: file is an executable program. | |
#define | MSCAB_ATTRIB_UTF_NAME (0x80) |
mscabd_file::attribs attribute: filename is UTF8, not ISO-8859-1. | |
#define | MSCABD_PARAM_SEARCHBUF (0) |
mscab_decompressor::set_param() parameter: search buffer size. | |
#define | MSCABD_PARAM_FIXMSZIP (1) |
mscab_decompressor::set_param() parameter: repair MS-ZIP streams? | |
#define | MSCABD_PARAM_DECOMPBUF (2) |
mscab_decompressor::set_param() parameter: size of decompression buffer | |
Functions | |
int | mspack_sys_selftest_internal (int) |
Part of the MSPACK_SYS_SELFTEST() macro, must not be used directly. | |
int | mspack_version (int interface) |
Enquire about the binary compatibility version of a specific interface in the library. | |
mscab_compressor * | mspack_create_cab_compressor (struct mspack_system *sys) |
Creates a new CAB compressor. | |
mscab_decompressor * | mspack_create_cab_decompressor (struct mspack_system *sys) |
Creates a new CAB decompressor. | |
void | mspack_destroy_cab_compressor (struct mscab_compressor *this) |
Destroys an existing CAB compressor. | |
void | mspack_destroy_cab_decompressor (struct mscab_decompressor *this) |
Destroys an existing CAB decompressor. | |
mschm_compressor * | mspack_create_chm_compressor (struct mspack_system *sys) |
Creates a new CHM compressor. | |
mschm_decompressor * | mspack_create_chm_decompressor (struct mspack_system *sys) |
Creates a new CHM decompressor. | |
void | mspack_destroy_chm_compressor (struct mschm_compressor *this) |
Destroys an existing CHM compressor. | |
void | mspack_destroy_chm_decompressor (struct mschm_decompressor *this) |
Destroys an existing CHM decompressor. | |
mslit_compressor * | mspack_create_lit_compressor (struct mspack_system *sys) |
Creates a new LIT compressor. | |
mslit_decompressor * | mspack_create_lit_decompressor (struct mspack_system *sys) |
Creates a new LIT decompressor. | |
void | mspack_destroy_lit_compressor (struct mslit_compressor *this) |
Destroys an existing LIT compressor. | |
void | mspack_destroy_lit_decompressor (struct mslit_decompressor *this) |
Destroys an existing LIT decompressor. | |
mshlp_compressor * | mspack_create_hlp_compressor (struct mspack_system *sys) |
Creates a new HLP compressor. | |
mshlp_decompressor * | mspack_create_hlp_decompressor (struct mspack_system *sys) |
Creates a new HLP decompressor. | |
void | mspack_destroy_hlp_compressor (struct mshlp_compressor *this) |
Destroys an existing hlp compressor. | |
void | mspack_destroy_hlp_decompressor (struct mshlp_decompressor *this) |
Destroys an existing hlp decompressor. | |
msszdd_compressor * | mspack_create_szdd_compressor (struct mspack_system *sys) |
Creates a new SZDD compressor. | |
msszdd_decompressor * | mspack_create_szdd_decompressor (struct mspack_system *sys) |
Creates a new SZDD decompressor. | |
void | mspack_destroy_szdd_compressor (struct msszdd_compressor *this) |
Destroys an existing SZDD compressor. | |
void | mspack_destroy_szdd_decompressor (struct msszdd_decompressor *this) |
Destroys an existing SZDD decompressor. | |
mskwaj_compressor * | mspack_create_kwaj_compressor (struct mspack_system *sys) |
Creates a new KWAJ compressor. | |
mskwaj_decompressor * | mspack_create_kwaj_decompressor (struct mspack_system *sys) |
Creates a new KWAJ decompressor. | |
void | mspack_destroy_kwaj_compressor (struct mskwaj_compressor *this) |
Destroys an existing KWAJ compressor. | |
void | mspack_destroy_kwaj_decompressor (struct mskwaj_decompressor *this) |
Destroys an existing KWAJ decompressor. |
|
|
|
mscabd_file::attribs attribute: file is "archived".
|
|
mscabd_file::attribs attribute: file is an executable program.
|
|
mscabd_file::attribs attribute: file is hidden.
|
|
mscabd_file::attribs attribute: file is read-only.
|
|
mscabd_file::attribs attribute: file is an operating system file.
|
|
mscabd_file::attribs attribute: filename is UTF8, not ISO-8859-1.
|
|
Compression mode: LZX compression.
|
|
Compression mode: MSZIP (deflate) compression.
|
|
Compression mode: no compression.
|
|
Compression mode: Quantum compression.
|
|
Cabinet header flag: cabinet has a successor.
|
|
Cabinet header flag: cabinet has a predecessor.
|
|
Cabinet header flag: cabinet has reserved header space.
|
|
Offset from start of cabinet to the reserved header data (if present).
|
|
Returns the compression level used by a folder.
|
|
Returns the compression method used by a folder.
|
|
mscab_decompressor::set_param() parameter: size of decompression buffer
|
|
mscab_decompressor::set_param() parameter: repair MS-ZIP streams?
|
|
mscab_decompressor::set_param() parameter: search buffer size.
|
|
Error code: bad arguments to method.
|
|
Error code: bad checksum or CRC.
|
|
Error code: error during compression.
|
|
Error code: bad or corrupt file format.
|
|
Error code: error during decompression.
|
|
Error code: out of memory.
|
|
Error code: no error.
|
|
Error code: error opening file.
|
|
Error code: error reading file.
|
|
Error code: seek error.
|
|
Error code: bad "magic id" in file.
|
|
Error code: error writing file.
|
|
mspack_system::open() mode: open existing file for writing
|
|
mspack_system::open() mode: open existing file for reading.
|
|
mspack_system::open() mode: open existing file for writing
|
|
mspack_system::open() mode: open new file for writing
|
|
mspack_system::seek() mode: seek relative to current offset
|
|
mspack_system::seek() mode: seek relative to end of file
|
|
mspack_system::seek() mode: seek relative to start of file
|
|
Value: do { \ (result) = mspack_sys_selftest_internal(sizeof(off_t)); \ } while (0) A result of MSPACK_ERR_OK means the library and caller are compatible. Any other result indicates that the library and caller are not compatible and should not be used. In particular, a value of MSPACK_ERR_SEEK means the library and caller use different off_t datatypes. It should be used like so:
int selftest_result; MSPACK_SYS_SELFTEST(selftest_result); if (selftest_result != MSPACK_ERR_OK) { fprintf(stderr, "incompatible with this build of libmspack\n"); exit(0); }
|
|
Pass to mspack_version() to get the overall library version.
|
|
Pass to mspack_version() to get the mscab_compressor version.
|
|
Pass to mspack_version() to get the mscab_decompressor version.
|
|
Pass to mspack_version() to get the mschm_compressor version.
|
|
Pass to mspack_version() to get the mschm_decompressor version.
|
|
Pass to mspack_version() to get the mshlp_compressor version.
|
|
Pass to mspack_version() to get the mshlp_decompressor version.
|
|
Pass to mspack_version() to get the mskwaj_compressor version.
|
|
Pass to mspack_version() to get the mskwaj_decompressor version.
|
|
Pass to mspack_version() to get the mslit_compressor version.
|
|
Pass to mspack_version() to get the mslit_decompressor version.
|
|
Pass to mspack_version() to get the msszdd_compressor version.
|
|
Pass to mspack_version() to get the msszdd_decompressor version.
|
|
Pass to mspack_version() to get the mspack_system version.
|
|
Creates a new CAB compressor.
|
|
Creates a new CAB decompressor.
|
|
Creates a new CHM compressor.
|
|
Creates a new CHM decompressor.
|
|
Creates a new HLP compressor.
|
|
Creates a new HLP decompressor.
|
|
Creates a new KWAJ compressor.
|
|
Creates a new KWAJ decompressor.
|
|
Creates a new LIT compressor.
|
|
Creates a new LIT decompressor.
|
|
Creates a new SZDD compressor.
|
|
Creates a new SZDD decompressor.
|
|
Destroys an existing CAB compressor.
|
|
Destroys an existing CAB decompressor.
|
|
Destroys an existing CHM compressor.
|
|
Destroys an existing CHM decompressor.
|
|
Destroys an existing hlp compressor.
|
|
Destroys an existing hlp decompressor.
|
|
Destroys an existing KWAJ compressor.
|
|
Destroys an existing KWAJ decompressor.
|
|
Destroys an existing LIT compressor.
|
|
Destroys an existing LIT decompressor.
|
|
Destroys an existing SZDD compressor.
|
|
Destroys an existing SZDD decompressor.
|
|
Part of the MSPACK_SYS_SELFTEST() macro, must not be used directly.
|
|
Enquire about the binary compatibility version of a specific interface in the library. Currently, the following interfaces are defined:
The result of the function should be interpreted as follows:
|