diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2023-07-10 11:27:50 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2023-07-10 11:27:50 -0700 |
commit | a88f727dbe9366ffdb63a13fc2c5f122f486cd61 (patch) | |
tree | 7a77e4e29d7b94847d4125d93b5bc0e2922f09dc | |
parent | 263a9828669594d235dc65a8b61748be5bbacf2b (diff) | |
download | zlib-a88f727dbe9366ffdb63a13fc2c5f122f486cd61.tar.gz zlib-a88f727dbe9366ffdb63a13fc2c5f122f486cd61.tar.bz2 zlib-a88f727dbe9366ffdb63a13fc2c5f122f486cd61.zip |
Document in zlib.h the initialization of stream fields by the Init
and Reset functions.
-rw-r--r-- | zlib.h | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -230,7 +230,7 @@ ZEXTERN int ZEXPORT deflateInit(z_streamp strm, int level); | |||
230 | Initializes the internal stream state for compression. The fields | 230 | Initializes the internal stream state for compression. The fields |
231 | zalloc, zfree and opaque must be initialized before by the caller. If | 231 | zalloc, zfree and opaque must be initialized before by the caller. If |
232 | zalloc and zfree are set to Z_NULL, deflateInit updates them to use default | 232 | zalloc and zfree are set to Z_NULL, deflateInit updates them to use default |
233 | allocation functions. | 233 | allocation functions. total_in, total_out, adler, and msg are initialized. |
234 | 234 | ||
235 | The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: | 235 | The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: |
236 | 1 gives best speed, 9 gives best compression, 0 gives no compression at all | 236 | 1 gives best speed, 9 gives best compression, 0 gives no compression at all |
@@ -383,7 +383,8 @@ ZEXTERN int ZEXPORT inflateInit(z_streamp strm); | |||
383 | read or consumed. The allocation of a sliding window will be deferred to | 383 | read or consumed. The allocation of a sliding window will be deferred to |
384 | the first call of inflate (if the decompression does not complete on the | 384 | the first call of inflate (if the decompression does not complete on the |
385 | first call). If zalloc and zfree are set to Z_NULL, inflateInit updates | 385 | first call). If zalloc and zfree are set to Z_NULL, inflateInit updates |
386 | them to use default allocation functions. | 386 | them to use default allocation functions. total_in, total_out, adler, and |
387 | msg are initialized. | ||
387 | 388 | ||
388 | inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough | 389 | inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough |
389 | memory, Z_VERSION_ERROR if the zlib library version is incompatible with the | 390 | memory, Z_VERSION_ERROR if the zlib library version is incompatible with the |
@@ -696,7 +697,7 @@ ZEXTERN int ZEXPORT deflateReset(z_streamp strm); | |||
696 | This function is equivalent to deflateEnd followed by deflateInit, but | 697 | This function is equivalent to deflateEnd followed by deflateInit, but |
697 | does not free and reallocate the internal compression state. The stream | 698 | does not free and reallocate the internal compression state. The stream |
698 | will leave the compression level and any other attributes that may have been | 699 | will leave the compression level and any other attributes that may have been |
699 | set unchanged. | 700 | set unchanged. total_in, total_out, adler, and msg are initialized. |
700 | 701 | ||
701 | deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source | 702 | deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source |
702 | stream state was inconsistent (such as zalloc or state being Z_NULL). | 703 | stream state was inconsistent (such as zalloc or state being Z_NULL). |
@@ -962,6 +963,7 @@ ZEXTERN int ZEXPORT inflateReset(z_streamp strm); | |||
962 | This function is equivalent to inflateEnd followed by inflateInit, | 963 | This function is equivalent to inflateEnd followed by inflateInit, |
963 | but does not free and reallocate the internal decompression state. The | 964 | but does not free and reallocate the internal decompression state. The |
964 | stream will keep attributes that may have been set by inflateInit2. | 965 | stream will keep attributes that may have been set by inflateInit2. |
966 | total_in, total_out, adler, and msg are initialized. | ||
965 | 967 | ||
966 | inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source | 968 | inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source |
967 | stream state was inconsistent (such as zalloc or state being Z_NULL). | 969 | stream state was inconsistent (such as zalloc or state being Z_NULL). |