Commit Graph

146 Commits

Author SHA1 Message Date
Mark Adler
cacf7f1d4e zlib 1.2.11 2017-01-15 09:29:40 -08:00
Mark Adler
cbbd20302c Permit immediate deflateParams changes before any deflate input.
This permits deflateParams to change the strategy and level right
after deflateInit, without having to wait until a header has been
written. The parameters can be changed immediately up until the
first deflate call that consumes any input data.
2017-01-15 09:29:40 -08:00
Mark Adler
11ceaed751 Change version number to 1.2.10.1. 2017-01-15 09:07:08 -08:00
Mark Adler
4a090adef8 zlib 1.2.10 2017-01-02 18:21:29 -08:00
Mark Adler
52aa5501ec Minor edits and clarifications of comments. 2017-01-01 22:24:37 -08:00
Mark Adler
20e472546e Change version number to zlib 1.2.9.1. 2017-01-01 22:24:17 -08:00
Mark Adler
2fa463bacf zlib 1.2.9 2016-12-31 23:37:10 -08:00
Mark Adler
b9ae6f0079 Add crc32_z() and adler32_z() functions with size_t lengths. 2016-12-31 17:50:52 -08:00
Mark Adler
50dca6d127 Fix init macros to use z_ prefix when requested. 2016-12-30 20:00:56 -08:00
Mark Adler
ee7d7b5dda Add deflateGetDictionary() function.
Per request, but its utility is likely to be very limited. See the
comments in zlib.h.
2016-12-30 16:29:56 -08:00
Mark Adler
77bc4f8944 Add gzfwrite(), duplicating the interface of fwrite(). 2016-12-04 18:47:34 -08:00
Mark Adler
44dfd831d2 Add gzfread(), duplicating the interface of fread(). 2016-12-04 18:35:41 -08:00
Mark Adler
123f9cfaf7 Clean up gz* function return values.
In some cases the return values did not match the documentation,
or the documentation did not document all of the return values.
gzprintf() now consistently returns negative values on error,
which matches the behavior of the stdio fprintf() function.
2016-12-04 07:48:47 -08:00
Mark Adler
7161ad76e2 Assure that deflateParams() will not switch functions mid-block.
This alters the specification in zlib.h, so that deflateParams()
will not change any parameters if there is not enough output space
in the event that a block is emitted in order to allow switching
the compression function.
2016-12-04 07:48:47 -08:00
Mark Adler
37281ac222 Add uncompress2() function, which returns the input size used. 2016-12-04 07:48:47 -08:00
Mark Adler
001300d0d9 Minor edits to the documentation in source file contents. 2016-12-04 07:48:41 -08:00
Mark Adler
03614c56ad Fix some typos. 2016-10-30 08:49:01 -07:00
Mark Adler
77fd7e56bf Document the rejection of 256-byte window requests in zlib.h. 2016-10-24 16:00:51 -07:00
Mark Adler
ebbc57393d Avoid recursive gzgetc() macro call.
Recursive macro calls are normally caught by the preprocessor and
avoided. This commit avoids the possibility of a problem entirely.
2016-10-14 13:16:07 -07:00
Mark Adler
7096424f23 Clean up type conversions. 2016-10-11 22:15:50 -07:00
Mark Adler
3fb251b363 Remove dummy structure declarations for old buggy compilers.
While woolly mammoths still roamed the Earth and before Atlantis
sunk into the ocean, there were C compilers that could not handle
forward structure references, e.g. "struct name;". zlib dutifully
provided a work-around for such compilers. That work-around is no
longer needed, and, per the recommendation of a security audit of
the zlib code by Trail of Bits and TrustInSoft, in support of the
Mozilla Foundation, should be removed since what a compiler will
do with this is technically undefined. From the report: "there is
no telling what interactions the bug could have in the future with
link-time optimizations and type-based alias analyses, both
features that are present (but not default) in clang."
2016-09-21 20:34:04 -07:00
Mark Adler
9852c209ac Add option to not compute or check check values.
The undocumented (except in these commit comments) function
inflateValidate(strm, check) can be called after an inflateInit(),
inflateInit2(), or inflateReset2() with check equal to zero to
turn off the check value (CRC-32 or Adler-32) computation and
comparison. Calling with check not equal to zero turns checking
back on. This should only be called immediately after the init or
reset function. inflateReset() does not change the state, so a
previous inflateValidate() setting will remain in effect.

This also turns off validation of the gzip header CRC when
present.

