From: Mark Adler Date: Mon, 21 Aug 2023 20:45:31 +0000 (-0700) Subject: Document in zlib.h the initialization of stream fields by the Init X-Git-Tag: 2.1.4~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10f51f6096429f20c189b7e8b603fd32478a0a71;p=thirdparty%2Fzlib-ng.git Document in zlib.h the initialization of stream fields by the Init and Reset functions. --- diff --git a/zlib-ng.h.in b/zlib-ng.h.in index 5d8f0a90a..de2d4fade 100644 --- a/zlib-ng.h.in +++ b/zlib-ng.h.in @@ -228,8 +228,8 @@ int32_t zng_deflateInit(zng_stream *strm, int32_t level); /* Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. If - zalloc and zfree are set to NULL, deflateInit updates them to use default - allocation functions. + zalloc and zfree are set to Z_NULL, deflateInit updates them to use default + allocation functions. total_in, total_out, adler, and msg are initialized. The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all @@ -381,8 +381,9 @@ int32_t zng_inflateInit(zng_stream *strm); the caller. In the current version of inflate, the provided input is not read or consumed. The allocation of a sliding window will be deferred to the first call of inflate (if the decompression does not complete on the - first call). If zalloc and zfree are set to NULL, inflateInit updates - them to use default allocation functions. + first call). If zalloc and zfree are set to Z_NULL, inflateInit updates + them to use default allocation functions. total_in, total_out, adler, and + msg are initialized. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, or Z_STREAM_ERROR if the parameters are invalid, such as a null @@ -688,7 +689,7 @@ int32_t zng_deflateReset(zng_stream *strm); This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate the internal compression state. The stream will leave the compression level and any other attributes that may have been - set unchanged. + set unchanged. total_in, total_out, adler, and msg are initialized. deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being NULL). @@ -945,6 +946,7 @@ int32_t zng_inflateReset(zng_stream *strm); This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. + total_in, total_out, adler, and msg are initialized. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being NULL). diff --git a/zlib.h.in b/zlib.h.in index ad58e2110..69b7d424e 100644 --- a/zlib.h.in +++ b/zlib.h.in @@ -239,8 +239,8 @@ Z_EXTERN int Z_EXPORT deflateInit (z_stream *strm, int level); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. If - zalloc and zfree are set to NULL, deflateInit updates them to use default - allocation functions. + zalloc and zfree are set to Z_NULL, deflateInit updates them to use default + allocation functions. total_in, total_out, adler, and msg are initialized. The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all @@ -392,8 +392,9 @@ Z_EXTERN int Z_EXPORT inflateInit (z_stream *strm); the caller. In the current version of inflate, the provided input is not read or consumed. The allocation of a sliding window will be deferred to the first call of inflate (if the decompression does not complete on the - first call). If zalloc and zfree are set to NULL, inflateInit updates - them to use default allocation functions. + first call). If zalloc and zfree are set to Z_NULL, inflateInit updates + them to use default allocation functions. total_in, total_out, adler, and + msg are initialized. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the @@ -703,7 +704,7 @@ Z_EXTERN int Z_EXPORT deflateReset(z_stream *strm); This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate the internal compression state. The stream will leave the compression level and any other attributes that may have been - set unchanged. + set unchanged. total_in, total_out, adler, and msg are initialized. deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being NULL). @@ -951,6 +952,7 @@ Z_EXTERN int Z_EXPORT inflateReset(z_stream *strm); This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. + total_in, total_out, adler, and msg are initialized. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being NULL).