summaryrefslogtreecommitdiff
path: root/zlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'zlib.h')
-rw-r--r--zlib.h38
1 files changed, 22 insertions, 16 deletions
diff --git a/zlib.h b/zlib.h
index 6983fb7..f72fff8 100644
--- a/zlib.h
+++ b/zlib.h
@@ -1,5 +1,5 @@
1/* zlib.h -- interface of the 'zlib' general purpose compression library 1/* zlib.h -- interface of the 'zlib' general purpose compression library
2 version 0.79 April 28th, 1995. 2 version 0.8 April 29th, 1995.
3 3
4 Copyright (C) 1995 Jean-loup Gailly and Mark Adler 4 Copyright (C) 1995 Jean-loup Gailly and Mark Adler
5 5
@@ -28,7 +28,7 @@
28 28
29#include "zconf.h" 29#include "zconf.h"
30 30
31#define ZLIB_VERSION "0.79" 31#define ZLIB_VERSION "0.8"
32 32
33/* 33/*
34 The 'zlib' compression library provides in-memory compression and 34 The 'zlib' compression library provides in-memory compression and
@@ -191,25 +191,30 @@ extern int deflate __P((z_stream *strm, int flush));
191 so should be used only when necessary. Using Z_FULL_FLUSH too often can 191 so should be used only when necessary. Using Z_FULL_FLUSH too often can
192 seriously degrade the compression. 192 seriously degrade the compression.
193 193
194 If the parameter flush is set to Z_FINISH, all pending input is 194 If the parameter flush is set to Z_FINISH, all pending input is processed,
195 processed and all pending output is flushed. The next operation on this 195 all pending output is flushed and deflate returns with Z_STREAM_END if there
196 stream must be another call of deflate with Z_FINISH but no more input data 196 was enough output space; if deflate returns with Z_OK, this function must be
197 (unchanged avail_in) if this call returned with avail_out equal to zero, 197 called again with Z_FINISH and more output space (updated avail_out) but no
198 or a call of deflateEnd to deallocate the compression state. Z_FINISH can 198 more input data, until it returns with Z_STREAM_END or an error. After
199 be used immediately after deflateInit if all the compression is to be 199 deflate has returned Z_STREAM_END, the only possible operations on the
200 done in a single step. In this case, avail_out must be at least 0.1% 200 stream are deflateReset or deflateEnd.
201 larger than avail_in plus 12 bytes. 201
202 Z_FINISH can be used immediately after deflateInit if all the compression
203 is to be done in a single step. In this case, avail_out must be at least
204 0.1% larger than avail_in plus 12 bytes. If deflate does not return
205 Z_STREAM_END, then it must be called again as described above.
202 206
203 deflate() may update data_type if it can make a good guess about 207 deflate() may update data_type if it can make a good guess about
204 the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered 208 the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
205 binary. This field is only for information purposes and does not affect 209 binary. This field is only for information purposes and does not affect
206 the compression algorithm in any manner. 210 the compression algorithm in any manner.
207 211
208 deflate() returns Z_OK if some progress has been made (more input processed 212 deflate() returns Z_OK if some progress has been made (more input
209 or more output produced), Z_STREAM_ERROR if the stream state was 213 processed or more output produced), Z_STREAM_END if all input has been
210 inconsistent (for example if next_in or next_out was NULL), Z_BUF_ERROR if 214 consumed and all output has been produced (only when flush is set to
211 no progress is possible or if there was not enough room in the output buffer 215 Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
212 when Z_FINISH is used. ??? to be changed (use Z_STEAM_END) */ 216 if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible.
217*/
213 218
214 219
215extern int deflateEnd __P((z_stream *strm)); 220extern int deflateEnd __P((z_stream *strm));
@@ -534,7 +539,8 @@ extern int gzflush __P((gzFile file, int flush));
534/* 539/*
535 Flushes all pending output into the compressed file. The parameter 540 Flushes all pending output into the compressed file. The parameter
536 flush is as in the deflate() function. The return value is the zlib 541 flush is as in the deflate() function. The return value is the zlib
537 error number (see function gzerror below). 542 error number (see function gzerror below). gzflush returns Z_OK if
543 the flush parameter is Z_FINISH and all output could be flushed.
538 gzflush should be called only when strictly necessary because it can 544 gzflush should be called only when strictly necessary because it can
539 degrade compression. 545 degrade compression.
540*/ 546*/