V3.6 update libz (#263)
* update win zlib to 1.2.12 * update linux zlib to 1.2.12 * update android zlib to 1.2.12
This commit is contained in:
parent
4bf6c8924b
commit
fb1ee5c0e5
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
#ifndef ZCONF_H
|
#ifndef ZCONF_H
|
||||||
#define ZCONF_H
|
#define ZCONF_H
|
||||||
|
/* #undef Z_PREFIX */
|
||||||
|
#define Z_HAVE_UNISTD_H
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If you *really* need a unique prefix for all types and library functions,
|
* If you *really* need a unique prefix for all types and library functions,
|
||||||
|
|
@ -431,11 +433,11 @@ typedef uLong FAR uLongf;
|
||||||
typedef unsigned long z_crc_t;
|
typedef unsigned long z_crc_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1 /* was set to #if 1 by ./configure */
|
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
|
||||||
# define Z_HAVE_UNISTD_H
|
# define Z_HAVE_UNISTD_H
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1 /* was set to #if 1 by ./configure */
|
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
|
||||||
# define Z_HAVE_STDARG_H
|
# define Z_HAVE_STDARG_H
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
||||||
version 1.2.11, January 15th, 2017
|
version 1.2.12, March 11th, 2022
|
||||||
|
|
||||||
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
|
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|
@ -37,11 +37,11 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ZLIB_VERSION "1.2.11"
|
#define ZLIB_VERSION "1.2.12"
|
||||||
#define ZLIB_VERNUM 0x12b0
|
#define ZLIB_VERNUM 0x12c0
|
||||||
#define ZLIB_VER_MAJOR 1
|
#define ZLIB_VER_MAJOR 1
|
||||||
#define ZLIB_VER_MINOR 2
|
#define ZLIB_VER_MINOR 2
|
||||||
#define ZLIB_VER_REVISION 11
|
#define ZLIB_VER_REVISION 12
|
||||||
#define ZLIB_VER_SUBREVISION 0
|
#define ZLIB_VER_SUBREVISION 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -543,8 +543,7 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
|
||||||
int strategy));
|
int strategy));
|
||||||
|
|
||||||
This is another version of deflateInit with more compression options. The
|
This is another version of deflateInit with more compression options. The
|
||||||
fields next_in, zalloc, zfree and opaque must be initialized before by the
|
fields zalloc, zfree and opaque must be initialized before by the caller.
|
||||||
caller.
|
|
||||||
|
|
||||||
The method parameter is the compression method. It must be Z_DEFLATED in
|
The method parameter is the compression method. It must be Z_DEFLATED in
|
||||||
this version of the library.
|
this version of the library.
|
||||||
|
|
@ -712,11 +711,12 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
|
||||||
used to switch between compression and straight copy of the input data, or
|
used to switch between compression and straight copy of the input data, or
|
||||||
to switch to a different kind of input data requiring a different strategy.
|
to switch to a different kind of input data requiring a different strategy.
|
||||||
If the compression approach (which is a function of the level) or the
|
If the compression approach (which is a function of the level) or the
|
||||||
strategy is changed, and if any input has been consumed in a previous
|
strategy is changed, and if there have been any deflate() calls since the
|
||||||
deflate() call, then the input available so far is compressed with the old
|
state was initialized or reset, then the input available so far is
|
||||||
level and strategy using deflate(strm, Z_BLOCK). There are three approaches
|
compressed with the old level and strategy using deflate(strm, Z_BLOCK).
|
||||||
for the compression levels 0, 1..3, and 4..9 respectively. The new level
|
There are three approaches for the compression levels 0, 1..3, and 4..9
|
||||||
and strategy will take effect at the next call of deflate().
|
respectively. The new level and strategy will take effect at the next call
|
||||||
|
of deflate().
|
||||||
|
|
||||||
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
|
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
|
||||||
not have enough output space to complete, then the parameter change will not
|
not have enough output space to complete, then the parameter change will not
|
||||||
|
|
@ -865,9 +865,11 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
|
||||||
detection, or add 16 to decode only the gzip format (the zlib format will
|
detection, or add 16 to decode only the gzip format (the zlib format will
|
||||||
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
|
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
|
||||||
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
|
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
|
||||||
below), inflate() will not automatically decode concatenated gzip streams.
|
below), inflate() will *not* automatically decode concatenated gzip members.
|
||||||
inflate() will return Z_STREAM_END at the end of the gzip stream. The state
|
inflate() will return Z_STREAM_END at the end of the gzip member. The state
|
||||||
would need to be reset to continue decoding a subsequent gzip stream.
|
would need to be reset to continue decoding a subsequent gzip member. This
|
||||||
|
*must* be done if there is more data after a gzip member, in order for the
|
||||||
|
decompression to be compliant with the gzip standard (RFC 1952).
|
||||||
|
|
||||||
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
inflateInit2 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
|
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
|
||||||
|
|
@ -1302,14 +1304,14 @@ typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
|
||||||
/*
|
/*
|
||||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
||||||
|
|
||||||
Opens a gzip (.gz) file for reading or writing. The mode parameter is as
|
Open the gzip (.gz) file at path for reading and decompressing, or
|
||||||
in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
|
compressing and writing. The mode parameter is as in fopen ("rb" or "wb")
|
||||||
a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
|
but can also include a compression level ("wb9") or a strategy: 'f' for
|
||||||
compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
|
filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h",
|
||||||
for fixed code compression as in "wb9F". (See the description of
|
'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression
|
||||||
deflateInit2 for more information about the strategy parameter.) 'T' will
|
as in "wb9F". (See the description of deflateInit2 for more information
|
||||||
request transparent writing or appending with no compression and not using
|
about the strategy parameter.) 'T' will request transparent writing or
|
||||||
the gzip format.
|
appending with no compression and not using the gzip format.
|
||||||
|
|
||||||
"a" can be used instead of "w" to request that the gzip stream that will
|
"a" can be used instead of "w" to request that the gzip stream that will
|
||||||
be written be appended to the file. "+" will result in an error, since
|
be written be appended to the file. "+" will result in an error, since
|
||||||
|
|
@ -1339,9 +1341,9 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
||||||
|
|
||||||
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
||||||
/*
|
/*
|
||||||
gzdopen associates a gzFile with the file descriptor fd. File descriptors
|
Associate a gzFile with the file descriptor fd. File descriptors are
|
||||||
are obtained from calls like open, dup, creat, pipe or fileno (if the file
|
obtained from calls like open, dup, creat, pipe or fileno (if the file has
|
||||||
has been previously opened with fopen). The mode parameter is as in gzopen.
|
been previously opened with fopen). The mode parameter is as in gzopen.
|
||||||
|
|
||||||
The next call of gzclose on the returned gzFile will also close the file
|
The next call of gzclose on the returned gzFile will also close the file
|
||||||
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
|
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
|
||||||
|
|
@ -1362,13 +1364,13 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
||||||
/*
|
/*
|
||||||
Set the internal buffer size used by this library's functions. The
|
Set the internal buffer size used by this library's functions for file to
|
||||||
default buffer size is 8192 bytes. This function must be called after
|
size. The default buffer size is 8192 bytes. This function must be called
|
||||||
gzopen() or gzdopen(), and before any other calls that read or write the
|
after gzopen() or gzdopen(), and before any other calls that read or write
|
||||||
file. The buffer memory allocation is always deferred to the first read or
|
the file. The buffer memory allocation is always deferred to the first read
|
||||||
write. Three times that size in buffer space is allocated. A larger buffer
|
or write. Three times that size in buffer space is allocated. A larger
|
||||||
size of, for example, 64K or 128K bytes will noticeably increase the speed
|
buffer size of, for example, 64K or 128K bytes will noticeably increase the
|
||||||
of decompression (reading).
|
speed of decompression (reading).
|
||||||
|
|
||||||
The new buffer size also affects the maximum length for gzprintf().
|
The new buffer size also affects the maximum length for gzprintf().
|
||||||
|
|
||||||
|
|
@ -1378,9 +1380,9 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
||||||
/*
|
/*
|
||||||
Dynamically update the compression level or strategy. See the description
|
Dynamically update the compression level and strategy for file. See the
|
||||||
of deflateInit2 for the meaning of these parameters. Previously provided
|
description of deflateInit2 for the meaning of these parameters. Previously
|
||||||
data is flushed before the parameter change.
|
provided data is flushed before applying the parameter changes.
|
||||||
|
|
||||||
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
|
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
|
||||||
opened for writing, Z_ERRNO if there is an error writing the flushed data,
|
opened for writing, Z_ERRNO if there is an error writing the flushed data,
|
||||||
|
|
@ -1389,7 +1391,7 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
||||||
/*
|
/*
|
||||||
Reads the given number of uncompressed bytes from the compressed file. If
|
Read and decompress up to len uncompressed bytes from file into buf. If
|
||||||
the input file is not in gzip format, gzread copies the given number of
|
the input file is not in gzip format, gzread copies the given number of
|
||||||
bytes into the buffer directly from the file.
|
bytes into the buffer directly from the file.
|
||||||
|
|
||||||
|
|
@ -1420,11 +1422,11 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
||||||
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
||||||
gzFile file));
|
gzFile file));
|
||||||
/*
|
/*
|
||||||
Read up to nitems items of size size from file to buf, otherwise operating
|
Read and decompress up to nitems items of size size from file into buf,
|
||||||
as gzread() does. This duplicates the interface of stdio's fread(), with
|
otherwise operating as gzread() does. This duplicates the interface of
|
||||||
size_t request and return types. If the library defines size_t, then
|
stdio's fread(), with size_t request and return types. If the library
|
||||||
z_size_t is identical to size_t. If not, then z_size_t is an unsigned
|
defines size_t, then z_size_t is identical to size_t. If not, then z_size_t
|
||||||
integer type that can contain a pointer.
|
is an unsigned integer type that can contain a pointer.
|
||||||
|
|
||||||
gzfread() returns the number of full items read of size size, or zero if
|
gzfread() returns the number of full items read of size size, or zero if
|
||||||
the end of the file was reached and a full item could not be read, or if
|
the end of the file was reached and a full item could not be read, or if
|
||||||
|
|
@ -1443,18 +1445,16 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
||||||
file, reseting and retrying on end-of-file, when size is not 1.
|
file, reseting and retrying on end-of-file, when size is not 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
|
ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len));
|
||||||
voidpc buf, unsigned len));
|
|
||||||
/*
|
/*
|
||||||
Writes the given number of uncompressed bytes into the compressed file.
|
Compress and write the len uncompressed bytes at buf to file. gzwrite
|
||||||
gzwrite returns the number of uncompressed bytes written or 0 in case of
|
returns the number of uncompressed bytes written or 0 in case of error.
|
||||||
error.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
||||||
z_size_t nitems, gzFile file));
|
z_size_t nitems, gzFile file));
|
||||||
/*
|
/*
|
||||||
gzfwrite() writes nitems items of size size from buf to file, duplicating
|
Compress and write nitems items of size size from buf to file, duplicating
|
||||||
the interface of stdio's fwrite(), with size_t request and return types. If
|
the interface of stdio's fwrite(), with size_t request and return types. If
|
||||||
the library defines size_t, then z_size_t is identical to size_t. If not,
|
the library defines size_t, then z_size_t is identical to size_t. If not,
|
||||||
then z_size_t is an unsigned integer type that can contain a pointer.
|
then z_size_t is an unsigned integer type that can contain a pointer.
|
||||||
|
|
@ -1467,22 +1467,22 @@ ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
||||||
|
|
||||||
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
|
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
|
||||||
/*
|
/*
|
||||||
Converts, formats, and writes the arguments to the compressed file under
|
Convert, format, compress, and write the arguments (...) to file under
|
||||||
control of the format string, as in fprintf. gzprintf returns the number of
|
control of the string format, as in fprintf. gzprintf returns the number of
|
||||||
uncompressed bytes actually written, or a negative zlib error code in case
|
uncompressed bytes actually written, or a negative zlib error code in case
|
||||||
of error. The number of uncompressed bytes written is limited to 8191, or
|
of error. The number of uncompressed bytes written is limited to 8191, or
|
||||||
one less than the buffer size given to gzbuffer(). The caller should assure
|
one less than the buffer size given to gzbuffer(). The caller should assure
|
||||||
that this limit is not exceeded. If it is exceeded, then gzprintf() will
|
that this limit is not exceeded. If it is exceeded, then gzprintf() will
|
||||||
return an error (0) with nothing written. In this case, there may also be a
|
return an error (0) with nothing written. In this case, there may also be a
|
||||||
buffer overflow with unpredictable consequences, which is possible only if
|
buffer overflow with unpredictable consequences, which is possible only if
|
||||||
zlib was compiled with the insecure functions sprintf() or vsprintf()
|
zlib was compiled with the insecure functions sprintf() or vsprintf(),
|
||||||
because the secure snprintf() or vsnprintf() functions were not available.
|
because the secure snprintf() or vsnprintf() functions were not available.
|
||||||
This can be determined using zlibCompileFlags().
|
This can be determined using zlibCompileFlags().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
||||||
/*
|
/*
|
||||||
Writes the given null-terminated string to the compressed file, excluding
|
Compress and write the given null-terminated string s to file, excluding
|
||||||
the terminating null character.
|
the terminating null character.
|
||||||
|
|
||||||
gzputs returns the number of characters written, or -1 in case of error.
|
gzputs returns the number of characters written, or -1 in case of error.
|
||||||
|
|
@ -1490,11 +1490,12 @@ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
||||||
|
|
||||||
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
||||||
/*
|
/*
|
||||||
Reads bytes from the compressed file until len-1 characters are read, or a
|
Read and decompress bytes from file into buf, until len-1 characters are
|
||||||
newline character is read and transferred to buf, or an end-of-file
|
read, or until a newline character is read and transferred to buf, or an
|
||||||
condition is encountered. If any characters are read or if len == 1, the
|
end-of-file condition is encountered. If any characters are read or if len
|
||||||
string is terminated with a null character. If no characters are read due
|
is one, the string is terminated with a null character. If no characters
|
||||||
to an end-of-file or len < 1, then the buffer is left untouched.
|
are read due to an end-of-file or len is less than one, then the buffer is
|
||||||
|
left untouched.
|
||||||
|
|
||||||
gzgets returns buf which is a null-terminated string, or it returns NULL
|
gzgets returns buf which is a null-terminated string, or it returns NULL
|
||||||
for end-of-file or in case of error. If there was an error, the contents at
|
for end-of-file or in case of error. If there was an error, the contents at
|
||||||
|
|
@ -1503,13 +1504,13 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
||||||
/*
|
/*
|
||||||
Writes c, converted to an unsigned char, into the compressed file. gzputc
|
Compress and write c, converted to an unsigned char, into file. gzputc
|
||||||
returns the value that was written, or -1 in case of error.
|
returns the value that was written, or -1 in case of error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Reads one byte from the compressed file. gzgetc returns this byte or -1
|
Read and decompress one byte from file. gzgetc returns this byte or -1
|
||||||
in case of end of file or error. This is implemented as a macro for speed.
|
in case of end of file or error. This is implemented as a macro for speed.
|
||||||
As such, it does not do all of the checking the other functions do. I.e.
|
As such, it does not do all of the checking the other functions do. I.e.
|
||||||
it does not check to see if file is NULL, nor whether the structure file
|
it does not check to see if file is NULL, nor whether the structure file
|
||||||
|
|
@ -1518,8 +1519,8 @@ ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
||||||
/*
|
/*
|
||||||
Push one character back onto the stream to be read as the first character
|
Push c back onto the stream for file to be read as the first character on
|
||||||
on the next read. At least one character of push-back is allowed.
|
the next read. At least one character of push-back is always allowed.
|
||||||
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
|
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
|
||||||
fail if c is -1, and may fail if a character has been pushed but not read
|
fail if c is -1, and may fail if a character has been pushed but not read
|
||||||
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
|
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
|
||||||
|
|
@ -1530,9 +1531,9 @@ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
||||||
/*
|
/*
|
||||||
Flushes all pending output into the compressed file. The parameter flush
|
Flush all pending output to file. The parameter flush is as in the
|
||||||
is as in the deflate() function. The return value is the zlib error number
|
deflate() function. The return value is the zlib error number (see function
|
||||||
(see function gzerror below). gzflush is only permitted when writing.
|
gzerror below). gzflush is only permitted when writing.
|
||||||
|
|
||||||
If the flush parameter is Z_FINISH, the remaining data is written and the
|
If the flush parameter is Z_FINISH, the remaining data is written and the
|
||||||
gzip stream is completed in the output. If gzwrite() is called again, a new
|
gzip stream is completed in the output. If gzwrite() is called again, a new
|
||||||
|
|
@ -1547,8 +1548,8 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
||||||
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
||||||
z_off_t offset, int whence));
|
z_off_t offset, int whence));
|
||||||
|
|
||||||
Sets the starting position for the next gzread or gzwrite on the given
|
Set the starting position to offset relative to whence for the next gzread
|
||||||
compressed file. The offset represents a number of bytes in the
|
or gzwrite on file. The offset represents a number of bytes in the
|
||||||
uncompressed data stream. The whence parameter is defined as in lseek(2);
|
uncompressed data stream. The whence parameter is defined as in lseek(2);
|
||||||
the value SEEK_END is not supported.
|
the value SEEK_END is not supported.
|
||||||
|
|
||||||
|
|
@ -1565,18 +1566,18 @@ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
|
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Rewinds the given file. This function is supported only for reading.
|
Rewind file. This function is supported only for reading.
|
||||||
|
|
||||||
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
|
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
||||||
|
|
||||||
Returns the starting position for the next gzread or gzwrite on the given
|
Return the starting position for the next gzread or gzwrite on file.
|
||||||
compressed file. This position represents a number of bytes in the
|
This position represents a number of bytes in the uncompressed data stream,
|
||||||
uncompressed data stream, and is zero when starting, even if appending or
|
and is zero when starting, even if appending or reading a gzip stream from
|
||||||
reading a gzip stream from the middle of a file using gzdopen().
|
the middle of a file using gzdopen().
|
||||||
|
|
||||||
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
|
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
|
||||||
*/
|
*/
|
||||||
|
|
@ -1584,22 +1585,22 @@ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
||||||
|
|
||||||
Returns the current offset in the file being read or written. This offset
|
Return the current compressed (actual) read or write offset of file. This
|
||||||
includes the count of bytes that precede the gzip stream, for example when
|
offset includes the count of bytes that precede the gzip stream, for example
|
||||||
appending or when using gzdopen() for reading. When reading, the offset
|
when appending or when using gzdopen() for reading. When reading, the
|
||||||
does not include as yet unused buffered input. This information can be used
|
offset does not include as yet unused buffered input. This information can
|
||||||
for a progress indicator. On error, gzoffset() returns -1.
|
be used for a progress indicator. On error, gzoffset() returns -1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Returns true (1) if the end-of-file indicator has been set while reading,
|
Return true (1) if the end-of-file indicator for file has been set while
|
||||||
false (0) otherwise. Note that the end-of-file indicator is set only if the
|
reading, false (0) otherwise. Note that the end-of-file indicator is set
|
||||||
read tried to go past the end of the input, but came up short. Therefore,
|
only if the read tried to go past the end of the input, but came up short.
|
||||||
just like feof(), gzeof() may return false even if there is no more data to
|
Therefore, just like feof(), gzeof() may return false even if there is no
|
||||||
read, in the event that the last read request was for the exact number of
|
more data to read, in the event that the last read request was for the exact
|
||||||
bytes remaining in the input file. This will happen if the input file size
|
number of bytes remaining in the input file. This will happen if the input
|
||||||
is an exact multiple of the buffer size.
|
file size is an exact multiple of the buffer size.
|
||||||
|
|
||||||
If gzeof() returns true, then the read functions will return no more data,
|
If gzeof() returns true, then the read functions will return no more data,
|
||||||
unless the end-of-file indicator is reset by gzclearerr() and the input file
|
unless the end-of-file indicator is reset by gzclearerr() and the input file
|
||||||
|
|
@ -1608,7 +1609,7 @@ ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Returns true (1) if file is being copied directly while reading, or false
|
Return true (1) if file is being copied directly while reading, or false
|
||||||
(0) if file is a gzip stream being decompressed.
|
(0) if file is a gzip stream being decompressed.
|
||||||
|
|
||||||
If the input file is empty, gzdirect() will return true, since the input
|
If the input file is empty, gzdirect() will return true, since the input
|
||||||
|
|
@ -1629,8 +1630,8 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Flushes all pending output if necessary, closes the compressed file and
|
Flush all pending output for file, if necessary, close file and
|
||||||
deallocates the (de)compression state. Note that once file is closed, you
|
deallocate the (de)compression state. Note that once file is closed, you
|
||||||
cannot call gzerror with file, since its structures have been deallocated.
|
cannot call gzerror with file, since its structures have been deallocated.
|
||||||
gzclose must not be called more than once on the same file, just as free
|
gzclose must not be called more than once on the same file, just as free
|
||||||
must not be called more than once on the same allocation.
|
must not be called more than once on the same allocation.
|
||||||
|
|
@ -1654,10 +1655,10 @@ ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
||||||
/*
|
/*
|
||||||
Returns the error message for the last error which occurred on the given
|
Return the error message for the last error which occurred on file.
|
||||||
compressed file. errnum is set to zlib error number. If an error occurred
|
errnum is set to zlib error number. If an error occurred in the file system
|
||||||
in the file system and not in the compression library, errnum is set to
|
and not in the compression library, errnum is set to Z_ERRNO and the
|
||||||
Z_ERRNO and the application may consult errno to get the exact error code.
|
application may consult errno to get the exact error code.
|
||||||
|
|
||||||
The application must not modify the returned string. Future calls to
|
The application must not modify the returned string. Future calls to
|
||||||
this function may invalidate the previously returned string. If file is
|
this function may invalidate the previously returned string. If file is
|
||||||
|
|
@ -1670,7 +1671,7 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
||||||
|
|
||||||
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Clears the error and end-of-file flags for file. This is analogous to the
|
Clear the error and end-of-file flags for file. This is analogous to the
|
||||||
clearerr() function in stdio. This is useful for continuing to read a gzip
|
clearerr() function in stdio. This is useful for continuing to read a gzip
|
||||||
file that is being written concurrently.
|
file that is being written concurrently.
|
||||||
*/
|
*/
|
||||||
|
|
@ -1688,8 +1689,9 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
||||||
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
|
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
|
||||||
/*
|
/*
|
||||||
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
||||||
return the updated checksum. If buf is Z_NULL, this function returns the
|
return the updated checksum. An Adler-32 value is in the range of a 32-bit
|
||||||
required initial value for the checksum.
|
unsigned integer. If buf is Z_NULL, this function returns the required
|
||||||
|
initial value for the checksum.
|
||||||
|
|
||||||
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
|
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
|
||||||
much faster.
|
much faster.
|
||||||
|
|
@ -1725,9 +1727,10 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
|
||||||
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||||
/*
|
/*
|
||||||
Update a running CRC-32 with the bytes buf[0..len-1] and return the
|
Update a running CRC-32 with the bytes buf[0..len-1] and return the
|
||||||
updated CRC-32. If buf is Z_NULL, this function returns the required
|
updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer.
|
||||||
initial value for the crc. Pre- and post-conditioning (one's complement) is
|
If buf is Z_NULL, this function returns the required initial value for the
|
||||||
performed within this function so it shouldn't be done by the application.
|
crc. Pre- and post-conditioning (one's complement) is performed within this
|
||||||
|
function so it shouldn't be done by the application.
|
||||||
|
|
||||||
Usage example:
|
Usage example:
|
||||||
|
|
||||||
|
|
@ -1739,7 +1742,7 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||||
if (crc != original_crc) error();
|
if (crc != original_crc) error();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf,
|
ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
|
||||||
z_size_t len));
|
z_size_t len));
|
||||||
/*
|
/*
|
||||||
Same as crc32(), but with a size_t length.
|
Same as crc32(), but with a size_t length.
|
||||||
|
|
@ -1755,6 +1758,20 @@ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
|
||||||
len2.
|
len2.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2));
|
||||||
|
|
||||||
|
Return the operator corresponding to length len2, to be used with
|
||||||
|
crc32_combine_op().
|
||||||
|
*/
|
||||||
|
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op));
|
||||||
|
/*
|
||||||
|
Give the same result as crc32_combine(), using op in place of len2. op is
|
||||||
|
is generated from len2 by crc32_combine_gen(). This will be faster than
|
||||||
|
crc32_combine() if the generated op is used more than once.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* various hacks, don't look :) */
|
/* various hacks, don't look :) */
|
||||||
|
|
||||||
|
|
@ -1842,6 +1859,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
|
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
|
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
|
||||||
|
|
@ -1852,6 +1870,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
# define z_gzoffset z_gzoffset64
|
# define z_gzoffset z_gzoffset64
|
||||||
# define z_adler32_combine z_adler32_combine64
|
# define z_adler32_combine z_adler32_combine64
|
||||||
# define z_crc32_combine z_crc32_combine64
|
# define z_crc32_combine z_crc32_combine64
|
||||||
|
# define z_crc32_combine_gen z_crc32_combine_gen64
|
||||||
# else
|
# else
|
||||||
# define gzopen gzopen64
|
# define gzopen gzopen64
|
||||||
# define gzseek gzseek64
|
# define gzseek gzseek64
|
||||||
|
|
@ -1859,6 +1878,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
# define gzoffset gzoffset64
|
# define gzoffset gzoffset64
|
||||||
# define adler32_combine adler32_combine64
|
# define adler32_combine adler32_combine64
|
||||||
# define crc32_combine crc32_combine64
|
# define crc32_combine crc32_combine64
|
||||||
|
# define crc32_combine_gen crc32_combine_gen64
|
||||||
# endif
|
# endif
|
||||||
# ifndef Z_LARGE64
|
# ifndef Z_LARGE64
|
||||||
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
||||||
|
|
@ -1867,6 +1887,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
|
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
|
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
|
||||||
|
|
@ -1875,12 +1896,14 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
|
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* Z_SOLO */
|
#else /* Z_SOLO */
|
||||||
|
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||||
|
|
||||||
#endif /* !Z_SOLO */
|
#endif /* !Z_SOLO */
|
||||||
|
|
||||||
|
|
@ -1893,7 +1916,7 @@ ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int));
|
||||||
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
|
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
|
||||||
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
||||||
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
||||||
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO)
|
#if defined(_WIN32) && !defined(Z_SOLO)
|
||||||
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
||||||
const char *mode));
|
const char *mode));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
#ifndef ZCONF_H
|
#ifndef ZCONF_H
|
||||||
#define ZCONF_H
|
#define ZCONF_H
|
||||||
|
/* #undef Z_PREFIX */
|
||||||
|
#define Z_HAVE_UNISTD_H
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If you *really* need a unique prefix for all types and library functions,
|
* If you *really* need a unique prefix for all types and library functions,
|
||||||
|
|
@ -431,11 +433,11 @@ typedef uLong FAR uLongf;
|
||||||
typedef unsigned long z_crc_t;
|
typedef unsigned long z_crc_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1 /* was set to #if 1 by ./configure */
|
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
|
||||||
# define Z_HAVE_UNISTD_H
|
# define Z_HAVE_UNISTD_H
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1 /* was set to #if 1 by ./configure */
|
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
|
||||||
# define Z_HAVE_STDARG_H
|
# define Z_HAVE_STDARG_H
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
||||||
version 1.2.11, January 15th, 2017
|
version 1.2.12, March 11th, 2022
|
||||||
|
|
||||||
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
|
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|
@ -37,11 +37,11 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ZLIB_VERSION "1.2.11"
|
#define ZLIB_VERSION "1.2.12"
|
||||||
#define ZLIB_VERNUM 0x12b0
|
#define ZLIB_VERNUM 0x12c0
|
||||||
#define ZLIB_VER_MAJOR 1
|
#define ZLIB_VER_MAJOR 1
|
||||||
#define ZLIB_VER_MINOR 2
|
#define ZLIB_VER_MINOR 2
|
||||||
#define ZLIB_VER_REVISION 11
|
#define ZLIB_VER_REVISION 12
|
||||||
#define ZLIB_VER_SUBREVISION 0
|
#define ZLIB_VER_SUBREVISION 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -543,8 +543,7 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
|
||||||
int strategy));
|
int strategy));
|
||||||
|
|
||||||
This is another version of deflateInit with more compression options. The
|
This is another version of deflateInit with more compression options. The
|
||||||
fields next_in, zalloc, zfree and opaque must be initialized before by the
|
fields zalloc, zfree and opaque must be initialized before by the caller.
|
||||||
caller.
|
|
||||||
|
|
||||||
The method parameter is the compression method. It must be Z_DEFLATED in
|
The method parameter is the compression method. It must be Z_DEFLATED in
|
||||||
this version of the library.
|
this version of the library.
|
||||||
|
|
@ -712,11 +711,12 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
|
||||||
used to switch between compression and straight copy of the input data, or
|
used to switch between compression and straight copy of the input data, or
|
||||||
to switch to a different kind of input data requiring a different strategy.
|
to switch to a different kind of input data requiring a different strategy.
|
||||||
If the compression approach (which is a function of the level) or the
|
If the compression approach (which is a function of the level) or the
|
||||||
strategy is changed, and if any input has been consumed in a previous
|
strategy is changed, and if there have been any deflate() calls since the
|
||||||
deflate() call, then the input available so far is compressed with the old
|
state was initialized or reset, then the input available so far is
|
||||||
level and strategy using deflate(strm, Z_BLOCK). There are three approaches
|
compressed with the old level and strategy using deflate(strm, Z_BLOCK).
|
||||||
for the compression levels 0, 1..3, and 4..9 respectively. The new level
|
There are three approaches for the compression levels 0, 1..3, and 4..9
|
||||||
and strategy will take effect at the next call of deflate().
|
respectively. The new level and strategy will take effect at the next call
|
||||||
|
of deflate().
|
||||||
|
|
||||||
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
|
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
|
||||||
not have enough output space to complete, then the parameter change will not
|
not have enough output space to complete, then the parameter change will not
|
||||||
|
|
@ -865,9 +865,11 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
|
||||||
detection, or add 16 to decode only the gzip format (the zlib format will
|
detection, or add 16 to decode only the gzip format (the zlib format will
|
||||||
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
|
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
|
||||||
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
|
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
|
||||||
below), inflate() will not automatically decode concatenated gzip streams.
|
below), inflate() will *not* automatically decode concatenated gzip members.
|
||||||
inflate() will return Z_STREAM_END at the end of the gzip stream. The state
|
inflate() will return Z_STREAM_END at the end of the gzip member. The state
|
||||||
would need to be reset to continue decoding a subsequent gzip stream.
|
would need to be reset to continue decoding a subsequent gzip member. This
|
||||||
|
*must* be done if there is more data after a gzip member, in order for the
|
||||||
|
decompression to be compliant with the gzip standard (RFC 1952).
|
||||||
|
|
||||||
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
inflateInit2 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
|
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
|
||||||
|
|
@ -1302,14 +1304,14 @@ typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
|
||||||
/*
|
/*
|
||||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
||||||
|
|
||||||
Opens a gzip (.gz) file for reading or writing. The mode parameter is as
|
Open the gzip (.gz) file at path for reading and decompressing, or
|
||||||
in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
|
compressing and writing. The mode parameter is as in fopen ("rb" or "wb")
|
||||||
a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
|
but can also include a compression level ("wb9") or a strategy: 'f' for
|
||||||
compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
|
filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h",
|
||||||
for fixed code compression as in "wb9F". (See the description of
|
'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression
|
||||||
deflateInit2 for more information about the strategy parameter.) 'T' will
|
as in "wb9F". (See the description of deflateInit2 for more information
|
||||||
request transparent writing or appending with no compression and not using
|
about the strategy parameter.) 'T' will request transparent writing or
|
||||||
the gzip format.
|
appending with no compression and not using the gzip format.
|
||||||
|
|
||||||
"a" can be used instead of "w" to request that the gzip stream that will
|
"a" can be used instead of "w" to request that the gzip stream that will
|
||||||
be written be appended to the file. "+" will result in an error, since
|
be written be appended to the file. "+" will result in an error, since
|
||||||
|
|
@ -1339,9 +1341,9 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
||||||
|
|
||||||
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
||||||
/*
|
/*
|
||||||
gzdopen associates a gzFile with the file descriptor fd. File descriptors
|
Associate a gzFile with the file descriptor fd. File descriptors are
|
||||||
are obtained from calls like open, dup, creat, pipe or fileno (if the file
|
obtained from calls like open, dup, creat, pipe or fileno (if the file has
|
||||||
has been previously opened with fopen). The mode parameter is as in gzopen.
|
been previously opened with fopen). The mode parameter is as in gzopen.
|
||||||
|
|
||||||
The next call of gzclose on the returned gzFile will also close the file
|
The next call of gzclose on the returned gzFile will also close the file
|
||||||
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
|
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
|
||||||
|
|
@ -1362,13 +1364,13 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
||||||
/*
|
/*
|
||||||
Set the internal buffer size used by this library's functions. The
|
Set the internal buffer size used by this library's functions for file to
|
||||||
default buffer size is 8192 bytes. This function must be called after
|
size. The default buffer size is 8192 bytes. This function must be called
|
||||||
gzopen() or gzdopen(), and before any other calls that read or write the
|
after gzopen() or gzdopen(), and before any other calls that read or write
|
||||||
file. The buffer memory allocation is always deferred to the first read or
|
the file. The buffer memory allocation is always deferred to the first read
|
||||||
write. Three times that size in buffer space is allocated. A larger buffer
|
or write. Three times that size in buffer space is allocated. A larger
|
||||||
size of, for example, 64K or 128K bytes will noticeably increase the speed
|
buffer size of, for example, 64K or 128K bytes will noticeably increase the
|
||||||
of decompression (reading).
|
speed of decompression (reading).
|
||||||
|
|
||||||
The new buffer size also affects the maximum length for gzprintf().
|
The new buffer size also affects the maximum length for gzprintf().
|
||||||
|
|
||||||
|
|
@ -1378,9 +1380,9 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
||||||
/*
|
/*
|
||||||
Dynamically update the compression level or strategy. See the description
|
Dynamically update the compression level and strategy for file. See the
|
||||||
of deflateInit2 for the meaning of these parameters. Previously provided
|
description of deflateInit2 for the meaning of these parameters. Previously
|
||||||
data is flushed before the parameter change.
|
provided data is flushed before applying the parameter changes.
|
||||||
|
|
||||||
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
|
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
|
||||||
opened for writing, Z_ERRNO if there is an error writing the flushed data,
|
opened for writing, Z_ERRNO if there is an error writing the flushed data,
|
||||||
|
|
@ -1389,7 +1391,7 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
||||||
/*
|
/*
|
||||||
Reads the given number of uncompressed bytes from the compressed file. If
|
Read and decompress up to len uncompressed bytes from file into buf. If
|
||||||
the input file is not in gzip format, gzread copies the given number of
|
the input file is not in gzip format, gzread copies the given number of
|
||||||
bytes into the buffer directly from the file.
|
bytes into the buffer directly from the file.
|
||||||
|
|
||||||
|
|
@ -1420,11 +1422,11 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
||||||
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
||||||
gzFile file));
|
gzFile file));
|
||||||
/*
|
/*
|
||||||
Read up to nitems items of size size from file to buf, otherwise operating
|
Read and decompress up to nitems items of size size from file into buf,
|
||||||
as gzread() does. This duplicates the interface of stdio's fread(), with
|
otherwise operating as gzread() does. This duplicates the interface of
|
||||||
size_t request and return types. If the library defines size_t, then
|
stdio's fread(), with size_t request and return types. If the library
|
||||||
z_size_t is identical to size_t. If not, then z_size_t is an unsigned
|
defines size_t, then z_size_t is identical to size_t. If not, then z_size_t
|
||||||
integer type that can contain a pointer.
|
is an unsigned integer type that can contain a pointer.
|
||||||
|
|
||||||
gzfread() returns the number of full items read of size size, or zero if
|
gzfread() returns the number of full items read of size size, or zero if
|
||||||
the end of the file was reached and a full item could not be read, or if
|
the end of the file was reached and a full item could not be read, or if
|
||||||
|
|
@ -1443,18 +1445,16 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
||||||
file, reseting and retrying on end-of-file, when size is not 1.
|
file, reseting and retrying on end-of-file, when size is not 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
|
ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len));
|
||||||
voidpc buf, unsigned len));
|
|
||||||
/*
|
/*
|
||||||
Writes the given number of uncompressed bytes into the compressed file.
|
Compress and write the len uncompressed bytes at buf to file. gzwrite
|
||||||
gzwrite returns the number of uncompressed bytes written or 0 in case of
|
returns the number of uncompressed bytes written or 0 in case of error.
|
||||||
error.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
||||||
z_size_t nitems, gzFile file));
|
z_size_t nitems, gzFile file));
|
||||||
/*
|
/*
|
||||||
gzfwrite() writes nitems items of size size from buf to file, duplicating
|
Compress and write nitems items of size size from buf to file, duplicating
|
||||||
the interface of stdio's fwrite(), with size_t request and return types. If
|
the interface of stdio's fwrite(), with size_t request and return types. If
|
||||||
the library defines size_t, then z_size_t is identical to size_t. If not,
|
the library defines size_t, then z_size_t is identical to size_t. If not,
|
||||||
then z_size_t is an unsigned integer type that can contain a pointer.
|
then z_size_t is an unsigned integer type that can contain a pointer.
|
||||||
|
|
@ -1467,22 +1467,22 @@ ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
||||||
|
|
||||||
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
|
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
|
||||||
/*
|
/*
|
||||||
Converts, formats, and writes the arguments to the compressed file under
|
Convert, format, compress, and write the arguments (...) to file under
|
||||||
control of the format string, as in fprintf. gzprintf returns the number of
|
control of the string format, as in fprintf. gzprintf returns the number of
|
||||||
uncompressed bytes actually written, or a negative zlib error code in case
|
uncompressed bytes actually written, or a negative zlib error code in case
|
||||||
of error. The number of uncompressed bytes written is limited to 8191, or
|
of error. The number of uncompressed bytes written is limited to 8191, or
|
||||||
one less than the buffer size given to gzbuffer(). The caller should assure
|
one less than the buffer size given to gzbuffer(). The caller should assure
|
||||||
that this limit is not exceeded. If it is exceeded, then gzprintf() will
|
that this limit is not exceeded. If it is exceeded, then gzprintf() will
|
||||||
return an error (0) with nothing written. In this case, there may also be a
|
return an error (0) with nothing written. In this case, there may also be a
|
||||||
buffer overflow with unpredictable consequences, which is possible only if
|
buffer overflow with unpredictable consequences, which is possible only if
|
||||||
zlib was compiled with the insecure functions sprintf() or vsprintf()
|
zlib was compiled with the insecure functions sprintf() or vsprintf(),
|
||||||
because the secure snprintf() or vsnprintf() functions were not available.
|
because the secure snprintf() or vsnprintf() functions were not available.
|
||||||
This can be determined using zlibCompileFlags().
|
This can be determined using zlibCompileFlags().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
||||||
/*
|
/*
|
||||||
Writes the given null-terminated string to the compressed file, excluding
|
Compress and write the given null-terminated string s to file, excluding
|
||||||
the terminating null character.
|
the terminating null character.
|
||||||
|
|
||||||
gzputs returns the number of characters written, or -1 in case of error.
|
gzputs returns the number of characters written, or -1 in case of error.
|
||||||
|
|
@ -1490,11 +1490,12 @@ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
||||||
|
|
||||||
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
||||||
/*
|
/*
|
||||||
Reads bytes from the compressed file until len-1 characters are read, or a
|
Read and decompress bytes from file into buf, until len-1 characters are
|
||||||
newline character is read and transferred to buf, or an end-of-file
|
read, or until a newline character is read and transferred to buf, or an
|
||||||
condition is encountered. If any characters are read or if len == 1, the
|
end-of-file condition is encountered. If any characters are read or if len
|
||||||
string is terminated with a null character. If no characters are read due
|
is one, the string is terminated with a null character. If no characters
|
||||||
to an end-of-file or len < 1, then the buffer is left untouched.
|
are read due to an end-of-file or len is less than one, then the buffer is
|
||||||
|
left untouched.
|
||||||
|
|
||||||
gzgets returns buf which is a null-terminated string, or it returns NULL
|
gzgets returns buf which is a null-terminated string, or it returns NULL
|
||||||
for end-of-file or in case of error. If there was an error, the contents at
|
for end-of-file or in case of error. If there was an error, the contents at
|
||||||
|
|
@ -1503,13 +1504,13 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
||||||
/*
|
/*
|
||||||
Writes c, converted to an unsigned char, into the compressed file. gzputc
|
Compress and write c, converted to an unsigned char, into file. gzputc
|
||||||
returns the value that was written, or -1 in case of error.
|
returns the value that was written, or -1 in case of error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Reads one byte from the compressed file. gzgetc returns this byte or -1
|
Read and decompress one byte from file. gzgetc returns this byte or -1
|
||||||
in case of end of file or error. This is implemented as a macro for speed.
|
in case of end of file or error. This is implemented as a macro for speed.
|
||||||
As such, it does not do all of the checking the other functions do. I.e.
|
As such, it does not do all of the checking the other functions do. I.e.
|
||||||
it does not check to see if file is NULL, nor whether the structure file
|
it does not check to see if file is NULL, nor whether the structure file
|
||||||
|
|
@ -1518,8 +1519,8 @@ ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
||||||
/*
|
/*
|
||||||
Push one character back onto the stream to be read as the first character
|
Push c back onto the stream for file to be read as the first character on
|
||||||
on the next read. At least one character of push-back is allowed.
|
the next read. At least one character of push-back is always allowed.
|
||||||
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
|
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
|
||||||
fail if c is -1, and may fail if a character has been pushed but not read
|
fail if c is -1, and may fail if a character has been pushed but not read
|
||||||
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
|
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
|
||||||
|
|
@ -1530,9 +1531,9 @@ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
||||||
/*
|
/*
|
||||||
Flushes all pending output into the compressed file. The parameter flush
|
Flush all pending output to file. The parameter flush is as in the
|
||||||
is as in the deflate() function. The return value is the zlib error number
|
deflate() function. The return value is the zlib error number (see function
|
||||||
(see function gzerror below). gzflush is only permitted when writing.
|
gzerror below). gzflush is only permitted when writing.
|
||||||
|
|
||||||
If the flush parameter is Z_FINISH, the remaining data is written and the
|
If the flush parameter is Z_FINISH, the remaining data is written and the
|
||||||
gzip stream is completed in the output. If gzwrite() is called again, a new
|
gzip stream is completed in the output. If gzwrite() is called again, a new
|
||||||
|
|
@ -1547,8 +1548,8 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
||||||
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
||||||
z_off_t offset, int whence));
|
z_off_t offset, int whence));
|
||||||
|
|
||||||
Sets the starting position for the next gzread or gzwrite on the given
|
Set the starting position to offset relative to whence for the next gzread
|
||||||
compressed file. The offset represents a number of bytes in the
|
or gzwrite on file. The offset represents a number of bytes in the
|
||||||
uncompressed data stream. The whence parameter is defined as in lseek(2);
|
uncompressed data stream. The whence parameter is defined as in lseek(2);
|
||||||
the value SEEK_END is not supported.
|
the value SEEK_END is not supported.
|
||||||
|
|
||||||
|
|
@ -1565,18 +1566,18 @@ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
|
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Rewinds the given file. This function is supported only for reading.
|
Rewind file. This function is supported only for reading.
|
||||||
|
|
||||||
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
|
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
||||||
|
|
||||||
Returns the starting position for the next gzread or gzwrite on the given
|
Return the starting position for the next gzread or gzwrite on file.
|
||||||
compressed file. This position represents a number of bytes in the
|
This position represents a number of bytes in the uncompressed data stream,
|
||||||
uncompressed data stream, and is zero when starting, even if appending or
|
and is zero when starting, even if appending or reading a gzip stream from
|
||||||
reading a gzip stream from the middle of a file using gzdopen().
|
the middle of a file using gzdopen().
|
||||||
|
|
||||||
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
|
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
|
||||||
*/
|
*/
|
||||||
|
|
@ -1584,22 +1585,22 @@ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
||||||
|
|
||||||
Returns the current offset in the file being read or written. This offset
|
Return the current compressed (actual) read or write offset of file. This
|
||||||
includes the count of bytes that precede the gzip stream, for example when
|
offset includes the count of bytes that precede the gzip stream, for example
|
||||||
appending or when using gzdopen() for reading. When reading, the offset
|
when appending or when using gzdopen() for reading. When reading, the
|
||||||
does not include as yet unused buffered input. This information can be used
|
offset does not include as yet unused buffered input. This information can
|
||||||
for a progress indicator. On error, gzoffset() returns -1.
|
be used for a progress indicator. On error, gzoffset() returns -1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Returns true (1) if the end-of-file indicator has been set while reading,
|
Return true (1) if the end-of-file indicator for file has been set while
|
||||||
false (0) otherwise. Note that the end-of-file indicator is set only if the
|
reading, false (0) otherwise. Note that the end-of-file indicator is set
|
||||||
read tried to go past the end of the input, but came up short. Therefore,
|
only if the read tried to go past the end of the input, but came up short.
|
||||||
just like feof(), gzeof() may return false even if there is no more data to
|
Therefore, just like feof(), gzeof() may return false even if there is no
|
||||||
read, in the event that the last read request was for the exact number of
|
more data to read, in the event that the last read request was for the exact
|
||||||
bytes remaining in the input file. This will happen if the input file size
|
number of bytes remaining in the input file. This will happen if the input
|
||||||
is an exact multiple of the buffer size.
|
file size is an exact multiple of the buffer size.
|
||||||
|
|
||||||
If gzeof() returns true, then the read functions will return no more data,
|
If gzeof() returns true, then the read functions will return no more data,
|
||||||
unless the end-of-file indicator is reset by gzclearerr() and the input file
|
unless the end-of-file indicator is reset by gzclearerr() and the input file
|
||||||
|
|
@ -1608,7 +1609,7 @@ ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Returns true (1) if file is being copied directly while reading, or false
|
Return true (1) if file is being copied directly while reading, or false
|
||||||
(0) if file is a gzip stream being decompressed.
|
(0) if file is a gzip stream being decompressed.
|
||||||
|
|
||||||
If the input file is empty, gzdirect() will return true, since the input
|
If the input file is empty, gzdirect() will return true, since the input
|
||||||
|
|
@ -1629,8 +1630,8 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Flushes all pending output if necessary, closes the compressed file and
|
Flush all pending output for file, if necessary, close file and
|
||||||
deallocates the (de)compression state. Note that once file is closed, you
|
deallocate the (de)compression state. Note that once file is closed, you
|
||||||
cannot call gzerror with file, since its structures have been deallocated.
|
cannot call gzerror with file, since its structures have been deallocated.
|
||||||
gzclose must not be called more than once on the same file, just as free
|
gzclose must not be called more than once on the same file, just as free
|
||||||
must not be called more than once on the same allocation.
|
must not be called more than once on the same allocation.
|
||||||
|
|
@ -1654,10 +1655,10 @@ ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
||||||
/*
|
/*
|
||||||
Returns the error message for the last error which occurred on the given
|
Return the error message for the last error which occurred on file.
|
||||||
compressed file. errnum is set to zlib error number. If an error occurred
|
errnum is set to zlib error number. If an error occurred in the file system
|
||||||
in the file system and not in the compression library, errnum is set to
|
and not in the compression library, errnum is set to Z_ERRNO and the
|
||||||
Z_ERRNO and the application may consult errno to get the exact error code.
|
application may consult errno to get the exact error code.
|
||||||
|
|
||||||
The application must not modify the returned string. Future calls to
|
The application must not modify the returned string. Future calls to
|
||||||
this function may invalidate the previously returned string. If file is
|
this function may invalidate the previously returned string. If file is
|
||||||
|
|
@ -1670,7 +1671,7 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
||||||
|
|
||||||
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Clears the error and end-of-file flags for file. This is analogous to the
|
Clear the error and end-of-file flags for file. This is analogous to the
|
||||||
clearerr() function in stdio. This is useful for continuing to read a gzip
|
clearerr() function in stdio. This is useful for continuing to read a gzip
|
||||||
file that is being written concurrently.
|
file that is being written concurrently.
|
||||||
*/
|
*/
|
||||||
|
|
@ -1688,8 +1689,9 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
||||||
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
|
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
|
||||||
/*
|
/*
|
||||||
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
||||||
return the updated checksum. If buf is Z_NULL, this function returns the
|
return the updated checksum. An Adler-32 value is in the range of a 32-bit
|
||||||
required initial value for the checksum.
|
unsigned integer. If buf is Z_NULL, this function returns the required
|
||||||
|
initial value for the checksum.
|
||||||
|
|
||||||
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
|
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
|
||||||
much faster.
|
much faster.
|
||||||
|
|
@ -1725,9 +1727,10 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
|
||||||
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||||
/*
|
/*
|
||||||
Update a running CRC-32 with the bytes buf[0..len-1] and return the
|
Update a running CRC-32 with the bytes buf[0..len-1] and return the
|
||||||
updated CRC-32. If buf is Z_NULL, this function returns the required
|
updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer.
|
||||||
initial value for the crc. Pre- and post-conditioning (one's complement) is
|
If buf is Z_NULL, this function returns the required initial value for the
|
||||||
performed within this function so it shouldn't be done by the application.
|
crc. Pre- and post-conditioning (one's complement) is performed within this
|
||||||
|
function so it shouldn't be done by the application.
|
||||||
|
|
||||||
Usage example:
|
Usage example:
|
||||||
|
|
||||||
|
|
@ -1739,7 +1742,7 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||||
if (crc != original_crc) error();
|
if (crc != original_crc) error();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf,
|
ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
|
||||||
z_size_t len));
|
z_size_t len));
|
||||||
/*
|
/*
|
||||||
Same as crc32(), but with a size_t length.
|
Same as crc32(), but with a size_t length.
|
||||||
|
|
@ -1755,6 +1758,20 @@ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
|
||||||
len2.
|
len2.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2));
|
||||||
|
|
||||||
|
Return the operator corresponding to length len2, to be used with
|
||||||
|
crc32_combine_op().
|
||||||
|
*/
|
||||||
|
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op));
|
||||||
|
/*
|
||||||
|
Give the same result as crc32_combine(), using op in place of len2. op is
|
||||||
|
is generated from len2 by crc32_combine_gen(). This will be faster than
|
||||||
|
crc32_combine() if the generated op is used more than once.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* various hacks, don't look :) */
|
/* various hacks, don't look :) */
|
||||||
|
|
||||||
|
|
@ -1842,6 +1859,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
|
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
|
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
|
||||||
|
|
@ -1852,6 +1870,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
# define z_gzoffset z_gzoffset64
|
# define z_gzoffset z_gzoffset64
|
||||||
# define z_adler32_combine z_adler32_combine64
|
# define z_adler32_combine z_adler32_combine64
|
||||||
# define z_crc32_combine z_crc32_combine64
|
# define z_crc32_combine z_crc32_combine64
|
||||||
|
# define z_crc32_combine_gen z_crc32_combine_gen64
|
||||||
# else
|
# else
|
||||||
# define gzopen gzopen64
|
# define gzopen gzopen64
|
||||||
# define gzseek gzseek64
|
# define gzseek gzseek64
|
||||||
|
|
@ -1859,6 +1878,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
# define gzoffset gzoffset64
|
# define gzoffset gzoffset64
|
||||||
# define adler32_combine adler32_combine64
|
# define adler32_combine adler32_combine64
|
||||||
# define crc32_combine crc32_combine64
|
# define crc32_combine crc32_combine64
|
||||||
|
# define crc32_combine_gen crc32_combine_gen64
|
||||||
# endif
|
# endif
|
||||||
# ifndef Z_LARGE64
|
# ifndef Z_LARGE64
|
||||||
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
||||||
|
|
@ -1867,6 +1887,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
|
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
|
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
|
||||||
|
|
@ -1875,12 +1896,14 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
|
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* Z_SOLO */
|
#else /* Z_SOLO */
|
||||||
|
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||||
|
|
||||||
#endif /* !Z_SOLO */
|
#endif /* !Z_SOLO */
|
||||||
|
|
||||||
|
|
@ -1893,7 +1916,7 @@ ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int));
|
||||||
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
|
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
|
||||||
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
||||||
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
||||||
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO)
|
#if defined(_WIN32) && !defined(Z_SOLO)
|
||||||
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
||||||
const char *mode));
|
const char *mode));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
#ifndef ZCONF_H
|
#ifndef ZCONF_H
|
||||||
#define ZCONF_H
|
#define ZCONF_H
|
||||||
|
/* #undef Z_PREFIX */
|
||||||
|
#define Z_HAVE_UNISTD_H
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If you *really* need a unique prefix for all types and library functions,
|
* If you *really* need a unique prefix for all types and library functions,
|
||||||
|
|
@ -431,11 +433,11 @@ typedef uLong FAR uLongf;
|
||||||
typedef unsigned long z_crc_t;
|
typedef unsigned long z_crc_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1 /* was set to #if 1 by ./configure */
|
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
|
||||||
# define Z_HAVE_UNISTD_H
|
# define Z_HAVE_UNISTD_H
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1 /* was set to #if 1 by ./configure */
|
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
|
||||||
# define Z_HAVE_STDARG_H
|
# define Z_HAVE_STDARG_H
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
||||||
version 1.2.11, January 15th, 2017
|
version 1.2.12, March 11th, 2022
|
||||||
|
|
||||||
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
|
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|
@ -37,11 +37,11 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ZLIB_VERSION "1.2.11"
|
#define ZLIB_VERSION "1.2.12"
|
||||||
#define ZLIB_VERNUM 0x12b0
|
#define ZLIB_VERNUM 0x12c0
|
||||||
#define ZLIB_VER_MAJOR 1
|
#define ZLIB_VER_MAJOR 1
|
||||||
#define ZLIB_VER_MINOR 2
|
#define ZLIB_VER_MINOR 2
|
||||||
#define ZLIB_VER_REVISION 11
|
#define ZLIB_VER_REVISION 12
|
||||||
#define ZLIB_VER_SUBREVISION 0
|
#define ZLIB_VER_SUBREVISION 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -543,8 +543,7 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
|
||||||
int strategy));
|
int strategy));
|
||||||
|
|
||||||
This is another version of deflateInit with more compression options. The
|
This is another version of deflateInit with more compression options. The
|
||||||
fields next_in, zalloc, zfree and opaque must be initialized before by the
|
fields zalloc, zfree and opaque must be initialized before by the caller.
|
||||||
caller.
|
|
||||||
|
|
||||||
The method parameter is the compression method. It must be Z_DEFLATED in
|
The method parameter is the compression method. It must be Z_DEFLATED in
|
||||||
this version of the library.
|
this version of the library.
|
||||||
|
|
@ -712,11 +711,12 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
|
||||||
used to switch between compression and straight copy of the input data, or
|
used to switch between compression and straight copy of the input data, or
|
||||||
to switch to a different kind of input data requiring a different strategy.
|
to switch to a different kind of input data requiring a different strategy.
|
||||||
If the compression approach (which is a function of the level) or the
|
If the compression approach (which is a function of the level) or the
|
||||||
strategy is changed, and if any input has been consumed in a previous
|
strategy is changed, and if there have been any deflate() calls since the
|
||||||
deflate() call, then the input available so far is compressed with the old
|
state was initialized or reset, then the input available so far is
|
||||||
level and strategy using deflate(strm, Z_BLOCK). There are three approaches
|
compressed with the old level and strategy using deflate(strm, Z_BLOCK).
|
||||||
for the compression levels 0, 1..3, and 4..9 respectively. The new level
|
There are three approaches for the compression levels 0, 1..3, and 4..9
|
||||||
and strategy will take effect at the next call of deflate().
|
respectively. The new level and strategy will take effect at the next call
|
||||||
|
of deflate().
|
||||||
|
|
||||||
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
|
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
|
||||||
not have enough output space to complete, then the parameter change will not
|
not have enough output space to complete, then the parameter change will not
|
||||||
|
|
@ -865,9 +865,11 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
|
||||||
detection, or add 16 to decode only the gzip format (the zlib format will
|
detection, or add 16 to decode only the gzip format (the zlib format will
|
||||||
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
|
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
|
||||||
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
|
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
|
||||||
below), inflate() will not automatically decode concatenated gzip streams.
|
below), inflate() will *not* automatically decode concatenated gzip members.
|
||||||
inflate() will return Z_STREAM_END at the end of the gzip stream. The state
|
inflate() will return Z_STREAM_END at the end of the gzip member. The state
|
||||||
would need to be reset to continue decoding a subsequent gzip stream.
|
would need to be reset to continue decoding a subsequent gzip member. This
|
||||||
|
*must* be done if there is more data after a gzip member, in order for the
|
||||||
|
decompression to be compliant with the gzip standard (RFC 1952).
|
||||||
|
|
||||||
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
inflateInit2 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
|
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
|
||||||
|
|
@ -1302,14 +1304,14 @@ typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
|
||||||
/*
|
/*
|
||||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
||||||
|
|
||||||
Opens a gzip (.gz) file for reading or writing. The mode parameter is as
|
Open the gzip (.gz) file at path for reading and decompressing, or
|
||||||
in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
|
compressing and writing. The mode parameter is as in fopen ("rb" or "wb")
|
||||||
a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
|
but can also include a compression level ("wb9") or a strategy: 'f' for
|
||||||
compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
|
filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h",
|
||||||
for fixed code compression as in "wb9F". (See the description of
|
'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression
|
||||||
deflateInit2 for more information about the strategy parameter.) 'T' will
|
as in "wb9F". (See the description of deflateInit2 for more information
|
||||||
request transparent writing or appending with no compression and not using
|
about the strategy parameter.) 'T' will request transparent writing or
|
||||||
the gzip format.
|
appending with no compression and not using the gzip format.
|
||||||
|
|
||||||
"a" can be used instead of "w" to request that the gzip stream that will
|
"a" can be used instead of "w" to request that the gzip stream that will
|
||||||
be written be appended to the file. "+" will result in an error, since
|
be written be appended to the file. "+" will result in an error, since
|
||||||
|
|
@ -1339,9 +1341,9 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
||||||
|
|
||||||
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
||||||
/*
|
/*
|
||||||
gzdopen associates a gzFile with the file descriptor fd. File descriptors
|
Associate a gzFile with the file descriptor fd. File descriptors are
|
||||||
are obtained from calls like open, dup, creat, pipe or fileno (if the file
|
obtained from calls like open, dup, creat, pipe or fileno (if the file has
|
||||||
has been previously opened with fopen). The mode parameter is as in gzopen.
|
been previously opened with fopen). The mode parameter is as in gzopen.
|
||||||
|
|
||||||
The next call of gzclose on the returned gzFile will also close the file
|
The next call of gzclose on the returned gzFile will also close the file
|
||||||
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
|
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
|
||||||
|
|
@ -1362,13 +1364,13 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
||||||
/*
|
/*
|
||||||
Set the internal buffer size used by this library's functions. The
|
Set the internal buffer size used by this library's functions for file to
|
||||||
default buffer size is 8192 bytes. This function must be called after
|
size. The default buffer size is 8192 bytes. This function must be called
|
||||||
gzopen() or gzdopen(), and before any other calls that read or write the
|
after gzopen() or gzdopen(), and before any other calls that read or write
|
||||||
file. The buffer memory allocation is always deferred to the first read or
|
the file. The buffer memory allocation is always deferred to the first read
|
||||||
write. Three times that size in buffer space is allocated. A larger buffer
|
or write. Three times that size in buffer space is allocated. A larger
|
||||||
size of, for example, 64K or 128K bytes will noticeably increase the speed
|
buffer size of, for example, 64K or 128K bytes will noticeably increase the
|
||||||
of decompression (reading).
|
speed of decompression (reading).
|
||||||
|
|
||||||
The new buffer size also affects the maximum length for gzprintf().
|
The new buffer size also affects the maximum length for gzprintf().
|
||||||
|
|
||||||
|
|
@ -1378,9 +1380,9 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
||||||
/*
|
/*
|
||||||
Dynamically update the compression level or strategy. See the description
|
Dynamically update the compression level and strategy for file. See the
|
||||||
of deflateInit2 for the meaning of these parameters. Previously provided
|
description of deflateInit2 for the meaning of these parameters. Previously
|
||||||
data is flushed before the parameter change.
|
provided data is flushed before applying the parameter changes.
|
||||||
|
|
||||||
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
|
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
|
||||||
opened for writing, Z_ERRNO if there is an error writing the flushed data,
|
opened for writing, Z_ERRNO if there is an error writing the flushed data,
|
||||||
|
|
@ -1389,7 +1391,7 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
||||||
/*
|
/*
|
||||||
Reads the given number of uncompressed bytes from the compressed file. If
|
Read and decompress up to len uncompressed bytes from file into buf. If
|
||||||
the input file is not in gzip format, gzread copies the given number of
|
the input file is not in gzip format, gzread copies the given number of
|
||||||
bytes into the buffer directly from the file.
|
bytes into the buffer directly from the file.
|
||||||
|
|
||||||
|
|
@ -1420,11 +1422,11 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
||||||
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
||||||
gzFile file));
|
gzFile file));
|
||||||
/*
|
/*
|
||||||
Read up to nitems items of size size from file to buf, otherwise operating
|
Read and decompress up to nitems items of size size from file into buf,
|
||||||
as gzread() does. This duplicates the interface of stdio's fread(), with
|
otherwise operating as gzread() does. This duplicates the interface of
|
||||||
size_t request and return types. If the library defines size_t, then
|
stdio's fread(), with size_t request and return types. If the library
|
||||||
z_size_t is identical to size_t. If not, then z_size_t is an unsigned
|
defines size_t, then z_size_t is identical to size_t. If not, then z_size_t
|
||||||
integer type that can contain a pointer.
|
is an unsigned integer type that can contain a pointer.
|
||||||
|
|
||||||
gzfread() returns the number of full items read of size size, or zero if
|
gzfread() returns the number of full items read of size size, or zero if
|
||||||
the end of the file was reached and a full item could not be read, or if
|
the end of the file was reached and a full item could not be read, or if
|
||||||
|
|
@ -1443,18 +1445,16 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
||||||
file, reseting and retrying on end-of-file, when size is not 1.
|
file, reseting and retrying on end-of-file, when size is not 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
|
ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len));
|
||||||
voidpc buf, unsigned len));
|
|
||||||
/*
|
/*
|
||||||
Writes the given number of uncompressed bytes into the compressed file.
|
Compress and write the len uncompressed bytes at buf to file. gzwrite
|
||||||
gzwrite returns the number of uncompressed bytes written or 0 in case of
|
returns the number of uncompressed bytes written or 0 in case of error.
|
||||||
error.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
||||||
z_size_t nitems, gzFile file));
|
z_size_t nitems, gzFile file));
|
||||||
/*
|
/*
|
||||||
gzfwrite() writes nitems items of size size from buf to file, duplicating
|
Compress and write nitems items of size size from buf to file, duplicating
|
||||||
the interface of stdio's fwrite(), with size_t request and return types. If
|
the interface of stdio's fwrite(), with size_t request and return types. If
|
||||||
the library defines size_t, then z_size_t is identical to size_t. If not,
|
the library defines size_t, then z_size_t is identical to size_t. If not,
|
||||||
then z_size_t is an unsigned integer type that can contain a pointer.
|
then z_size_t is an unsigned integer type that can contain a pointer.
|
||||||
|
|
@ -1467,22 +1467,22 @@ ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
||||||
|
|
||||||
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
|
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
|
||||||
/*
|
/*
|
||||||
Converts, formats, and writes the arguments to the compressed file under
|
Convert, format, compress, and write the arguments (...) to file under
|
||||||
control of the format string, as in fprintf. gzprintf returns the number of
|
control of the string format, as in fprintf. gzprintf returns the number of
|
||||||
uncompressed bytes actually written, or a negative zlib error code in case
|
uncompressed bytes actually written, or a negative zlib error code in case
|
||||||
of error. The number of uncompressed bytes written is limited to 8191, or
|
of error. The number of uncompressed bytes written is limited to 8191, or
|
||||||
one less than the buffer size given to gzbuffer(). The caller should assure
|
one less than the buffer size given to gzbuffer(). The caller should assure
|
||||||
that this limit is not exceeded. If it is exceeded, then gzprintf() will
|
that this limit is not exceeded. If it is exceeded, then gzprintf() will
|
||||||
return an error (0) with nothing written. In this case, there may also be a
|
return an error (0) with nothing written. In this case, there may also be a
|
||||||
buffer overflow with unpredictable consequences, which is possible only if
|
buffer overflow with unpredictable consequences, which is possible only if
|
||||||
zlib was compiled with the insecure functions sprintf() or vsprintf()
|
zlib was compiled with the insecure functions sprintf() or vsprintf(),
|
||||||
because the secure snprintf() or vsnprintf() functions were not available.
|
because the secure snprintf() or vsnprintf() functions were not available.
|
||||||
This can be determined using zlibCompileFlags().
|
This can be determined using zlibCompileFlags().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
||||||
/*
|
/*
|
||||||
Writes the given null-terminated string to the compressed file, excluding
|
Compress and write the given null-terminated string s to file, excluding
|
||||||
the terminating null character.
|
the terminating null character.
|
||||||
|
|
||||||
gzputs returns the number of characters written, or -1 in case of error.
|
gzputs returns the number of characters written, or -1 in case of error.
|
||||||
|
|
@ -1490,11 +1490,12 @@ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
||||||
|
|
||||||
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
||||||
/*
|
/*
|
||||||
Reads bytes from the compressed file until len-1 characters are read, or a
|
Read and decompress bytes from file into buf, until len-1 characters are
|
||||||
newline character is read and transferred to buf, or an end-of-file
|
read, or until a newline character is read and transferred to buf, or an
|
||||||
condition is encountered. If any characters are read or if len == 1, the
|
end-of-file condition is encountered. If any characters are read or if len
|
||||||
string is terminated with a null character. If no characters are read due
|
is one, the string is terminated with a null character. If no characters
|
||||||
to an end-of-file or len < 1, then the buffer is left untouched.
|
are read due to an end-of-file or len is less than one, then the buffer is
|
||||||
|
left untouched.
|
||||||
|
|
||||||
gzgets returns buf which is a null-terminated string, or it returns NULL
|
gzgets returns buf which is a null-terminated string, or it returns NULL
|
||||||
for end-of-file or in case of error. If there was an error, the contents at
|
for end-of-file or in case of error. If there was an error, the contents at
|
||||||
|
|
@ -1503,13 +1504,13 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
||||||
/*
|
/*
|
||||||
Writes c, converted to an unsigned char, into the compressed file. gzputc
|
Compress and write c, converted to an unsigned char, into file. gzputc
|
||||||
returns the value that was written, or -1 in case of error.
|
returns the value that was written, or -1 in case of error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Reads one byte from the compressed file. gzgetc returns this byte or -1
|
Read and decompress one byte from file. gzgetc returns this byte or -1
|
||||||
in case of end of file or error. This is implemented as a macro for speed.
|
in case of end of file or error. This is implemented as a macro for speed.
|
||||||
As such, it does not do all of the checking the other functions do. I.e.
|
As such, it does not do all of the checking the other functions do. I.e.
|
||||||
it does not check to see if file is NULL, nor whether the structure file
|
it does not check to see if file is NULL, nor whether the structure file
|
||||||
|
|
@ -1518,8 +1519,8 @@ ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
||||||
/*
|
/*
|
||||||
Push one character back onto the stream to be read as the first character
|
Push c back onto the stream for file to be read as the first character on
|
||||||
on the next read. At least one character of push-back is allowed.
|
the next read. At least one character of push-back is always allowed.
|
||||||
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
|
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
|
||||||
fail if c is -1, and may fail if a character has been pushed but not read
|
fail if c is -1, and may fail if a character has been pushed but not read
|
||||||
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
|
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
|
||||||
|
|
@ -1530,9 +1531,9 @@ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
||||||
/*
|
/*
|
||||||
Flushes all pending output into the compressed file. The parameter flush
|
Flush all pending output to file. The parameter flush is as in the
|
||||||
is as in the deflate() function. The return value is the zlib error number
|
deflate() function. The return value is the zlib error number (see function
|
||||||
(see function gzerror below). gzflush is only permitted when writing.
|
gzerror below). gzflush is only permitted when writing.
|
||||||
|
|
||||||
If the flush parameter is Z_FINISH, the remaining data is written and the
|
If the flush parameter is Z_FINISH, the remaining data is written and the
|
||||||
gzip stream is completed in the output. If gzwrite() is called again, a new
|
gzip stream is completed in the output. If gzwrite() is called again, a new
|
||||||
|
|
@ -1547,8 +1548,8 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
||||||
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
||||||
z_off_t offset, int whence));
|
z_off_t offset, int whence));
|
||||||
|
|
||||||
Sets the starting position for the next gzread or gzwrite on the given
|
Set the starting position to offset relative to whence for the next gzread
|
||||||
compressed file. The offset represents a number of bytes in the
|
or gzwrite on file. The offset represents a number of bytes in the
|
||||||
uncompressed data stream. The whence parameter is defined as in lseek(2);
|
uncompressed data stream. The whence parameter is defined as in lseek(2);
|
||||||
the value SEEK_END is not supported.
|
the value SEEK_END is not supported.
|
||||||
|
|
||||||
|
|
@ -1565,18 +1566,18 @@ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
|
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Rewinds the given file. This function is supported only for reading.
|
Rewind file. This function is supported only for reading.
|
||||||
|
|
||||||
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
|
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
||||||
|
|
||||||
Returns the starting position for the next gzread or gzwrite on the given
|
Return the starting position for the next gzread or gzwrite on file.
|
||||||
compressed file. This position represents a number of bytes in the
|
This position represents a number of bytes in the uncompressed data stream,
|
||||||
uncompressed data stream, and is zero when starting, even if appending or
|
and is zero when starting, even if appending or reading a gzip stream from
|
||||||
reading a gzip stream from the middle of a file using gzdopen().
|
the middle of a file using gzdopen().
|
||||||
|
|
||||||
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
|
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
|
||||||
*/
|
*/
|
||||||
|
|
@ -1584,22 +1585,22 @@ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
||||||
|
|
||||||
Returns the current offset in the file being read or written. This offset
|
Return the current compressed (actual) read or write offset of file. This
|
||||||
includes the count of bytes that precede the gzip stream, for example when
|
offset includes the count of bytes that precede the gzip stream, for example
|
||||||
appending or when using gzdopen() for reading. When reading, the offset
|
when appending or when using gzdopen() for reading. When reading, the
|
||||||
does not include as yet unused buffered input. This information can be used
|
offset does not include as yet unused buffered input. This information can
|
||||||
for a progress indicator. On error, gzoffset() returns -1.
|
be used for a progress indicator. On error, gzoffset() returns -1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Returns true (1) if the end-of-file indicator has been set while reading,
|
Return true (1) if the end-of-file indicator for file has been set while
|
||||||
false (0) otherwise. Note that the end-of-file indicator is set only if the
|
reading, false (0) otherwise. Note that the end-of-file indicator is set
|
||||||
read tried to go past the end of the input, but came up short. Therefore,
|
only if the read tried to go past the end of the input, but came up short.
|
||||||
just like feof(), gzeof() may return false even if there is no more data to
|
Therefore, just like feof(), gzeof() may return false even if there is no
|
||||||
read, in the event that the last read request was for the exact number of
|
more data to read, in the event that the last read request was for the exact
|
||||||
bytes remaining in the input file. This will happen if the input file size
|
number of bytes remaining in the input file. This will happen if the input
|
||||||
is an exact multiple of the buffer size.
|
file size is an exact multiple of the buffer size.
|
||||||
|
|
||||||
If gzeof() returns true, then the read functions will return no more data,
|
If gzeof() returns true, then the read functions will return no more data,
|
||||||
unless the end-of-file indicator is reset by gzclearerr() and the input file
|
unless the end-of-file indicator is reset by gzclearerr() and the input file
|
||||||
|
|
@ -1608,7 +1609,7 @@ ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Returns true (1) if file is being copied directly while reading, or false
|
Return true (1) if file is being copied directly while reading, or false
|
||||||
(0) if file is a gzip stream being decompressed.
|
(0) if file is a gzip stream being decompressed.
|
||||||
|
|
||||||
If the input file is empty, gzdirect() will return true, since the input
|
If the input file is empty, gzdirect() will return true, since the input
|
||||||
|
|
@ -1629,8 +1630,8 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Flushes all pending output if necessary, closes the compressed file and
|
Flush all pending output for file, if necessary, close file and
|
||||||
deallocates the (de)compression state. Note that once file is closed, you
|
deallocate the (de)compression state. Note that once file is closed, you
|
||||||
cannot call gzerror with file, since its structures have been deallocated.
|
cannot call gzerror with file, since its structures have been deallocated.
|
||||||
gzclose must not be called more than once on the same file, just as free
|
gzclose must not be called more than once on the same file, just as free
|
||||||
must not be called more than once on the same allocation.
|
must not be called more than once on the same allocation.
|
||||||
|
|
@ -1654,10 +1655,10 @@ ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
||||||
/*
|
/*
|
||||||
Returns the error message for the last error which occurred on the given
|
Return the error message for the last error which occurred on file.
|
||||||
compressed file. errnum is set to zlib error number. If an error occurred
|
errnum is set to zlib error number. If an error occurred in the file system
|
||||||
in the file system and not in the compression library, errnum is set to
|
and not in the compression library, errnum is set to Z_ERRNO and the
|
||||||
Z_ERRNO and the application may consult errno to get the exact error code.
|
application may consult errno to get the exact error code.
|
||||||
|
|
||||||
The application must not modify the returned string. Future calls to
|
The application must not modify the returned string. Future calls to
|
||||||
this function may invalidate the previously returned string. If file is
|
this function may invalidate the previously returned string. If file is
|
||||||
|
|
@ -1670,7 +1671,7 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
||||||
|
|
||||||
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Clears the error and end-of-file flags for file. This is analogous to the
|
Clear the error and end-of-file flags for file. This is analogous to the
|
||||||
clearerr() function in stdio. This is useful for continuing to read a gzip
|
clearerr() function in stdio. This is useful for continuing to read a gzip
|
||||||
file that is being written concurrently.
|
file that is being written concurrently.
|
||||||
*/
|
*/
|
||||||
|
|
@ -1688,8 +1689,9 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
||||||
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
|
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
|
||||||
/*
|
/*
|
||||||
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
||||||
return the updated checksum. If buf is Z_NULL, this function returns the
|
return the updated checksum. An Adler-32 value is in the range of a 32-bit
|
||||||
required initial value for the checksum.
|
unsigned integer. If buf is Z_NULL, this function returns the required
|
||||||
|
initial value for the checksum.
|
||||||
|
|
||||||
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
|
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
|
||||||
much faster.
|
much faster.
|
||||||
|
|
@ -1725,9 +1727,10 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
|
||||||
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||||
/*
|
/*
|
||||||
Update a running CRC-32 with the bytes buf[0..len-1] and return the
|
Update a running CRC-32 with the bytes buf[0..len-1] and return the
|
||||||
updated CRC-32. If buf is Z_NULL, this function returns the required
|
updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer.
|
||||||
initial value for the crc. Pre- and post-conditioning (one's complement) is
|
If buf is Z_NULL, this function returns the required initial value for the
|
||||||
performed within this function so it shouldn't be done by the application.
|
crc. Pre- and post-conditioning (one's complement) is performed within this
|
||||||
|
function so it shouldn't be done by the application.
|
||||||
|
|
||||||
Usage example:
|
Usage example:
|
||||||
|
|
||||||
|
|
@ -1739,7 +1742,7 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||||
if (crc != original_crc) error();
|
if (crc != original_crc) error();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf,
|
ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
|
||||||
z_size_t len));
|
z_size_t len));
|
||||||
/*
|
/*
|
||||||
Same as crc32(), but with a size_t length.
|
Same as crc32(), but with a size_t length.
|
||||||
|
|
@ -1755,6 +1758,20 @@ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
|
||||||
len2.
|
len2.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2));
|
||||||
|
|
||||||
|
Return the operator corresponding to length len2, to be used with
|
||||||
|
crc32_combine_op().
|
||||||
|
*/
|
||||||
|
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op));
|
||||||
|
/*
|
||||||
|
Give the same result as crc32_combine(), using op in place of len2. op is
|
||||||
|
is generated from len2 by crc32_combine_gen(). This will be faster than
|
||||||
|
crc32_combine() if the generated op is used more than once.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* various hacks, don't look :) */
|
/* various hacks, don't look :) */
|
||||||
|
|
||||||
|
|
@ -1842,6 +1859,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
|
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
|
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
|
||||||
|
|
@ -1852,6 +1870,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
# define z_gzoffset z_gzoffset64
|
# define z_gzoffset z_gzoffset64
|
||||||
# define z_adler32_combine z_adler32_combine64
|
# define z_adler32_combine z_adler32_combine64
|
||||||
# define z_crc32_combine z_crc32_combine64
|
# define z_crc32_combine z_crc32_combine64
|
||||||
|
# define z_crc32_combine_gen z_crc32_combine_gen64
|
||||||
# else
|
# else
|
||||||
# define gzopen gzopen64
|
# define gzopen gzopen64
|
||||||
# define gzseek gzseek64
|
# define gzseek gzseek64
|
||||||
|
|
@ -1859,6 +1878,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
# define gzoffset gzoffset64
|
# define gzoffset gzoffset64
|
||||||
# define adler32_combine adler32_combine64
|
# define adler32_combine adler32_combine64
|
||||||
# define crc32_combine crc32_combine64
|
# define crc32_combine crc32_combine64
|
||||||
|
# define crc32_combine_gen crc32_combine_gen64
|
||||||
# endif
|
# endif
|
||||||
# ifndef Z_LARGE64
|
# ifndef Z_LARGE64
|
||||||
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
||||||
|
|
@ -1867,6 +1887,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
|
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
|
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
|
||||||
|
|
@ -1875,12 +1896,14 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
|
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* Z_SOLO */
|
#else /* Z_SOLO */
|
||||||
|
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||||
|
|
||||||
#endif /* !Z_SOLO */
|
#endif /* !Z_SOLO */
|
||||||
|
|
||||||
|
|
@ -1893,7 +1916,7 @@ ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int));
|
||||||
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
|
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
|
||||||
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
||||||
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
||||||
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO)
|
#if defined(_WIN32) && !defined(Z_SOLO)
|
||||||
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
||||||
const char *mode));
|
const char *mode));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
#ifndef ZCONF_H
|
#ifndef ZCONF_H
|
||||||
#define ZCONF_H
|
#define ZCONF_H
|
||||||
|
/* #undef Z_PREFIX */
|
||||||
|
#define Z_HAVE_UNISTD_H
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If you *really* need a unique prefix for all types and library functions,
|
* If you *really* need a unique prefix for all types and library functions,
|
||||||
|
|
@ -431,11 +433,11 @@ typedef uLong FAR uLongf;
|
||||||
typedef unsigned long z_crc_t;
|
typedef unsigned long z_crc_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1 /* was set to #if 1 by ./configure */
|
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
|
||||||
# define Z_HAVE_UNISTD_H
|
# define Z_HAVE_UNISTD_H
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 1 /* was set to #if 1 by ./configure */
|
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
|
||||||
# define Z_HAVE_STDARG_H
|
# define Z_HAVE_STDARG_H
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
||||||
version 1.2.11, January 15th, 2017
|
version 1.2.12, March 11th, 2022
|
||||||
|
|
||||||
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
|
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|
@ -37,11 +37,11 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ZLIB_VERSION "1.2.11"
|
#define ZLIB_VERSION "1.2.12"
|
||||||
#define ZLIB_VERNUM 0x12b0
|
#define ZLIB_VERNUM 0x12c0
|
||||||
#define ZLIB_VER_MAJOR 1
|
#define ZLIB_VER_MAJOR 1
|
||||||
#define ZLIB_VER_MINOR 2
|
#define ZLIB_VER_MINOR 2
|
||||||
#define ZLIB_VER_REVISION 11
|
#define ZLIB_VER_REVISION 12
|
||||||
#define ZLIB_VER_SUBREVISION 0
|
#define ZLIB_VER_SUBREVISION 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -543,8 +543,7 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
|
||||||
int strategy));
|
int strategy));
|
||||||
|
|
||||||
This is another version of deflateInit with more compression options. The
|
This is another version of deflateInit with more compression options. The
|
||||||
fields next_in, zalloc, zfree and opaque must be initialized before by the
|
fields zalloc, zfree and opaque must be initialized before by the caller.
|
||||||
caller.
|
|
||||||
|
|
||||||
The method parameter is the compression method. It must be Z_DEFLATED in
|
The method parameter is the compression method. It must be Z_DEFLATED in
|
||||||
this version of the library.
|
this version of the library.
|
||||||
|
|
@ -712,11 +711,12 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
|
||||||
used to switch between compression and straight copy of the input data, or
|
used to switch between compression and straight copy of the input data, or
|
||||||
to switch to a different kind of input data requiring a different strategy.
|
to switch to a different kind of input data requiring a different strategy.
|
||||||
If the compression approach (which is a function of the level) or the
|
If the compression approach (which is a function of the level) or the
|
||||||
strategy is changed, and if any input has been consumed in a previous
|
strategy is changed, and if there have been any deflate() calls since the
|
||||||
deflate() call, then the input available so far is compressed with the old
|
state was initialized or reset, then the input available so far is
|
||||||
level and strategy using deflate(strm, Z_BLOCK). There are three approaches
|
compressed with the old level and strategy using deflate(strm, Z_BLOCK).
|
||||||
for the compression levels 0, 1..3, and 4..9 respectively. The new level
|
There are three approaches for the compression levels 0, 1..3, and 4..9
|
||||||
and strategy will take effect at the next call of deflate().
|
respectively. The new level and strategy will take effect at the next call
|
||||||
|
of deflate().
|
||||||
|
|
||||||
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
|
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
|
||||||
not have enough output space to complete, then the parameter change will not
|
not have enough output space to complete, then the parameter change will not
|
||||||
|
|
@ -865,9 +865,11 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
|
||||||
detection, or add 16 to decode only the gzip format (the zlib format will
|
detection, or add 16 to decode only the gzip format (the zlib format will
|
||||||
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
|
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
|
||||||
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
|
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
|
||||||
below), inflate() will not automatically decode concatenated gzip streams.
|
below), inflate() will *not* automatically decode concatenated gzip members.
|
||||||
inflate() will return Z_STREAM_END at the end of the gzip stream. The state
|
inflate() will return Z_STREAM_END at the end of the gzip member. The state
|
||||||
would need to be reset to continue decoding a subsequent gzip stream.
|
would need to be reset to continue decoding a subsequent gzip member. This
|
||||||
|
*must* be done if there is more data after a gzip member, in order for the
|
||||||
|
decompression to be compliant with the gzip standard (RFC 1952).
|
||||||
|
|
||||||
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
inflateInit2 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
|
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
|
||||||
|
|
@ -1302,14 +1304,14 @@ typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
|
||||||
/*
|
/*
|
||||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
||||||
|
|
||||||
Opens a gzip (.gz) file for reading or writing. The mode parameter is as
|
Open the gzip (.gz) file at path for reading and decompressing, or
|
||||||
in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
|
compressing and writing. The mode parameter is as in fopen ("rb" or "wb")
|
||||||
a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
|
but can also include a compression level ("wb9") or a strategy: 'f' for
|
||||||
compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
|
filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h",
|
||||||
for fixed code compression as in "wb9F". (See the description of
|
'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression
|
||||||
deflateInit2 for more information about the strategy parameter.) 'T' will
|
as in "wb9F". (See the description of deflateInit2 for more information
|
||||||
request transparent writing or appending with no compression and not using
|
about the strategy parameter.) 'T' will request transparent writing or
|
||||||
the gzip format.
|
appending with no compression and not using the gzip format.
|
||||||
|
|
||||||
"a" can be used instead of "w" to request that the gzip stream that will
|
"a" can be used instead of "w" to request that the gzip stream that will
|
||||||
be written be appended to the file. "+" will result in an error, since
|
be written be appended to the file. "+" will result in an error, since
|
||||||
|
|
@ -1339,9 +1341,9 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
||||||
|
|
||||||
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
||||||
/*
|
/*
|
||||||
gzdopen associates a gzFile with the file descriptor fd. File descriptors
|
Associate a gzFile with the file descriptor fd. File descriptors are
|
||||||
are obtained from calls like open, dup, creat, pipe or fileno (if the file
|
obtained from calls like open, dup, creat, pipe or fileno (if the file has
|
||||||
has been previously opened with fopen). The mode parameter is as in gzopen.
|
been previously opened with fopen). The mode parameter is as in gzopen.
|
||||||
|
|
||||||
The next call of gzclose on the returned gzFile will also close the file
|
The next call of gzclose on the returned gzFile will also close the file
|
||||||
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
|
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
|
||||||
|
|
@ -1362,13 +1364,13 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
||||||
/*
|
/*
|
||||||
Set the internal buffer size used by this library's functions. The
|
Set the internal buffer size used by this library's functions for file to
|
||||||
default buffer size is 8192 bytes. This function must be called after
|
size. The default buffer size is 8192 bytes. This function must be called
|
||||||
gzopen() or gzdopen(), and before any other calls that read or write the
|
after gzopen() or gzdopen(), and before any other calls that read or write
|
||||||
file. The buffer memory allocation is always deferred to the first read or
|
the file. The buffer memory allocation is always deferred to the first read
|
||||||
write. Three times that size in buffer space is allocated. A larger buffer
|
or write. Three times that size in buffer space is allocated. A larger
|
||||||
size of, for example, 64K or 128K bytes will noticeably increase the speed
|
buffer size of, for example, 64K or 128K bytes will noticeably increase the
|
||||||
of decompression (reading).
|
speed of decompression (reading).
|
||||||
|
|
||||||
The new buffer size also affects the maximum length for gzprintf().
|
The new buffer size also affects the maximum length for gzprintf().
|
||||||
|
|
||||||
|
|
@ -1378,9 +1380,9 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
||||||
/*
|
/*
|
||||||
Dynamically update the compression level or strategy. See the description
|
Dynamically update the compression level and strategy for file. See the
|
||||||
of deflateInit2 for the meaning of these parameters. Previously provided
|
description of deflateInit2 for the meaning of these parameters. Previously
|
||||||
data is flushed before the parameter change.
|
provided data is flushed before applying the parameter changes.
|
||||||
|
|
||||||
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
|
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
|
||||||
opened for writing, Z_ERRNO if there is an error writing the flushed data,
|
opened for writing, Z_ERRNO if there is an error writing the flushed data,
|
||||||
|
|
@ -1389,7 +1391,7 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
||||||
/*
|
/*
|
||||||
Reads the given number of uncompressed bytes from the compressed file. If
|
Read and decompress up to len uncompressed bytes from file into buf. If
|
||||||
the input file is not in gzip format, gzread copies the given number of
|
the input file is not in gzip format, gzread copies the given number of
|
||||||
bytes into the buffer directly from the file.
|
bytes into the buffer directly from the file.
|
||||||
|
|
||||||
|
|
@ -1420,11 +1422,11 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
||||||
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
||||||
gzFile file));
|
gzFile file));
|
||||||
/*
|
/*
|
||||||
Read up to nitems items of size size from file to buf, otherwise operating
|
Read and decompress up to nitems items of size size from file into buf,
|
||||||
as gzread() does. This duplicates the interface of stdio's fread(), with
|
otherwise operating as gzread() does. This duplicates the interface of
|
||||||
size_t request and return types. If the library defines size_t, then
|
stdio's fread(), with size_t request and return types. If the library
|
||||||
z_size_t is identical to size_t. If not, then z_size_t is an unsigned
|
defines size_t, then z_size_t is identical to size_t. If not, then z_size_t
|
||||||
integer type that can contain a pointer.
|
is an unsigned integer type that can contain a pointer.
|
||||||
|
|
||||||
gzfread() returns the number of full items read of size size, or zero if
|
gzfread() returns the number of full items read of size size, or zero if
|
||||||
the end of the file was reached and a full item could not be read, or if
|
the end of the file was reached and a full item could not be read, or if
|
||||||
|
|
@ -1443,18 +1445,16 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
||||||
file, reseting and retrying on end-of-file, when size is not 1.
|
file, reseting and retrying on end-of-file, when size is not 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
|
ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len));
|
||||||
voidpc buf, unsigned len));
|
|
||||||
/*
|
/*
|
||||||
Writes the given number of uncompressed bytes into the compressed file.
|
Compress and write the len uncompressed bytes at buf to file. gzwrite
|
||||||
gzwrite returns the number of uncompressed bytes written or 0 in case of
|
returns the number of uncompressed bytes written or 0 in case of error.
|
||||||
error.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
||||||
z_size_t nitems, gzFile file));
|
z_size_t nitems, gzFile file));
|
||||||
/*
|
/*
|
||||||
gzfwrite() writes nitems items of size size from buf to file, duplicating
|
Compress and write nitems items of size size from buf to file, duplicating
|
||||||
the interface of stdio's fwrite(), with size_t request and return types. If
|
the interface of stdio's fwrite(), with size_t request and return types. If
|
||||||
the library defines size_t, then z_size_t is identical to size_t. If not,
|
the library defines size_t, then z_size_t is identical to size_t. If not,
|
||||||
then z_size_t is an unsigned integer type that can contain a pointer.
|
then z_size_t is an unsigned integer type that can contain a pointer.
|
||||||
|
|
@ -1467,22 +1467,22 @@ ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
||||||
|
|
||||||
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
|
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
|
||||||
/*
|
/*
|
||||||
Converts, formats, and writes the arguments to the compressed file under
|
Convert, format, compress, and write the arguments (...) to file under
|
||||||
control of the format string, as in fprintf. gzprintf returns the number of
|
control of the string format, as in fprintf. gzprintf returns the number of
|
||||||
uncompressed bytes actually written, or a negative zlib error code in case
|
uncompressed bytes actually written, or a negative zlib error code in case
|
||||||
of error. The number of uncompressed bytes written is limited to 8191, or
|
of error. The number of uncompressed bytes written is limited to 8191, or
|
||||||
one less than the buffer size given to gzbuffer(). The caller should assure
|
one less than the buffer size given to gzbuffer(). The caller should assure
|
||||||
that this limit is not exceeded. If it is exceeded, then gzprintf() will
|
that this limit is not exceeded. If it is exceeded, then gzprintf() will
|
||||||
return an error (0) with nothing written. In this case, there may also be a
|
return an error (0) with nothing written. In this case, there may also be a
|
||||||
buffer overflow with unpredictable consequences, which is possible only if
|
buffer overflow with unpredictable consequences, which is possible only if
|
||||||
zlib was compiled with the insecure functions sprintf() or vsprintf()
|
zlib was compiled with the insecure functions sprintf() or vsprintf(),
|
||||||
because the secure snprintf() or vsnprintf() functions were not available.
|
because the secure snprintf() or vsnprintf() functions were not available.
|
||||||
This can be determined using zlibCompileFlags().
|
This can be determined using zlibCompileFlags().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
||||||
/*
|
/*
|
||||||
Writes the given null-terminated string to the compressed file, excluding
|
Compress and write the given null-terminated string s to file, excluding
|
||||||
the terminating null character.
|
the terminating null character.
|
||||||
|
|
||||||
gzputs returns the number of characters written, or -1 in case of error.
|
gzputs returns the number of characters written, or -1 in case of error.
|
||||||
|
|
@ -1490,11 +1490,12 @@ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
||||||
|
|
||||||
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
||||||
/*
|
/*
|
||||||
Reads bytes from the compressed file until len-1 characters are read, or a
|
Read and decompress bytes from file into buf, until len-1 characters are
|
||||||
newline character is read and transferred to buf, or an end-of-file
|
read, or until a newline character is read and transferred to buf, or an
|
||||||
condition is encountered. If any characters are read or if len == 1, the
|
end-of-file condition is encountered. If any characters are read or if len
|
||||||
string is terminated with a null character. If no characters are read due
|
is one, the string is terminated with a null character. If no characters
|
||||||
to an end-of-file or len < 1, then the buffer is left untouched.
|
are read due to an end-of-file or len is less than one, then the buffer is
|
||||||
|
left untouched.
|
||||||
|
|
||||||
gzgets returns buf which is a null-terminated string, or it returns NULL
|
gzgets returns buf which is a null-terminated string, or it returns NULL
|
||||||
for end-of-file or in case of error. If there was an error, the contents at
|
for end-of-file or in case of error. If there was an error, the contents at
|
||||||
|
|
@ -1503,13 +1504,13 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
||||||
/*
|
/*
|
||||||
Writes c, converted to an unsigned char, into the compressed file. gzputc
|
Compress and write c, converted to an unsigned char, into file. gzputc
|
||||||
returns the value that was written, or -1 in case of error.
|
returns the value that was written, or -1 in case of error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Reads one byte from the compressed file. gzgetc returns this byte or -1
|
Read and decompress one byte from file. gzgetc returns this byte or -1
|
||||||
in case of end of file or error. This is implemented as a macro for speed.
|
in case of end of file or error. This is implemented as a macro for speed.
|
||||||
As such, it does not do all of the checking the other functions do. I.e.
|
As such, it does not do all of the checking the other functions do. I.e.
|
||||||
it does not check to see if file is NULL, nor whether the structure file
|
it does not check to see if file is NULL, nor whether the structure file
|
||||||
|
|
@ -1518,8 +1519,8 @@ ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
||||||
/*
|
/*
|
||||||
Push one character back onto the stream to be read as the first character
|
Push c back onto the stream for file to be read as the first character on
|
||||||
on the next read. At least one character of push-back is allowed.
|
the next read. At least one character of push-back is always allowed.
|
||||||
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
|
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
|
||||||
fail if c is -1, and may fail if a character has been pushed but not read
|
fail if c is -1, and may fail if a character has been pushed but not read
|
||||||
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
|
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
|
||||||
|
|
@ -1530,9 +1531,9 @@ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
||||||
/*
|
/*
|
||||||
Flushes all pending output into the compressed file. The parameter flush
|
Flush all pending output to file. The parameter flush is as in the
|
||||||
is as in the deflate() function. The return value is the zlib error number
|
deflate() function. The return value is the zlib error number (see function
|
||||||
(see function gzerror below). gzflush is only permitted when writing.
|
gzerror below). gzflush is only permitted when writing.
|
||||||
|
|
||||||
If the flush parameter is Z_FINISH, the remaining data is written and the
|
If the flush parameter is Z_FINISH, the remaining data is written and the
|
||||||
gzip stream is completed in the output. If gzwrite() is called again, a new
|
gzip stream is completed in the output. If gzwrite() is called again, a new
|
||||||
|
|
@ -1547,8 +1548,8 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
||||||
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
||||||
z_off_t offset, int whence));
|
z_off_t offset, int whence));
|
||||||
|
|
||||||
Sets the starting position for the next gzread or gzwrite on the given
|
Set the starting position to offset relative to whence for the next gzread
|
||||||
compressed file. The offset represents a number of bytes in the
|
or gzwrite on file. The offset represents a number of bytes in the
|
||||||
uncompressed data stream. The whence parameter is defined as in lseek(2);
|
uncompressed data stream. The whence parameter is defined as in lseek(2);
|
||||||
the value SEEK_END is not supported.
|
the value SEEK_END is not supported.
|
||||||
|
|
||||||
|
|
@ -1565,18 +1566,18 @@ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
|
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Rewinds the given file. This function is supported only for reading.
|
Rewind file. This function is supported only for reading.
|
||||||
|
|
||||||
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
|
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
||||||
|
|
||||||
Returns the starting position for the next gzread or gzwrite on the given
|
Return the starting position for the next gzread or gzwrite on file.
|
||||||
compressed file. This position represents a number of bytes in the
|
This position represents a number of bytes in the uncompressed data stream,
|
||||||
uncompressed data stream, and is zero when starting, even if appending or
|
and is zero when starting, even if appending or reading a gzip stream from
|
||||||
reading a gzip stream from the middle of a file using gzdopen().
|
the middle of a file using gzdopen().
|
||||||
|
|
||||||
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
|
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
|
||||||
*/
|
*/
|
||||||
|
|
@ -1584,22 +1585,22 @@ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
||||||
|
|
||||||
Returns the current offset in the file being read or written. This offset
|
Return the current compressed (actual) read or write offset of file. This
|
||||||
includes the count of bytes that precede the gzip stream, for example when
|
offset includes the count of bytes that precede the gzip stream, for example
|
||||||
appending or when using gzdopen() for reading. When reading, the offset
|
when appending or when using gzdopen() for reading. When reading, the
|
||||||
does not include as yet unused buffered input. This information can be used
|
offset does not include as yet unused buffered input. This information can
|
||||||
for a progress indicator. On error, gzoffset() returns -1.
|
be used for a progress indicator. On error, gzoffset() returns -1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Returns true (1) if the end-of-file indicator has been set while reading,
|
Return true (1) if the end-of-file indicator for file has been set while
|
||||||
false (0) otherwise. Note that the end-of-file indicator is set only if the
|
reading, false (0) otherwise. Note that the end-of-file indicator is set
|
||||||
read tried to go past the end of the input, but came up short. Therefore,
|
only if the read tried to go past the end of the input, but came up short.
|
||||||
just like feof(), gzeof() may return false even if there is no more data to
|
Therefore, just like feof(), gzeof() may return false even if there is no
|
||||||
read, in the event that the last read request was for the exact number of
|
more data to read, in the event that the last read request was for the exact
|
||||||
bytes remaining in the input file. This will happen if the input file size
|
number of bytes remaining in the input file. This will happen if the input
|
||||||
is an exact multiple of the buffer size.
|
file size is an exact multiple of the buffer size.
|
||||||
|
|
||||||
If gzeof() returns true, then the read functions will return no more data,
|
If gzeof() returns true, then the read functions will return no more data,
|
||||||
unless the end-of-file indicator is reset by gzclearerr() and the input file
|
unless the end-of-file indicator is reset by gzclearerr() and the input file
|
||||||
|
|
@ -1608,7 +1609,7 @@ ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Returns true (1) if file is being copied directly while reading, or false
|
Return true (1) if file is being copied directly while reading, or false
|
||||||
(0) if file is a gzip stream being decompressed.
|
(0) if file is a gzip stream being decompressed.
|
||||||
|
|
||||||
If the input file is empty, gzdirect() will return true, since the input
|
If the input file is empty, gzdirect() will return true, since the input
|
||||||
|
|
@ -1629,8 +1630,8 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Flushes all pending output if necessary, closes the compressed file and
|
Flush all pending output for file, if necessary, close file and
|
||||||
deallocates the (de)compression state. Note that once file is closed, you
|
deallocate the (de)compression state. Note that once file is closed, you
|
||||||
cannot call gzerror with file, since its structures have been deallocated.
|
cannot call gzerror with file, since its structures have been deallocated.
|
||||||
gzclose must not be called more than once on the same file, just as free
|
gzclose must not be called more than once on the same file, just as free
|
||||||
must not be called more than once on the same allocation.
|
must not be called more than once on the same allocation.
|
||||||
|
|
@ -1654,10 +1655,10 @@ ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
||||||
/*
|
/*
|
||||||
Returns the error message for the last error which occurred on the given
|
Return the error message for the last error which occurred on file.
|
||||||
compressed file. errnum is set to zlib error number. If an error occurred
|
errnum is set to zlib error number. If an error occurred in the file system
|
||||||
in the file system and not in the compression library, errnum is set to
|
and not in the compression library, errnum is set to Z_ERRNO and the
|
||||||
Z_ERRNO and the application may consult errno to get the exact error code.
|
application may consult errno to get the exact error code.
|
||||||
|
|
||||||
The application must not modify the returned string. Future calls to
|
The application must not modify the returned string. Future calls to
|
||||||
this function may invalidate the previously returned string. If file is
|
this function may invalidate the previously returned string. If file is
|
||||||
|
|
@ -1670,7 +1671,7 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
||||||
|
|
||||||
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Clears the error and end-of-file flags for file. This is analogous to the
|
Clear the error and end-of-file flags for file. This is analogous to the
|
||||||
clearerr() function in stdio. This is useful for continuing to read a gzip
|
clearerr() function in stdio. This is useful for continuing to read a gzip
|
||||||
file that is being written concurrently.
|
file that is being written concurrently.
|
||||||
*/
|
*/
|
||||||
|
|
@ -1688,8 +1689,9 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
||||||
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
|
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
|
||||||
/*
|
/*
|
||||||
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
||||||
return the updated checksum. If buf is Z_NULL, this function returns the
|
return the updated checksum. An Adler-32 value is in the range of a 32-bit
|
||||||
required initial value for the checksum.
|
unsigned integer. If buf is Z_NULL, this function returns the required
|
||||||
|
initial value for the checksum.
|
||||||
|
|
||||||
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
|
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
|
||||||
much faster.
|
much faster.
|
||||||
|
|
@ -1725,9 +1727,10 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
|
||||||
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||||
/*
|
/*
|
||||||
Update a running CRC-32 with the bytes buf[0..len-1] and return the
|
Update a running CRC-32 with the bytes buf[0..len-1] and return the
|
||||||
updated CRC-32. If buf is Z_NULL, this function returns the required
|
updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer.
|
||||||
initial value for the crc. Pre- and post-conditioning (one's complement) is
|
If buf is Z_NULL, this function returns the required initial value for the
|
||||||
performed within this function so it shouldn't be done by the application.
|
crc. Pre- and post-conditioning (one's complement) is performed within this
|
||||||
|
function so it shouldn't be done by the application.
|
||||||
|
|
||||||
Usage example:
|
Usage example:
|
||||||
|
|
||||||
|
|
@ -1739,7 +1742,7 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||||
if (crc != original_crc) error();
|
if (crc != original_crc) error();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf,
|
ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
|
||||||
z_size_t len));
|
z_size_t len));
|
||||||
/*
|
/*
|
||||||
Same as crc32(), but with a size_t length.
|
Same as crc32(), but with a size_t length.
|
||||||
|
|
@ -1755,6 +1758,20 @@ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
|
||||||
len2.
|
len2.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2));
|
||||||
|
|
||||||
|
Return the operator corresponding to length len2, to be used with
|
||||||
|
crc32_combine_op().
|
||||||
|
*/
|
||||||
|
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op));
|
||||||
|
/*
|
||||||
|
Give the same result as crc32_combine(), using op in place of len2. op is
|
||||||
|
is generated from len2 by crc32_combine_gen(). This will be faster than
|
||||||
|
crc32_combine() if the generated op is used more than once.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* various hacks, don't look :) */
|
/* various hacks, don't look :) */
|
||||||
|
|
||||||
|
|
@ -1842,6 +1859,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
|
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
|
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
|
||||||
|
|
@ -1852,6 +1870,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
# define z_gzoffset z_gzoffset64
|
# define z_gzoffset z_gzoffset64
|
||||||
# define z_adler32_combine z_adler32_combine64
|
# define z_adler32_combine z_adler32_combine64
|
||||||
# define z_crc32_combine z_crc32_combine64
|
# define z_crc32_combine z_crc32_combine64
|
||||||
|
# define z_crc32_combine_gen z_crc32_combine_gen64
|
||||||
# else
|
# else
|
||||||
# define gzopen gzopen64
|
# define gzopen gzopen64
|
||||||
# define gzseek gzseek64
|
# define gzseek gzseek64
|
||||||
|
|
@ -1859,6 +1878,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
# define gzoffset gzoffset64
|
# define gzoffset gzoffset64
|
||||||
# define adler32_combine adler32_combine64
|
# define adler32_combine adler32_combine64
|
||||||
# define crc32_combine crc32_combine64
|
# define crc32_combine crc32_combine64
|
||||||
|
# define crc32_combine_gen crc32_combine_gen64
|
||||||
# endif
|
# endif
|
||||||
# ifndef Z_LARGE64
|
# ifndef Z_LARGE64
|
||||||
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
||||||
|
|
@ -1867,6 +1887,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
|
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
|
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
|
||||||
|
|
@ -1875,12 +1896,14 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
|
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* Z_SOLO */
|
#else /* Z_SOLO */
|
||||||
|
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||||
|
|
||||||
#endif /* !Z_SOLO */
|
#endif /* !Z_SOLO */
|
||||||
|
|
||||||
|
|
@ -1893,7 +1916,7 @@ ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int));
|
||||||
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
|
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
|
||||||
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
||||||
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
||||||
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO)
|
#if defined(_WIN32) && !defined(Z_SOLO)
|
||||||
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
||||||
const char *mode));
|
const char *mode));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,7 +1,7 @@
|
||||||
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
||||||
version 1.2.11, January 15th, 2017
|
version 1.2.12, March 11th, 2022
|
||||||
|
|
||||||
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
|
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|
@ -37,11 +37,11 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ZLIB_VERSION "1.2.11"
|
#define ZLIB_VERSION "1.2.12"
|
||||||
#define ZLIB_VERNUM 0x12b0
|
#define ZLIB_VERNUM 0x12c0
|
||||||
#define ZLIB_VER_MAJOR 1
|
#define ZLIB_VER_MAJOR 1
|
||||||
#define ZLIB_VER_MINOR 2
|
#define ZLIB_VER_MINOR 2
|
||||||
#define ZLIB_VER_REVISION 11
|
#define ZLIB_VER_REVISION 12
|
||||||
#define ZLIB_VER_SUBREVISION 0
|
#define ZLIB_VER_SUBREVISION 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -543,8 +543,7 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
|
||||||
int strategy));
|
int strategy));
|
||||||
|
|
||||||
This is another version of deflateInit with more compression options. The
|
This is another version of deflateInit with more compression options. The
|
||||||
fields next_in, zalloc, zfree and opaque must be initialized before by the
|
fields zalloc, zfree and opaque must be initialized before by the caller.
|
||||||
caller.
|
|
||||||
|
|
||||||
The method parameter is the compression method. It must be Z_DEFLATED in
|
The method parameter is the compression method. It must be Z_DEFLATED in
|
||||||
this version of the library.
|
this version of the library.
|
||||||
|
|
@ -712,11 +711,12 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
|
||||||
used to switch between compression and straight copy of the input data, or
|
used to switch between compression and straight copy of the input data, or
|
||||||
to switch to a different kind of input data requiring a different strategy.
|
to switch to a different kind of input data requiring a different strategy.
|
||||||
If the compression approach (which is a function of the level) or the
|
If the compression approach (which is a function of the level) or the
|
||||||
strategy is changed, and if any input has been consumed in a previous
|
strategy is changed, and if there have been any deflate() calls since the
|
||||||
deflate() call, then the input available so far is compressed with the old
|
state was initialized or reset, then the input available so far is
|
||||||
level and strategy using deflate(strm, Z_BLOCK). There are three approaches
|
compressed with the old level and strategy using deflate(strm, Z_BLOCK).
|
||||||
for the compression levels 0, 1..3, and 4..9 respectively. The new level
|
There are three approaches for the compression levels 0, 1..3, and 4..9
|
||||||
and strategy will take effect at the next call of deflate().
|
respectively. The new level and strategy will take effect at the next call
|
||||||
|
of deflate().
|
||||||
|
|
||||||
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
|
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
|
||||||
not have enough output space to complete, then the parameter change will not
|
not have enough output space to complete, then the parameter change will not
|
||||||
|
|
@ -865,9 +865,11 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
|
||||||
detection, or add 16 to decode only the gzip format (the zlib format will
|
detection, or add 16 to decode only the gzip format (the zlib format will
|
||||||
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
|
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
|
||||||
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
|
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
|
||||||
below), inflate() will not automatically decode concatenated gzip streams.
|
below), inflate() will *not* automatically decode concatenated gzip members.
|
||||||
inflate() will return Z_STREAM_END at the end of the gzip stream. The state
|
inflate() will return Z_STREAM_END at the end of the gzip member. The state
|
||||||
would need to be reset to continue decoding a subsequent gzip stream.
|
would need to be reset to continue decoding a subsequent gzip member. This
|
||||||
|
*must* be done if there is more data after a gzip member, in order for the
|
||||||
|
decompression to be compliant with the gzip standard (RFC 1952).
|
||||||
|
|
||||||
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
inflateInit2 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
|
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
|
||||||
|
|
@ -1302,14 +1304,14 @@ typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
|
||||||
/*
|
/*
|
||||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
||||||
|
|
||||||
Opens a gzip (.gz) file for reading or writing. The mode parameter is as
|
Open the gzip (.gz) file at path for reading and decompressing, or
|
||||||
in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
|
compressing and writing. The mode parameter is as in fopen ("rb" or "wb")
|
||||||
a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
|
but can also include a compression level ("wb9") or a strategy: 'f' for
|
||||||
compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
|
filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h",
|
||||||
for fixed code compression as in "wb9F". (See the description of
|
'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression
|
||||||
deflateInit2 for more information about the strategy parameter.) 'T' will
|
as in "wb9F". (See the description of deflateInit2 for more information
|
||||||
request transparent writing or appending with no compression and not using
|
about the strategy parameter.) 'T' will request transparent writing or
|
||||||
the gzip format.
|
appending with no compression and not using the gzip format.
|
||||||
|
|
||||||
"a" can be used instead of "w" to request that the gzip stream that will
|
"a" can be used instead of "w" to request that the gzip stream that will
|
||||||
be written be appended to the file. "+" will result in an error, since
|
be written be appended to the file. "+" will result in an error, since
|
||||||
|
|
@ -1339,9 +1341,9 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
||||||
|
|
||||||
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
||||||
/*
|
/*
|
||||||
gzdopen associates a gzFile with the file descriptor fd. File descriptors
|
Associate a gzFile with the file descriptor fd. File descriptors are
|
||||||
are obtained from calls like open, dup, creat, pipe or fileno (if the file
|
obtained from calls like open, dup, creat, pipe or fileno (if the file has
|
||||||
has been previously opened with fopen). The mode parameter is as in gzopen.
|
been previously opened with fopen). The mode parameter is as in gzopen.
|
||||||
|
|
||||||
The next call of gzclose on the returned gzFile will also close the file
|
The next call of gzclose on the returned gzFile will also close the file
|
||||||
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
|
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
|
||||||
|
|
@ -1362,13 +1364,13 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
||||||
/*
|
/*
|
||||||
Set the internal buffer size used by this library's functions. The
|
Set the internal buffer size used by this library's functions for file to
|
||||||
default buffer size is 8192 bytes. This function must be called after
|
size. The default buffer size is 8192 bytes. This function must be called
|
||||||
gzopen() or gzdopen(), and before any other calls that read or write the
|
after gzopen() or gzdopen(), and before any other calls that read or write
|
||||||
file. The buffer memory allocation is always deferred to the first read or
|
the file. The buffer memory allocation is always deferred to the first read
|
||||||
write. Three times that size in buffer space is allocated. A larger buffer
|
or write. Three times that size in buffer space is allocated. A larger
|
||||||
size of, for example, 64K or 128K bytes will noticeably increase the speed
|
buffer size of, for example, 64K or 128K bytes will noticeably increase the
|
||||||
of decompression (reading).
|
speed of decompression (reading).
|
||||||
|
|
||||||
The new buffer size also affects the maximum length for gzprintf().
|
The new buffer size also affects the maximum length for gzprintf().
|
||||||
|
|
||||||
|
|
@ -1378,9 +1380,9 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
||||||
/*
|
/*
|
||||||
Dynamically update the compression level or strategy. See the description
|
Dynamically update the compression level and strategy for file. See the
|
||||||
of deflateInit2 for the meaning of these parameters. Previously provided
|
description of deflateInit2 for the meaning of these parameters. Previously
|
||||||
data is flushed before the parameter change.
|
provided data is flushed before applying the parameter changes.
|
||||||
|
|
||||||
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
|
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
|
||||||
opened for writing, Z_ERRNO if there is an error writing the flushed data,
|
opened for writing, Z_ERRNO if there is an error writing the flushed data,
|
||||||
|
|
@ -1389,7 +1391,7 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
||||||
/*
|
/*
|
||||||
Reads the given number of uncompressed bytes from the compressed file. If
|
Read and decompress up to len uncompressed bytes from file into buf. If
|
||||||
the input file is not in gzip format, gzread copies the given number of
|
the input file is not in gzip format, gzread copies the given number of
|
||||||
bytes into the buffer directly from the file.
|
bytes into the buffer directly from the file.
|
||||||
|
|
||||||
|
|
@ -1420,11 +1422,11 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
||||||
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
||||||
gzFile file));
|
gzFile file));
|
||||||
/*
|
/*
|
||||||
Read up to nitems items of size size from file to buf, otherwise operating
|
Read and decompress up to nitems items of size size from file into buf,
|
||||||
as gzread() does. This duplicates the interface of stdio's fread(), with
|
otherwise operating as gzread() does. This duplicates the interface of
|
||||||
size_t request and return types. If the library defines size_t, then
|
stdio's fread(), with size_t request and return types. If the library
|
||||||
z_size_t is identical to size_t. If not, then z_size_t is an unsigned
|
defines size_t, then z_size_t is identical to size_t. If not, then z_size_t
|
||||||
integer type that can contain a pointer.
|
is an unsigned integer type that can contain a pointer.
|
||||||
|
|
||||||
gzfread() returns the number of full items read of size size, or zero if
|
gzfread() returns the number of full items read of size size, or zero if
|
||||||
the end of the file was reached and a full item could not be read, or if
|
the end of the file was reached and a full item could not be read, or if
|
||||||
|
|
@ -1443,18 +1445,16 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
||||||
file, reseting and retrying on end-of-file, when size is not 1.
|
file, reseting and retrying on end-of-file, when size is not 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
|
ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len));
|
||||||
voidpc buf, unsigned len));
|
|
||||||
/*
|
/*
|
||||||
Writes the given number of uncompressed bytes into the compressed file.
|
Compress and write the len uncompressed bytes at buf to file. gzwrite
|
||||||
gzwrite returns the number of uncompressed bytes written or 0 in case of
|
returns the number of uncompressed bytes written or 0 in case of error.
|
||||||
error.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
||||||
z_size_t nitems, gzFile file));
|
z_size_t nitems, gzFile file));
|
||||||
/*
|
/*
|
||||||
gzfwrite() writes nitems items of size size from buf to file, duplicating
|
Compress and write nitems items of size size from buf to file, duplicating
|
||||||
the interface of stdio's fwrite(), with size_t request and return types. If
|
the interface of stdio's fwrite(), with size_t request and return types. If
|
||||||
the library defines size_t, then z_size_t is identical to size_t. If not,
|
the library defines size_t, then z_size_t is identical to size_t. If not,
|
||||||
then z_size_t is an unsigned integer type that can contain a pointer.
|
then z_size_t is an unsigned integer type that can contain a pointer.
|
||||||
|
|
@ -1467,22 +1467,22 @@ ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
||||||
|
|
||||||
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
|
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
|
||||||
/*
|
/*
|
||||||
Converts, formats, and writes the arguments to the compressed file under
|
Convert, format, compress, and write the arguments (...) to file under
|
||||||
control of the format string, as in fprintf. gzprintf returns the number of
|
control of the string format, as in fprintf. gzprintf returns the number of
|
||||||
uncompressed bytes actually written, or a negative zlib error code in case
|
uncompressed bytes actually written, or a negative zlib error code in case
|
||||||
of error. The number of uncompressed bytes written is limited to 8191, or
|
of error. The number of uncompressed bytes written is limited to 8191, or
|
||||||
one less than the buffer size given to gzbuffer(). The caller should assure
|
one less than the buffer size given to gzbuffer(). The caller should assure
|
||||||
that this limit is not exceeded. If it is exceeded, then gzprintf() will
|
that this limit is not exceeded. If it is exceeded, then gzprintf() will
|
||||||
return an error (0) with nothing written. In this case, there may also be a
|
return an error (0) with nothing written. In this case, there may also be a
|
||||||
buffer overflow with unpredictable consequences, which is possible only if
|
buffer overflow with unpredictable consequences, which is possible only if
|
||||||
zlib was compiled with the insecure functions sprintf() or vsprintf()
|
zlib was compiled with the insecure functions sprintf() or vsprintf(),
|
||||||
because the secure snprintf() or vsnprintf() functions were not available.
|
because the secure snprintf() or vsnprintf() functions were not available.
|
||||||
This can be determined using zlibCompileFlags().
|
This can be determined using zlibCompileFlags().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
||||||
/*
|
/*
|
||||||
Writes the given null-terminated string to the compressed file, excluding
|
Compress and write the given null-terminated string s to file, excluding
|
||||||
the terminating null character.
|
the terminating null character.
|
||||||
|
|
||||||
gzputs returns the number of characters written, or -1 in case of error.
|
gzputs returns the number of characters written, or -1 in case of error.
|
||||||
|
|
@ -1490,11 +1490,12 @@ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
||||||
|
|
||||||
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
||||||
/*
|
/*
|
||||||
Reads bytes from the compressed file until len-1 characters are read, or a
|
Read and decompress bytes from file into buf, until len-1 characters are
|
||||||
newline character is read and transferred to buf, or an end-of-file
|
read, or until a newline character is read and transferred to buf, or an
|
||||||
condition is encountered. If any characters are read or if len == 1, the
|
end-of-file condition is encountered. If any characters are read or if len
|
||||||
string is terminated with a null character. If no characters are read due
|
is one, the string is terminated with a null character. If no characters
|
||||||
to an end-of-file or len < 1, then the buffer is left untouched.
|
are read due to an end-of-file or len is less than one, then the buffer is
|
||||||
|
left untouched.
|
||||||
|
|
||||||
gzgets returns buf which is a null-terminated string, or it returns NULL
|
gzgets returns buf which is a null-terminated string, or it returns NULL
|
||||||
for end-of-file or in case of error. If there was an error, the contents at
|
for end-of-file or in case of error. If there was an error, the contents at
|
||||||
|
|
@ -1503,13 +1504,13 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
||||||
/*
|
/*
|
||||||
Writes c, converted to an unsigned char, into the compressed file. gzputc
|
Compress and write c, converted to an unsigned char, into file. gzputc
|
||||||
returns the value that was written, or -1 in case of error.
|
returns the value that was written, or -1 in case of error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Reads one byte from the compressed file. gzgetc returns this byte or -1
|
Read and decompress one byte from file. gzgetc returns this byte or -1
|
||||||
in case of end of file or error. This is implemented as a macro for speed.
|
in case of end of file or error. This is implemented as a macro for speed.
|
||||||
As such, it does not do all of the checking the other functions do. I.e.
|
As such, it does not do all of the checking the other functions do. I.e.
|
||||||
it does not check to see if file is NULL, nor whether the structure file
|
it does not check to see if file is NULL, nor whether the structure file
|
||||||
|
|
@ -1518,8 +1519,8 @@ ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
||||||
/*
|
/*
|
||||||
Push one character back onto the stream to be read as the first character
|
Push c back onto the stream for file to be read as the first character on
|
||||||
on the next read. At least one character of push-back is allowed.
|
the next read. At least one character of push-back is always allowed.
|
||||||
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
|
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
|
||||||
fail if c is -1, and may fail if a character has been pushed but not read
|
fail if c is -1, and may fail if a character has been pushed but not read
|
||||||
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
|
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
|
||||||
|
|
@ -1530,9 +1531,9 @@ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
||||||
/*
|
/*
|
||||||
Flushes all pending output into the compressed file. The parameter flush
|
Flush all pending output to file. The parameter flush is as in the
|
||||||
is as in the deflate() function. The return value is the zlib error number
|
deflate() function. The return value is the zlib error number (see function
|
||||||
(see function gzerror below). gzflush is only permitted when writing.
|
gzerror below). gzflush is only permitted when writing.
|
||||||
|
|
||||||
If the flush parameter is Z_FINISH, the remaining data is written and the
|
If the flush parameter is Z_FINISH, the remaining data is written and the
|
||||||
gzip stream is completed in the output. If gzwrite() is called again, a new
|
gzip stream is completed in the output. If gzwrite() is called again, a new
|
||||||
|
|
@ -1547,8 +1548,8 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
||||||
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
||||||
z_off_t offset, int whence));
|
z_off_t offset, int whence));
|
||||||
|
|
||||||
Sets the starting position for the next gzread or gzwrite on the given
|
Set the starting position to offset relative to whence for the next gzread
|
||||||
compressed file. The offset represents a number of bytes in the
|
or gzwrite on file. The offset represents a number of bytes in the
|
||||||
uncompressed data stream. The whence parameter is defined as in lseek(2);
|
uncompressed data stream. The whence parameter is defined as in lseek(2);
|
||||||
the value SEEK_END is not supported.
|
the value SEEK_END is not supported.
|
||||||
|
|
||||||
|
|
@ -1565,18 +1566,18 @@ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
|
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Rewinds the given file. This function is supported only for reading.
|
Rewind file. This function is supported only for reading.
|
||||||
|
|
||||||
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
|
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
||||||
|
|
||||||
Returns the starting position for the next gzread or gzwrite on the given
|
Return the starting position for the next gzread or gzwrite on file.
|
||||||
compressed file. This position represents a number of bytes in the
|
This position represents a number of bytes in the uncompressed data stream,
|
||||||
uncompressed data stream, and is zero when starting, even if appending or
|
and is zero when starting, even if appending or reading a gzip stream from
|
||||||
reading a gzip stream from the middle of a file using gzdopen().
|
the middle of a file using gzdopen().
|
||||||
|
|
||||||
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
|
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
|
||||||
*/
|
*/
|
||||||
|
|
@ -1584,22 +1585,22 @@ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
||||||
|
|
||||||
Returns the current offset in the file being read or written. This offset
|
Return the current compressed (actual) read or write offset of file. This
|
||||||
includes the count of bytes that precede the gzip stream, for example when
|
offset includes the count of bytes that precede the gzip stream, for example
|
||||||
appending or when using gzdopen() for reading. When reading, the offset
|
when appending or when using gzdopen() for reading. When reading, the
|
||||||
does not include as yet unused buffered input. This information can be used
|
offset does not include as yet unused buffered input. This information can
|
||||||
for a progress indicator. On error, gzoffset() returns -1.
|
be used for a progress indicator. On error, gzoffset() returns -1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Returns true (1) if the end-of-file indicator has been set while reading,
|
Return true (1) if the end-of-file indicator for file has been set while
|
||||||
false (0) otherwise. Note that the end-of-file indicator is set only if the
|
reading, false (0) otherwise. Note that the end-of-file indicator is set
|
||||||
read tried to go past the end of the input, but came up short. Therefore,
|
only if the read tried to go past the end of the input, but came up short.
|
||||||
just like feof(), gzeof() may return false even if there is no more data to
|
Therefore, just like feof(), gzeof() may return false even if there is no
|
||||||
read, in the event that the last read request was for the exact number of
|
more data to read, in the event that the last read request was for the exact
|
||||||
bytes remaining in the input file. This will happen if the input file size
|
number of bytes remaining in the input file. This will happen if the input
|
||||||
is an exact multiple of the buffer size.
|
file size is an exact multiple of the buffer size.
|
||||||
|
|
||||||
If gzeof() returns true, then the read functions will return no more data,
|
If gzeof() returns true, then the read functions will return no more data,
|
||||||
unless the end-of-file indicator is reset by gzclearerr() and the input file
|
unless the end-of-file indicator is reset by gzclearerr() and the input file
|
||||||
|
|
@ -1608,7 +1609,7 @@ ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Returns true (1) if file is being copied directly while reading, or false
|
Return true (1) if file is being copied directly while reading, or false
|
||||||
(0) if file is a gzip stream being decompressed.
|
(0) if file is a gzip stream being decompressed.
|
||||||
|
|
||||||
If the input file is empty, gzdirect() will return true, since the input
|
If the input file is empty, gzdirect() will return true, since the input
|
||||||
|
|
@ -1629,8 +1630,8 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Flushes all pending output if necessary, closes the compressed file and
|
Flush all pending output for file, if necessary, close file and
|
||||||
deallocates the (de)compression state. Note that once file is closed, you
|
deallocate the (de)compression state. Note that once file is closed, you
|
||||||
cannot call gzerror with file, since its structures have been deallocated.
|
cannot call gzerror with file, since its structures have been deallocated.
|
||||||
gzclose must not be called more than once on the same file, just as free
|
gzclose must not be called more than once on the same file, just as free
|
||||||
must not be called more than once on the same allocation.
|
must not be called more than once on the same allocation.
|
||||||
|
|
@ -1654,10 +1655,10 @@ ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
||||||
/*
|
/*
|
||||||
Returns the error message for the last error which occurred on the given
|
Return the error message for the last error which occurred on file.
|
||||||
compressed file. errnum is set to zlib error number. If an error occurred
|
errnum is set to zlib error number. If an error occurred in the file system
|
||||||
in the file system and not in the compression library, errnum is set to
|
and not in the compression library, errnum is set to Z_ERRNO and the
|
||||||
Z_ERRNO and the application may consult errno to get the exact error code.
|
application may consult errno to get the exact error code.
|
||||||
|
|
||||||
The application must not modify the returned string. Future calls to
|
The application must not modify the returned string. Future calls to
|
||||||
this function may invalidate the previously returned string. If file is
|
this function may invalidate the previously returned string. If file is
|
||||||
|
|
@ -1670,7 +1671,7 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
||||||
|
|
||||||
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Clears the error and end-of-file flags for file. This is analogous to the
|
Clear the error and end-of-file flags for file. This is analogous to the
|
||||||
clearerr() function in stdio. This is useful for continuing to read a gzip
|
clearerr() function in stdio. This is useful for continuing to read a gzip
|
||||||
file that is being written concurrently.
|
file that is being written concurrently.
|
||||||
*/
|
*/
|
||||||
|
|
@ -1688,8 +1689,9 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
||||||
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
|
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
|
||||||
/*
|
/*
|
||||||
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
||||||
return the updated checksum. If buf is Z_NULL, this function returns the
|
return the updated checksum. An Adler-32 value is in the range of a 32-bit
|
||||||
required initial value for the checksum.
|
unsigned integer. If buf is Z_NULL, this function returns the required
|
||||||
|
initial value for the checksum.
|
||||||
|
|
||||||
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
|
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
|
||||||
much faster.
|
much faster.
|
||||||
|
|
@ -1725,9 +1727,10 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
|
||||||
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||||
/*
|
/*
|
||||||
Update a running CRC-32 with the bytes buf[0..len-1] and return the
|
Update a running CRC-32 with the bytes buf[0..len-1] and return the
|
||||||
updated CRC-32. If buf is Z_NULL, this function returns the required
|
updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer.
|
||||||
initial value for the crc. Pre- and post-conditioning (one's complement) is
|
If buf is Z_NULL, this function returns the required initial value for the
|
||||||
performed within this function so it shouldn't be done by the application.
|
crc. Pre- and post-conditioning (one's complement) is performed within this
|
||||||
|
function so it shouldn't be done by the application.
|
||||||
|
|
||||||
Usage example:
|
Usage example:
|
||||||
|
|
||||||
|
|
@ -1739,7 +1742,7 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||||
if (crc != original_crc) error();
|
if (crc != original_crc) error();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf,
|
ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
|
||||||
z_size_t len));
|
z_size_t len));
|
||||||
/*
|
/*
|
||||||
Same as crc32(), but with a size_t length.
|
Same as crc32(), but with a size_t length.
|
||||||
|
|
@ -1755,6 +1758,20 @@ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
|
||||||
len2.
|
len2.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2));
|
||||||
|
|
||||||
|
Return the operator corresponding to length len2, to be used with
|
||||||
|
crc32_combine_op().
|
||||||
|
*/
|
||||||
|
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op));
|
||||||
|
/*
|
||||||
|
Give the same result as crc32_combine(), using op in place of len2. op is
|
||||||
|
is generated from len2 by crc32_combine_gen(). This will be faster than
|
||||||
|
crc32_combine() if the generated op is used more than once.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* various hacks, don't look :) */
|
/* various hacks, don't look :) */
|
||||||
|
|
||||||
|
|
@ -1842,6 +1859,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
|
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
|
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
|
||||||
|
|
@ -1852,6 +1870,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
# define z_gzoffset z_gzoffset64
|
# define z_gzoffset z_gzoffset64
|
||||||
# define z_adler32_combine z_adler32_combine64
|
# define z_adler32_combine z_adler32_combine64
|
||||||
# define z_crc32_combine z_crc32_combine64
|
# define z_crc32_combine z_crc32_combine64
|
||||||
|
# define z_crc32_combine_gen z_crc32_combine_gen64
|
||||||
# else
|
# else
|
||||||
# define gzopen gzopen64
|
# define gzopen gzopen64
|
||||||
# define gzseek gzseek64
|
# define gzseek gzseek64
|
||||||
|
|
@ -1859,6 +1878,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
# define gzoffset gzoffset64
|
# define gzoffset gzoffset64
|
||||||
# define adler32_combine adler32_combine64
|
# define adler32_combine adler32_combine64
|
||||||
# define crc32_combine crc32_combine64
|
# define crc32_combine crc32_combine64
|
||||||
|
# define crc32_combine_gen crc32_combine_gen64
|
||||||
# endif
|
# endif
|
||||||
# ifndef Z_LARGE64
|
# ifndef Z_LARGE64
|
||||||
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
||||||
|
|
@ -1867,6 +1887,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
|
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
|
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
|
||||||
|
|
@ -1875,12 +1896,14 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
|
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* Z_SOLO */
|
#else /* Z_SOLO */
|
||||||
|
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||||
|
|
||||||
#endif /* !Z_SOLO */
|
#endif /* !Z_SOLO */
|
||||||
|
|
||||||
|
|
@ -1893,7 +1916,7 @@ ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int));
|
||||||
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
|
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
|
||||||
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
||||||
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
||||||
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO)
|
#if defined(_WIN32) && !defined(Z_SOLO)
|
||||||
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
||||||
const char *mode));
|
const char *mode));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +0,0 @@
|
||||||
libz.so.1
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
libz.so.1.2.11
|
|
||||||
Binary file not shown.
|
|
@ -47,10 +47,11 @@ freetype2
|
||||||
|
|
||||||
libz
|
libz
|
||||||
mac: 1.2.11
|
mac: 1.2.11
|
||||||
win32: 1.2.11
|
win32: --
|
||||||
ios: --
|
ios: --
|
||||||
android: 1.2.11
|
android: 1.2.12
|
||||||
win64: 1.2.11
|
win64: 1.2.12
|
||||||
|
linux: 1.2.12
|
||||||
|
|
||||||
spidermonkey
|
spidermonkey
|
||||||
mac: v52
|
mac: v52
|
||||||
|
|
|
||||||
|
|
@ -434,19 +434,11 @@ typedef uLong FAR uLongf;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
|
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
|
||||||
# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1
|
|
||||||
# define Z_HAVE_UNISTD_H
|
# define Z_HAVE_UNISTD_H
|
||||||
# elif HAVE_UNISTD_H != 0
|
|
||||||
# define Z_HAVE_UNISTD_H
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
|
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
|
||||||
# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1
|
|
||||||
# define Z_HAVE_STDARG_H
|
# define Z_HAVE_STDARG_H
|
||||||
# elif HAVE_STDARG_H != 0
|
|
||||||
# define Z_HAVE_STDARG_H
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef STDC
|
#ifdef STDC
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
||||||
version 1.2.11, January 15th, 2017
|
version 1.2.12, March 11th, 2022
|
||||||
|
|
||||||
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
|
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|
@ -37,11 +37,11 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ZLIB_VERSION "1.2.11"
|
#define ZLIB_VERSION "1.2.12"
|
||||||
#define ZLIB_VERNUM 0x12b0
|
#define ZLIB_VERNUM 0x12c0
|
||||||
#define ZLIB_VER_MAJOR 1
|
#define ZLIB_VER_MAJOR 1
|
||||||
#define ZLIB_VER_MINOR 2
|
#define ZLIB_VER_MINOR 2
|
||||||
#define ZLIB_VER_REVISION 11
|
#define ZLIB_VER_REVISION 12
|
||||||
#define ZLIB_VER_SUBREVISION 0
|
#define ZLIB_VER_SUBREVISION 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -543,8 +543,7 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
|
||||||
int strategy));
|
int strategy));
|
||||||
|
|
||||||
This is another version of deflateInit with more compression options. The
|
This is another version of deflateInit with more compression options. The
|
||||||
fields next_in, zalloc, zfree and opaque must be initialized before by the
|
fields zalloc, zfree and opaque must be initialized before by the caller.
|
||||||
caller.
|
|
||||||
|
|
||||||
The method parameter is the compression method. It must be Z_DEFLATED in
|
The method parameter is the compression method. It must be Z_DEFLATED in
|
||||||
this version of the library.
|
this version of the library.
|
||||||
|
|
@ -712,11 +711,12 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
|
||||||
used to switch between compression and straight copy of the input data, or
|
used to switch between compression and straight copy of the input data, or
|
||||||
to switch to a different kind of input data requiring a different strategy.
|
to switch to a different kind of input data requiring a different strategy.
|
||||||
If the compression approach (which is a function of the level) or the
|
If the compression approach (which is a function of the level) or the
|
||||||
strategy is changed, and if any input has been consumed in a previous
|
strategy is changed, and if there have been any deflate() calls since the
|
||||||
deflate() call, then the input available so far is compressed with the old
|
state was initialized or reset, then the input available so far is
|
||||||
level and strategy using deflate(strm, Z_BLOCK). There are three approaches
|
compressed with the old level and strategy using deflate(strm, Z_BLOCK).
|
||||||
for the compression levels 0, 1..3, and 4..9 respectively. The new level
|
There are three approaches for the compression levels 0, 1..3, and 4..9
|
||||||
and strategy will take effect at the next call of deflate().
|
respectively. The new level and strategy will take effect at the next call
|
||||||
|
of deflate().
|
||||||
|
|
||||||
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
|
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
|
||||||
not have enough output space to complete, then the parameter change will not
|
not have enough output space to complete, then the parameter change will not
|
||||||
|
|
@ -865,9 +865,11 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
|
||||||
detection, or add 16 to decode only the gzip format (the zlib format will
|
detection, or add 16 to decode only the gzip format (the zlib format will
|
||||||
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
|
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
|
||||||
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
|
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
|
||||||
below), inflate() will not automatically decode concatenated gzip streams.
|
below), inflate() will *not* automatically decode concatenated gzip members.
|
||||||
inflate() will return Z_STREAM_END at the end of the gzip stream. The state
|
inflate() will return Z_STREAM_END at the end of the gzip member. The state
|
||||||
would need to be reset to continue decoding a subsequent gzip stream.
|
would need to be reset to continue decoding a subsequent gzip member. This
|
||||||
|
*must* be done if there is more data after a gzip member, in order for the
|
||||||
|
decompression to be compliant with the gzip standard (RFC 1952).
|
||||||
|
|
||||||
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
inflateInit2 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
|
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
|
||||||
|
|
@ -1302,14 +1304,14 @@ typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
|
||||||
/*
|
/*
|
||||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
||||||
|
|
||||||
Opens a gzip (.gz) file for reading or writing. The mode parameter is as
|
Open the gzip (.gz) file at path for reading and decompressing, or
|
||||||
in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
|
compressing and writing. The mode parameter is as in fopen ("rb" or "wb")
|
||||||
a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
|
but can also include a compression level ("wb9") or a strategy: 'f' for
|
||||||
compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
|
filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h",
|
||||||
for fixed code compression as in "wb9F". (See the description of
|
'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression
|
||||||
deflateInit2 for more information about the strategy parameter.) 'T' will
|
as in "wb9F". (See the description of deflateInit2 for more information
|
||||||
request transparent writing or appending with no compression and not using
|
about the strategy parameter.) 'T' will request transparent writing or
|
||||||
the gzip format.
|
appending with no compression and not using the gzip format.
|
||||||
|
|
||||||
"a" can be used instead of "w" to request that the gzip stream that will
|
"a" can be used instead of "w" to request that the gzip stream that will
|
||||||
be written be appended to the file. "+" will result in an error, since
|
be written be appended to the file. "+" will result in an error, since
|
||||||
|
|
@ -1339,9 +1341,9 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
||||||
|
|
||||||
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
||||||
/*
|
/*
|
||||||
gzdopen associates a gzFile with the file descriptor fd. File descriptors
|
Associate a gzFile with the file descriptor fd. File descriptors are
|
||||||
are obtained from calls like open, dup, creat, pipe or fileno (if the file
|
obtained from calls like open, dup, creat, pipe or fileno (if the file has
|
||||||
has been previously opened with fopen). The mode parameter is as in gzopen.
|
been previously opened with fopen). The mode parameter is as in gzopen.
|
||||||
|
|
||||||
The next call of gzclose on the returned gzFile will also close the file
|
The next call of gzclose on the returned gzFile will also close the file
|
||||||
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
|
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
|
||||||
|
|
@ -1362,13 +1364,13 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
||||||
/*
|
/*
|
||||||
Set the internal buffer size used by this library's functions. The
|
Set the internal buffer size used by this library's functions for file to
|
||||||
default buffer size is 8192 bytes. This function must be called after
|
size. The default buffer size is 8192 bytes. This function must be called
|
||||||
gzopen() or gzdopen(), and before any other calls that read or write the
|
after gzopen() or gzdopen(), and before any other calls that read or write
|
||||||
file. The buffer memory allocation is always deferred to the first read or
|
the file. The buffer memory allocation is always deferred to the first read
|
||||||
write. Three times that size in buffer space is allocated. A larger buffer
|
or write. Three times that size in buffer space is allocated. A larger
|
||||||
size of, for example, 64K or 128K bytes will noticeably increase the speed
|
buffer size of, for example, 64K or 128K bytes will noticeably increase the
|
||||||
of decompression (reading).
|
speed of decompression (reading).
|
||||||
|
|
||||||
The new buffer size also affects the maximum length for gzprintf().
|
The new buffer size also affects the maximum length for gzprintf().
|
||||||
|
|
||||||
|
|
@ -1378,9 +1380,9 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
||||||
/*
|
/*
|
||||||
Dynamically update the compression level or strategy. See the description
|
Dynamically update the compression level and strategy for file. See the
|
||||||
of deflateInit2 for the meaning of these parameters. Previously provided
|
description of deflateInit2 for the meaning of these parameters. Previously
|
||||||
data is flushed before the parameter change.
|
provided data is flushed before applying the parameter changes.
|
||||||
|
|
||||||
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
|
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
|
||||||
opened for writing, Z_ERRNO if there is an error writing the flushed data,
|
opened for writing, Z_ERRNO if there is an error writing the flushed data,
|
||||||
|
|
@ -1389,7 +1391,7 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
||||||
/*
|
/*
|
||||||
Reads the given number of uncompressed bytes from the compressed file. If
|
Read and decompress up to len uncompressed bytes from file into buf. If
|
||||||
the input file is not in gzip format, gzread copies the given number of
|
the input file is not in gzip format, gzread copies the given number of
|
||||||
bytes into the buffer directly from the file.
|
bytes into the buffer directly from the file.
|
||||||
|
|
||||||
|
|
@ -1420,11 +1422,11 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
||||||
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
||||||
gzFile file));
|
gzFile file));
|
||||||
/*
|
/*
|
||||||
Read up to nitems items of size size from file to buf, otherwise operating
|
Read and decompress up to nitems items of size size from file into buf,
|
||||||
as gzread() does. This duplicates the interface of stdio's fread(), with
|
otherwise operating as gzread() does. This duplicates the interface of
|
||||||
size_t request and return types. If the library defines size_t, then
|
stdio's fread(), with size_t request and return types. If the library
|
||||||
z_size_t is identical to size_t. If not, then z_size_t is an unsigned
|
defines size_t, then z_size_t is identical to size_t. If not, then z_size_t
|
||||||
integer type that can contain a pointer.
|
is an unsigned integer type that can contain a pointer.
|
||||||
|
|
||||||
gzfread() returns the number of full items read of size size, or zero if
|
gzfread() returns the number of full items read of size size, or zero if
|
||||||
the end of the file was reached and a full item could not be read, or if
|
the end of the file was reached and a full item could not be read, or if
|
||||||
|
|
@ -1443,18 +1445,16 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
||||||
file, reseting and retrying on end-of-file, when size is not 1.
|
file, reseting and retrying on end-of-file, when size is not 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
|
ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len));
|
||||||
voidpc buf, unsigned len));
|
|
||||||
/*
|
/*
|
||||||
Writes the given number of uncompressed bytes into the compressed file.
|
Compress and write the len uncompressed bytes at buf to file. gzwrite
|
||||||
gzwrite returns the number of uncompressed bytes written or 0 in case of
|
returns the number of uncompressed bytes written or 0 in case of error.
|
||||||
error.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
||||||
z_size_t nitems, gzFile file));
|
z_size_t nitems, gzFile file));
|
||||||
/*
|
/*
|
||||||
gzfwrite() writes nitems items of size size from buf to file, duplicating
|
Compress and write nitems items of size size from buf to file, duplicating
|
||||||
the interface of stdio's fwrite(), with size_t request and return types. If
|
the interface of stdio's fwrite(), with size_t request and return types. If
|
||||||
the library defines size_t, then z_size_t is identical to size_t. If not,
|
the library defines size_t, then z_size_t is identical to size_t. If not,
|
||||||
then z_size_t is an unsigned integer type that can contain a pointer.
|
then z_size_t is an unsigned integer type that can contain a pointer.
|
||||||
|
|
@ -1467,22 +1467,22 @@ ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
||||||
|
|
||||||
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
|
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
|
||||||
/*
|
/*
|
||||||
Converts, formats, and writes the arguments to the compressed file under
|
Convert, format, compress, and write the arguments (...) to file under
|
||||||
control of the format string, as in fprintf. gzprintf returns the number of
|
control of the string format, as in fprintf. gzprintf returns the number of
|
||||||
uncompressed bytes actually written, or a negative zlib error code in case
|
uncompressed bytes actually written, or a negative zlib error code in case
|
||||||
of error. The number of uncompressed bytes written is limited to 8191, or
|
of error. The number of uncompressed bytes written is limited to 8191, or
|
||||||
one less than the buffer size given to gzbuffer(). The caller should assure
|
one less than the buffer size given to gzbuffer(). The caller should assure
|
||||||
that this limit is not exceeded. If it is exceeded, then gzprintf() will
|
that this limit is not exceeded. If it is exceeded, then gzprintf() will
|
||||||
return an error (0) with nothing written. In this case, there may also be a
|
return an error (0) with nothing written. In this case, there may also be a
|
||||||
buffer overflow with unpredictable consequences, which is possible only if
|
buffer overflow with unpredictable consequences, which is possible only if
|
||||||
zlib was compiled with the insecure functions sprintf() or vsprintf()
|
zlib was compiled with the insecure functions sprintf() or vsprintf(),
|
||||||
because the secure snprintf() or vsnprintf() functions were not available.
|
because the secure snprintf() or vsnprintf() functions were not available.
|
||||||
This can be determined using zlibCompileFlags().
|
This can be determined using zlibCompileFlags().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
||||||
/*
|
/*
|
||||||
Writes the given null-terminated string to the compressed file, excluding
|
Compress and write the given null-terminated string s to file, excluding
|
||||||
the terminating null character.
|
the terminating null character.
|
||||||
|
|
||||||
gzputs returns the number of characters written, or -1 in case of error.
|
gzputs returns the number of characters written, or -1 in case of error.
|
||||||
|
|
@ -1490,11 +1490,12 @@ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
||||||
|
|
||||||
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
||||||
/*
|
/*
|
||||||
Reads bytes from the compressed file until len-1 characters are read, or a
|
Read and decompress bytes from file into buf, until len-1 characters are
|
||||||
newline character is read and transferred to buf, or an end-of-file
|
read, or until a newline character is read and transferred to buf, or an
|
||||||
condition is encountered. If any characters are read or if len == 1, the
|
end-of-file condition is encountered. If any characters are read or if len
|
||||||
string is terminated with a null character. If no characters are read due
|
is one, the string is terminated with a null character. If no characters
|
||||||
to an end-of-file or len < 1, then the buffer is left untouched.
|
are read due to an end-of-file or len is less than one, then the buffer is
|
||||||
|
left untouched.
|
||||||
|
|
||||||
gzgets returns buf which is a null-terminated string, or it returns NULL
|
gzgets returns buf which is a null-terminated string, or it returns NULL
|
||||||
for end-of-file or in case of error. If there was an error, the contents at
|
for end-of-file or in case of error. If there was an error, the contents at
|
||||||
|
|
@ -1503,13 +1504,13 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
||||||
/*
|
/*
|
||||||
Writes c, converted to an unsigned char, into the compressed file. gzputc
|
Compress and write c, converted to an unsigned char, into file. gzputc
|
||||||
returns the value that was written, or -1 in case of error.
|
returns the value that was written, or -1 in case of error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Reads one byte from the compressed file. gzgetc returns this byte or -1
|
Read and decompress one byte from file. gzgetc returns this byte or -1
|
||||||
in case of end of file or error. This is implemented as a macro for speed.
|
in case of end of file or error. This is implemented as a macro for speed.
|
||||||
As such, it does not do all of the checking the other functions do. I.e.
|
As such, it does not do all of the checking the other functions do. I.e.
|
||||||
it does not check to see if file is NULL, nor whether the structure file
|
it does not check to see if file is NULL, nor whether the structure file
|
||||||
|
|
@ -1518,8 +1519,8 @@ ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
||||||
/*
|
/*
|
||||||
Push one character back onto the stream to be read as the first character
|
Push c back onto the stream for file to be read as the first character on
|
||||||
on the next read. At least one character of push-back is allowed.
|
the next read. At least one character of push-back is always allowed.
|
||||||
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
|
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
|
||||||
fail if c is -1, and may fail if a character has been pushed but not read
|
fail if c is -1, and may fail if a character has been pushed but not read
|
||||||
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
|
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
|
||||||
|
|
@ -1530,9 +1531,9 @@ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
||||||
/*
|
/*
|
||||||
Flushes all pending output into the compressed file. The parameter flush
|
Flush all pending output to file. The parameter flush is as in the
|
||||||
is as in the deflate() function. The return value is the zlib error number
|
deflate() function. The return value is the zlib error number (see function
|
||||||
(see function gzerror below). gzflush is only permitted when writing.
|
gzerror below). gzflush is only permitted when writing.
|
||||||
|
|
||||||
If the flush parameter is Z_FINISH, the remaining data is written and the
|
If the flush parameter is Z_FINISH, the remaining data is written and the
|
||||||
gzip stream is completed in the output. If gzwrite() is called again, a new
|
gzip stream is completed in the output. If gzwrite() is called again, a new
|
||||||
|
|
@ -1547,8 +1548,8 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
||||||
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
||||||
z_off_t offset, int whence));
|
z_off_t offset, int whence));
|
||||||
|
|
||||||
Sets the starting position for the next gzread or gzwrite on the given
|
Set the starting position to offset relative to whence for the next gzread
|
||||||
compressed file. The offset represents a number of bytes in the
|
or gzwrite on file. The offset represents a number of bytes in the
|
||||||
uncompressed data stream. The whence parameter is defined as in lseek(2);
|
uncompressed data stream. The whence parameter is defined as in lseek(2);
|
||||||
the value SEEK_END is not supported.
|
the value SEEK_END is not supported.
|
||||||
|
|
||||||
|
|
@ -1565,18 +1566,18 @@ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
|
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Rewinds the given file. This function is supported only for reading.
|
Rewind file. This function is supported only for reading.
|
||||||
|
|
||||||
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
|
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
||||||
|
|
||||||
Returns the starting position for the next gzread or gzwrite on the given
|
Return the starting position for the next gzread or gzwrite on file.
|
||||||
compressed file. This position represents a number of bytes in the
|
This position represents a number of bytes in the uncompressed data stream,
|
||||||
uncompressed data stream, and is zero when starting, even if appending or
|
and is zero when starting, even if appending or reading a gzip stream from
|
||||||
reading a gzip stream from the middle of a file using gzdopen().
|
the middle of a file using gzdopen().
|
||||||
|
|
||||||
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
|
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
|
||||||
*/
|
*/
|
||||||
|
|
@ -1584,22 +1585,22 @@ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
||||||
|
|
||||||
Returns the current offset in the file being read or written. This offset
|
Return the current compressed (actual) read or write offset of file. This
|
||||||
includes the count of bytes that precede the gzip stream, for example when
|
offset includes the count of bytes that precede the gzip stream, for example
|
||||||
appending or when using gzdopen() for reading. When reading, the offset
|
when appending or when using gzdopen() for reading. When reading, the
|
||||||
does not include as yet unused buffered input. This information can be used
|
offset does not include as yet unused buffered input. This information can
|
||||||
for a progress indicator. On error, gzoffset() returns -1.
|
be used for a progress indicator. On error, gzoffset() returns -1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Returns true (1) if the end-of-file indicator has been set while reading,
|
Return true (1) if the end-of-file indicator for file has been set while
|
||||||
false (0) otherwise. Note that the end-of-file indicator is set only if the
|
reading, false (0) otherwise. Note that the end-of-file indicator is set
|
||||||
read tried to go past the end of the input, but came up short. Therefore,
|
only if the read tried to go past the end of the input, but came up short.
|
||||||
just like feof(), gzeof() may return false even if there is no more data to
|
Therefore, just like feof(), gzeof() may return false even if there is no
|
||||||
read, in the event that the last read request was for the exact number of
|
more data to read, in the event that the last read request was for the exact
|
||||||
bytes remaining in the input file. This will happen if the input file size
|
number of bytes remaining in the input file. This will happen if the input
|
||||||
is an exact multiple of the buffer size.
|
file size is an exact multiple of the buffer size.
|
||||||
|
|
||||||
If gzeof() returns true, then the read functions will return no more data,
|
If gzeof() returns true, then the read functions will return no more data,
|
||||||
unless the end-of-file indicator is reset by gzclearerr() and the input file
|
unless the end-of-file indicator is reset by gzclearerr() and the input file
|
||||||
|
|
@ -1608,7 +1609,7 @@ ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Returns true (1) if file is being copied directly while reading, or false
|
Return true (1) if file is being copied directly while reading, or false
|
||||||
(0) if file is a gzip stream being decompressed.
|
(0) if file is a gzip stream being decompressed.
|
||||||
|
|
||||||
If the input file is empty, gzdirect() will return true, since the input
|
If the input file is empty, gzdirect() will return true, since the input
|
||||||
|
|
@ -1629,8 +1630,8 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Flushes all pending output if necessary, closes the compressed file and
|
Flush all pending output for file, if necessary, close file and
|
||||||
deallocates the (de)compression state. Note that once file is closed, you
|
deallocate the (de)compression state. Note that once file is closed, you
|
||||||
cannot call gzerror with file, since its structures have been deallocated.
|
cannot call gzerror with file, since its structures have been deallocated.
|
||||||
gzclose must not be called more than once on the same file, just as free
|
gzclose must not be called more than once on the same file, just as free
|
||||||
must not be called more than once on the same allocation.
|
must not be called more than once on the same allocation.
|
||||||
|
|
@ -1654,10 +1655,10 @@ ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
||||||
/*
|
/*
|
||||||
Returns the error message for the last error which occurred on the given
|
Return the error message for the last error which occurred on file.
|
||||||
compressed file. errnum is set to zlib error number. If an error occurred
|
errnum is set to zlib error number. If an error occurred in the file system
|
||||||
in the file system and not in the compression library, errnum is set to
|
and not in the compression library, errnum is set to Z_ERRNO and the
|
||||||
Z_ERRNO and the application may consult errno to get the exact error code.
|
application may consult errno to get the exact error code.
|
||||||
|
|
||||||
The application must not modify the returned string. Future calls to
|
The application must not modify the returned string. Future calls to
|
||||||
this function may invalidate the previously returned string. If file is
|
this function may invalidate the previously returned string. If file is
|
||||||
|
|
@ -1670,7 +1671,7 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
||||||
|
|
||||||
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Clears the error and end-of-file flags for file. This is analogous to the
|
Clear the error and end-of-file flags for file. This is analogous to the
|
||||||
clearerr() function in stdio. This is useful for continuing to read a gzip
|
clearerr() function in stdio. This is useful for continuing to read a gzip
|
||||||
file that is being written concurrently.
|
file that is being written concurrently.
|
||||||
*/
|
*/
|
||||||
|
|
@ -1688,8 +1689,9 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
||||||
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
|
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
|
||||||
/*
|
/*
|
||||||
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
||||||
return the updated checksum. If buf is Z_NULL, this function returns the
|
return the updated checksum. An Adler-32 value is in the range of a 32-bit
|
||||||
required initial value for the checksum.
|
unsigned integer. If buf is Z_NULL, this function returns the required
|
||||||
|
initial value for the checksum.
|
||||||
|
|
||||||
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
|
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
|
||||||
much faster.
|
much faster.
|
||||||
|
|
@ -1725,9 +1727,10 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
|
||||||
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||||
/*
|
/*
|
||||||
Update a running CRC-32 with the bytes buf[0..len-1] and return the
|
Update a running CRC-32 with the bytes buf[0..len-1] and return the
|
||||||
updated CRC-32. If buf is Z_NULL, this function returns the required
|
updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer.
|
||||||
initial value for the crc. Pre- and post-conditioning (one's complement) is
|
If buf is Z_NULL, this function returns the required initial value for the
|
||||||
performed within this function so it shouldn't be done by the application.
|
crc. Pre- and post-conditioning (one's complement) is performed within this
|
||||||
|
function so it shouldn't be done by the application.
|
||||||
|
|
||||||
Usage example:
|
Usage example:
|
||||||
|
|
||||||
|
|
@ -1739,7 +1742,7 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||||
if (crc != original_crc) error();
|
if (crc != original_crc) error();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf,
|
ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
|
||||||
z_size_t len));
|
z_size_t len));
|
||||||
/*
|
/*
|
||||||
Same as crc32(), but with a size_t length.
|
Same as crc32(), but with a size_t length.
|
||||||
|
|
@ -1755,6 +1758,20 @@ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
|
||||||
len2.
|
len2.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2));
|
||||||
|
|
||||||
|
Return the operator corresponding to length len2, to be used with
|
||||||
|
crc32_combine_op().
|
||||||
|
*/
|
||||||
|
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op));
|
||||||
|
/*
|
||||||
|
Give the same result as crc32_combine(), using op in place of len2. op is
|
||||||
|
is generated from len2 by crc32_combine_gen(). This will be faster than
|
||||||
|
crc32_combine() if the generated op is used more than once.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* various hacks, don't look :) */
|
/* various hacks, don't look :) */
|
||||||
|
|
||||||
|
|
@ -1842,6 +1859,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
|
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
|
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
|
||||||
|
|
@ -1852,6 +1870,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
# define z_gzoffset z_gzoffset64
|
# define z_gzoffset z_gzoffset64
|
||||||
# define z_adler32_combine z_adler32_combine64
|
# define z_adler32_combine z_adler32_combine64
|
||||||
# define z_crc32_combine z_crc32_combine64
|
# define z_crc32_combine z_crc32_combine64
|
||||||
|
# define z_crc32_combine_gen z_crc32_combine_gen64
|
||||||
# else
|
# else
|
||||||
# define gzopen gzopen64
|
# define gzopen gzopen64
|
||||||
# define gzseek gzseek64
|
# define gzseek gzseek64
|
||||||
|
|
@ -1859,6 +1878,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
# define gzoffset gzoffset64
|
# define gzoffset gzoffset64
|
||||||
# define adler32_combine adler32_combine64
|
# define adler32_combine adler32_combine64
|
||||||
# define crc32_combine crc32_combine64
|
# define crc32_combine crc32_combine64
|
||||||
|
# define crc32_combine_gen crc32_combine_gen64
|
||||||
# endif
|
# endif
|
||||||
# ifndef Z_LARGE64
|
# ifndef Z_LARGE64
|
||||||
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
||||||
|
|
@ -1867,6 +1887,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
|
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
|
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
|
||||||
|
|
@ -1875,12 +1896,14 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
|
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* Z_SOLO */
|
#else /* Z_SOLO */
|
||||||
|
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||||
|
|
||||||
#endif /* !Z_SOLO */
|
#endif /* !Z_SOLO */
|
||||||
|
|
||||||
|
|
@ -1893,7 +1916,7 @@ ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int));
|
||||||
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
|
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
|
||||||
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
||||||
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
||||||
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO)
|
#if defined(_WIN32) && !defined(Z_SOLO)
|
||||||
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
||||||
const char *mode));
|
const char *mode));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue