summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:23:01 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:23:01 -0700
commitb97ec631c6f7dd9cff2e3caf3b38e70b006e1b2d (patch)
tree2a9609068ca980db627bceb3f5a48638eaad1c13
parentf81ba93d4a7e43fccf4730e5e7404ee765a76e3e (diff)
downloadzlib-1.2.0.7.tar.gz
zlib-1.2.0.7.tar.bz2
zlib-1.2.0.7.zip
zlib 1.2.0.7v1.2.0.7
-rw-r--r--ChangeLog17
-rw-r--r--Makefile63
-rw-r--r--Makefile.in63
-rw-r--r--README33
-rw-r--r--amiga/Makefile.pup66
-rw-r--r--amiga/Makefile.sas (renamed from old/amiga/Makefile.sas)33
-rwxr-xr-xconfigure57
-rw-r--r--contrib/infback9/infback9.c6
-rw-r--r--contrib/infback9/inftree9.c4
-rw-r--r--contrib/untgz/untgz.c212
-rw-r--r--deflate.c2
-rw-r--r--inftrees.c4
-rw-r--r--old/README2
-rw-r--r--old/amiga/Makefile.pup66
-rw-r--r--old/msdos/Makefile.b32104
-rw-r--r--old/msdos/Makefile.wat103
-rw-r--r--qnx/package.qpg10
-rw-r--r--trees.c3
-rw-r--r--win32/zlib1.rc8
-rw-r--r--zlib.34
-rw-r--r--zlib.h6
-rw-r--r--zutil.h3
22 files changed, 321 insertions, 548 deletions
diff --git a/ChangeLog b/ChangeLog
index 0193989..cf9dcb6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,17 +1,28 @@
1 1
2 ChangeLog file for zlib 2 ChangeLog file for zlib
3 3
4Changes in 1.2.0.7 (21 September 2003)
5- Correct some debug formats in contrib/infback9
6- Cast a type in a debug statement in trees.c
7- Change search and replace delimiter in configure from % to # [Beebe]
8- Update contrib/untgz to 0.2 with various fixes [Truta]
9- Add build support for Amiga [Nikl]
10- Remove some directories in old that have been updated to 1.2
11- Add dylib building for Mac OS X in configure and Makefile.in
12- Remove old distribution stuff from Makefile
13- Update README to point for DLL_FAQ.txt, and add comment on Mac OS X
14- Update links in README
15
4Changes in 1.2.0.6 (13 September 2003) 16Changes in 1.2.0.6 (13 September 2003)
5- Minor FAQ updates 17- Minor FAQ updates
6- Update contrib/minizip to 1.00 [Vollant] 18- Update contrib/minizip to 1.00 [Vollant]
7- Remove test of gz functions in example.c when GZ_COMPRESS defined [Truta] 19- Remove test of gz functions in example.c when GZ_COMPRESS defined [Truta]
8- Updated POSTINC comment for 68060 [Nikl] 20- Update POSTINC comment for 68060 [Nikl]
9- Added contrib/infback9 with deflate64 decoding (unsupported) 21- Add contrib/infback9 with deflate64 decoding (unsupported)
10- For MVS define NO_vsnprintf and undefine FAR [van Burik] 22- For MVS define NO_vsnprintf and undefine FAR [van Burik]
11- Add pragma for fdopen on MVS [van Burik] 23- Add pragma for fdopen on MVS [van Burik]
12 24
13Changes in 1.2.0.5 (8 September 2003) 25Changes in 1.2.0.5 (8 September 2003)
14- Add infback9 diffs to contrib
15- Add OF to inflateBackEnd() declaration in zlib.h 26- Add OF to inflateBackEnd() declaration in zlib.h
16- Remember start when using gzdopen in the middle of a file 27- Remember start when using gzdopen in the middle of a file
17- Use internal off_t counters in gz* functions to properly handle seeks 28- Use internal off_t counters in gz* functions to properly handle seeks
diff --git a/Makefile b/Makefile
index ccf0a56..039280d 100644
--- a/Makefile
+++ b/Makefile
@@ -28,9 +28,10 @@ LDFLAGS=libz.a
28LDSHARED=$(CC) 28LDSHARED=$(CC)
29CPP=$(CC) -E 29CPP=$(CC) -E
30 30
31VER=1.2.0.6
32LIBS=libz.a 31LIBS=libz.a
33SHAREDLIB=libz.so 32SHAREDLIB=libz.so
33SHAREDLIBV=libz.so.1.2.0.7
34SHAREDLIBM=libz.so.1
34 35
35AR=ar rc 36AR=ar rc
36RANLIB=ranlib 37RANLIB=ranlib
@@ -52,19 +53,6 @@ OBJA =
52 53
53TEST_OBJS = example.o minigzip.o 54TEST_OBJS = example.o minigzip.o
54 55
55# Note: this has not been updated for zlib 1.2.0
56DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \
57 algorithm.txt zlib.3 zlib.html \
58 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
59 nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
60 contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
61 contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
62 contrib/asm[56]86/*.S contrib/iostream/*.cpp \
63 contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
64 contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
65 contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
66 contrib/delphi*/*.???
67
68all: example minigzip 56all: example minigzip
69 57
70check: test 58check: test
@@ -88,11 +76,11 @@ match.o: match.S
88 mv _match.o match.o 76 mv _match.o match.o
89 rm -f _match.s 77 rm -f _match.s
90 78
91$(SHAREDLIB).$(VER): $(OBJS) 79$(SHAREDLIBV): $(OBJS)
92 $(LDSHARED) -o $@ $(OBJS) 80 $(LDSHARED) -o $@ $(OBJS)
93 rm -f $(SHAREDLIB) $(SHAREDLIB).1 81 rm -f $(SHAREDLIB) $(SHAREDLIBM)
94 ln -s $@ $(SHAREDLIB) 82 ln -s $@ $(SHAREDLIB)
95 ln -s $@ $(SHAREDLIB).1 83 ln -s $@ $(SHAREDLIBM)
96 84
97example: example.o $(LIBS) 85example: example.o $(LIBS)
98 $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) 86 $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
@@ -110,10 +98,10 @@ install: $(LIBS)
110 cp $(LIBS) $(libdir) 98 cp $(LIBS) $(libdir)
111 cd $(libdir); chmod 755 $(LIBS) 99 cd $(libdir); chmod 755 $(LIBS)
112 -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 100 -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
113 cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \ 101 cd $(libdir); if test -f $(SHAREDLIBV); then \
114 rm -f $(SHAREDLIB) $(SHAREDLIB).1; \ 102 rm -f $(SHAREDLIB) $(SHAREDLIBM); \
115 ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \ 103 ln -s $(SHAREDLIBV) $(SHAREDLIB); \
116 ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).1; \ 104 ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
117 (ldconfig || true) >/dev/null 2>&1; \ 105 (ldconfig || true) >/dev/null 2>&1; \
118 fi 106 fi
119 cp zlib.3 $(man3dir) 107 cp zlib.3 $(man3dir)
@@ -123,20 +111,15 @@ install: $(LIBS)
123 111
124uninstall: 112uninstall:
125 cd $(includedir); \ 113 cd $(includedir); \
126 v=$(VER); \
127 if test -f zlib.h; then \
128 v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
129 rm -f zlib.h zconf.h; \
130 fi; \
131 cd $(libdir); rm -f libz.a; \ 114 cd $(libdir); rm -f libz.a; \
132 if test -f $(SHAREDLIB).$$v; then \ 115 if test -f $(SHAREDLIBV); then \
133 rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \ 116 rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
134 fi 117 fi
135 cd $(man3dir); rm -f zlib.3 118 cd $(man3dir); rm -f zlib.3
136 119
137mostlyclean: clean 120mostlyclean: clean
138clean: 121clean:
139 rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \ 122 rm -f *.o *~ example minigzip libz.* foo.gz so_locations \
140 _match.s maketree contrib/infback9/*.o 123 _match.s maketree contrib/infback9/*.o
141 124
142maintainer-clean: distclean 125maintainer-clean: distclean
@@ -145,28 +128,6 @@ distclean: clean
145 cp -p zconf.in.h zconf.h 128 cp -p zconf.in.h zconf.h
146 rm -f .DS_Store 129 rm -f .DS_Store
147 130
148zip:
149 echo Warning: this has not been updated for zlib 1.2.0 -- do not use
150 mv Makefile Makefile~; cp -p Makefile.in Makefile
151 rm -f test.c ztest*.c contrib/minizip/test.zip
152 v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
153 zip -ul9 zlib$$v $(DISTFILES)
154 mv Makefile~ Makefile
155
156dist:
157 echo Warning: this has not been updated for zlib 1.2.0 -- do not use
158 mv Makefile Makefile~; cp -p Makefile.in Makefile
159 rm -f test.c ztest*.c contrib/minizip/test.zip
160 d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
161 rm -f $$d.tar.gz; \
162 if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
163 files=""; \
164 for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
165 cd ..; \
166 GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
167 if test ! -d $$d; then rm -f $$d; fi
168 mv Makefile~ Makefile
169
170tags: 131tags:
171 etags *.[ch] 132 etags *.[ch]
172 133
diff --git a/Makefile.in b/Makefile.in
index ccf0a56..039280d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -28,9 +28,10 @@ LDFLAGS=libz.a
28LDSHARED=$(CC) 28LDSHARED=$(CC)
29CPP=$(CC) -E 29CPP=$(CC) -E
30 30
31VER=1.2.0.6
32LIBS=libz.a 31LIBS=libz.a
33SHAREDLIB=libz.so 32SHAREDLIB=libz.so
33SHAREDLIBV=libz.so.1.2.0.7
34SHAREDLIBM=libz.so.1
34 35
35AR=ar rc 36AR=ar rc
36RANLIB=ranlib 37RANLIB=ranlib
@@ -52,19 +53,6 @@ OBJA =
52 53
53TEST_OBJS = example.o minigzip.o 54TEST_OBJS = example.o minigzip.o
54 55
55# Note: this has not been updated for zlib 1.2.0
56DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \
57 algorithm.txt zlib.3 zlib.html \
58 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
59 nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
60 contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
61 contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
62 contrib/asm[56]86/*.S contrib/iostream/*.cpp \
63 contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
64 contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
65 contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
66 contrib/delphi*/*.???
67
68all: example minigzip 56all: example minigzip
69 57
70check: test 58check: test
@@ -88,11 +76,11 @@ match.o: match.S
88 mv _match.o match.o 76 mv _match.o match.o
89 rm -f _match.s 77 rm -f _match.s
90 78
91$(SHAREDLIB).$(VER): $(OBJS) 79$(SHAREDLIBV): $(OBJS)
92 $(LDSHARED) -o $@ $(OBJS) 80 $(LDSHARED) -o $@ $(OBJS)
93 rm -f $(SHAREDLIB) $(SHAREDLIB).1 81 rm -f $(SHAREDLIB) $(SHAREDLIBM)
94 ln -s $@ $(SHAREDLIB) 82 ln -s $@ $(SHAREDLIB)
95 ln -s $@ $(SHAREDLIB).1 83 ln -s $@ $(SHAREDLIBM)
96 84
97example: example.o $(LIBS) 85example: example.o $(LIBS)
98 $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) 86 $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
@@ -110,10 +98,10 @@ install: $(LIBS)
110 cp $(LIBS) $(libdir) 98 cp $(LIBS) $(libdir)
111 cd $(libdir); chmod 755 $(LIBS) 99 cd $(libdir); chmod 755 $(LIBS)
112 -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 100 -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
113 cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \ 101 cd $(libdir); if test -f $(SHAREDLIBV); then \
114 rm -f $(SHAREDLIB) $(SHAREDLIB).1; \ 102 rm -f $(SHAREDLIB) $(SHAREDLIBM); \
115 ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \ 103 ln -s $(SHAREDLIBV) $(SHAREDLIB); \
116 ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).1; \ 104 ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
117 (ldconfig || true) >/dev/null 2>&1; \ 105 (ldconfig || true) >/dev/null 2>&1; \
118 fi 106 fi
119 cp zlib.3 $(man3dir) 107 cp zlib.3 $(man3dir)
@@ -123,20 +111,15 @@ install: $(LIBS)
123 111
124uninstall: 112uninstall:
125 cd $(includedir); \ 113 cd $(includedir); \
126 v=$(VER); \
127 if test -f zlib.h; then \
128 v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
129 rm -f zlib.h zconf.h; \
130 fi; \
131 cd $(libdir); rm -f libz.a; \ 114 cd $(libdir); rm -f libz.a; \
132 if test -f $(SHAREDLIB).$$v; then \ 115 if test -f $(SHAREDLIBV); then \
133 rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \ 116 rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
134 fi 117 fi
135 cd $(man3dir); rm -f zlib.3 118 cd $(man3dir); rm -f zlib.3
136 119
137mostlyclean: clean 120mostlyclean: clean
138clean: 121clean:
139 rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \ 122 rm -f *.o *~ example minigzip libz.* foo.gz so_locations \
140 _match.s maketree contrib/infback9/*.o 123 _match.s maketree contrib/infback9/*.o
141 124
142maintainer-clean: distclean 125maintainer-clean: distclean
@@ -145,28 +128,6 @@ distclean: clean
145 cp -p zconf.in.h zconf.h 128 cp -p zconf.in.h zconf.h
146 rm -f .DS_Store 129 rm -f .DS_Store
147 130
148zip:
149 echo Warning: this has not been updated for zlib 1.2.0 -- do not use
150 mv Makefile Makefile~; cp -p Makefile.in Makefile
151 rm -f test.c ztest*.c contrib/minizip/test.zip
152 v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
153 zip -ul9 zlib$$v $(DISTFILES)
154 mv Makefile~ Makefile
155
156dist:
157 echo Warning: this has not been updated for zlib 1.2.0 -- do not use
158 mv Makefile Makefile~; cp -p Makefile.in Makefile
159 rm -f test.c ztest*.c contrib/minizip/test.zip
160 d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
161 rm -f $$d.tar.gz; \
162 if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
163 files=""; \
164 for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
165 cd ..; \
166 GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
167 if test ! -d $$d; then rm -f $$d; fi
168 mv Makefile~ Makefile
169
170tags: 131tags:
171 etags *.[ch] 132 etags *.[ch]
172 133
diff --git a/README b/README
index db5ce3c..eda18fa 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
1ZLIB DATA COMPRESSION LIBRARY 1ZLIB DATA COMPRESSION LIBRARY
2 2
3zlib 1.2.0.6 is a general purpose data compression library. All the code is 3zlib 1.2.0.7 is a general purpose data compression library. All the code is
4thread safe. The data format used by the zlib library is described by RFCs 4thread safe. The data format used by the zlib library is described by RFCs
5(Request for Comments) 1950 to 1952 in the files 5(Request for Comments) 1950 to 1952 in the files
6http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) 6http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
@@ -8,7 +8,7 @@ and rfc1952.txt (gzip format). These documents are also available in other
8formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html 8formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
9 9
10All functions of the compression library are documented in the file zlib.h 10All functions of the compression library are documented in the file zlib.h
11(volunteer to write man pages welcome, contact jloup@gzip.org). A usage example 11(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
12of the library is given in the file example.c which also tests that the library 12of the library is given in the file example.c which also tests that the library
13is working correctly. Another example is given in the file minigzip.c. The 13is working correctly. Another example is given in the file minigzip.c. The
14compression library itself is composed of all source files except example.c and 14compression library itself is composed of all source files except example.c and
@@ -34,12 +34,12 @@ Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
34issue of Dr. Dobb's Journal; a copy of the article is available in 34issue of Dr. Dobb's Journal; a copy of the article is available in
35http://dogma.net/markn/articles/zlibtool/zlibtool.htm 35http://dogma.net/markn/articles/zlibtool/zlibtool.htm
36 36
37The changes made in version 1.2.0.6 are documented in the file ChangeLog. 37The changes made in version 1.2.0.7 are documented in the file ChangeLog.
38 38
39Unsupported third party contributions are provided in directory "contrib". 39Unsupported third party contributions are provided in directory "contrib".
40 40
41A Java implementation of zlib is available in the Java Development Kit 41A Java implementation of zlib is available in the Java Development Kit
42http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html 42http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/package-summary.html
43See the zlib home page http://www.zlib.org for details. 43See the zlib home page http://www.zlib.org for details.
44 44
45A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is in the 45A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is in the
@@ -51,26 +51,16 @@ available in Python 1.5 and later versions, see
51http://www.python.org/doc/lib/module-zlib.html 51http://www.python.org/doc/lib/module-zlib.html
52 52
53A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com> is 53A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com> is
54availlable at http://www.westend.com/~kupries/doc/trf/man/man.html 54availlable at http://www.oche.de/~akupries/soft/trf/trf_zip.html
55 55
56An experimental package to read and write files in .zip format, written on top 56An experimental package to read and write files in .zip format, written on top
57of zlib by Gilles Vollant <info@winimage.com>, is available at 57of zlib by Gilles Vollant <info@winimage.com>, is available in the
58http://www.winimage.com/zLibDll/unzip.html and also in the contrib/minizip 58contrib/minizip directory of zlib.
59directory of zlib.
60 59
61 60
62Notes for some targets: 61Notes for some targets:
63 62
64- To build a Windows DLL version, include in a DLL project zlib.def, zlib.rc 63- For Windows DLL versions, please see win32/DLL_FAQ.txt
65 and all .c files except example.c and minigzip.c; compile with -DZLIB_DLL The
66 zlib DLL support was initially done by Alessandro Iacopetti and is now
67 maintained by Gilles Vollant <info@winimage.com>. Check the zlib DLL home
68 page at http://www.winimage.com/zLibDll
69
70 From Visual Basic, you can call the DLL functions which do not take a
71 structure as argument: compress, uncompress and all gz* functions. See
72 contrib/visual-basic.txt for more information, or get
73 http://www.tcfb.com/dowseware/cmp-z-it.zip
74 64
75- For 64-bit Irix, deflate.c must be compiled without any optimization. With 65- For 64-bit Irix, deflate.c must be compiled without any optimization. With
76 -O, one libpng test fails. The test works in 32 bit mode (with the -n32 66 -O, one libpng test fails. The test works in 32 bit mode (with the -n32
@@ -90,8 +80,11 @@ Notes for some targets:
90- For Turbo C the small model is supported only with reduced performance to 80- For Turbo C the small model is supported only with reduced performance to
91 avoid any far allocation; it was tested with -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3 81 avoid any far allocation; it was tested with -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
92 82
93- For PalmOs, see http://www.cs.uit.no/~perm/PASTA/pilot/software.html Per 83- For PalmOs, see http://palmzlib.sourceforge.net/
94 Harald Myrvang <perm@stud.cs.uit.no> 84
85- When building a shared, i.e. dynamic library on Mac OS X, the library must be
86 installed before testing (do "make install" before "make test"), since the
87 library location is specified in the library.
95 88
96 89
97Acknowledgments: 90Acknowledgments:
diff --git a/amiga/Makefile.pup b/amiga/Makefile.pup
new file mode 100644
index 0000000..3f7e155
--- /dev/null
+++ b/amiga/Makefile.pup
@@ -0,0 +1,66 @@
1# Amiga powerUP (TM) Makefile
2# makefile for libpng and SAS C V6.58/7.00 PPC compiler
3# Copyright (C) 1998 by Andreas R. Kleinert
4
5LIBNAME = libzip.a
6
7CC = scppc
8CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL \
9 OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8 NOVER
10AR = ppc-amigaos-ar cr
11RANLIB = ppc-amigaos-ranlib
12LD = ppc-amigaos-ld -r
13LDFLAGS = -o
14LDLIBS = LIB:scppc.a LIB:end.o
15RM = delete quiet
16
17OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
18 zutil.o inflate.o infback.o inftrees.o inffast.o
19
20TEST_OBJS = example.o minigzip.o
21
22all: example minigzip
23
24check: test
25test: all
26 example
27 echo hello world | minigzip | minigzip -d
28
29$(LIBNAME): $(OBJS)
30 $(AR) $@ $(OBJS)
31 -$(RANLIB) $@
32
33example: example.o $(LIBNAME)
34 $(LD) $(LDFLAGS) $@ LIB:c_ppc.o $@.o $(LIBNAME) $(LDLIBS)
35
36minigzip: minigzip.o $(LIBNAME)
37 $(LD) $(LDFLAGS) $@ LIB:c_ppc.o $@.o $(LIBNAME) $(LDLIBS)
38
39mostlyclean: clean
40clean:
41 $(RM) *.o example minigzip $(LIBNAME) foo.gz
42
43zip:
44 zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \
45 descrip.mms *.[ch]
46
47tgz:
48 cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \
49 zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch]
50
51# DO NOT DELETE THIS LINE -- make depend depends on it.
52
53adler32.o: zlib.h zconf.h
54compress.o: zlib.h zconf.h
55crc32.o: crc32.h zlib.h zconf.h
56deflate.o: deflate.h zutil.h zlib.h zconf.h
57example.o: zlib.h zconf.h
58gzio.o: zutil.h zlib.h zconf.h
59inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
60inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
61infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
62inftrees.o: zutil.h zlib.h zconf.h inftrees.h
63minigzip.o: zlib.h zconf.h
64trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
65uncompr.o: zlib.h zconf.h
66zutil.o: zutil.h zlib.h zconf.h
diff --git a/old/amiga/Makefile.sas b/amiga/Makefile.sas
index 5323e82..d6842b8 100644
--- a/old/amiga/Makefile.sas
+++ b/amiga/Makefile.sas
@@ -10,22 +10,24 @@ CFLAGS=OPT
10LDFLAGS=LIB z.lib 10LDFLAGS=LIB z.lib
11 11
12SCOPTIONS=OPTSCHED OPTINLINE OPTALIAS OPTTIME OPTINLOCAL STRMERGE \ 12SCOPTIONS=OPTSCHED OPTINLINE OPTALIAS OPTTIME OPTINLOCAL STRMERGE \
13 NOICONS PARMS=BOTH NOSTACKCHECK UTILLIB NOVERSION ERRORREXX 13 NOICONS PARMS=BOTH NOSTACKCHECK UTILLIB NOVERSION ERRORREXX \
14 DEF=POSTINC
14 15
15OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ 16OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
16 zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o 17 zutil.o inflate.o infback.o inftrees.o inffast.o
17 18
18TEST_OBJS = example.o minigzip.o 19TEST_OBJS = example.o minigzip.o
19 20
20all: SCOPTIONS example minigzip 21all: SCOPTIONS example minigzip
21 22
23check: test
22test: all 24test: all
23 `cd`/example 25 example
24 echo hello world | minigzip | minigzip -d 26 echo hello world | minigzip | minigzip -d
25 27
26install: z.lib 28install: z.lib
27 copy zlib.h zconf.h INCLUDE: clone 29 copy clone zlib.h zconf.h INCLUDE:
28 copy z.lib LIB: clone 30 copy clone z.lib LIB:
29 31
30z.lib: $(OBJS) 32z.lib: $(OBJS)
31 oml z.lib r $(OBJS) 33 oml z.lib r $(OBJS)
@@ -36,29 +38,28 @@ example: example.o z.lib
36minigzip: minigzip.o z.lib 38minigzip: minigzip.o z.lib
37 $(CC) $(CFLAGS) LINK TO $@ minigzip.o $(LDFLAGS) 39 $(CC) $(CFLAGS) LINK TO $@ minigzip.o $(LDFLAGS)
38 40
41mostlyclean: clean
39clean: 42clean:
40 -delete force quiet *.o example minigzip z.lib foo.gz *.lnk SCOPTIONS 43 -delete force quiet example minigzip *.o z.lib foo.gz *.lnk SCOPTIONS
41 44
42SCOPTIONS: Smakefile 45SCOPTIONS: Makefile.sas
43 copy to $@ <from < 46 copy to $@ <from <
44$(SCOPTIONS) 47$(SCOPTIONS)
45< 48<
46 49
47# DO NOT DELETE THIS LINE -- make depend depends on it. 50# DO NOT DELETE THIS LINE -- make depend depends on it.
48 51
49adler32.o: zutil.h zlib.h zconf.h 52adler32.o: zlib.h zconf.h
50compress.o: zlib.h zconf.h 53compress.o: zlib.h zconf.h
51crc32.o: zutil.h zlib.h zconf.h 54crc32.o: crc32.h zlib.h zconf.h
52deflate.o: deflate.h zutil.h zlib.h zconf.h 55deflate.o: deflate.h zutil.h zlib.h zconf.h
53example.o: zlib.h zconf.h 56example.o: zlib.h zconf.h
54gzio.o: zutil.h zlib.h zconf.h 57gzio.o: zutil.h zlib.h zconf.h
55infblock.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h 58inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
56infcodes.o: zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h 59inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
57inffast.o: zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h 60infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
58inflate.o: zutil.h zlib.h zconf.h infblock.h
59inftrees.o: zutil.h zlib.h zconf.h inftrees.h 61inftrees.o: zutil.h zlib.h zconf.h inftrees.h
60infutil.o: zutil.h zlib.h zconf.h inftrees.h infutil.h
61minigzip.o: zlib.h zconf.h 62minigzip.o: zlib.h zconf.h
62trees.o: deflate.h zutil.h zlib.h zconf.h 63trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
63uncompr.o: zlib.h zconf.h 64uncompr.o: zlib.h zconf.h
64zutil.o: zutil.h zlib.h zconf.h 65zutil.o: zutil.h zlib.h zconf.h
diff --git a/configure b/configure
index 9999de8..e570a7a 100755
--- a/configure
+++ b/configure
@@ -20,8 +20,9 @@
20 20
21LIBS=libz.a 21LIBS=libz.a
22LDFLAGS="-L. ${LIBS}" 22LDFLAGS="-L. ${LIBS}"
23SHAREDLIB=libz.so
24VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h` 23VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
24VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h`
25VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h`
25AR=${AR-"ar rc"} 26AR=${AR-"ar rc"}
26RANLIB=${RANLIB-"ranlib"} 27RANLIB=${RANLIB-"ranlib"}
27prefix=${prefix-/usr/local} 28prefix=${prefix-/usr/local}
@@ -55,10 +56,6 @@ case "$1" in
55 esac 56 esac
56done 57done
57 58
58if [ $shared -eq 1 ]; then
59 LDFLAGS="-L. ${SHAREDLIB}"
60fi
61
62test=ztest$$ 59test=ztest$$
63cat > $test.c <<EOF 60cat > $test.c <<EOF
64extern int getchar(); 61extern int getchar();
@@ -85,6 +82,13 @@ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
85 HP-UX*) LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"} 82 HP-UX*) LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"}
86 shared_ext='.sl' 83 shared_ext='.sl'
87 SHAREDLIB='libz.sl';; 84 SHAREDLIB='libz.sl';;
85 Darwin*) shared_ext='.dylib'
86 SHAREDLIB=libz$shared_ext
87 SHAREDLIBV=libz.$VER$shared_ext
88 SHAREDLIBM=libz.$VER1$shared_ext
89 LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name /usr/lib/$SHAREDLIBV -compatibility_version $VER2 -current_version $VER"}
90 libdir='/usr/lib'
91 includedir='/usr/include';;
88 *) LDSHARED=${LDSHARED-"$cc -shared"};; 92 *) LDSHARED=${LDSHARED-"$cc -shared"};;
89 esac 93 esac
90else 94else
@@ -102,7 +106,7 @@ else
102 LDSHARED=${LDSHARED-"cc -shared"};; 106 LDSHARED=${LDSHARED-"cc -shared"};;
103 OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"} 107 OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
104 CFLAGS=${CFLAGS-"-O -std1"} 108 CFLAGS=${CFLAGS-"-O -std1"}
105 LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,$SHAREDLIB -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};; 109 LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};;
106 OSF1*) SFLAGS=${CFLAGS-"-O -std1"} 110 OSF1*) SFLAGS=${CFLAGS-"-O -std1"}
107 CFLAGS=${CFLAGS-"-O -std1"} 111 CFLAGS=${CFLAGS-"-O -std1"}
108 LDSHARED=${LDSHARED-"cc -shared"};; 112 LDSHARED=${LDSHARED-"cc -shared"};;
@@ -143,14 +147,18 @@ else
143 esac 147 esac
144fi 148fi
145 149
150SHAREDLIB=${SHAREDLIB-"libz$shared_ext"}
151SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"}
152SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"}
153
146if test $shared -eq 1; then 154if test $shared -eq 1; then
147 echo Checking for shared library support... 155 echo Checking for shared library support...
148 # we must test in two steps (cc then ld), required at least on SunOS 4.x 156 # we must test in two steps (cc then ld), required at least on SunOS 4.x
149 if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" && 157 if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" &&
150 test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then 158 test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then
151 CFLAGS="$SFLAGS" 159 CFLAGS="$SFLAGS"
152 LIBS="$SHAREDLIB.$VER" 160 LIBS="$SHAREDLIBV"
153 echo Building shared library $SHAREDLIB.$VER with $CC. 161 echo Building shared library $SHAREDLIBV with $CC.
154 elif test -z "$old_cc" -a -z "$old_cflags"; then 162 elif test -z "$old_cc" -a -z "$old_cflags"; then
155 echo No shared library support. 163 echo No shared library support.
156 shared=0; 164 shared=0;
@@ -162,6 +170,8 @@ fi
162if test $shared -eq 0; then 170if test $shared -eq 0; then
163 LDSHARED="$CC" 171 LDSHARED="$CC"
164 echo Building static library $LIBS version $VER with $CC. 172 echo Building static library $LIBS version $VER with $CC.
173else
174 LDFLAGS="-L. ${SHAREDLIBV}"
165fi 175fi
166 176
167cat > $test.c <<EOF 177cat > $test.c <<EOF
@@ -422,19 +432,20 @@ rm -f $test.[co] $test$shared_ext
422 432
423# udpate Makefile 433# udpate Makefile
424sed < Makefile.in " 434sed < Makefile.in "
425/^CC *=/s%=.*%=$CC% 435/^CC *=/s#=.*#=$CC#
426/^CFLAGS *=/s%=.*%=$CFLAGS% 436/^CFLAGS *=/s#=.*#=$CFLAGS#
427/^CPP *=/s%=.*%=$CPP% 437/^CPP *=/s#=.*#=$CPP#
428/^LDSHARED *=/s%=.*%=$LDSHARED% 438/^LDSHARED *=/s#=.*#=$LDSHARED#
429/^LIBS *=/s%=.*%=$LIBS% 439/^LIBS *=/s#=.*#=$LIBS#
430/^SHAREDLIB *=/s%=.*%=$SHAREDLIB% 440/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
431/^AR *=/s%=.*%=$AR% 441/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
432/^RANLIB *=/s%=.*%=$RANLIB% 442/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
433/^VER *=/s%=.*%=$VER% 443/^AR *=/s#=.*#=$AR#
434/^prefix *=/s%=.*%=$prefix% 444/^RANLIB *=/s#=.*#=$RANLIB#
435/^exec_prefix *=/s%=.*%=$exec_prefix% 445/^prefix *=/s#=.*#=$prefix#
436/^libdir *=/s%=.*%=$libdir% 446/^exec_prefix *=/s#=.*#=$exec_prefix#
437/^includedir *=/s%=.*%=$includedir% 447/^libdir *=/s#=.*#=$libdir#
438/^mandir *=/s%=.*%=$mandir% 448/^includedir *=/s#=.*#=$includedir#
439/^LDFLAGS *=/s%=.*%=$LDFLAGS% 449/^mandir *=/s#=.*#=$mandir#
450/^LDFLAGS *=/s#=.*#=$LDFLAGS#
440" > Makefile 451" > Makefile
diff --git a/contrib/infback9/infback9.c b/contrib/infback9/infback9.c
index fb6acb4..34a95fc 100644
--- a/contrib/infback9/infback9.c
+++ b/contrib/infback9/infback9.c
@@ -321,7 +321,7 @@ void FAR *out_desc;
321 break; 321 break;
322 } 322 }
323 length = (unsigned)hold & 0xffff; 323 length = (unsigned)hold & 0xffff;
324 Tracev((stderr, "inflate: stored length %u\n", 324 Tracev((stderr, "inflate: stored length %lu\n",
325 length)); 325 length));
326 INITBITS(); 326 INITBITS();
327 327
@@ -507,7 +507,7 @@ void FAR *out_desc;
507 length += BITS(extra); 507 length += BITS(extra);
508 DROPBITS(extra); 508 DROPBITS(extra);
509 } 509 }
510 Tracevv((stderr, "inflate: length %u\n", length)); 510 Tracevv((stderr, "inflate: length %lu\n", length));
511 511
512 /* get distance code */ 512 /* get distance code */
513 for (;;) { 513 for (;;) {
@@ -545,7 +545,7 @@ void FAR *out_desc;
545 mode = BAD; 545 mode = BAD;
546 break; 546 break;
547 } 547 }
548 Tracevv((stderr, "inflate: distance %u\n", offset)); 548 Tracevv((stderr, "inflate: distance %lu\n", offset));
549 549
550 /* copy match from window to output */ 550 /* copy match from window to output */
551 do { 551 do {
diff --git a/contrib/infback9/inftree9.c b/contrib/infback9/inftree9.c
index 0c544cf..2829a84 100644
--- a/contrib/infback9/inftree9.c
+++ b/contrib/infback9/inftree9.c
@@ -9,7 +9,7 @@
9#define MAXBITS 15 9#define MAXBITS 15
10 10
11const char inflate9_copyright[] = 11const char inflate9_copyright[] =
12 " inflate9 1.2.0.6 Copyright 1995-2003 Mark Adler "; 12 " inflate9 1.2.0.7 Copyright 1995-2003 Mark Adler ";
13/* 13/*
14 If you use the zlib library in a product, an acknowledgment is welcome 14 If you use the zlib library in a product, an acknowledgment is welcome
15 in the documentation of your product. If for some reason you cannot 15 in the documentation of your product. If for some reason you cannot
@@ -64,7 +64,7 @@ unsigned short FAR *work;
64 static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 64 static const unsigned short lext[31] = { /* Length codes 257..285 extra */
65 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 65 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
66 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132, 66 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
67 133, 133, 133, 133, 144, 65, 77}; 67 133, 133, 133, 133, 144, 71, 69};
68 static const unsigned short dbase[32] = { /* Distance codes 0..31 base */ 68 static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
69 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 69 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
70 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 70 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,
diff --git a/contrib/untgz/untgz.c b/contrib/untgz/untgz.c
index 478d744..d748b69 100644
--- a/contrib/untgz/untgz.c
+++ b/contrib/untgz/untgz.c
@@ -1,8 +1,9 @@
1/* 1/*
2 * untgz.c -- Display contents and/or extract file from 2 * untgz.c -- Display contents and extract files from a gzip'd TAR file
3 * a gzip'd TAR file 3 *
4 * written by "Pedro A. Aranda Guti\irrez" <paag@tid.es> 4 * written by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
5 * adaptation to Unix by Jean-loup Gailly <jloup@gzip.org> 5 * adaptation to Unix by Jean-loup Gailly <jloup@gzip.org>
6 * various fixes by Cosmin Truta <cosmint@cs.ubbcluj.ro>
6 */ 7 */
7 8
8#include <stdio.h> 9#include <stdio.h>
@@ -10,7 +11,9 @@
10#include <string.h> 11#include <string.h>
11#include <time.h> 12#include <time.h>
12#include <errno.h> 13#include <errno.h>
13#include <fcntl.h> 14
15#include "zlib.h"
16
14#ifdef unix 17#ifdef unix
15# include <unistd.h> 18# include <unistd.h>
16#else 19#else
@@ -18,27 +21,22 @@
18# include <io.h> 21# include <io.h>
19#endif 22#endif
20 23
21#include "zlib.h"
22
23#ifdef WIN32 24#ifdef WIN32
24#include <windows.h> 25#include <windows.h>
25# ifndef F_OK 26# ifndef F_OK
26# define F_OK (0) 27# define F_OK 0
27# endif 28# endif
29# define mkdir(dirname,mode) _mkdir(dirname)
28# ifdef _MSC_VER 30# ifdef _MSC_VER
29# define mkdir(dirname,mode) _mkdir(dirname)
30# define strdup(str) _strdup(str) 31# define strdup(str) _strdup(str)
31# define unlink(fn) _unlink(fn)
32# define access(path,mode) _access(path,mode) 32# define access(path,mode) _access(path,mode)
33# else
34# define mkdir(dirname,mode) _mkdir(dirname)
35# endif 33# endif
36#else 34#else
37# include <utime.h> 35# include <utime.h>
38#endif 36#endif
39 37
40 38
41/* Values used in typeflag field. */ 39/* values used in typeflag field */
42 40
43#define REGTYPE '0' /* regular file */ 41#define REGTYPE '0' /* regular file */
44#define AREGTYPE '\0' /* regular file */ 42#define AREGTYPE '\0' /* regular file */
@@ -78,40 +76,38 @@ union tar_buffer {
78 struct tar_header header; 76 struct tar_header header;
79}; 77};
80 78
81enum { TGZ_EXTRACT = 0, TGZ_LIST }; 79enum { TGZ_EXTRACT, TGZ_LIST, TGZ_INVALID };
82 80
83static char *TGZfname OF((const char *)); 81char *TGZfname OF((const char *));
84void TGZnotfound OF((const char *)); 82void TGZnotfound OF((const char *));
85 83
86int getoct OF((char *, int)); 84int getoct OF((char *, int));
87char *strtime OF((time_t *)); 85char *strtime OF((time_t *));
88int setftime OF((char *, time_t)); 86int setfiletime OF((char *, time_t));
89int ExprMatch OF((char *, char *)); 87int ExprMatch OF((char *, char *));
90 88
91int makedir OF((char *)); 89int makedir OF((char *));
92int matchname OF((int, int, char **, char *)); 90int matchname OF((int, int, char **, char *));
93 91
94void error OF((const char *)); 92void error OF((const char *));
95int tar OF((gzFile, int, int, int, char **)); 93int tar OF((gzFile, int, int, int, char **));
96 94
97void help OF((int)); 95void help OF((int));
98int main OF((int, char **)); 96int main OF((int, char **));
99 97
100char *prog; 98char *prog;
101 99
102/* This will give a benign warning */ 100const char *TGZsuffix[] = { "\0", ".tar", ".tar.gz", ".taz", ".tgz", NULL };
103
104static char *TGZsuffix[] = { "\0", ".tar", ".tar.gz", ".taz", ".tgz", NULL };
105 101
106/* Return the real name of the TGZ archive */ 102/* return the file name of the TGZ archive */
107/* or NULL if it does not exist. */ 103/* or NULL if it does not exist */
108 104
109static char *TGZfname (const char *fname) 105char *TGZfname (const char *arcname)
110{ 106{
111 static char buffer[1024]; 107 static char buffer[1024];
112 int origlen,i; 108 int origlen,i;
113 109
114 strcpy(buffer,fname); 110 strcpy(buffer,arcname);
115 origlen = strlen(buffer); 111 origlen = strlen(buffer);
116 112
117 for (i=0; TGZsuffix[i]; i++) 113 for (i=0; TGZsuffix[i]; i++)
@@ -123,55 +119,67 @@ static char *TGZfname (const char *fname)
123 return NULL; 119 return NULL;
124} 120}
125 121
122
126/* error message for the filename */ 123/* error message for the filename */
127 124
128void TGZnotfound (const char *fname) 125void TGZnotfound (const char *arcname)
129{ 126{
130 int i; 127 int i;
131 128
132 fprintf(stderr,"%s : couldn't find ",prog); 129 fprintf(stderr,"%s: Couldn't find ",prog);
133 for (i=0;TGZsuffix[i];i++) 130 for (i=0;TGZsuffix[i];i++)
134 fprintf(stderr,(TGZsuffix[i+1]) ? "%s%s, " : "or %s%s\n", 131 fprintf(stderr,(TGZsuffix[i+1]) ? "%s%s, " : "or %s%s\n",
135 fname, 132 arcname,
136 TGZsuffix[i]); 133 TGZsuffix[i]);
137 exit(1); 134 exit(1);
138} 135}
139 136
140 137
141/* help functions */ 138/* convert octal digits to int */
139/* on error return -1 */
142 140
143int getoct (char *p,int width) 141int getoct (char *p,int width)
144{ 142{
145 int result = 0; 143 int result = 0;
146 char c; 144 char c;
147 145
148 while (width --) 146 while (width--)
149 { 147 {
150 c = *p++; 148 c = *p++;
151 if (c == ' ')
152 continue;
153 if (c == 0) 149 if (c == 0)
154 break; 150 break;
151 if (c == ' ')
152 continue;
153 if (c < '0' || c > '7')
154 return -1;
155 result = result * 8 + (c - '0'); 155 result = result * 8 + (c - '0');
156 } 156 }
157 return result; 157 return result;
158} 158}
159 159
160
161/* convert time_t to string */
162/* use the "YYYY/MM/DD hh:mm:ss" format */
163
160char *strtime (time_t *t) 164char *strtime (time_t *t)
161{ 165{
162 struct tm *local; 166 struct tm *local;
163 static char result[32]; 167 static char result[32];
164 168
165 local = localtime(t); 169 local = localtime(t);
166 sprintf(result,"%2d/%02d/%4d %02d:%02d:%02d", 170 sprintf(result,"%4d/%02d/%02d %02d:%02d:%02d",
167 local->tm_mday, local->tm_mon+1, local->tm_year+1900, 171 local->tm_year+1900, local->tm_mon+1, local->tm_mday,
168 local->tm_hour, local->tm_min, local->tm_sec); 172 local->tm_hour, local->tm_min, local->tm_sec);
169 return result; 173 return result;
170} 174}
171 175
172int setftime (char *fname,time_t ftime) 176
177/* set file time */
178
179int setfiletime (char *fname,time_t ftime)
173{ 180{
174#ifdef WIN32 181#ifdef WIN32
182 static int isWinNT = -1;
175 SYSTEMTIME st; 183 SYSTEMTIME st;
176 FILETIME locft, modft; 184 FILETIME locft, modft;
177 struct tm *loctm; 185 struct tm *loctm;
@@ -194,8 +202,11 @@ int setftime (char *fname,time_t ftime)
194 !LocalFileTimeToFileTime(&locft, &modft)) 202 !LocalFileTimeToFileTime(&locft, &modft))
195 return -1; 203 return -1;
196 204
197 hFile = CreateFile(fname, GENERIC_READ | GENERIC_WRITE, 205 if (isWinNT < 0)
198 0, NULL, OPEN_EXISTING, 0, 0); 206 isWinNT = (GetVersion() < 0x80000000) ? 1 : 0;
207 hFile = CreateFile(fname, GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
208 (isWinNT ? FILE_FLAG_BACKUP_SEMANTICS : 0),
209 NULL);
199 if (hFile == INVALID_HANDLE_VALUE) 210 if (hFile == INVALID_HANDLE_VALUE)
200 return -1; 211 return -1;
201 result = SetFileTime(hFile, NULL, NULL, &modft) ? 0 : -1; 212 result = SetFileTime(hFile, NULL, NULL, &modft) ? 0 : -1;
@@ -246,10 +257,9 @@ int ExprMatch (char *string,char *expr)
246 } 257 }
247} 258}
248 259
249/* recursive make directory */ 260
250/* abort if you get an ENOENT errno somewhere in the middle */ 261/* recursive mkdir */
251/* e.g. ignore error "mkdir on existing directory" */ 262/* abort on ENOENT; ignore other errors like "directory already exists" */
252/* */
253/* return 1 if OK */ 263/* return 1 if OK */
254/* 0 on error */ 264/* 0 on error */
255 265
@@ -266,7 +276,7 @@ int makedir (char *newdir)
266 if (buffer[len-1] == '/') { 276 if (buffer[len-1] == '/') {
267 buffer[len-1] = '\0'; 277 buffer[len-1] = '\0';
268 } 278 }
269 if (mkdir(buffer, 0775) == 0) 279 if (mkdir(buffer, 0755) == 0)
270 { 280 {
271 free(buffer); 281 free(buffer);
272 return 1; 282 return 1;
@@ -281,9 +291,9 @@ int makedir (char *newdir)
281 p++; 291 p++;
282 hold = *p; 292 hold = *p;
283 *p = 0; 293 *p = 0;
284 if ((mkdir(buffer, 0775) == -1) && (errno == ENOENT)) 294 if ((mkdir(buffer, 0755) == -1) && (errno == ENOENT))
285 { 295 {
286 fprintf(stderr,"%s: couldn't create directory %s\n",prog,buffer); 296 fprintf(stderr,"%s: Couldn't create directory %s\n",prog,buffer);
287 free(buffer); 297 free(buffer);
288 return 0; 298 return 0;
289 } 299 }
@@ -295,9 +305,10 @@ int makedir (char *newdir)
295 return 1; 305 return 1;
296} 306}
297 307
308
298int matchname (int arg,int argc,char **argv,char *fname) 309int matchname (int arg,int argc,char **argv,char *fname)
299{ 310{
300 if (arg == argc) /* no arguments given (untgz tgzarchive) */ 311 if (arg == argc) /* no arguments given (untgz tgzarchive) */
301 return 1; 312 return 1;
302 313
303 while (arg < argc) 314 while (arg < argc)
@@ -308,7 +319,7 @@ int matchname (int arg,int argc,char **argv,char *fname)
308} 319}
309 320
310 321
311/* Tar file list or extract */ 322/* tar file list or extract */
312 323
313int tar (gzFile in,int action,int arg,int argc,char **argv) 324int tar (gzFile in,int action,int arg,int argc,char **argv)
314{ 325{
@@ -319,22 +330,26 @@ int tar (gzFile in,int action,int arg,int argc,char **argv)
319 int remaining = 0; 330 int remaining = 0;
320 FILE *outfile = NULL; 331 FILE *outfile = NULL;
321 char fname[BLOCKSIZE]; 332 char fname[BLOCKSIZE];
333 int tarmode;
322 time_t tartime; 334 time_t tartime;
323 335
324 if (action == TGZ_LIST) 336 if (action == TGZ_LIST)
325 printf(" day time size file\n" 337 printf(" date time size file\n"
326 " ---------- -------- --------- -------------------------------------\n"); 338 " ---------- -------- --------- -------------------------------------\n");
327 while (1) 339 while (1)
328 { 340 {
329 len = gzread(in, &buffer, BLOCKSIZE); 341 len = gzread(in, &buffer, BLOCKSIZE);
330 if (len < 0) 342 if (len < 0)
331 error (gzerror(in, &err)); 343 error(gzerror(in, &err));
332 /* 344 /*
333 * Always expect complete blocks to process 345 * Always expect complete blocks to process
334 * the tar information. 346 * the tar information.
335 */ 347 */
336 if (len != BLOCKSIZE) 348 if (len != BLOCKSIZE)
337 error("gzread: incomplete block read"); 349 {
350 action = TGZ_INVALID; /* force error exit */
351 remaining = 0; /* force I/O cleanup */
352 }
338 353
339 /* 354 /*
340 * If we have to get a tar header 355 * If we have to get a tar header
@@ -346,9 +361,16 @@ int tar (gzFile in,int action,int arg,int argc,char **argv)
346 * or the end-of-tar block, 361 * or the end-of-tar block,
347 * we are done 362 * we are done
348 */ 363 */
349 if ((len == 0) || (buffer.header.name[0]== 0)) break; 364 if ((len == 0) || (buffer.header.name[0] == 0)) break;
350 365
366 tarmode = getoct(buffer.header.mode,8);
351 tartime = (time_t)getoct(buffer.header.mtime,12); 367 tartime = (time_t)getoct(buffer.header.mtime,12);
368 if (tarmode == -1 || tartime == (time_t)-1)
369 {
370 buffer.header.name[0] = 0;
371 action = TGZ_INVALID;
372 }
373
352 strcpy(fname,buffer.header.name); 374 strcpy(fname,buffer.header.name);
353 375
354 switch (buffer.header.typeflag) 376 switch (buffer.header.typeflag)
@@ -357,16 +379,24 @@ int tar (gzFile in,int action,int arg,int argc,char **argv)
357 if (action == TGZ_LIST) 379 if (action == TGZ_LIST)
358 printf(" %s <dir> %s\n",strtime(&tartime),fname); 380 printf(" %s <dir> %s\n",strtime(&tartime),fname);
359 if (action == TGZ_EXTRACT) 381 if (action == TGZ_EXTRACT)
360 makedir(fname); 382 {
383 makedir(fname);
384 setfiletime(fname,tartime);
385 }
361 break; 386 break;
362 case REGTYPE: 387 case REGTYPE:
363 case AREGTYPE: 388 case AREGTYPE:
364 remaining = getoct(buffer.header.size,12); 389 remaining = getoct(buffer.header.size,12);
390 if (remaining == -1)
391 {
392 action = TGZ_INVALID;
393 break;
394 }
365 if (action == TGZ_LIST) 395 if (action == TGZ_LIST)
366 printf(" %s %9d %s\n",strtime(&tartime),remaining,fname); 396 printf(" %s %9d %s\n",strtime(&tartime),remaining,fname);
367 if (action == TGZ_EXTRACT) 397 else if (action == TGZ_EXTRACT)
368 { 398 {
369 if ((remaining) && (matchname(arg,argc,argv,fname))) 399 if (matchname(arg,argc,argv,fname))
370 { 400 {
371 outfile = fopen(fname,"wb"); 401 outfile = fopen(fname,"wb");
372 if (outfile == NULL) { 402 if (outfile == NULL) {
@@ -379,18 +409,15 @@ int tar (gzFile in,int action,int arg,int argc,char **argv)
379 outfile = fopen(fname,"wb"); 409 outfile = fopen(fname,"wb");
380 } 410 }
381 } 411 }
382 fprintf(stderr, 412 if (outfile != NULL)
383 "%s %s\n", 413 printf("Extracting %s\n",fname);
384 (outfile) ? "Extracting" : "Couldn't create", 414 else
385 fname); 415 fprintf(stderr, "%s: Couldn't create %s",prog,fname);
386 } 416 }
387 else 417 else
388 outfile = NULL; 418 outfile = NULL;
389 } 419 }
390 /* 420 getheader = 0;
391 * could have no contents
392 */
393 getheader = (remaining) ? 0 : 1;
394 break; 421 break;
395 default: 422 default:
396 if (action == TGZ_LIST) 423 if (action == TGZ_LIST)
@@ -402,27 +429,39 @@ int tar (gzFile in,int action,int arg,int argc,char **argv)
402 { 429 {
403 unsigned int bytes = (remaining > BLOCKSIZE) ? BLOCKSIZE : remaining; 430 unsigned int bytes = (remaining > BLOCKSIZE) ? BLOCKSIZE : remaining;
404 431
405 if ((action == TGZ_EXTRACT) && (outfile != NULL)) 432 if (outfile != NULL)
406 { 433 {
407 if (fwrite(&buffer,sizeof(char),bytes,outfile) != bytes) 434 if (fwrite(&buffer,sizeof(char),bytes,outfile) != bytes)
408 { 435 {
409 fprintf(stderr,"%s : error writing %s skipping...\n",prog,fname); 436 fprintf(stderr,"%s: Error writing %s -- skipping\n",prog,fname);
410 fclose(outfile); 437 fclose(outfile);
411 unlink(fname); 438 outfile = NULL;
439 remove(fname);
412 } 440 }
413 } 441 }
414 remaining -= bytes; 442 remaining -= bytes;
415 if (remaining == 0) 443 }
444
445 if (remaining == 0)
446 {
447 getheader = 1;
448 if (outfile != NULL)
416 { 449 {
417 getheader = 1; 450 fclose(outfile);
418 if ((action == TGZ_EXTRACT) && (outfile != NULL)) 451 outfile = NULL;
419 { 452 if (action != TGZ_INVALID)
420 fclose(outfile); 453 setfiletime(fname,tartime);
421 outfile = NULL;
422 setftime(fname,tartime);
423 }
424 } 454 }
425 } 455 }
456
457 /*
458 * Abandon if errors are found
459 */
460 if (action == TGZ_INVALID)
461 {
462 error("broken archive");
463 break;
464 }
426 } 465 }
427 466
428 if (gzclose(in) != Z_OK) 467 if (gzclose(in) != Z_OK)
@@ -432,30 +471,32 @@ int tar (gzFile in,int action,int arg,int argc,char **argv)
432} 471}
433 472
434 473
435/* =========================================================== */ 474/* ============================================================ */
436 475
437void help(int exitval) 476void help(int exitval)
438{ 477{
439 fprintf(stderr, 478 printf("untgz version 0.2\n"
440 "untgz version 0.1\n" 479 " using zlib version %s\n\n",
441 " a sample application of zlib\n\n" 480 zlibVersion());
442 "Usage : untgz file.tgz to extract all files\n" 481 printf("Usage: untgz file.tgz extract all files\n"
443 " untgz file.tgz fname ... to extract selected files\n" 482 " untgz file.tgz fname ... extract selected files\n"
444 " untgz -l file.tgz to list archive contents\n" 483 " untgz -l file.tgz list archive contents\n"
445 " untgz -h to display this help\n\n"); 484 " untgz -h display this help\n");
446 exit(exitval); 485 exit(exitval);
447} 486}
448 487
449void error(const char *msg) 488void error(const char *msg)
450{ 489{
451 fprintf(stderr, "%s: %s\n", prog, msg); 490 fprintf(stderr, "%s: %s\n", prog, msg);
452 exit(1); 491 exit(1);
453} 492}
454 493
455 494
456/* ====================================================================== */ 495/* ============================================================ */
457 496
458int _CRT_glob = 0; /* disable globbing of the arguments */ 497#if defined(WIN32) && defined(__GNUC__)
498int _CRT_glob = 0; /* disable argument globbing in MinGW */
499#endif
459 500
460int main(int argc,char **argv) 501int main(int argc,char **argv)
461{ 502{
@@ -464,7 +505,6 @@ int main(int argc,char **argv)
464 char *TGZfile; 505 char *TGZfile;
465 gzFile *f; 506 gzFile *f;
466 507
467
468 prog = strrchr(argv[0],'\\'); 508 prog = strrchr(argv[0],'\\');
469 if (prog == NULL) 509 if (prog == NULL)
470 { 510 {
@@ -514,16 +554,14 @@ int main(int argc,char **argv)
514 f = gzopen(TGZfile,"rb"); 554 f = gzopen(TGZfile,"rb");
515 if (f == NULL) 555 if (f == NULL)
516 { 556 {
517 fprintf(stderr,"%s: Couldn't gzopen %s\n", 557 fprintf(stderr,"%s: Couldn't gzopen %s\n",prog,TGZfile);
518 prog,
519 TGZfile);
520 return 1; 558 return 1;
521 } 559 }
522 exit(tar(f, action, arg, argc, argv)); 560 exit(tar(f, action, arg, argc, argv));
523 break; 561 break;
524 562
525 default: 563 default:
526 error("Unknown option!"); 564 error("Unknown option");
527 exit(1); 565 exit(1);
528 } 566 }
529 567
diff --git a/deflate.c b/deflate.c
index ac083ae..ddc0c5e 100644
--- a/deflate.c
+++ b/deflate.c
@@ -52,7 +52,7 @@
52#include "deflate.h" 52#include "deflate.h"
53 53
54const char deflate_copyright[] = 54const char deflate_copyright[] =
55 " deflate 1.2.0.6 Copyright 1995-2003 Jean-loup Gailly "; 55 " deflate 1.2.0.7 Copyright 1995-2003 Jean-loup Gailly ";
56/* 56/*
57 If you use the zlib library in a product, an acknowledgment is welcome 57 If you use the zlib library in a product, an acknowledgment is welcome
58 in the documentation of your product. If for some reason you cannot 58 in the documentation of your product. If for some reason you cannot
diff --git a/inftrees.c b/inftrees.c
index 204afe6..75bc22f 100644
--- a/inftrees.c
+++ b/inftrees.c
@@ -9,7 +9,7 @@
9#define MAXBITS 15 9#define MAXBITS 15
10 10
11const char inflate_copyright[] = 11const char inflate_copyright[] =
12 " inflate 1.2.0.6 Copyright 1995-2003 Mark Adler "; 12 " inflate 1.2.0.7 Copyright 1995-2003 Mark Adler ";
13/* 13/*
14 If you use the zlib library in a product, an acknowledgment is welcome 14 If you use the zlib library in a product, an acknowledgment is welcome
15 in the documentation of your product. If for some reason you cannot 15 in the documentation of your product. If for some reason you cannot
@@ -62,7 +62,7 @@ unsigned short FAR *work;
62 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; 62 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
63 static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 63 static const unsigned short lext[31] = { /* Length codes 257..285 extra */
64 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 64 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
65 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 65, 77}; 65 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 71, 69};
66 static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 66 static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
67 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 67 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
68 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 68 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
diff --git a/old/README b/old/README
index ea9cd22..e2700df 100644
--- a/old/README
+++ b/old/README
@@ -1,3 +1,3 @@
1This directory contains files that have not been updated for zlib 1.2.0. 1This directory contains files that have not been updated for zlib 1.2.
2 2
3(Volunteers are encouraged to help clean this up. Thanks.) 3(Volunteers are encouraged to help clean this up. Thanks.)
diff --git a/old/amiga/Makefile.pup b/old/amiga/Makefile.pup
deleted file mode 100644
index 6cfad1d..0000000
--- a/old/amiga/Makefile.pup
+++ /dev/null
@@ -1,66 +0,0 @@
1# Amiga powerUP (TM) Makefile
2# makefile for libpng and SAS C V6.58/7.00 PPC compiler
3# Copyright (C) 1998 by Andreas R. Kleinert
4
5CC = scppc
6CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL \
7 OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8
8LIBNAME = libzip.a
9AR = ppc-amigaos-ar
10AR_FLAGS = cr
11RANLIB = ppc-amigaos-ranlib
12LDFLAGS = -r -o
13LDLIBS = LIB:scppc.a
14LN = ppc-amigaos-ld
15RM = delete quiet
16
17OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
18 zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
19
20TEST_OBJS = example.o minigzip.o
21
22all: example minigzip
23
24test: all
25 example
26 echo hello world | minigzip | minigzip -d
27
28$(LIBNAME): $(OBJS)
29 $(AR) $(AR_FLAGS) $@ $(OBJS)
30 $(RANLIB) $@
31
32example: example.o $(LIBNAME)
33 $(LN) $(LDFLAGS) example LIB:c_ppc.o example.o $(LIBNAME) $(LDLIBS) LIB:end.o
34
35minigzip: minigzip.o $(LIBNAME)
36 $(LN) $(LDFLAGS) minigzip LIB:c_ppc.o minigzip.o $(LIBNAME) $(LDLIBS) LIB:end.o
37
38clean:
39 $(RM) *.o example minigzip $(LIBNAME) foo.gz
40
41zip:
42 zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \
43 descrip.mms *.[ch]
44
45tgz:
46 cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \
47 zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch]
48
49# DO NOT DELETE THIS LINE -- make depend depends on it.
50
51adler32.o: zutil.h zlib.h zconf.h
52compress.o: zlib.h zconf.h
53crc32.o: zutil.h zlib.h zconf.h
54deflate.o: deflate.h zutil.h zlib.h zconf.h
55example.o: zlib.h zconf.h
56gzio.o: zutil.h zlib.h zconf.h
57infblock.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
58infcodes.o: zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h
59inffast.o: zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
60inflate.o: zutil.h zlib.h zconf.h infblock.h
61inftrees.o: zutil.h zlib.h zconf.h inftrees.h
62infutil.o: zutil.h zlib.h zconf.h inftrees.h infutil.h
63minigzip.o: zlib.h zconf.h
64trees.o: deflate.h zutil.h zlib.h zconf.h
65uncompr.o: zlib.h zconf.h
66zutil.o: zutil.h zlib.h zconf.h
diff --git a/old/msdos/Makefile.b32 b/old/msdos/Makefile.b32
deleted file mode 100644
index 3802ea4..0000000
--- a/old/msdos/Makefile.b32
+++ /dev/null
@@ -1,104 +0,0 @@
1# Makefile for zlib
2# Borland C++
3
4# This version of the zlib makefile was adapted by Chris Young for use
5# with Borland C 4.5x with the Dos Power Pack for a 32-bit protected mode
6# flat memory model. It was created for use with POV-Ray ray tracer and
7# you may choose to edit the CFLAGS to suit your needs but the
8# switches -WX and -DMSDOS are required.
9# -- Chris Young 76702.1655@compuserve.com
10
11# To use, do "make -fmakefile.b32"
12
13# See zconf.h for details about the memory requirements.
14
15# ------------- Borland C++ -------------
16MODEL=-WX
17CFLAGS= $(MODEL) -P-C -K -N- -k- -d -3 -r- -v- -f -DMSDOS
18CC=bcc32
19LD=bcc32
20LIB=tlib
21LDFLAGS= $(MODEL)
22O=.obj
23
24# variables
25OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
26 trees$(O)
27OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
28 trees$(O)
29OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
30 infutil$(O) inffast$(O)
31OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
32 infutil$(O)+inffast$(O)
33
34all: test
35
36adler32.obj: adler32.c zlib.h zconf.h
37 $(CC) -c $(CFLAGS) $*.c
38
39compress.obj: compress.c zlib.h zconf.h
40 $(CC) -c $(CFLAGS) $*.c
41
42crc32.obj: crc32.c zlib.h zconf.h
43 $(CC) -c $(CFLAGS) $*.c
44
45deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
46 $(CC) -c $(CFLAGS) $*.c
47
48gzio.obj: gzio.c zutil.h zlib.h zconf.h
49 $(CC) -c $(CFLAGS) $*.c
50
51infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h\
52 infcodes.h infutil.h
53 $(CC) -c $(CFLAGS) $*.c
54
55infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h\
56 infcodes.h inffast.h
57 $(CC) -c $(CFLAGS) $*.c
58
59inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h
60 $(CC) -c $(CFLAGS) $*.c
61
62inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
63 $(CC) -c $(CFLAGS) $*.c
64
65infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
66 $(CC) -c $(CFLAGS) $*.c
67
68inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
69 $(CC) -c $(CFLAGS) $*.c
70
71trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h
72 $(CC) -c $(CFLAGS) $*.c
73
74uncompr.obj: uncompr.c zlib.h zconf.h
75 $(CC) -c $(CFLAGS) $*.c
76
77zutil.obj: zutil.c zutil.h zlib.h zconf.h
78 $(CC) -c $(CFLAGS) $*.c
79
80example.obj: example.c zlib.h zconf.h
81 $(CC) -c $(CFLAGS) $*.c
82
83minigzip.obj: minigzip.c zlib.h zconf.h
84 $(CC) -c $(CFLAGS) $*.c
85
86# we must cut the command line to fit in the MS/DOS 128 byte limit:
87zlib.lib: $(OBJ1) $(OBJ2)
88 del zlib.lib
89 $(LIB) zlib +$(OBJP1)
90 $(LIB) zlib +$(OBJP2)
91
92example.exe: example.obj zlib.lib
93 $(LD) $(LDFLAGS) example.obj zlib.lib
94
95minigzip.exe: minigzip.obj zlib.lib
96 $(LD) $(LDFLAGS) minigzip.obj zlib.lib
97
98test: example.exe minigzip.exe
99 example
100 echo hello world | minigzip | minigzip -d
101
102#clean:
103# del *.obj
104# del *.exe
diff --git a/old/msdos/Makefile.wat b/old/msdos/Makefile.wat
deleted file mode 100644
index 065fe4c..0000000
--- a/old/msdos/Makefile.wat
+++ /dev/null
@@ -1,103 +0,0 @@
1# Makefile for zlib
2# Watcom 10a
3
4# This version of the zlib makefile was adapted by Chris Young for use
5# with Watcom 10a 32-bit protected mode flat memory model. It was created
6# for use with POV-Ray ray tracer and you may choose to edit the CFLAGS to
7# suit your needs but the -DMSDOS is required.
8# -- Chris Young 76702.1655@compuserve.com
9
10# To use, do "wmake -f makefile.wat"
11
12# See zconf.h for details about the memory requirements.
13
14# ------------- Watcom 10a -------------
15MODEL=-mf
16CFLAGS= $(MODEL) -fpi87 -fp5 -zp4 -5r -w5 -oneatx -DMSDOS
17CC=wcc386
18LD=wcl386
19LIB=wlib -b -c
20LDFLAGS=
21O=.obj
22
23# variables
24OBJ1=adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O)
25OBJ2=trees$(O) zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O)
26OBJ3=infutil$(O) inffast$(O)
27OBJP1=adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)
28OBJP2=trees$(O)+zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)
29OBJP3=infutil$(O)+inffast$(O)
30
31all: test
32
33adler32.obj: adler32.c zlib.h zconf.h
34 $(CC) $(CFLAGS) $*.c
35
36compress.obj: compress.c zlib.h zconf.h
37 $(CC) $(CFLAGS) $*.c
38
39crc32.obj: crc32.c zlib.h zconf.h
40 $(CC) $(CFLAGS) $*.c
41
42deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
43 $(CC) $(CFLAGS) $*.c
44
45gzio.obj: gzio.c zutil.h zlib.h zconf.h
46 $(CC) $(CFLAGS) $*.c
47
48infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h &
49 infcodes.h infutil.h
50 $(CC) $(CFLAGS) $*.c
51
52infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h &
53 infcodes.h inffast.h
54 $(CC) $(CFLAGS) $*.c
55
56inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h
57 $(CC) $(CFLAGS) $*.c
58
59inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
60 $(CC) $(CFLAGS) $*.c
61
62infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
63 $(CC) $(CFLAGS) $*.c
64
65inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
66 $(CC) $(CFLAGS) $*.c
67
68trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h
69 $(CC) $(CFLAGS) $*.c
70
71uncompr.obj: uncompr.c zlib.h zconf.h
72 $(CC) $(CFLAGS) $*.c
73
74zutil.obj: zutil.c zutil.h zlib.h zconf.h
75 $(CC) $(CFLAGS) $*.c
76
77example.obj: example.c zlib.h zconf.h
78 $(CC) $(CFLAGS) $*.c
79
80minigzip.obj: minigzip.c zlib.h zconf.h
81 $(CC) $(CFLAGS) $*.c
82
83# we must cut the command line to fit in the MS/DOS 128 byte limit:
84zlib.lib: $(OBJ1) $(OBJ2) $(OBJ3)
85 del zlib.lib
86 $(LIB) zlib.lib +$(OBJP1)
87 $(LIB) zlib.lib +$(OBJP2)
88 $(LIB) zlib.lib +$(OBJP3)
89
90example.exe: example.obj zlib.lib
91 $(LD) $(LDFLAGS) example.obj zlib.lib
92
93minigzip.exe: minigzip.obj zlib.lib
94 $(LD) $(LDFLAGS) minigzip.obj zlib.lib
95
96test: minigzip.exe example.exe
97 example
98 echo hello world | minigzip | minigzip -d >test
99 type test
100
101#clean:
102# del *.obj
103# del *.exe
diff --git a/qnx/package.qpg b/qnx/package.qpg
index f07311f..f7c9e73 100644
--- a/qnx/package.qpg
+++ b/qnx/package.qpg
@@ -25,10 +25,10 @@
25 <QPG:Files> 25 <QPG:Files>
26 <QPG:Add file="../zconf.h" install="/opt/include/" user="root:sys" permission="644"/> 26 <QPG:Add file="../zconf.h" install="/opt/include/" user="root:sys" permission="644"/>
27 <QPG:Add file="../zlib.h" install="/opt/include/" user="root:sys" permission="644"/> 27 <QPG:Add file="../zlib.h" install="/opt/include/" user="root:sys" permission="644"/>
28 <QPG:Add file="../libz.so.1.2.0.6" install="/opt/lib/" user="root:bin" permission="644"/> 28 <QPG:Add file="../libz.so.1.2.0.7" install="/opt/lib/" user="root:bin" permission="644"/>
29 <QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.0.6"/> 29 <QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.0.7"/>
30 <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.0.6"/> 30 <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.0.7"/>
31 <QPG:Add file="../libz.so.1.2.0.6" install="/opt/lib/" component="slib"/> 31 <QPG:Add file="../libz.so.1.2.0.7" install="/opt/lib/" component="slib"/>
32 </QPG:Files> 32 </QPG:Files>
33 33
34 <QPG:PackageFilter> 34 <QPG:PackageFilter>
@@ -63,7 +63,7 @@
63 </QPM:ProductDescription> 63 </QPM:ProductDescription>
64 64
65 <QPM:ReleaseDescription> 65 <QPM:ReleaseDescription>
66 <QPM:ReleaseVersion>1.2.0.6</QPM:ReleaseVersion> 66 <QPM:ReleaseVersion>1.2.0.7</QPM:ReleaseVersion>
67 <QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency> 67 <QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
68 <QPM:ReleaseStability>Stable</QPM:ReleaseStability> 68 <QPM:ReleaseStability>Stable</QPM:ReleaseStability>
69 <QPM:ReleaseNoteMinor></QPM:ReleaseNoteMinor> 69 <QPM:ReleaseNoteMinor></QPM:ReleaseNoteMinor>
diff --git a/trees.c b/trees.c
index 5f6d4af..bb09554 100644
--- a/trees.c
+++ b/trees.c
@@ -1107,7 +1107,8 @@ local void compress_block(s, ltree, dtree)
1107 } /* literal or match pair ? */ 1107 } /* literal or match pair ? */
1108 1108
1109 /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ 1109 /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
1110 Assert(s->pending < s->lit_bufsize + 2*lx, "pendingBuf overflow"); 1110 Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
1111 "pendingBuf overflow");
1111 1112
1112 } while (lx < s->last_lit); 1113 } while (lx < s->last_lit);
1113 1114
diff --git a/win32/zlib1.rc b/win32/zlib1.rc
index f5f2a1f..9c26467 100644
--- a/win32/zlib1.rc
+++ b/win32/zlib1.rc
@@ -5,8 +5,8 @@ VS_VERSION_INFO VERSIONINFO
5#else 5#else
6VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 6VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
7#endif 7#endif
8 FILEVERSION 1,2,0,6 8 FILEVERSION 1,2,0,7
9 PRODUCTVERSION 1,2,0,6 9 PRODUCTVERSION 1,2,0,7
10 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 10 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
11#ifdef _DEBUG 11#ifdef _DEBUG
12 FILEFLAGS 1 12 FILEFLAGS 1
@@ -23,12 +23,12 @@ BEGIN
23 //language ID = U.S. English, char set = Windows, Multilingual 23 //language ID = U.S. English, char set = Windows, Multilingual
24 BEGIN 24 BEGIN
25 VALUE "FileDescription", "zlib data compression library\0" 25 VALUE "FileDescription", "zlib data compression library\0"
26 VALUE "FileVersion", "1.2.0.6\0" 26 VALUE "FileVersion", "1.2.0.7\0"
27 VALUE "InternalName", "zlib1.dll\0" 27 VALUE "InternalName", "zlib1.dll\0"
28 VALUE "LegalCopyright", "(C) 1995-2003 Jean-loup Gailly & Mark Adler\0" 28 VALUE "LegalCopyright", "(C) 1995-2003 Jean-loup Gailly & Mark Adler\0"
29 VALUE "OriginalFilename", "zlib1.dll\0" 29 VALUE "OriginalFilename", "zlib1.dll\0"
30 VALUE "ProductName", "zlib\0" 30 VALUE "ProductName", "zlib\0"
31 VALUE "ProductVersion", "1.2.0.6\0" 31 VALUE "ProductVersion", "1.2.0.7\0"
32 VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 32 VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
33 END 33 END
34 END 34 END
diff --git a/zlib.3 b/zlib.3
index 92a436a..0a1a57e 100644
--- a/zlib.3
+++ b/zlib.3
@@ -1,4 +1,4 @@
1.TH ZLIB 3 "13 September 2003" 1.TH ZLIB 3 "21 September 2003"
2.SH NAME 2.SH NAME
3zlib \- compression/decompression library 3zlib \- compression/decompression library
4.SH SYNOPSIS 4.SH SYNOPSIS
@@ -133,7 +133,7 @@ before asking for help.
133Send questions and/or comments to zlib@gzip.org, 133Send questions and/or comments to zlib@gzip.org,
134or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). 134or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
135.SH AUTHORS 135.SH AUTHORS
136Version 1.2.0.6 136Version 1.2.0.7
137Copyright (C) 1995-2003 Jean-loup Gailly (jloup@gzip.org) 137Copyright (C) 1995-2003 Jean-loup Gailly (jloup@gzip.org)
138and Mark Adler (madler@alumni.caltech.edu). 138and Mark Adler (madler@alumni.caltech.edu).
139.LP 139.LP
diff --git a/zlib.h b/zlib.h
index 61a69a2..c38b83c 100644
--- a/zlib.h
+++ b/zlib.h
@@ -1,5 +1,5 @@
1/* zlib.h -- interface of the 'zlib' general purpose compression library 1/* zlib.h -- interface of the 'zlib' general purpose compression library
2 version 1.2.0.6, September 13th, 2003 2 version 1.2.0.7, September 21st, 2003
3 3
4 Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler 4 Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler
5 5
@@ -37,8 +37,8 @@
37extern "C" { 37extern "C" {
38#endif 38#endif
39 39
40#define ZLIB_VERSION "1.2.0.6" 40#define ZLIB_VERSION "1.2.0.7"
41#define ZLIB_VERNUM 0x1206 41#define ZLIB_VERNUM 0x1207
42 42
43/* 43/*
44 The 'zlib' compression library provides in-memory compression and 44 The 'zlib' compression library provides in-memory compression and
diff --git a/zutil.h b/zutil.h
index db678b0..c2c98d9 100644
--- a/zutil.h
+++ b/zutil.h
@@ -181,6 +181,9 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
181# define vsnprintf _vsnprintf 181# define vsnprintf _vsnprintf
182# endif 182# endif
183# endif 183# endif
184# ifdef __SASC
185# define NO_vsnprintf
186# endif
184#endif 187#endif
185 188
186#ifdef HAVE_STRERROR 189#ifdef HAVE_STRERROR