Commit Graph

82 Commits

Author SHA1 Message Date
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 aef4174dd2 Remove unused variable in infback9.c. 2012-07-08 16:48:36 -07:00
Birunthan Mohanathas f51cc49c94 Fix comment typos in unzip.h and unzip.c. 2012-07-08 16:34:08 -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
jK ba04838a74 Fix contrib/minizip compilation in the MinGW environment. 2012-03-26 20:17:41 -07:00
Birunthan Mohanathas 11f4065ea9 Remove gzflags from zlibvc.def in vc9 and vc10. 2012-03-22 22:24:52 -07:00
Mark Adler dbe0bed739 Add gzopen_w() in Windows for wide character path names. 2012-03-16 20:53:09 -07:00
Mark Adler e3ba2a10ca Fix contrib/vstudio project link errors [Mohanathas]. 2012-03-04 09:46:25 -08:00
Mark Adler d81e7213b7 Restore gzgetc_ for backward compatibility with 1.2.6. 2012-02-18 14:15:17 -08:00
Mark Adler 455adc3029 Expunge gzgetc_ from configuration files. 2012-02-13 23:34:48 -08:00
Mark Adler 72e2c8f088 Change version number to 1.2.7. 2012-02-12 16:15:47 -08:00
Mark Adler fc68b60086 Minor cleanup in contrib/minizip/zip.c [Vollant]. 2012-02-04 10:14:13 -08:00
Mark Adler 55b8b5fec1 Put gzflags() functionality back in zutil.c.
gzflags() was put in gzwrite.c in order to be compiled exactly the
same as gzprintf(), so that it was guaranteed to return the correct
information.  However that causes a static linkage to zlib to bring
in many routines that are often not used.  All that is required to
duplicate the compilation environment of gzprintf() is to include
gzguts.h.  So that is now done in zutil.c to assure that the correct
flags are returned.
2012-02-01 23:25:34 -08:00
Mark Adler 7b3f71ba5f Change version number to 1.2.6.1. 2012-01-29 21:15:24 -08:00
Jonathan Nieder 32d8a5379e Add an --enable-demos option to contrib/minizip/configure.
This makes build-testing and installing the minizip/miniunzip programs
as simple as "autoreconf -if && ./configure --enable-demos && make &&
make install".  Without --enable-demos, the makefile will only build
and install the library, as before.  Helped by Mike Frysinger.

minizip/miniunzip were not intended to be general-purpose installed
utilities, but they can be useful from time to time as a lightweight
substitute for zip/unzip.  You can also use them to quickly test that
the library installation procedure worked.
2012-01-21 17:15:48 -08:00
Jonathan Nieder f0cff24214 Add support for VPATH builds in contrib/minizip.
Instead of using relative paths directly, use paths relative to
top_srcdir and top_builddir to refer to source files and built files,
respectively.

