]> git.lizzy.rs Git - zlib.git/commit
Enable dictionary setting in middle of stream, and keeping the dictionary.
authorMark Adler <madler@alumni.caltech.edu>
Thu, 8 Dec 2011 07:57:37 +0000 (23:57 -0800)
committerMark Adler <madler@alumni.caltech.edu>
Thu, 8 Dec 2011 08:13:52 +0000 (00:13 -0800)
commitafe7cf78d51b819dcdc5b0f4cb85a25a52a9fcd0
tree24c9db96071504cd7beb1d1800dbb265c736070f
parentfbac04f666339eef3678e4eb81b25ae69bfcbd81
Enable dictionary setting in middle of stream, and keeping the dictionary.

This patch adds the deflateResetKeep() function to retain the sliding
window for the next deflate operation, and fixes an inflateResetKeep()
problem that came from inflate() not updating the window when the
stream completed.  This enables constructing and decompressing a series
of concatenated deflate streams where each can depend on the history of
uncompressed data that precedes it.

This generalizes deflateSetDictionary() and inflateSetDictionary() to
permit setting the dictionary in the middle of a stream for raw deflate
and inflate.  This in combination with the Keep functions enables a
scheme for updating files block by block with the transmission of
compressed data, where blocks are sent with deflateResetKeep() to
retain history for better compression, and deflateSetDictionary() is
used for blocks already present at the receiver to skip compression but
insert that data in the history, again for better compression.  The
corresponding inflate calls are done on the receiver side.
12 files changed:
as400/bndsrc
as400/zlib.inc
contrib/vstudio/vc10/zlibvc.def
contrib/vstudio/vc9/zlibvc.def
deflate.c
inflate.c
win32/zlib.def
zconf.h
zconf.h.cmakein
zconf.h.in
zlib.h
zlib.map