]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Document in zlib.h the initialization of stream fields by the Init
authorMark Adler <madler@alumni.caltech.edu>
Mon, 21 Aug 2023 20:45:31 +0000 (13:45 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 24 Aug 2023 09:22:33 +0000 (11:22 +0200)
and Reset functions.

zlib-ng.h.in
zlib.h.in

index 5d8f0a90a6023cf545816917cb14030d58465466..de2d4fade1724c4107723bbec1f9a3b2cb08ecae 100644 (file)
@@ -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).
index ad58e21102b3c845965a2c862e08577cc614501b..69b7d424e31fabb5d46ad22270ef1032fec63d73 100644 (file)
--- 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).