Note that the toplevel zlib configure script still does not have any
special support for out-of-tree builds.  But now you can do

	(cd contrib/minizip && autoreconf -fis)

	mkdir -p BUILD/test
	cp *.c *.h *.in zlib.map configure zlib.3 BUILD
	cp test/*.c BUILD/test
	(cd BUILD && ./configure --shared)
	(cd BUILD && make)

	mkdir -p BUILD/contrib/minizip
	cd BUILD/contrib/minizip
	../../../contrib/minizip/configure
	make

While at it, move the include path and library path settings to
CPPFLAGS and LDFLAGS respectively instead of setting both in CFLAGS.
Thanks to Mike Frysinger for advice.
2012-01-21 12:56:57 -08:00
Jonathan Nieder 81015585d2 Add missing libs to minizip linker command.
Trying to build the minizip utility from contrib/minizip after an
autoreconf -f:

	libtool: link: gcc -g -O2 -o minizip minizip.o
	minizip.o: In function `getFileCrc':
	/tmp/zlib/contrib/minizip/minizip.c:211: undefined reference to `crc32'
	minizip.o: In function `main':
	/tmp/zlib/contrib/minizip/minizip.c:378: undefined reference to `zipOpen64'
	/tmp/zlib/contrib/minizip/minizip.c:451: undefined reference to `zipOpenNewFileInZip3_64'
	/tmp/zlib/contrib/minizip/minizip.c:502: undefined reference to `zipCloseFileInZip'
	/tmp/zlib/contrib/minizip/minizip.c:509: undefined reference to `zipClose'
	/tmp/zlib/contrib/minizip/minizip.c:485: undefined reference to `zipWriteInFileInZip'
	collect2: error: ld returned 1 exit status

The cause: contrib/minizip/Makefile.am does not specify that minizip
needs to be linked to libminizip.  With some linkers (e.g., GNU
binutils without --copy-dt-needed-entries), an indirect dependency
cannot be used to resolve symbols, so link to libz for crc32(), too.
2012-01-21 12:46:25 -08:00
Jonathan Nieder ad88c19baa Add -I../.. -L../.. to CFLAGS for minizip and miniunzip.
Trying to build miniunzip utility from contrib/minizip after an
autoreconf -f produces

	[...]
	In file included from minizip.c:61:0:
	zip.h:50:18: fatal error: zlib.h: No such file or directory

unless zlib is already installed.  Use AM_CFLAGS to set the include
path and library path to point to the just-build copy of zlib to
fix this.  (This was already done for libminizip but not the binaries
that use it before this patch.)
2012-01-21 12:45:38 -08:00
Mark Adler 17741efa02 Remove trailing space in contrib/minizip/minizip.c. 2012-01-21 12:00:26 -08:00
Mark Adler de6cb6fe5c Avoid some warnings in contrib/minizip [Vollant]. 2012-01-21 11:58:45 -08:00
Mark Adler 601b542a9d Protect for long name and extra fields in contrib/minizip [Vollant]. 2012-01-21 11:58:45 -08:00
Mark Adler 0458bbf2c0 Fix bug when compiling minizip with C++ [Vollant]. 2012-01-21 11:58:35 -08:00
Mark Adler 06c0e754ce Minor cleanup up contrib/minizip/unzip.c [Vollant]. 2012-01-21 11:49:31 -08:00
Mark Adler 9cdb49c96e Avoid warning for no encryption in contrib/minizip/zip.c [Vollant]. 2012-01-21 11:48:14 -08:00
Mark Adler 09bbe4c7f0 Make version explicit in contrib/minizip/configure.ac [Bosmans]. 2012-01-20 23:36:59 -08:00
Mark Adler 5c312df969 Fix compilation of contrib/minizip on FreeBSD [Márquez]. 2012-01-16 18:51:31 -08:00
Mark Adler e1f45fed54 Fix contrib/minizip/zip.c for 64-bit architectures [Dalsnes]. 2012-01-16 18:51:31 -08:00
Mark Adler 5a5dd2c793 Fix large-entry detection in minizip on 64-bit systems [Schiffer]. 2012-01-16 16:44:40 -08:00
Mark Adler eb33abcc55 Fix configure.ac for contrib/minizip [Schiffer]. 2012-01-16 16:44:40 -08:00
Mark Adler ce0ca940c2 Fix function numbers for gzgetc_ in zlibvc.def files. 2012-01-16 16:44:40 -08:00
Mark Adler c3799a2480 Update the Pascal interface in contrib/pascal. 2012-01-16 16:44:40 -08:00
Mark Adler 0ddfbd2346 Change version number to 1.2.6. 2012-01-16 16:44:29 -08:00
Mark Adler 3d85f02a09 Restore gzgetc function for binary compatibility.
Newly compiled applications will use the gzgetc macro.
2011-12-18 14:47:08 -08:00
Mark Adler df60b50769 Change version numbers to 1.2.5.3. 2011-12-18 12:07:25 -08:00
Mark Adler afe7cf78d5 Enable dictionary setting in middle of stream, and keeping the dictionary.
This patch adds the deflateResetKeep() function to retain the sliding
window for the next deflate operation, and fixes an inflateResetKeep()
problem that came from inflate() not updating the window when the
stream completed.  This enables constructing and decompressing a series
of concatenated deflate streams where each can depend on the history of
uncompressed data that precedes it.

This generalizes deflateSetDictionary() and inflateSetDictionary() to
permit setting the dictionary in the middle of a stream for raw deflate
and inflate.  This in combination with the Keep functions enables a
scheme for updating files block by block with the transmission of
compressed data, where blocks are sent with deflateResetKeep() to
retain history for better compression, and deflateSetDictionary() is
used for blocks already present at the receiver to skip compression but
insert that data in the history, again for better compression.  The
corresponding inflate calls are done on the receiver side.
2011-12-08 00:13:52 -08:00
Mark Adler 1b57de3aef Move example.c and minigzip.c to test/. 2011-11-27 14:15:32 -08:00
Mark Adler 9e50ed8ef1 Add files in contrib/minizip to aid in building libminizip.
Patch provided by Franz Schrober.
2011-11-13 12:42:47 -08:00
Mark Adler 77b47d55f1 Add undocumented inflateResetKeep() function for CAB file decoding.
The Microsoft CAB file format compresses each block with completed
deflate streams that depend on the sliding window history of the
previous block in order to decode.  inflateResetKeep() does what
inflateReset() does, except the sliding window history from the
previous inflate operation is retained.
2011-10-07 23:13:37 -07:00
Mark Adler 00c836e325 Merge vestigial vsnprintf determination from zutil.h to gzguts.h.
This also moves some of the same from zconf.h to gzguts.h. A new
function, gzflags(), was created to pass the compilation flags
related to vsnprintf usage back to zlibCompileFlags() in zutil.c.
In the process, various compiler configuration files were updated
to include gzflags(), as well as the new gzgetc_() function added
when the gzgetc() macro was introduced in a previous patch.
2011-10-02 11:15:00 -07:00
Mark Adler d6cbbd5c64 Change version numbers to 1.2.5.2 and release dates
Also added "-motley" to ZLIB_VERSION in zlib.h, so that versions
in-between 1.2.5.1 and 1.2.5.2 that are pulled down from github
can be identified as such if bugs are reported on them.
2011-09-11 11:16:41 -07:00
Mark Adler 10daf0d4d7 zlib 1.2.5.1 2011-09-11 11:04:49 -07:00
Mark Adler 9712272c78 zlib 1.2.5 2011-09-09 23:35:10 -07:00
Mark Adler 7301420248 zlib 1.2.4.5 2011-09-09 23:34:55 -07:00
Mark Adler a7d70663cf zlib 1.2.4.4 2011-09-09 23:34:45 -07:00
Mark Adler f4498bea28 zlib 1.2.4.3 2011-09-09 23:34:38 -07:00
Mark Adler 7147f24cd7 zlib 1.2.4.2 2011-09-09 23:34:30 -07:00
Mark Adler 05d47d2627 zlib 1.2.4.1 2011-09-09 23:34:22 -07:00
Mark Adler a1141160bc zlib 1.2.4 2011-09-09 23:33:59 -07:00
Mark Adler 59ca2179ff zlib 1.2.4-pre2 2011-09-09 23:33:23 -07:00