aboutsummaryrefslogtreecommitdiff
path: root/as400
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-12-07 23:57:37 -0800
committerMark Adler <madler@alumni.caltech.edu>2011-12-08 00:13:52 -0800
commitafe7cf78d51b819dcdc5b0f4cb85a25a52a9fcd0 (patch)
tree24c9db96071504cd7beb1d1800dbb265c736070f /as400
parentfbac04f666339eef3678e4eb81b25ae69bfcbd81 (diff)
downloadzlib-afe7cf78d51b819dcdc5b0f4cb85a25a52a9fcd0.tar.gz
zlib-afe7cf78d51b819dcdc5b0f4cb85a25a52a9fcd0.tar.bz2
zlib-afe7cf78d51b819dcdc5b0f4cb85a25a52a9fcd0.zip
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.
Diffstat (limited to 'as400')
-rw-r--r--as400/bndsrc1
-rw-r--r--as400/zlib.inc4
2 files changed, 5 insertions, 0 deletions
diff --git a/as400/bndsrc b/as400/bndsrc
index 036cd63..3e26283 100644
--- a/as400/bndsrc
+++ b/as400/bndsrc
@@ -33,6 +33,7 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB')
33 EXPORT SYMBOL("deflateSetDictionary") 33 EXPORT SYMBOL("deflateSetDictionary")
34 EXPORT SYMBOL("deflateCopy") 34 EXPORT SYMBOL("deflateCopy")
35 EXPORT SYMBOL("deflateReset") 35 EXPORT SYMBOL("deflateReset")
36 EXPORT SYMBOL("deflateResetKeep")
36 EXPORT SYMBOL("deflateParams") 37 EXPORT SYMBOL("deflateParams")
37 EXPORT SYMBOL("deflatePending") 38 EXPORT SYMBOL("deflatePending")
38 EXPORT SYMBOL("deflatePrime") 39 EXPORT SYMBOL("deflatePrime")
diff --git a/as400/zlib.inc b/as400/zlib.inc
index 976dca2..f0915c8 100644
--- a/as400/zlib.inc
+++ b/as400/zlib.inc
@@ -435,6 +435,10 @@
435 D PR 10I 0 extproc('inflateResetKeep') End and init. stream 435 D PR 10I 0 extproc('inflateResetKeep') End and init. stream
436 D strm like(z_stream) Expansion stream 436 D strm like(z_stream) Expansion stream
437 * 437 *
438 D deflateResetKeep...
439 D PR 10I 0 extproc('deflateResetKeep') End and init. stream
440 D strm like(z_stream) Expansion stream
441 *
438 D gzflags PR 10U 0 extproc('gzflags') 442 D gzflags PR 10U 0 extproc('gzflags')
439 * 443 *
440 /endif 444 /endif