This should only be used when a zlib or gzip stream has already
been checked, and repeated decompressions of the same stream no
longer need to be validated.
2016-09-20 18:55:37 -07:00
Mark Adler
44ae761dc2 Clean up portability for shifts and integer sizes. 2015-09-05 18:56:55 -07:00
Mark Adler
43bfaba3d7 Align deflateParams() and its documentation in zlib.h.
This updates the documentation to reflect the behavior of
deflateParams() when it is not able to compress all of the input
data provided so far due to insufficient output space.  It also
assures that data provided is compressed before the parameter
changes, even if at the beginning of the stream.
2015-08-02 00:06:28 -07:00
Mark Adler
b4ce6caf09 Compile the gzopen_w() function when __CYGWIN__ defined. 2015-08-01 17:38:56 -07:00
Mark Adler
5701f48cf5 Clarify deflateReset() documentation.
It previously could have been misinterpreted to mean that parameter
changes after deflateInit2() would be reversed, which is not the
case.
2015-07-28 23:19:50 -07:00
Mark Adler
51a223def4 Avoid use of DEBUG macro -- change to ZLIB_DEBUG. 2015-07-28 22:44:31 -07:00
Mark Adler
b56d1c62ee Add comment about not using windowBits of 8 for deflate(). 2015-07-28 21:06:06 -07:00
Mark Adler
95698093f0 Improve speed of gzprintf() in transparent mode. 2015-07-05 18:14:53 -07:00
Mark Adler
9cbda797c1 Note in zlib.h that compress() uses Z_DEFAULT_COMPRESSION. 2014-04-26 08:12:37 -07:00
Mark Adler
ceeb615f46 Change version number to 1.2.8.1. 2013-05-02 23:12:54 -07:00
Mark Adler
5089329162 zlib 1.2.8 2013-04-28 17:23:49 -07:00
Mark Adler
2dad5389af Correct spelling error in zlib.h. 2013-04-28 15:57:11 -07:00
Mark Adler
e8fee0ea7b Change version number to 1.2.8. 2013-04-28 15:57:10 -07:00
Mark Adler
b7bc388454 zlib 1.2.7.3 2013-04-13 21:18:35 -07:00
Mark Adler
388a285cb8 Change version number to 1.2.7.3. 2013-04-13 18:58:46 -07:00
Mark Adler
139c67fc87 zlib 1.2.7.2 2013-04-13 18:15:42 -07:00
Mark Adler
8a93f49c86 Change version number to 1.2.7.2. 2013-04-13 08:08:57 -07:00
Mark Adler
0b16609409 zlib 1.2.7.1 2013-03-24 22:47:59 -07:00
Mark Adler
0aac8cf7c4 Clean up the addition of gzvprintf. 2013-03-23 23:47:15 -07:00
Mark Adler
f0546c8e34 Clean up the addition of inflateGetDictionary. 2013-03-23 23:32:58 -07:00
Mark Adler
b06dee4369 Add gzvprintf() as an undocumented function in zlib.
The function is only available if stdarg.h is available.
2013-03-22 18:32:37 -07:00
Mark Adler
931aa25aea Update inflateBack() comments, since inflate() can be faster. 2013-02-23 20:12:20 -08:00
Mark Adler
62d6112a79 Clean up the usage of z_const and respect const usage within zlib.
This patch allows zlib to compile cleanly with the -Wcast-qual gcc
warning enabled, but only if ZLIB_CONST is defined, which adds
const to next_in and msg in z_stream and in the in_func prototype.
A --const option is added to ./configure which adds -DZLIB_CONST
to the compile flags, and adds -Wcast-qual to the compile flags
when ZLIBGCCWARN is set in the environment.
2012-08-13 00:02:40 -07:00
Mark Adler
dca9e1d6f3 Add inflateGetDictionary() function. 2012-05-26 23:25:35 -07:00
Mark Adler
2689b3cceb Change version number to 1.2.7.1. 2012-05-02 22:38:26 -07:00
Mark Adler
30a1c7065d zlib 1.2.7 2012-05-02 21:12:35 -07:00
Mark Adler
6c9bd474aa Fix type mismatch between get_crc_table() and crc_table.
crc_table is made using a four-byte integer (when that can be
determined).  However get_crc_table() returned a pointer to an
unsigned long, which could be eight bytes.  This fixes that by
creating a new z_crc_t type for the crc_table.

This type is also used for the BYFOUR crc calculations that depend
on a four-byte type.  The four-byte type can now be determined by
./configure, which also solves a problem where ./configure --solo
would never use BYFOUR.  No the Z_U4 #define indicates that four-
byte integer was found either by ./configure or by zconf.h.
2012-04-29 16:18:12 -07:00
Mark Adler
a1af6e96e3 Fix gzopen_w() type and add #include for the type. 2012-03-17 21:45:01 -07:00
Mark Adler
dbe0bed739 Add gzopen_w() in Windows for wide character path names. 2012-03-16 20:53:09 -07:00