Skip to content

Commit

Permalink
zlib 1.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
madler committed Sep 10, 2011
1 parent 6759211 commit b8c9ecb
Show file tree
Hide file tree
Showing 33 changed files with 1,460 additions and 1,465 deletions.
24 changes: 24 additions & 0 deletions ChangeLog
@@ -1,6 +1,30 @@

ChangeLog file for zlib

Changes in 1.0.9 (17 Feb 1998)
- added gzputs and gzgets functions
- do not clear eof flag in gzseek (Mark Diekhans)
- fix gzseek for files in transparent mode (Mark Diekhans)
- do not assume that vsprintf returns the number of bytes written (Jens Krinke)
- replace EXPORT with ZEXPORT to avoid conflict with other programs
- added compress2 in zconf.h, zlib.def, zlib.dnt
- new asm code from Gilles Vollant in contrib/asm386
- simplify the inflate code (Mark):
. Replace ZALLOC's in huft_build() with single ZALLOC in inflate_blocks_new()
. ZALLOC the length list in inflate_trees_fixed() instead of using stack
. ZALLOC the value area for huft_build() instead of using stack
. Simplify Z_FINISH check in inflate()

- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8
- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi)
- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with
the declaration of FAR (Gilles VOllant)
- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann)
- read_buf buf parameter of type Bytef* instead of charf*
- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout)
- do not redeclare unlink in minigzip.c for WIN32 (John Bowler)
- fix check for presence of directories in "make install" (Ian Willis)

Changes in 1.0.8 (27 Jan 1998)
- fixed offsets in contrib/asm386/gvmat32.asm (Gilles Vollant)
- fix gzgetc and gzputc for big endian systems (Markus Oberhumer)
Expand Down
12 changes: 7 additions & 5 deletions Makefile
Expand Up @@ -23,7 +23,7 @@ CFLAGS=-O
LDFLAGS=-L. -lz
LDSHARED=$(CC)

VER=1.0.8
VER=1.0.9
LIBS=libz.a
SHAREDLIB=libz.so

Expand All @@ -44,7 +44,7 @@ DISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \
algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
nt/Makefile.nt nt/zlib.dnt contrib/README.contrib contrib/*.txt \
contrib/asm386/*.asm contrib/asm386/*.c \
contrib/asm386/*.bat contrib/asm386/*.mak contrib/iostream/*.cpp \
contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \
contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32

Expand Down Expand Up @@ -77,12 +77,12 @@ minigzip: minigzip.o $(LIBS)
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)

install: $(LIBS)
-@if [ ! $(prefix)/include ]; then mkdir $(prefix)/include; fi
-@if [ ! $(exec_prefix)/lib ]; then mkdir $(exec_prefix)/lib; fi
-@if [ ! -d $(prefix)/include ]; then mkdir $(prefix)/include; fi
-@if [ ! -d $(exec_prefix)/lib ]; then mkdir $(exec_prefix)/lib; fi
cp zlib.h zconf.h $(prefix)/include
chmod 644 $(prefix)/include/zlib.h $(prefix)/include/zconf.h
cp $(LIBS) $(exec_prefix)/lib
cd $(exec_prefix)/lib; chmod 644 $(LIBS)
cd $(exec_prefix)/lib; chmod 755 $(LIBS)
-@(cd $(exec_prefix)/lib; $(RANLIB) libz.a || true) >/dev/null 2>&1
cd $(exec_prefix)/lib; if test -f $(SHAREDLIB).$(VER); then \
rm -f $(SHAREDLIB) $(SHAREDLIB).1; \
Expand Down Expand Up @@ -112,12 +112,14 @@ distclean: clean

zip:
mv Makefile Makefile~; cp -p Makefile.in Makefile
rm -f test.c ztest*.c
v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
zip -ul9 zlib$$v $(DISTFILES)
mv Makefile~ Makefile

dist:
mv Makefile Makefile~; cp -p Makefile.in Makefile
rm -f test.c ztest*.c
d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
rm -f $$d.tar.gz; \
if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
Expand Down
12 changes: 7 additions & 5 deletions Makefile.in
Expand Up @@ -23,7 +23,7 @@ CFLAGS=-O
LDFLAGS=-L. -lz
LDSHARED=$(CC)

VER=1.0.8
VER=1.0.9
LIBS=libz.a
SHAREDLIB=libz.so

Expand All @@ -44,7 +44,7 @@ DISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \
algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
nt/Makefile.nt nt/zlib.dnt contrib/README.contrib contrib/*.txt \
contrib/asm386/*.asm contrib/asm386/*.c \
contrib/asm386/*.bat contrib/asm386/*.mak contrib/iostream/*.cpp \
contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \
contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32

Expand Down Expand Up @@ -77,12 +77,12 @@ minigzip: minigzip.o $(LIBS)
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)

install: $(LIBS)
-@if [ ! $(prefix)/include ]; then mkdir $(prefix)/include; fi
-@if [ ! $(exec_prefix)/lib ]; then mkdir $(exec_prefix)/lib; fi
-@if [ ! -d $(prefix)/include ]; then mkdir $(prefix)/include; fi
-@if [ ! -d $(exec_prefix)/lib ]; then mkdir $(exec_prefix)/lib; fi
cp zlib.h zconf.h $(prefix)/include
chmod 644 $(prefix)/include/zlib.h $(prefix)/include/zconf.h
cp $(LIBS) $(exec_prefix)/lib
cd $(exec_prefix)/lib; chmod 644 $(LIBS)
cd $(exec_prefix)/lib; chmod 755 $(LIBS)
-@(cd $(exec_prefix)/lib; $(RANLIB) libz.a || true) >/dev/null 2>&1
cd $(exec_prefix)/lib; if test -f $(SHAREDLIB).$(VER); then \
rm -f $(SHAREDLIB) $(SHAREDLIB).1; \
Expand Down Expand Up @@ -112,12 +112,14 @@ distclean: clean

zip:
mv Makefile Makefile~; cp -p Makefile.in Makefile
rm -f test.c ztest*.c
v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
zip -ul9 zlib$$v $(DISTFILES)
mv Makefile~ Makefile

dist:
mv Makefile Makefile~; cp -p Makefile.in Makefile
rm -f test.c ztest*.c
d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
rm -f $$d.tar.gz; \
if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
Expand Down
38 changes: 20 additions & 18 deletions README
@@ -1,4 +1,4 @@
zlib 1.0.8 is a general purpose data compression library. All the code
zlib 1.0.9 is a general purpose data compression library. All the code
is thread safe. The data format used by the zlib library
is described by RFCs (Request for Comments) 1950 to 1952 in the files
ftp://ds.internic.net/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate
Expand All @@ -25,18 +25,22 @@ Mark Nelson wrote an article about zlib for the Jan. 1997 issue of
Dr. Dobb's Journal; a copy of the article is available in
http://web2.airmail.net/markn/articles/zlibtool/zlibtool.htm

The changes made in version 1.0.8 are documented in the file ChangeLog.
The main changes since 1.0.7 are:
The changes made in version 1.0.9 are documented in the file ChangeLog.
The main changes since 1.0.8 are:

- added gzputs and gzgets functions
- do not clear eof flag in gzseek (Mark Diekhans)
- fix gzseek for files in transparent mode (Mark Diekhans)
- do not assume that vsprintf returns the number of bytes written (Jens Krinke)
- replace EXPORT with ZEXPORT to avoid conflict with other programs
- added compress2 in zconf.h, zlib.def, zlib.dnt
- new asm code from Gilles Vollant in contrib/asm386
- simplify the inflate code (Mark):
. Replace ZALLOC's in huft_build() with single ZALLOC in inflate_blocks_new()
. ZALLOC the length list in inflate_trees_fixed() instead of using stack
. ZALLOC the value area for huft_build() instead of using stack
. Simplify Z_FINISH check in inflate()

- fixed offsets in contrib/asm386/gvmat32.asm (Gilles Vollant)
- fix gzgetc and gzputc for big endian systems (Markus Oberhumer)
- added compress2() to allow setting the compression level
- include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong)
- use constant arrays for the static trees in trees.c instead of computing
them at run time (thanks to Ken Raeburn for this suggestion). To create
trees.h, compile with GEN_TREES_H and run "make test".
- check return code of example in "make test" and display result
- pass minigzip command line options to file_compress

Unsupported third party contributions are provided in directory "contrib".

Expand Down Expand Up @@ -65,21 +69,19 @@ Notes for some targets:
See contrib/visual-basic.txt for more information.
I don't know how to handle structures in Visual Basic, sorry.

- "make test" fails on Solaris 2.6 with gcc 2.8.0. It works with cc and
with gcc 2.7.2.1.

- For 64-bit Irix, deflate.c must be compiled without any optimization.
With -O, one libpng test fails. The test works in 32 bit mode (with
the -n32 compiler flag). The compiler bug has been reported to SGI.

- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1
it works when compiled with cc.

- zlib doesn't work on HP-UX 9.05 with one cc compiler (the one not
accepting the -O option). It works with the other cc compiler.
- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works
with other compilers. Use "make test" to check your compiler.

- For shared memory multiprocessors, the decompression code assumes that
writes to pointers are atomic.
writes to pointers are atomic. Also the functions zalloc and zfree passed
to deflateInit must be multi-threaded in this case.

- gzdopen is not supported on RISCOS, BEOS and Mac

Expand Down
2 changes: 1 addition & 1 deletion adler32.c
Expand Up @@ -18,7 +18,7 @@
#define DO16(buf) DO8(buf,0); DO8(buf,8);

/* ========================================================================= */
uLong EXPORT adler32(adler, buf, len)
uLong ZEXPORT adler32(adler, buf, len)
uLong adler;
const Bytef *buf;
uInt len;
Expand Down
4 changes: 2 additions & 2 deletions compress.c
Expand Up @@ -18,7 +18,7 @@
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
int EXPORT compress2 (dest, destLen, source, sourceLen, level)
int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
Expand Down Expand Up @@ -58,7 +58,7 @@ int EXPORT compress2 (dest, destLen, source, sourceLen, level)

