The lzip file format is designed for data sharing and long-term archiving, taking into account both data integrity and decoder availability:
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.
The functions and variables forming the interface of the compression 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.
Compression/decompression is done by repeatedly calling a couple of read/write functions until all the data has been processed by the library. This interface is safer and less error prone than the traditional zlib interface.
Compression/decompression is done when the read function is called. This means the value returned by the position functions will not be updated until some data is read, even if you write a lot of data. If you want the data to be compressed in advance, just call the read function with a size equal to 0.
Lzlib will correctly decompress a data stream which is the concatenation of two or more compressed data streams. The result is the concatenation of the corresponding decompressed data streams. Integrity testing of 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.
Learn more about lzip in the Lzip Home Page.
An online manual for lzlib can be found here.
An archive of the bug report mailing list is available at http://lists.gnu.org/mailman/listinfo/lzip-bug.
See also the lzip project page at Savannah.
As a special exception, you may use this free software library without restriction. Specifically, if other files instantiate templates or use macros or inline functions from this library, or you compile this library and link it with other files to produce an executable, this library does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License.
You are free to copy, modify and distribute all or part of this article without limitation.