platform/upstream/zlib.git
12 years agoExpunge gzgetc_ from configuration files.
Mark Adler [Tue, 14 Feb 2012 07:34:48 +0000 (23:34 -0800)]
Expunge gzgetc_ from configuration files.

12 years agoRemove unnecessary include for byte swap built-in [Bosmans].
Mark Adler [Tue, 14 Feb 2012 07:02:13 +0000 (23:02 -0800)]
Remove unnecessary include for byte swap built-in [Bosmans].

12 years agoDon't use built-in byte swaps if compiled solo.
Mark Adler [Mon, 13 Feb 2012 03:28:06 +0000 (19:28 -0800)]
Don't use built-in byte swaps if compiled solo.

12 years agoChange version number to 1.2.7.
Mark Adler [Mon, 13 Feb 2012 00:15:47 +0000 (16:15 -0800)]
Change version number to 1.2.7.

12 years agozlib 1.2.6.1
Mark Adler [Sun, 12 Feb 2012 22:11:48 +0000 (14:11 -0800)]
zlib 1.2.6.1

12 years agoFix minor typo in zlib.h comments [Rześniowiecki].
Mark Adler [Sat, 11 Feb 2012 08:31:24 +0000 (00:31 -0800)]
Fix minor typo in zlib.h comments [Rześniowiecki].

12 years agoUse optimized byte swap operations for Microsoft and GNU [Snyder].
Mark Adler [Sat, 11 Feb 2012 08:26:38 +0000 (00:26 -0800)]
Use optimized byte swap operations for Microsoft and GNU [Snyder].

12 years agoRemove unnecessary gzgetc_ function.
Mark Adler [Sat, 11 Feb 2012 07:55:12 +0000 (23:55 -0800)]
Remove unnecessary gzgetc_ function.

12 years agoUpdate make_vms.com [Zinser].
Mark Adler [Sun, 5 Feb 2012 18:55:09 +0000 (10:55 -0800)]
Update make_vms.com [Zinser].

12 years agoMinor cleanup in contrib/minizip/zip.c [Vollant].
Mark Adler [Sat, 4 Feb 2012 18:14:13 +0000 (10:14 -0800)]
Minor cleanup in contrib/minizip/zip.c [Vollant].

12 years agoUse name in GCC_CLASSIC as C compiler for coverage testing, if set.
Mark Adler [Sat, 4 Feb 2012 06:56:16 +0000 (22:56 -0800)]
Use name in GCC_CLASSIC as C compiler for coverage testing, if set.

Apple removed support for gcov in the default gcc compiler chain,
when they moved to llvm.  This can be circumvented in XCode 4.2 by
using the gcc chain with gcc-4.2.  This patch allows setting
GCC_CLASSIC to the name of a real gcc executable (e.g. "gcc-4.2")
to allow coverage testing.

12 years agoAvoid library header include in crc32.c for Z_SOLO.
Mark Adler [Thu, 2 Feb 2012 07:47:47 +0000 (23:47 -0800)]
Avoid library header include in crc32.c for Z_SOLO.

crc32.c was #including limits.h in order to find a four-byte integer
type.  It was doing this even if Z_SOLO were defined, violating the
intent of Z_SOLO, which is to include no library headers and require
no library functions.  Now crc32.c obeys the intent of Z_SOLO, but
with the downside that crc32() will be slower than when not compiled
with Z_SOLO.  This can be remedied manually by typedefing u4 to a
known four-byte unsigned integer type, and #defining BYFOUR in
crc32.c.

12 years agoPut gzflags() functionality back in zutil.c.
Mark Adler [Thu, 2 Feb 2012 07:25:34 +0000 (23:25 -0800)]
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.

12 years agoInclude gz_header definition when compiling zlib solo.
Mark Adler [Thu, 2 Feb 2012 06:41:52 +0000 (22:41 -0800)]
Include gz_header definition when compiling zlib solo.

12 years agoFix problem with ./configure --prefix and gzgetc macro.
Mark Adler [Tue, 31 Jan 2012 07:55:14 +0000 (23:55 -0800)]
Fix problem with ./configure --prefix and gzgetc macro.

12 years agoInclude io.h in gzguts.h for Microsoft compilers.
Mark Adler [Mon, 30 Jan 2012 03:20:13 +0000 (19:20 -0800)]
Include io.h in gzguts.h for Microsoft compilers.

12 years agoAvoid the use of the Objective-C reserved name "id".
Mark Adler [Mon, 30 Jan 2012 01:44:04 +0000 (17:44 -0800)]
Avoid the use of the Objective-C reserved name "id".

12 years agoChange version number to 1.2.6.1.
Mark Adler [Mon, 30 Jan 2012 03:25:44 +0000 (19:25 -0800)]
Change version number to 1.2.6.1.

12 years agozlib 1.2.6
Mark Adler [Sun, 29 Jan 2012 18:13:15 +0000 (10:13 -0800)]
zlib 1.2.6

12 years agoCorrect in zlib.map when deflateResetKeep was added.
Mark Adler [Sun, 29 Jan 2012 17:57:58 +0000 (09:57 -0800)]
Correct in zlib.map when deflateResetKeep was added.

12 years agoUse the -m option on ldconfig for BSD systems [Tobias].
Mark Adler [Sun, 29 Jan 2012 17:27:41 +0000 (09:27 -0800)]
Use the -m option on ldconfig for BSD systems [Tobias].

12 years agoHave gzputc return the character written instead of the argument.
Mark Adler [Sun, 29 Jan 2012 17:12:08 +0000 (09:12 -0800)]
Have gzputc return the character written instead of the argument.

When successful, gzputc would return the second argument.  If the
second argument were -1, gzputc would return -1 instead of the
character written, which was 255.  However the -1 would not be
distinguishable from an error.  Now gzputc returns 255 in that
case.

12 years agoExit when required parameters not provided to win32/Makefile.gcc.
Mark Adler [Sun, 29 Jan 2012 16:53:53 +0000 (08:53 -0800)]
Exit when required parameters not provided to win32/Makefile.gcc.

12 years agoAdd the generation of configure.log by ./configure.
Mark Adler [Sat, 28 Jan 2012 22:48:50 +0000 (14:48 -0800)]
Add the generation of configure.log by ./configure.

12 years agoAdd an --enable-demos option to contrib/minizip/configure.
Jonathan Nieder [Sat, 21 Jan 2012 21:55:54 +0000 (15:55 -0600)]
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.

12 years agoAdd support for VPATH builds in contrib/minizip.
Jonathan Nieder [Tue, 17 Jan 2012 21:06:41 +0000 (15:06 -0600)]
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.

12 years agoAdd missing libs to minizip linker command.
Jonathan Nieder [Tue, 17 Jan 2012 20:28:30 +0000 (14:28 -0600)]
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.

12 years agoAdd -I../.. -L../.. to CFLAGS for minizip and miniunzip.
Jonathan Nieder [Tue, 17 Jan 2012 20:26:05 +0000 (14:26 -0600)]
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.)

12 years agoRemove trailing space in contrib/minizip/minizip.c.
Mark Adler [Sat, 21 Jan 2012 19:59:32 +0000 (11:59 -0800)]
Remove trailing space in contrib/minizip/minizip.c.

12 years agoAvoid some warnings in contrib/minizip [Vollant].
Mark Adler [Sat, 21 Jan 2012 19:54:52 +0000 (11:54 -0800)]
Avoid some warnings in contrib/minizip [Vollant].

12 years agoProtect for long name and extra fields in contrib/minizip [Vollant].
Mark Adler [Sat, 21 Jan 2012 19:51:54 +0000 (11:51 -0800)]
Protect for long name and extra fields in contrib/minizip [Vollant].

12 years agoFix bug when compiling minizip with C++ [Vollant].
Mark Adler [Sat, 21 Jan 2012 19:50:36 +0000 (11:50 -0800)]
Fix bug when compiling minizip with C++ [Vollant].

12 years agoMinor cleanup up contrib/minizip/unzip.c [Vollant].
Mark Adler [Sat, 21 Jan 2012 19:49:31 +0000 (11:49 -0800)]
Minor cleanup up contrib/minizip/unzip.c [Vollant].

12 years agoAvoid warning for no encryption in contrib/minizip/zip.c [Vollant].
Mark Adler [Sat, 21 Jan 2012 19:48:14 +0000 (11:48 -0800)]
Avoid warning for no encryption in contrib/minizip/zip.c [Vollant].

12 years agoMake version explicit in contrib/minizip/configure.ac [Bosmans].
Mark Adler [Sat, 21 Jan 2012 07:36:59 +0000 (23:36 -0800)]
Make version explicit in contrib/minizip/configure.ac [Bosmans].

12 years agoInclude io.h for Turbo C / Borland C on all platforms [Truta].
Mark Adler [Thu, 19 Jan 2012 03:33:02 +0000 (19:33 -0800)]
Include io.h for Turbo C / Borland C on all platforms [Truta].

12 years agoCorrect suggested usages in win32/Makefile.msc [שחר, Horvath].
Mark Adler [Tue, 17 Jan 2012 01:57:42 +0000 (17:57 -0800)]
Correct suggested usages in win32/Makefile.msc [שחר, Horvath].

12 years agoFix compilation of contrib/minizip on FreeBSD [Márquez].
Mark Adler [Tue, 17 Jan 2012 01:52:51 +0000 (17:52 -0800)]
Fix compilation of contrib/minizip on FreeBSD [Márquez].

12 years agoFix contrib/minizip/zip.c for 64-bit architectures [Dalsnes].
Mark Adler [Tue, 17 Jan 2012 01:45:58 +0000 (17:45 -0800)]
Fix contrib/minizip/zip.c for 64-bit architectures [Dalsnes].

12 years agoFix CMakeLists.txt for cross compilation [McClure].
Mark Adler [Tue, 17 Jan 2012 01:39:54 +0000 (17:39 -0800)]
Fix CMakeLists.txt for cross compilation [McClure].

12 years agoHave ./configure use the compiler return code for error indication.
Mark Adler [Mon, 16 Jan 2012 22:50:09 +0000 (14:50 -0800)]
Have ./configure use the compiler return code for error indication.

Previously ./configure would use any output on stderr as an indication
that the compilation failed.  However if some compiler wrapper uses
stderr for some other purpose, e.g. distcc for nodes going down, then
./configure would not properly configure the build.  This problem was
noted by Mike Frysinger.  For backwards compatibility, ./configure
will revert to the old way, i.e. checking for anything on stderr, if
when it deliberately runs the compiler with an error, a zero exit
status is returned.

12 years agoFix large-entry detection in minizip on 64-bit systems [Schiffer].
Mark Adler [Mon, 16 Jan 2012 21:16:39 +0000 (13:16 -0800)]
Fix large-entry detection in minizip on 64-bit systems [Schiffer].

12 years agoFix configure.ac for contrib/minizip [Schiffer].
Mark Adler [Mon, 16 Jan 2012 21:13:07 +0000 (13:13 -0800)]
Fix configure.ac for contrib/minizip [Schiffer].

12 years agoFix function numbers for gzgetc_ in zlibvc.def files.
Mark Adler [Mon, 16 Jan 2012 16:22:57 +0000 (08:22 -0800)]
Fix function numbers for gzgetc_ in zlibvc.def files.

12 years agoUpdate the Pascal interface in contrib/pascal.
Mark Adler [Mon, 16 Jan 2012 04:46:53 +0000 (20:46 -0800)]
Update the Pascal interface in contrib/pascal.

12 years agoChange version number to 1.2.6.
Mark Adler [Mon, 16 Jan 2012 03:31:31 +0000 (19:31 -0800)]
Change version number to 1.2.6.

12 years agozlib 1.2.5.3
Mark Adler [Mon, 16 Jan 2012 02:58:21 +0000 (18:58 -0800)]
zlib 1.2.5.3

12 years agoMake sure that no extra inserting is done if the strategy changes.
Mark Adler [Sat, 14 Jan 2012 18:53:23 +0000 (10:53 -0800)]
Make sure that no extra inserting is done if the strategy changes.

12 years agoInsert the first two strings in the hash table after a flush.
Mark Adler [Sat, 14 Jan 2012 05:54:40 +0000 (23:54 -0600)]
Insert the first two strings in the hash table after a flush.

This allows deflate to generate the same output when continuing after
a Z_SYNC_FLUSH vs. using deflateSetDictionary() after a Z_FULL_FLUSH
or a deflateReset().  It also slightly improves compression when
flushing by providing two more strings to possibly match at the start
of the new block.

12 years agoWrite out all of the available bits when using Z_BLOCK.
Mark Adler [Thu, 29 Dec 2011 21:19:27 +0000 (13:19 -0800)]
Write out all of the available bits when using Z_BLOCK.

Previously, the bit buffer would hold 1 to 16 bits after "all" of the
output is provided after a Z_BLOCK deflate() call.  Now at most seven
bits remain in the output buffer after Z_BLOCK.  flush_pending() now
flushes the bit buffer before copying out the byte buffer, in order
for it to really flush as much as possible.

12 years agoRemove second empty static block for Z_PARTIAL_FLUSH.
Mark Adler [Sat, 7 Jan 2012 19:00:37 +0000 (11:00 -0800)]
Remove second empty static block for Z_PARTIAL_FLUSH.

Z_PARTIAL_FLUSH would sometimes emit two empty static blocks instead
of one in order to provide enough lookahead for inflate to be able
to decode what was last compressed.  inflate no longer needs that
much lookahead, so this removes the possibility of emitting the
second empty static block.  Z_PARTIAL_FLUSH will now emit only one
empty static block.

12 years agoAllow deflatePrime() to insert bits in the middle of a stream.
Mark Adler [Sat, 7 Jan 2012 17:54:40 +0000 (09:54 -0800)]
Allow deflatePrime() to insert bits in the middle of a stream.

This allows the insertion of multiple empty static blocks for the
purpose of efficiently bringing a stream to a byte boundary.

12 years agoPermit Z_NULL arguments to deflatePending.
Mark Adler [Thu, 29 Dec 2011 08:15:44 +0000 (00:15 -0800)]
Permit Z_NULL arguments to deflatePending.

This avoids having to create useless variables for return values
that aren't needed.

12 years agoAvoid extraneous empty blocks when doing empty flushes.
Mark Adler [Thu, 29 Dec 2011 08:03:55 +0000 (00:03 -0800)]
Avoid extraneous empty blocks when doing empty flushes.

Previously when doing an empty flush, a extra static or stored block
could be emitted before the requested empty static or stored block.
This patch prevents the emission of empty blocks by the deflate_*
functions.

12 years agoPermit stronger flushes after Z_BLOCK flushes.
Mark Adler [Thu, 29 Dec 2011 07:57:14 +0000 (23:57 -0800)]
Permit stronger flushes after Z_BLOCK flushes.

The incorporation of the Z_BLOCK flush did not update the rejection
of lower ranked flushes immediately after higher ranked flushes with
no more input data.  This prevented an empty Z_SYNC_FLUSH right after
a Z_BLOCK flush, which would be desired to bring the deflate stream
to a byte boundary conditionally on whether or not it was already at
a byte boundary.  This patch re-ranks Z_BLOCK above Z_NO_FLUSH but
below Z_PARTIAL_FLUSH, allowing stronger empty flushes to follow a
Z_BLOCK flush.

12 years agoUpdate win32/Makefile.gcc to build test/*.c [Truta].
Mark Adler [Sat, 24 Dec 2011 04:56:27 +0000 (20:56 -0800)]
Update win32/Makefile.gcc to build test/*.c [Truta].

12 years agoUpdate AS400 build files and documentation [Monnerat].
Mark Adler [Tue, 20 Dec 2011 06:31:02 +0000 (22:31 -0800)]
Update AS400 build files and documentation [Monnerat].

Moves new function definitions in order to preserve shared library
compatibility with previous versions.  Also increases buffer size in
RPG binding and updates the documentation.

12 years agoRemove old/visualc6 given CMakefile and other alternatives.
Mark Adler [Mon, 19 Dec 2011 06:26:48 +0000 (22:26 -0800)]
Remove old/visualc6 given CMakefile and other alternatives.

12 years agoUpdate win32/Makefile.msc to build test/*.c [Truta].
Mark Adler [Mon, 19 Dec 2011 06:20:02 +0000 (22:20 -0800)]
Update win32/Makefile.msc to build test/*.c [Truta].

12 years agoDo not use _lseeki64 under Borland C++ [Truta].
Mark Adler [Mon, 19 Dec 2011 06:17:51 +0000 (22:17 -0800)]
Do not use _lseeki64 under Borland C++ [Truta].

12 years agoRestore gzgetc function for binary compatibility.
Mark Adler [Sun, 18 Dec 2011 22:47:08 +0000 (14:47 -0800)]
Restore gzgetc function for binary compatibility.

Newly compiled applications will use the gzgetc macro.

12 years agoChange version numbers to 1.2.5.3.
Mark Adler [Sun, 18 Dec 2011 20:07:25 +0000 (12:07 -0800)]
Change version numbers to 1.2.5.3.

12 years agozlib 1.2.5.2
Mark Adler [Sun, 18 Dec 2011 18:39:45 +0000 (10:39 -0800)]
zlib 1.2.5.2

12 years agoRemove hard-coding of resource compiler in CMakeLists.txt [Blammo]
Mark Adler [Sat, 17 Dec 2011 22:28:33 +0000 (14:28 -0800)]
Remove hard-coding of resource compiler in CMakeLists.txt [Blammo]

12 years agoDocument gzread() capability to read concurrently written files.
Mark Adler [Wed, 14 Dec 2011 12:21:00 +0000 (04:21 -0800)]
Document gzread() capability to read concurrently written files.

Also since gzread() will no longer return an error for an incomplete
gzip file, have gzclose() return an error if the last gzread() ended
in the middle of a gzip stream.

12 years agoAvoid use of Z_BUF_ERROR in gz* functions except for premature EOF.
Mark Adler [Wed, 14 Dec 2011 06:25:59 +0000 (22:25 -0800)]
Avoid use of Z_BUF_ERROR in gz* functions except for premature EOF.

Z_BUF_ERROR was also being used for an unsuccessful gzungetc and for buffer
lengths that didn't fit in an int.  Those uses were changed to Z_DATA_ERROR
in order to assure that Z_BUF_ERROR occurs only when a premature end of
input occurs, indicating that gzclearerr() can be used.

12 years agoFix bug in gzread.c when end-of-file is reached.
Mark Adler [Mon, 12 Dec 2011 07:30:56 +0000 (23:30 -0800)]
Fix bug in gzread.c when end-of-file is reached.

12 years agoFix gzeof() to behave just like feof() when read is not past end of file.
Mark Adler [Thu, 13 Oct 2011 06:24:31 +0000 (23:24 -0700)]
Fix gzeof() to behave just like feof() when read is not past end of file.

Before, gzeof() would return true (accurately) when the last read request
went just up to the end of the uncompressed data.  In the analogous case,
feof() would return false, only returning true when a read request goes
past the end of the file.  This patch corrects gzeof() to behave in the
same way as feof(), as noted in the zlib.h documentation.

12 years agoDo not set strm->adler when doing raw inflate.
Mark Adler [Sun, 11 Dec 2011 06:27:24 +0000 (22:27 -0800)]
Do not set strm->adler when doing raw inflate.

12 years agoHave inflate() with Z_FINISH avoid the allocation of a window.
Mark Adler [Fri, 9 Dec 2011 03:03:56 +0000 (19:03 -0800)]
Have inflate() with Z_FINISH avoid the allocation of a window.

inflate() avoided that allocation normally, until it was modified to
update the window on a normal completion so that inflateResetKeep()
could work.  This patch restores that behavior, but only when
Z_FINISH is used successfully to complete an inflation of a stream in
a single call of inflate().  The comments in zlib.h have been updated
accordingly.

12 years agoFix gzwrite.c to accommodate reduced memory zlib compilation.
Mark Adler [Thu, 8 Dec 2011 18:16:31 +0000 (10:16 -0800)]
Fix gzwrite.c to accommodate reduced memory zlib compilation.

gzwrite.c had hard-coded parameters to deflateInit2() which could
contradict compile-time options for the use of less memory and fewer
code bits.  This patch suggested by Karsten Saunte fixes that.

12 years agoEnable dictionary setting in middle of stream, and keeping the dictionary.
Mark Adler [Thu, 8 Dec 2011 07:57:37 +0000 (23:57 -0800)]
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.

12 years agoClean up infcover.c.
Mark Adler [Thu, 1 Dec 2011 04:19:05 +0000 (18:19 -1000)]
Clean up infcover.c.

12 years agoTest the inflate code with full coverage.
Mark Adler [Sun, 20 Nov 2011 16:43:17 +0000 (08:43 -0800)]
Test the inflate code with full coverage.

Add a cover target in Makefile and the test/infcover.c test program
to cover all of the code lines in the inf*.c source files.  The
coverage is run with memory allocation checking in order to expose
memory leaks.  The coverage testing is run using:

    ./configure --cover && make cover

12 years agoRemove code from inflate.c and infback.c that is impossible to execute.
Mark Adler [Sun, 20 Nov 2011 16:43:46 +0000 (08:43 -0800)]
Remove code from inflate.c and infback.c that is impossible to execute.

During coverage testing it was discovered that these two lines could
never pull more bits, since the immediately preceding for loop assures
that all of the code's bits are already pulled.

12 years agoSimplify incomplete code table filling in inflate_table().
Mark Adler [Sun, 6 Nov 2011 23:02:02 +0000 (15:02 -0800)]
Simplify incomplete code table filling in inflate_table().

Due to earlier changes in the error checking in inflate_table(), the
code to fill in a table for an incomplete code handled cases that can
never actually occur.  This simplifies that code to handle the only
possible case, which is a single empty table entry for a code with
a single symbol with a length of one bit.

12 years agoMove example.c and minigzip.c to test/.
Mark Adler [Tue, 22 Nov 2011 02:56:02 +0000 (18:56 -0800)]
Move example.c and minigzip.c to test/.

13 years agoInclude io.h for Turbo C / Borland C++.
Mark Adler [Tue, 22 Nov 2011 02:38:37 +0000 (18:38 -0800)]
Include io.h for Turbo C / Borland C++.

13 years agoFacilitate compilation with Borland C++ for pragmas and vsnprintf.
Mark Adler [Sat, 19 Nov 2011 07:14:14 +0000 (23:14 -0800)]
Facilitate compilation with Borland C++ for pragmas and vsnprintf.

13 years agoChange ON macro to Z_ARG to avoid application conflicts.
Mark Adler [Sun, 13 Nov 2011 21:35:02 +0000 (13:35 -0800)]
Change ON macro to Z_ARG to avoid application conflicts.

Using "ON" was a dumb idea, since it is common to have macros with
names like ON and OFF.  In fact, defining the OF macro back in 1995
was a bad idea, but now we're stuck with it.  Attempts to rename OF
to something else breaks many applications.

13 years agoSplit off AR options in Makefile.in and configure.
Mark Adler [Sun, 13 Nov 2011 21:04:26 +0000 (13:04 -0800)]
Split off AR options in Makefile.in and configure.

Adds ARFLAGS variable for options, where AR is now just the command
name.  So now $(AR) $(ARFLAGS) is used to build the static library.

13 years agoAdd files in contrib/minizip to aid in building libminizip.
Mark Adler [Sun, 13 Nov 2011 20:30:32 +0000 (12:30 -0800)]
Add files in contrib/minizip to aid in building libminizip.

Patch provided by Franz Schrober.

13 years agoNote behavior of uncompress() to provide as much data as it can.
Mark Adler [Sun, 23 Oct 2011 19:25:55 +0000 (12:25 -0700)]
Note behavior of uncompress() to provide as much data as it can.

13 years agoAdd comment to gzdopen() in zlib.h to use dup() when using fileno().
Mark Adler [Thu, 20 Oct 2011 16:07:58 +0000 (09:07 -0700)]
Add comment to gzdopen() in zlib.h to use dup() when using fileno().

A problem surfaced in a multi-threaded application where fileno() was
used to get a file descriptor from an fopen(), which was then fed to
gzdopen().  The problem occurred when the gzclose() followed by the
fclose() tried to close the same file descriptor twice.  If fclose()
were not done, there would be a memory leak.  The only way out is to
dup() the file descriptor so that gzclose() closes the duplicated
file descriptor, and fclose() closes the original file descriptor.

13 years agoAdd #define ZLIB_CONST option to use const in the z_stream interface.
Mark Adler [Wed, 19 Oct 2011 06:05:37 +0000 (23:05 -0700)]
Add #define ZLIB_CONST option to use const in the z_stream interface.

This permits compilers to check for the proper treatment of next_in and
msg in the z_stream structure.  This is an option instead of the default
in order to preserve backward compatibility.  Some applications make use
of the z_stream structure outside of zlib, and perform operations such
as free(strm->next_in), which would not be permitted when next_in is
const.  The #define ZLIB_CONST needs to precede the #include "zlib.h">,
in order to make next_in and msg const pointers in the z_stream type.

13 years agoFix indentation of code in inflate.c.
Mark Adler [Sun, 9 Oct 2011 22:25:48 +0000 (15:25 -0700)]
Fix indentation of code in inflate.c.

13 years agoAdd --cover option to ./configure for gcc coverage testing.
Mark Adler [Sun, 9 Oct 2011 17:16:43 +0000 (10:16 -0700)]
Add --cover option to ./configure for gcc coverage testing.

This adds the -fprofile-arcs and -ftest-coverage options when compiling
the source code for the static library.  Those same options must then be
used when linking the static library into an executable.  This updates
Makefile.in to remove and .gitignore to ignore the files generated when
testing coverage.

13 years agoMove example.c and minigzip.c to examples/ directory.
Mark Adler [Sun, 9 Oct 2011 16:50:48 +0000 (09:50 -0700)]
Move example.c and minigzip.c to examples/ directory.

13 years agoAdd undocumented inflateResetKeep() function for CAB file decoding.
Mark Adler [Sat, 8 Oct 2011 06:00:42 +0000 (23:00 -0700)]
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.

13 years agoAdd a ./config --solo option to make zlib subset with no libary use
Mark Adler [Fri, 7 Oct 2011 08:57:07 +0000 (01:57 -0700)]
Add a ./config --solo option to make zlib subset with no libary use

A common request has been the ability to compile zlib to require no
other libraries.  This --solo option provides that ability.  The price
is that the gz*, compress*, and uncompress functions are eliminated,
and that the user must provide memory allocation and free routines to
deflate and inflate when initializing.

13 years agoGet inffixed.h and MAKEFIXED result to match.
Mark Adler [Thu, 6 Oct 2011 03:32:32 +0000 (20:32 -0700)]
Get inffixed.h and MAKEFIXED result to match.

13 years agoUpdate python link in zlib man page.
Mark Adler [Mon, 3 Oct 2011 01:45:21 +0000 (18:45 -0700)]
Update python link in zlib man page.

13 years agoAdd a transparent write mode to gzopen() when 'T' is in the mode.
Mark Adler [Sun, 2 Oct 2011 20:24:43 +0000 (13:24 -0700)]
Add a transparent write mode to gzopen() when 'T' is in the mode.

13 years agoCorrect documentation of gzdirect() since junk at end now ignored.
Mark Adler [Sun, 2 Oct 2011 19:13:50 +0000 (12:13 -0700)]
Correct documentation of gzdirect() since junk at end now ignored.

13 years agoClarify how gzopen() appends in zlib.h comments.
Mark Adler [Sun, 2 Oct 2011 19:09:29 +0000 (12:09 -0700)]
Clarify how gzopen() appends in zlib.h comments.

13 years agoMerge vestigial vsnprintf determination from zutil.h to gzguts.h.
Mark Adler [Sun, 2 Oct 2011 18:15:00 +0000 (11:15 -0700)]
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.

13 years agoUpdate zconf.h.cmakein on make distclean.
Mark Adler [Sun, 2 Oct 2011 08:01:47 +0000 (01:01 -0700)]
Update zconf.h.cmakein on make distclean.

13 years agoInclude zconf.h.cmakein for windows large file support.
Mark Adler [Sat, 1 Oct 2011 17:19:36 +0000 (10:19 -0700)]
Include zconf.h.cmakein for windows large file support.

13 years agoInclude zconf.h for windows large file support.
Mark Adler [Sat, 1 Oct 2011 17:16:04 +0000 (10:16 -0700)]
Include zconf.h for windows large file support.

13 years agoAlways add large file support for windows
Tor Lillqvist [Sun, 18 Sep 2011 19:46:44 +0000 (21:46 +0200)]
Always add large file support for windows