/* ===========================================================================
*/
int EXPORT compress (dest, destLen, source, sourceLen)
int ZEXPORT compress (dest, destLen, source, sourceLen)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
Expand Down
11 changes: 10 additions & 1 deletion configure
Expand Up @@ -14,6 +14,10 @@
# (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
# LDSHARED is the command to be used to create a shared library

# Incorrect settings of CC or CFLAGS may prevent creating a shared library.
# If you have problems, try without defining CC and CFLAGS before reporting
# an error.

LIBS=libz.a
SHAREDLIB=libz.so
VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
Expand All @@ -23,6 +27,8 @@ prefix=${prefix-/usr/local}
exec_prefix=${exec_prefix-$prefix}
shared_ext='.so'
shared=0
old_cc="$CC"
old_cflags="$CFLAGS"

case "$1" in
-s* | --s*) shared=1; shift;;
Expand Down Expand Up @@ -96,9 +102,12 @@ if test $shared -eq 1; then
CFLAGS="$SFLAGS"
LIBS="$SHAREDLIB.$VER"
echo Building shared library $SHAREDLIB.$VER with $CC.
else
elif test -z "$old_cc" -a -z "$old_cflags"; then
echo No shared library suppport.
shared=0;
else
echo 'No shared library suppport; try without defining CC and CFLAGS'
shared=0;
fi
fi
if test $shared -eq 0; then
Expand Down

0 comments on commit b8c9ecb

Please sign in to comment.