• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

doc/H03-May-2022-1,9831,653

examples/H04-Mar-2019-915708

m4/H04-Mar-2019-9,0758,203

mspack/H04-Mar-2019-10,7485,729

test/H04-Mar-2019-2,4251,793

AUTHORSH A D13-Aug-2017490 1411

ChangeLogH A D18-Feb-201931.7 KiB816572

INSTALLH A D04-Mar-201915.4 KiB369287

Makefile.amH A D06-Nov-20184.8 KiB9281

Makefile.inH A D03-May-202272.4 KiB1,7301,557

READMEH A D04-Mar-20195.2 KiB13199

TODOH A D05-Jun-2015254 98

acinclude.m4H A D30-Oct-20183.7 KiB10096

aclocal.m4H A D04-Mar-201943.3 KiB1,2191,109

ar-libH A D04-Mar-20195.7 KiB271210

compileH A D04-Mar-20197.2 KiB348258

config.guessH A D04-Mar-201943.2 KiB1,4811,288

config.h.inH A D04-Mar-20193.3 KiB13091

config.subH A D04-Mar-201935.3 KiB1,8021,661

configureH A D04-Mar-2019449.9 KiB15,48813,045

configure.acH A D04-Mar-20191 KiB4941

depcompH A D04-Mar-201923 KiB792502

install-shH A D04-Mar-201914.8 KiB509329

libmscabd.laH A D04-Mar-2019867 4230

libmschmd.laH A D04-Mar-2019867 4230

libmspack.laH A D04-Mar-2019944 4230

libmspack.pc.inH A D05-Jun-2015234 119

ltmain.shH A D04-Mar-2019316.8 KiB11,1577,986

missingH A D04-Mar-20196.7 KiB216143

test-driverH A D04-Mar-20194.5 KiB14987

README

1libmspack 0.10.1alpha
2
3The purpose of libmspack is to provide compressors and decompressors,
4archivers and dearchivers for Microsoft compression formats: CAB, CHM, WIM,
5LIT, HLP, KWAJ and SZDD. It is also designed to be easily embeddable,
6stable, robust and resource-efficient.
7
8The library is not intended as a generalised "any archiver" interface.
9Users of the library must explicitly choose the format they intend to work
10with.
11
12All special features of the above formats will be covered as fully as
13possible -- for example, CAB's multi-part cabinet sets, or CHM's fast
14lookup indices. All compression methods used by the formats will be
15implemented as completely as possible.
16
17However, other than what is required for access to these formats and their
18features, no other functionality is intended. There is no file metadata
19translation functionality. All file I/O is abstracted, although a default
20implementation using the standard C library is provided.
21
22
23DOCUMENTATION
24
25The API documentation is stored in the doc/ directory. It is generated
26automatically from mspack.h with doxygen. It is also available online at
27https://www.cabextract.org.uk/libmspack/doc/
28
29
30BUILDING / INSTALLING
31
32./configure
33make
34make install
35
36This will install the main libmspack library and mspack.h header file.
37Some other libraries and executables are built, but not installed.
38
39If building from the Git repository, running rebuild.sh will create all the
40auto-generated files, then run ./configure && make. Running cleanup.sh will
41perform a thorough clean, deleting all auto-generated files.
42
43In addition to gcc, you also need the following for building from repository:
44
45- at least autoconf 2.57
46- at least automake 1.11
47- libtool
48
49This is an alpha release. Unless you are in a position to package the
50libmspack library for the environment you intend to run your application,
51it is recommended that you do not rely on users of your software having
52the binary library installed and instead you should include the libmspack
53source files directly in your application's build environment.
54
55
56LEGAL ISSUES
57
58To the best of my knowledge, libmspack does not infringe on any
59compression or decompression patents. However, this is not legal
60advice, and it is recommended that you perform your own patent search.
61
62libmspack is licensed under the LGPL - see COPYING.LIB in this directory.
63
64The LGPL requires you to build libmspack as a stand alone library then link
65your code to it using a linker. I personally grant you some extra rights:
66you can incorporate libmspack's source code wholly or partially in your own
67code, without having to build and link libmspack as an independent library,
68provided you meet ALL of the following conditions:
69
701. ANY modifications to the existing libmspack source code are published and
71   distributed under the LGPL license.
722. You MUST NOT use libmspack function calls, structures or definitions unless
73   they are defined in the public library interface "mspack.h".
743. When distributing your code, you MUST make clear your code uses libmspack,
75   and either include the full libmspack distribution with your code, or
76   provide access to it as per clause 4 of the LGPL.
77
78EXAMPLE CODE
79
80libmspack is bundled with programs which demonstrate the library's features.
81
82examples/cabd_memory.c - an mspack_system that can read and write to memory
83examples/multifh.c     - an mspack_system that can simultaneously work on
84                         in-memory images, raw file descriptors, open file
85                         handles and regular disk files
86
87examples/cabrip.c       - extracts any CAB files embedded in another file
88examples/chmextract.c   - extracts all files in a CHM file to disk
89examples/msexpand.c     - expands an SZDD or KWAJ file
90examples/oabextract.c   - extracts an Exchange Offline Address Book (.LZX) file
91
92test/cabd_c10          - tests the CAB decompressor on the C10 collection
93test/cabd_compare      - compares libmspack with Microsoft's EXTRACT.EXE
94test/cabd_md5          - shows MD5 checksums of all files in a CAB file/set
95test/chmd_compare      - compares libmspack with Microsoft's HH.EXE
96test/chmd_find.c       - checks all files in a CHM file can be fast-found
97test/chmd_md5.c        - shows MD5 checksums of all files within a CHM file
98test/chmd_order.c      - extracts files in a CHM file in four different ways
99test/chminfo.c         - prints verbose information about CHM file structures
100test/msdecompile_md5   - runs Microsoft's HH.EXE -DECOMPILE via WINE
101test/msextract_md5     - runs Microsoft's EXTRACT.EXE via WINE
102
103Here is a simple example of usage, which will create a CAB decompressor,
104then use that to open an existing Microsoft CAB file called "example.cab",
105and list the names of all the files contained in that cab.
106
107#include <stdio.h>
108#include <unistd.h>
109#include <mspack.h>
110
111int main() {
112  struct mscab_decompressor *cabd;
113  struct mscabd_cabinet *cab;
114  struct mscabd_file *file;
115  int test;
116
117  MSPACK_SYS_SELFTEST(test);
118  if (test != MSPACK_ERR_OK) exit(0);
119
120  if ((cabd = mspack_create_cab_decompressor(NULL))) {
121    if ((cab = cabd->open(cabd, "example.cab"))) {
122      for (file = cab->files; file; file = file->next) {
123        printf("%s\n", file->filename);
124      }
125      cabd->close(cabd, cab);
126    }
127    mspack_destroy_cab_decompressor(cabd);
128  }
129  return 0;
130}
131