Merging upstream version 1.7~pre1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
dda2aa8bae
commit
20b2675ae0
27 changed files with 1157 additions and 1534 deletions
101
doc/lzlib.info
101
doc/lzlib.info
|
@ -11,7 +11,7 @@ File: lzlib.info, Node: Top, Next: Introduction, Up: (dir)
|
|||
Lzlib Manual
|
||||
************
|
||||
|
||||
This manual is for Lzlib (version 1.6, 27 August 2014).
|
||||
This manual is for Lzlib (version 1.7-pre1, 24 February 2015).
|
||||
|
||||
* Menu:
|
||||
|
||||
|
@ -29,7 +29,7 @@ This manual is for Lzlib (version 1.6, 27 August 2014).
|
|||
* Concept index:: Index of concepts
|
||||
|
||||
|
||||
Copyright (C) 2009-2014 Antonio Diaz Diaz.
|
||||
Copyright (C) 2009-2015 Antonio Diaz Diaz.
|
||||
|
||||
This manual is free documentation: you have unlimited permission to
|
||||
copy, distribute and modify it.
|
||||
|
@ -45,8 +45,9 @@ and decompression functions, including integrity checking of the
|
|||
decompressed data. The compressed data format used by the library is the
|
||||
lzip format. Lzlib is written in C.
|
||||
|
||||
The lzip file format is designed for long-term data archiving, taking
|
||||
into account both data integrity and decoder availability:
|
||||
The lzip file format is designed for data sharing and long-term
|
||||
archiving, taking into account both data integrity and decoder
|
||||
availability:
|
||||
|
||||
* The lzip format provides very safe integrity checking and some data
|
||||
recovery means. The lziprecover program can repair bit-flip errors
|
||||
|
@ -61,8 +62,8 @@ into account both data integrity and decoder availability:
|
|||
archaeologist to extract the data from a lzip file long after
|
||||
quantum computers eventually render LZMA obsolete.
|
||||
|
||||
* Additionally lzip is copylefted, which guarantees that it will
|
||||
remain free forever.
|
||||
* Additionally the lzip reference implementation is copylefted, which
|
||||
guarantees that it will remain free forever.
|
||||
|
||||
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
|
||||
|
@ -75,15 +76,21 @@ 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
|
||||
read/write functions until all the data have 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.
|
||||
updated until a read call, even if a lot of data is written. If you
|
||||
want the data to be compressed in advance, just call the read function
|
||||
with a SIZE equal to 0.
|
||||
|
||||
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.
|
||||
|
||||
Lzlib will correctly decompress a data stream which is the
|
||||
concatenation of two or more compressed data streams. The result is the
|
||||
|
@ -103,9 +110,9 @@ elaborated way of finding coding sequences of minimum price than the one
|
|||
currently used by lzip could be developed, and the resulting sequence
|
||||
could also be coded using the LZMA coding scheme.
|
||||
|
||||
Lzip currently implements two variants of the LZMA algorithm; fast
|
||||
(used by option -0) and normal (used by all other compression levels).
|
||||
Lzlib just implements the "normal" variant.
|
||||
Lzlib currently implements two variants of the LZMA algorithm; fast
|
||||
(used by option -0 of minilzip) and normal (used by all other
|
||||
compression levels).
|
||||
|
||||
The high compression of LZMA comes from combining two basic,
|
||||
well-proven compression ideas: sliding dictionaries (LZ77/78) and
|
||||
|
@ -147,15 +154,18 @@ File: lzlib.info, Node: Buffering, Next: Parameter limits, Prev: Library vers
|
|||
|
||||
Lzlib internal functions need access to a memory chunk at least as large
|
||||
as the dictionary size (sliding window). For efficiency reasons, the
|
||||
input buffer for compression is twice as large as the dictionary size.
|
||||
Finally, for safety reasons, lzlib uses two more internal buffers.
|
||||
input buffer for compression is twice or sixteen times as large as the
|
||||
dictionary size.
|
||||
|
||||
Finally, for safety reasons, lzlib uses two more internal buffers.
|
||||
|
||||
These are the four buffers used by lzlib, and their guaranteed
|
||||
minimum sizes:
|
||||
|
||||
* Input compression buffer. Written to by the 'LZ_compress_write'
|
||||
function. Its size is two times the dictionary size set with the
|
||||
'LZ_compress_open' function or 64 KiB, whichever is larger.
|
||||
function. For the normal variant of LZMA, its size is two times
|
||||
the dictionary size set with the 'LZ_compress_open' function or 64
|
||||
KiB, whichever is larger. For the fast variant, its size is 1 MiB.
|
||||
|
||||
* Output compression buffer. Read from by the 'LZ_compress_read'
|
||||
function. Its size is 64 KiB.
|
||||
|
@ -230,6 +240,11 @@ calling 'LZ_compress_errno' before using it.
|
|||
range from 5 to 273. Larger values usually give better compression
|
||||
ratios but longer compression times.
|
||||
|
||||
If DICTIONARY_SIZE is 65535 and MATCH_LEN_LIMIT is 16, the fast
|
||||
variant of LZMA is chosen, which produces identical compressed
|
||||
output as 'lzip -0'. (The DICTIONARY_SIZE used will be rounded
|
||||
upwards to 64 KiB).
|
||||
|
||||
MEMBER_SIZE sets the member size limit in bytes. Minimum member
|
||||
size limit is 100 kB. Small member size may degrade compression
|
||||
ratio, so use it only when needed. To produce a single-member data
|
||||
|
@ -246,8 +261,8 @@ calling 'LZ_compress_errno' before using it.
|
|||
-- Function: int LZ_compress_finish ( struct LZ_Encoder * const
|
||||
ENCODER )
|
||||
Use this function to tell 'lzlib' that all the data for this member
|
||||
has already been written (with the 'LZ_compress_write' function).
|
||||
After all the produced compressed data has been read with
|
||||
have already been written (with the 'LZ_compress_write' function).
|
||||
After all the produced compressed data have been read with
|
||||
'LZ_compress_read' and 'LZ_compress_member_finished' returns 1, a
|
||||
new member can be started with 'LZ_compress_restart_member'.
|
||||
|
||||
|
@ -262,9 +277,8 @@ calling 'LZ_compress_errno' before using it.
|
|||
ENCODER )
|
||||
Use this function to make available to 'LZ_compress_read' all the
|
||||
data already written with the 'LZ_compress_write' function. First
|
||||
call 'LZ_compress_read' until it returns 0. Then call
|
||||
'LZ_compress_sync_flush'. Finally, call 'LZ_compress_read' again
|
||||
to read the remaining data.
|
||||
call 'LZ_compress_sync_flush'. Then call 'LZ_compress_read' until
|
||||
it returns 0.
|
||||
|
||||
Repeated use of 'LZ_compress_sync_flush' may degrade compression
|
||||
ratio, so use it only when needed.
|
||||
|
@ -304,8 +318,8 @@ calling 'LZ_compress_errno' before using it.
|
|||
|
||||
-- Function: int LZ_compress_finished ( struct LZ_Encoder * const
|
||||
ENCODER )
|
||||
Returns 1 if all the data has been read and 'LZ_compress_close' can
|
||||
be safely called. Otherwise it returns 0.
|
||||
Returns 1 if all the data have been read and 'LZ_compress_close'
|
||||
can be safely called. Otherwise it returns 0.
|
||||
|
||||
-- Function: int LZ_compress_member_finished ( struct LZ_Encoder *
|
||||
const ENCODER )
|
||||
|
@ -364,7 +378,8 @@ verified by calling 'LZ_decompress_errno' before using it.
|
|||
-- Function: int LZ_decompress_finish ( struct LZ_Decoder * const
|
||||
DECODER )
|
||||
Use this function to tell 'lzlib' that all the data for this stream
|
||||
has already been written (with the 'LZ_decompress_write' function).
|
||||
have already been written (with the 'LZ_decompress_write'
|
||||
function).
|
||||
|
||||
-- Function: int LZ_decompress_reset ( struct LZ_Decoder * const
|
||||
DECODER )
|
||||
|
@ -420,7 +435,7 @@ verified by calling 'LZ_decompress_errno' before using it.
|
|||
|
||||
-- Function: int LZ_decompress_finished ( struct LZ_Decoder * const
|
||||
DECODER )
|
||||
Returns 1 if all the data has been read and 'LZ_decompress_close'
|
||||
Returns 1 if all the data have been read and 'LZ_decompress_close'
|
||||
can be safely called. Otherwise it returns 0.
|
||||
|
||||
-- Function: int LZ_decompress_member_finished ( struct LZ_Decoder *
|
||||
|
@ -589,8 +604,8 @@ with no additional information before, between, or after them.
|
|||
|
||||
'Lzma stream'
|
||||
The lzma stream, finished by an end of stream marker. Uses default
|
||||
values for encoder properties. See the lzip manual for a full
|
||||
description.
|
||||
values for encoder properties. *Note Stream format: (lzip)Stream
|
||||
format, for a complete description.
|
||||
Lzip only uses the LZMA marker '2' ("End Of Stream" marker). Lzlib
|
||||
also uses the LZMA marker '3' ("Sync Flush" marker).
|
||||
|
||||
|
@ -630,7 +645,7 @@ Example 1: Normal compression (MEMBER_SIZE > total output).
|
|||
1) LZ_compress_open
|
||||
2) LZ_compress_write
|
||||
3) LZ_compress_read
|
||||
4) go back to step 2 until all input data has been written
|
||||
4) go back to step 2 until all input data have been written
|
||||
5) LZ_compress_finish
|
||||
6) LZ_compress_read
|
||||
7) go back to step 6 until LZ_compress_finished returns 1
|
||||
|
@ -653,7 +668,7 @@ Example 3: Decompression.
|
|||
1) LZ_decompress_open
|
||||
2) LZ_decompress_write
|
||||
3) LZ_decompress_read
|
||||
4) go back to step 2 until all input data has been written
|
||||
4) go back to step 2 until all input data have been written
|
||||
5) LZ_decompress_finish
|
||||
6) LZ_decompress_read
|
||||
7) go back to step 6 until LZ_decompress_finished returns 1
|
||||
|
@ -697,7 +712,7 @@ Example 6: Multi-member compression (user-restarted members).
|
|||
6) LZ_compress_read
|
||||
7) go back to step 6 until LZ_compress_member_finished returns 1
|
||||
8) verify that LZ_compress_finished returns 1
|
||||
9) go to step 12 if all input data has been written
|
||||
9) go to step 12 if all input data have been written
|
||||
10) LZ_compress_restart_member
|
||||
11) go back to step 2
|
||||
12) LZ_compress_close
|
||||
|
@ -770,18 +785,18 @@ Concept index
|
|||
|
||||
Tag Table:
|
||||
Node: Top220
|
||||
Node: Introduction1304
|
||||
Node: Library version5487
|
||||
Node: Buffering6132
|
||||
Node: Parameter limits7253
|
||||
Node: Compression functions8212
|
||||
Node: Decompression functions14594
|
||||
Node: Error codes20755
|
||||
Node: Error messages22694
|
||||
Node: Data format23273
|
||||
Node: Examples25922
|
||||
Node: Problems30005
|
||||
Node: Concept index30577
|
||||
Node: Introduction1311
|
||||
Node: Library version5808
|
||||
Node: Buffering6453
|
||||
Node: Parameter limits7673
|
||||
Node: Compression functions8632
|
||||
Node: Decompression functions15176
|
||||
Node: Error codes21344
|
||||
Node: Error messages23283
|
||||
Node: Data format23862
|
||||
Node: Examples26538
|
||||
Node: Problems30624
|
||||
Node: Concept index31196
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue