Compare commits

..

2 Commits

Author SHA1 Message Date
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
22 changed files with 44 additions and 182 deletions

View File

@@ -1,7 +1,7 @@
ChangeLog file for zlib ChangeLog file for zlib
Changes in 1.2.4 (11 Mar 2010) Changes in 1.2.4 (14 Mar 2010)
- Fix VER3 extraction in configure for no fourth subversion - Fix VER3 extraction in configure for no fourth subversion
- Update zlib.3, add docs to Makefile.in to make .pdf out of it - Update zlib.3, add docs to Makefile.in to make .pdf out of it
- Add zlib.3.pdf to distribution - Add zlib.3.pdf to distribution
@@ -25,6 +25,13 @@ Changes in 1.2.4 (11 Mar 2010)
- Update win32/Makefile.msc, add ZLIB_VER_SUBREVISION [Rowe] - Update win32/Makefile.msc, add ZLIB_VER_SUBREVISION [Rowe]
- Fix memory leaks in gzclose_r() and gzclose_w(), file leak in gz_open() - Fix memory leaks in gzclose_r() and gzclose_w(), file leak in gz_open()
- Add contrib/gcc_gvmat64 for longest_match and inflate_fast [Vollant] - Add contrib/gcc_gvmat64 for longest_match and inflate_fast [Vollant]
- Remove *64 functions from win32/zlib.def (they're not 64-bit yet)
- Fix bug in void-returning vsprintf() case in gzwrite.c
- Fix name change from inflate.h in contrib/inflate86/inffas86.c
- Check if temporary file exists before removing in make_vms.com [Zinser]
- Fix make install and uninstall for --static option
- Fix usage of _MSC_VER in gzguts.h and zutil.h [Truta]
- Update readme.txt in contrib/masmx64 and masmx86 to assemble
Changes in 1.2.3.9 (21 Feb 2010) Changes in 1.2.3.9 (21 Feb 2010)
- Expunge gzio.c - Expunge gzio.c

12
FAQ
View File

@@ -25,7 +25,7 @@ The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
4. compress() returns Z_BUF_ERROR. 4. compress() returns Z_BUF_ERROR.
Make sure that before the call of compress, the length of the compressed Make sure that before the call of compress(), the length of the compressed
buffer is equal to the available size of the compressed buffer and not buffer is equal to the available size of the compressed buffer and not
zero. For Visual Basic, check that this parameter is passed by reference zero. For Visual Basic, check that this parameter is passed by reference
("as any"), not by value ("as long"). ("as any"), not by value ("as long").
@@ -108,8 +108,8 @@ The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
16. Can zlib decode Flate data in an Adobe PDF file? 16. Can zlib decode Flate data in an Adobe PDF file?
Yes. See http://www.fastio.com/ (ClibPDF), or http://www.pdflib.com/ . Yes. See http://www.pdflib.com/ . To modify PDF forms, see
To modify PDF forms, see http://sourceforge.net/projects/acroformtool/ . http://sourceforge.net/projects/acroformtool/ .
17. Why am I getting this "register_frame_info not found" error on Solaris? 17. Why am I getting this "register_frame_info not found" error on Solaris?
@@ -152,8 +152,8 @@ The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
Yes. However any library routines that zlib uses and any application- Yes. However any library routines that zlib uses and any application-
provided memory allocation routines must also be thread-safe. zlib's gz* provided memory allocation routines must also be thread-safe. zlib's gz*
functions use stdio library routines, and most of zlib's functions use the functions use stdio library routines, and most of zlib's functions use the
library memory allocation routines by default. zlib's Init functions allow library memory allocation routines by default. zlib's *Init* functions
for the application to provide custom memory allocation routines. allow for the application to provide custom memory allocation routines.
Of course, you should only operate on any given zlib or gzip stream from a Of course, you should only operate on any given zlib or gzip stream from a
single thread at a time. single thread at a time.
@@ -354,7 +354,7 @@ The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
No. The files in contrib are not part of zlib. They were contributed by No. The files in contrib are not part of zlib. They were contributed by
other authors and are provided as a convenience to the user within the zlib other authors and are provided as a convenience to the user within the zlib
distribution. Each of the items in contrib have their own license. distribution. Each item in contrib has its own license.
43. Is zlib subject to export controls? What is its ECCN? 43. Is zlib subject to export controls? What is its ECCN?

View File

@@ -1,5 +1,5 @@
all: all:
-@echo "Use ./configure first. Thank you." -@echo "Please use ./configure first. Thank you."
distclean: distclean:
make -f Makefile.in distclean make -f Makefile.in distclean

View File

@@ -164,9 +164,10 @@ install-libs: $(LIBS)
-@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
-@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
cp $(LIBS) $(DESTDIR)$(libdir) cp $(LIBS) $(DESTDIR)$(libdir)
cd $(DESTDIR)$(libdir); chmod 755 $(SHAREDLIB) ; chmod u=rw,go=r $(STATICLIB) cd $(DESTDIR)$(libdir); chmod u=rw,go=r $(STATICLIB)
-@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 -@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
cd $(DESTDIR)$(libdir); if test -f $(SHAREDLIBV); then \ -@cd $(DESTDIR)$(libdir); if test "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
chmod 755 $(SHAREDLIBV); \
rm -f $(SHAREDLIB) $(SHAREDLIBM); \ rm -f $(SHAREDLIB) $(SHAREDLIBM); \
ln -s $(SHAREDLIBV) $(SHAREDLIB); \ ln -s $(SHAREDLIBV) $(SHAREDLIB); \
ln -s $(SHAREDLIBV) $(SHAREDLIBM); \ ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
@@ -187,7 +188,7 @@ install: install-libs
uninstall: uninstall:
cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h
cd $(DESTDIR)$(libdir); rm -f libz.a; \ cd $(DESTDIR)$(libdir); rm -f libz.a; \
if test -f $(SHAREDLIBV); then \ if test "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \ rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
fi fi
cd $(DESTDIR)$(man3dir); rm -f zlib.3 cd $(DESTDIR)$(man3dir); rm -f zlib.3
@@ -218,7 +219,7 @@ maintainer-clean: distclean
distclean: clean zconf docs distclean: clean zconf docs
rm -f Makefile zlib.pc rm -f Makefile zlib.pc
-@rm -f .DS_Store -@rm -f .DS_Store
-@printf 'all:\n\t-@echo "Use ./configure first. Thank you."\n' > Makefile -@printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile
-@printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile -@printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile
-@touch -r Makefile.in Makefile -@touch -r Makefile.in Makefile

3
configure vendored
View File

@@ -215,6 +215,9 @@ if test $shared -eq 0; then
LDSHARED="$CC" LDSHARED="$CC"
ALL="static" ALL="static"
TEST="all teststatic" TEST="all teststatic"
SHAREDLIB=""
SHAREDLIBV=""
SHAREDLIBM=""
echo Building static library $STATICLIB version $VER with $CC. echo Building static library $STATICLIB version $VER with $CC.
else else
ALL="static shared" ALL="static shared"

View File

@@ -64,7 +64,7 @@ unsigned short FAR *work;
static const unsigned short lext[31] = { /* Length codes 257..285 extra */ static const unsigned short lext[31] = { /* Length codes 257..285 extra */
128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132, 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
133, 133, 133, 133, 144, 66, 199}; 133, 133, 133, 133, 144, 64, 195};
static const unsigned short dbase[32] = { /* Distance codes 0..31 base */ static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,

View File

@@ -113,7 +113,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
ar.beg = ar.out - (start - strm->avail_out); ar.beg = ar.out - (start - strm->avail_out);
ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT); ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT);
ar.wsize = state->wsize; ar.wsize = state->wsize;
ar.write = state->write; ar.write = state->wnext;
ar.window = state->window; ar.window = state->window;
ar.hold = state->hold; ar.hold = state->hold;
ar.bits = state->bits; ar.bits = state->bits;

View File

@@ -12,7 +12,10 @@ inffasx64.asm and inffas8664.c were written by Chris Anderson, by optimizing
Use instructions Use instructions
---------------- ----------------
Copy these files into the zlib source directory. Assemble the .asm files using MASM and put the object files into the zlib source
directory. You can also get object files here:
http://www.winimage.com/zLibDll/zlib124_masm_obj.zip
define ASMV and ASMINF in your project. Include inffas8664.c in your source tree, define ASMV and ASMINF in your project. Include inffas8664.c in your source tree,
and inffasx64.obj and gvmat64.obj as object to link. and inffasx64.obj and gvmat64.obj as object to link.

Binary file not shown.

View File

@@ -7,9 +7,15 @@ longest_match() and inflate_fast().
Use instructions Use instructions
---------------- ----------------
Copy these files into the zlib source directory, then run the Assemble using MASM, and copy the object files into the zlib source
appropriate makefile, as suggested below. directory, then run the appropriate makefile, as suggested below. You can
donwload MASM from here:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64
You can also get objects files here:
http://www.winimage.com/zLibDll/zlib124_masm_obj.zip
Build instructions Build instructions
------------------ ------------------

View File

@@ -115,9 +115,7 @@ EXPORTS
; zlib1 v1.2.4 added: ; zlib1 v1.2.4 added:
adler32_combine @140 adler32_combine @140
adler32_combine64 @141
crc32_combine @142 crc32_combine @142
crc32_combine64 @143
deflateSetHeader @144 deflateSetHeader @144
deflateTune @145 deflateTune @145
gzbuffer @146 gzbuffer @146
@@ -125,10 +123,6 @@ EXPORTS
gzclose_w @148 gzclose_w @148
gzdirect @149 gzdirect @149
gzoffset @150 gzoffset @150
gzoffset64 @151
gzopen64 @152
gzseek64 @153
gztell64 @154
inflateGetHeader @156 inflateGetHeader @156
inflateMark @157 inflateMark @157
inflatePrime @158 inflatePrime @158

View File

@@ -115,9 +115,7 @@ EXPORTS
; zlib1 v1.2.4 added: ; zlib1 v1.2.4 added:
adler32_combine @140 adler32_combine @140
adler32_combine64 @141
crc32_combine @142 crc32_combine @142
crc32_combine64 @143
deflateSetHeader @144 deflateSetHeader @144
deflateTune @145 deflateTune @145
gzbuffer @146 gzbuffer @146
@@ -125,10 +123,6 @@ EXPORTS
gzclose_w @148 gzclose_w @148
gzdirect @149 gzdirect @149
gzoffset @150 gzoffset @150
gzoffset64 @151
gzopen64 @152
gzseek64 @153
gztell64 @154
inflateGetHeader @156 inflateGetHeader @156
inflateMark @157 inflateMark @157
inflatePrime @158 inflatePrime @158

View File

@@ -27,7 +27,7 @@
# define NO_GZCOMPRESS # define NO_GZCOMPRESS
#endif #endif
#ifdef WIN32 #ifdef _MSC_VER
# include <io.h> # include <io.h>
# define vsnprintf _vsnprintf # define vsnprintf _vsnprintf
#endif #endif

View File

@@ -318,7 +318,7 @@ int ZEXPORTVA gzprintf (gzFile file, const char *format, ...)
# ifdef HAS_vsprintf_void # ifdef HAS_vsprintf_void
(void)vsprintf(state->in, format, va); (void)vsprintf(state->in, format, va);
va_end(va); va_end(va);
for (len = 0; len < state->in; len++) for (len = 0; len < size; len++)
if (state->in[len] == 0) break; if (state->in[len] == 0) break;
# else # else
len = vsprintf(state->in, format, va); len = vsprintf(state->in, format, va);

View File

@@ -62,7 +62,7 @@ unsigned short FAR *work;
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
static const unsigned short lext[31] = { /* Length codes 257..285 extra */ static const unsigned short lext[31] = { /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 66, 199}; 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 64, 195};
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,

View File

@@ -134,7 +134,7 @@ $ write aconf "#define ftello64 ftell"
$ write aconf "#endif" $ write aconf "#endif"
$ close aconf_in $ close aconf_in
$ close aconf $ close aconf
$ delete 'th';* $ if f$search("''th'") .nes. "" then delete 'th';*
$! Build the thing plain or with mms $! Build the thing plain or with mms
$! $!
$ write sys$output "Compiling Zlib sources ..." $ write sys$output "Compiling Zlib sources ..."

View File

@@ -1,140 +0,0 @@
# Makefile for zlib, derived from Makefile.dj2.
# Modified for mingw32 by C. Spieler, 6/16/98.
# Updated for zlib 1.2.x by Christian Spieler and Cosmin Truta, Mar-2003.
# Last updated: 1-Aug-2003.
# Tested under Cygwin and MinGW.
# Copyright (C) 1995-2003 Jean-loup Gailly.
# For conditions of distribution and use, see copyright notice in zlib.h
# To compile, or to compile and test, type:
#
# make -fmakefile.gcc; make test testdll -fmakefile.gcc
#
# To use the asm code, type:
# cp contrib/asm?86/match.S ./match.S
# make LOC=-DASMV OBJA=match.o -fmakefile.gcc
#
# To install libz.a, zconf.h and zlib.h in the system directories, type:
#
# make install -fmakefile.gcc
# Note:
# If the platform is *not* MinGW (e.g. it is Cygwin or UWIN),
# the DLL name should be changed from "zlib1.dll".
STATICLIB = libz.a
SHAREDLIB = zlib1.dll
IMPLIB = libzdll.a
#LOC = -DASMV
#LOC = -DDEBUG -g
CC = gcc
CFLAGS = $(LOC) -O3 -Wall
AS = $(CC)
ASFLAGS = $(LOC) -Wall
LD = $(CC)
LDFLAGS = $(LOC) -s
AR = ar
ARFLAGS = rcs
RC = windres
RCFLAGS = --define GCC_WINDRES
CP = cp -fp
# If GNU install is available, replace $(CP) with install.
INSTALL = $(CP)
RM = rm -f
prefix = /usr/local
exec_prefix = $(prefix)
OBJS = adler32.o compress.o crc32.o deflate.o infback.o \
inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
OBJA =
all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) example minigzip example_d minigzip_d
test: example minigzip
./example
echo hello world | ./minigzip | ./minigzip -d
testdll: example_d minigzip_d
./example_d
echo hello world | ./minigzip_d | ./minigzip_d -d
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
.S.o:
$(AS) $(ASFLAGS) -c -o $@ $<
$(STATICLIB): $(OBJS) $(OBJA)
$(AR) $(ARFLAGS) $@ $(OBJS) $(OBJA)
$(IMPLIB): $(SHAREDLIB)
$(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlibrc.o
dllwrap --driver-name $(CC) --def win32/zlib.def \
--implib $(IMPLIB) -o $@ $(OBJS) $(OBJA) zlibrc.o
strip $@
example: example.o $(STATICLIB)
$(LD) $(LDFLAGS) -o $@ example.o $(STATICLIB)
minigzip: minigzip.o $(STATICLIB)
$(LD) $(LDFLAGS) -o $@ minigzip.o $(STATICLIB)
example_d: example.o $(IMPLIB)
$(LD) $(LDFLAGS) -o $@ example.o $(IMPLIB)
minigzip_d: minigzip.o $(IMPLIB)
$(LD) $(LDFLAGS) -o $@ minigzip.o $(IMPLIB)
zlibrc.o: win32/zlib1.rc
$(RC) $(RCFLAGS) -o $@ win32/zlib1.rc
# INCLUDE_PATH and LIBRARY_PATH must be set.
.PHONY: install uninstall clean
install: zlib.h zconf.h $(LIB)
-@if not exist $(INCLUDE_PATH)/nul mkdir $(INCLUDE_PATH)
-@if not exist $(LIBRARY_PATH)/nul mkdir $(LIBRARY_PATH)
-$(INSTALL) zlib.h $(INCLUDE_PATH)
-$(INSTALL) zconf.h $(INCLUDE_PATH)
-$(INSTALL) $(STATICLIB) $(LIBRARY_PATH)
-$(INSTALL) $(IMPLIB) $(LIBRARY_PATH)
uninstall:
-$(RM) $(INCLUDE_PATH)/zlib.h
-$(RM) $(INCLUDE_PATH)/zconf.h
-$(RM) $(LIBRARY_PATH)/$(STATICLIB)
-$(RM) $(LIBRARY_PATH)/$(IMPLIB)
clean:
-$(RM) $(STATICLIB)
-$(RM) $(SHAREDLIB)
-$(RM) $(IMPLIB)
-$(RM) *.o
-$(RM) *.exe
-$(RM) foo.gz
adler32.o: zlib.h zconf.h
compress.o: zlib.h zconf.h
crc32.o: crc32.h zlib.h zconf.h
deflate.o: deflate.h zutil.h zlib.h zconf.h
example.o: zlib.h zconf.h
inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
minigzip.o: zlib.h zconf.h
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
uncompr.o: zlib.h zconf.h
zutil.o: zutil.h zlib.h zconf.h

View File

@@ -68,12 +68,6 @@ EXPORTS
inflateInit_ inflateInit_
inflateInit2_ inflateInit2_
inflateBackInit_ inflateBackInit_
gzopen64
gzseek64
gztell64
gzoffset64
adler32_combine64
crc32_combine64
zError zError
inflateSyncPoint inflateSyncPoint
get_crc_table get_crc_table

2
zlib.3
View File

@@ -1,4 +1,4 @@
.TH ZLIB 3 "11 March 2010" .TH ZLIB 3 "14 March 2010"
.SH NAME .SH NAME
zlib \- compression/decompression library zlib \- compression/decompression library
.SH SYNOPSIS .SH SYNOPSIS

Binary file not shown.

2
zlib.h
View File

@@ -1,5 +1,5 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library /* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.3.9, Mar 11th, 2010 version 1.2.4, Mar 14th, 2010
Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler

View File

@@ -17,7 +17,7 @@
#include "zlib.h" #include "zlib.h"
#ifdef STDC #ifdef STDC
# if !(defined(_WIN32_WCE) && defined(_MSV_VER)) # if !(defined(_WIN32_WCE) && defined(_MSC_VER))
# include <stddef.h> # include <stddef.h>
# endif # endif
# include <string.h> # include <string.h>