From: Mark Adler Date: Wed, 14 Mar 2012 18:16:22 +0000 (-0700) Subject: Improve inflate() documentation on the use of Z_FINISH. X-Git-Tag: v1.2.7~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da32fd28927eeed480185184f1a3847f828235d1;p=thirdparty%2Fzlib-ng.git Improve inflate() documentation on the use of Z_FINISH. --- diff --git a/zlib.h b/zlib.h index bb07e2a6e..a569b002a 100644 --- a/zlib.h +++ b/zlib.h @@ -452,14 +452,17 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); error. However if all decompression is to be performed in a single step (a single call of inflate), the parameter flush should be set to Z_FINISH. In this case all pending input is processed and all pending output is flushed; - avail_out must be large enough to hold all the uncompressed data. (The size - of the uncompressed data may have been saved by the compressor for this - purpose.) The next operation on this stream must be inflateEnd to deallocate - the decompression state. The use of Z_FINISH is not required to perform an - inflation in one step. However it may be used to inform inflate that a - faster approach can be used for the single inflate() call. Z_FINISH also - informs inflate to not maintain a sliding window if the stream completes, - which reduces inflate's memory footprint. + avail_out must be large enough to hold all of the uncompressed data for the + operation to complete. (The size of the uncompressed data may have been + saved by the compressor for this purpose.) The use of Z_FINISH is not + required to perform an inflation in one step. However it may be used to + inform inflate that a faster approach can be used for the single inflate() + call. Z_FINISH also informs inflate to not maintain a sliding window if the + stream completes, which reduces inflate's memory footprint. If the stream + does not complete, either because not all of the stream is provided or not + enough output space is provided, then a sliding window will be allocated and + inflate() can be called again to continue the operation as if Z_NO_FLUSH had + been used. In this implementation, inflate() always flushes as much output as possible to the output buffer, and always uses the faster approach on the