2025-02-20 15:51:30 +01:00
|
|
|
Description
|
|
|
|
|
2025-02-20 16:01:38 +01:00
|
|
|
Lzlib is a data compression library providing in-memory LZMA compression
|
|
|
|
and decompression functions, including integrity checking of the
|
2025-02-20 16:49:45 +01:00
|
|
|
decompressed data. The compressed data format used by the library is the
|
2025-02-20 19:59:10 +01:00
|
|
|
lzip format. Lzlib is written in C.
|
2025-02-20 15:51:30 +01:00
|
|
|
|
2025-02-20 20:52:54 +01:00
|
|
|
The lzip file format is designed for data sharing and long-term
|
|
|
|
archiving, taking into account both data integrity and decoder
|
|
|
|
availability:
|
2025-02-20 20:23:05 +01:00
|
|
|
|
|
|
|
* The lzip format provides very safe integrity checking and some data
|
|
|
|
recovery means. The lziprecover program can repair bit-flip errors
|
|
|
|
(one of the most common forms of data corruption) in lzip files,
|
|
|
|
and provides data recovery capabilities, including error-checked
|
|
|
|
merging of damaged copies of a file.
|
|
|
|
|
|
|
|
* The lzip format is as simple as possible (but not simpler). The
|
2025-02-20 21:23:49 +01:00
|
|
|
lzip manual provides the source code of a simple decompressor along
|
|
|
|
with a detailed explanation of how it works, so that with the only
|
|
|
|
help of the lzip manual it would be possible for a digital
|
|
|
|
archaeologist to extract the data from a lzip file long after
|
|
|
|
quantum computers eventually render LZMA obsolete.
|
2025-02-20 20:23:05 +01:00
|
|
|
|
2025-02-20 20:52:54 +01:00
|
|
|
* Additionally the lzip reference implementation is copylefted, which
|
|
|
|
guarantees that it will remain free forever.
|
2025-02-20 20:18:02 +01:00
|
|
|
|
2025-02-20 20:29:07 +01:00
|
|
|
A nice feature of the lzip format is that a corrupt byte is easier to
|
|
|
|
repair the nearer it is from the beginning of the file. Therefore, with
|
|
|
|
the help of lziprecover, losing an entire archive just because of a
|
|
|
|
corrupt byte near the beginning is a thing of the past.
|
|
|
|
|
2025-02-20 15:51:30 +01:00
|
|
|
The functions and variables forming the interface of the compression
|
2025-02-20 20:21:13 +01:00
|
|
|
library are declared in the file 'lzlib.h'. Usage examples of the
|
|
|
|
library are given in the files 'main.c' and 'bbexample.c' from the
|
|
|
|
source distribution.
|
2025-02-20 15:51:30 +01:00
|
|
|
|
2025-02-20 16:49:45 +01:00
|
|
|
Compression/decompression is done by repeatedly calling a couple of
|
2025-02-20 20:54:52 +01:00
|
|
|
read/write functions until all the data have been processed by the
|
2025-02-20 15:51:30 +01:00
|
|
|
library. This interface is safer and less error prone than the
|
|
|
|
traditional zlib interface.
|
|
|
|
|
2025-02-20 19:59:10 +01:00
|
|
|
Compression/decompression is done when the read function is called. This
|
|
|
|
means the value returned by the position functions will not be updated
|
2025-02-20 21:23:49 +01:00
|
|
|
until a read call, even if a lot of data are written. If you want the
|
2025-02-20 20:54:52 +01:00
|
|
|
data to be compressed in advance, just call the read function with a
|
2025-02-20 19:59:10 +01:00
|
|
|
size equal to 0.
|
|
|
|
|
2025-02-20 20:52:54 +01:00
|
|
|
If all the data to be compressed are written in advance, lzlib will
|
|
|
|
automatically adjust the header of the compressed data to use the
|
|
|
|
smallest possible dictionary size. This feature reduces the amount of
|
|
|
|
memory needed for decompression and allows minilzip to produce identical
|
|
|
|
compressed output as lzip.
|
|
|
|
|
2025-02-20 15:51:30 +01:00
|
|
|
Lzlib will correctly decompress a data stream which is the concatenation
|
|
|
|
of two or more compressed data streams. The result is the concatenation
|
2025-02-20 16:49:45 +01:00
|
|
|
of the corresponding decompressed data streams. Integrity testing of
|
2025-02-20 15:51:30 +01:00
|
|
|
concatenated compressed data streams is also supported.
|
|
|
|
|
|
|
|
All the library functions are thread safe. The library does not install
|
|
|
|
any signal handler. The decoder checks the consistency of the compressed
|
|
|
|
data, so the library should never crash even in case of corrupted input.
|
|
|
|
|
2025-02-20 20:54:52 +01:00
|
|
|
In spite of its name (Lempel-Ziv-Markov chain-Algorithm), LZMA is not a
|
|
|
|
concrete algorithm; it is more like "any algorithm using the LZMA coding
|
|
|
|
scheme". For example, the option '-0' of lzip uses the scheme in almost
|
|
|
|
the simplest way possible; issuing the longest match it can find, or a
|
|
|
|
literal byte if it can't find a match. Inversely, a much more elaborated
|
|
|
|
way of finding coding sequences of minimum size than the one currently
|
|
|
|
used by lzip could be developed, and the resulting sequence could also
|
|
|
|
be coded using the LZMA coding scheme.
|
2025-02-20 20:23:05 +01:00
|
|
|
|
2025-02-20 20:52:54 +01:00
|
|
|
Lzlib currently implements two variants of the LZMA algorithm; fast
|
2025-02-20 20:55:25 +01:00
|
|
|
(used by option '-0' of minilzip) and normal (used by all other
|
2025-02-20 20:52:54 +01:00
|
|
|
compression levels).
|
2025-02-20 20:23:05 +01:00
|
|
|
|
|
|
|
The high compression of LZMA comes from combining two basic, well-proven
|
|
|
|
compression ideas: sliding dictionaries (LZ77/78) and markov models (the
|
|
|
|
thing used by every compression algorithm that uses a range encoder or
|
|
|
|
similar order-0 entropy coder as its last stage) with segregation of
|
|
|
|
contexts according to what the bits are used for.
|
2025-02-20 20:18:02 +01:00
|
|
|
|
|
|
|
The ideas embodied in lzlib are due to (at least) the following people:
|
|
|
|
Abraham Lempel and Jacob Ziv (for the LZ algorithm), Andrey Markov (for
|
|
|
|
the definition of Markov chains), G.N.N. Martin (for the definition of
|
|
|
|
range encoding), Igor Pavlov (for putting all the above together in
|
|
|
|
LZMA), and Julian Seward (for bzip2's CLI).
|
2025-02-20 15:51:30 +01:00
|
|
|
|
|
|
|
|
2025-02-20 21:26:45 +01:00
|
|
|
Copyright (C) 2009-2018 Antonio Diaz Diaz.
|
2025-02-20 15:51:30 +01:00
|
|
|
|
|
|
|
This file is free documentation: you have unlimited permission to copy,
|
|
|
|
distribute and modify it.
|
|
|
|
|
|
|
|
The file Makefile.in is a data file used by configure to produce the
|
2025-02-20 16:49:45 +01:00
|
|
|
Makefile. It has the same copyright owner and permissions that configure
|
|
|
|
itself.
|