Navigation Menu

Skip to content

Commit

Permalink
zlib 0.99
Browse files Browse the repository at this point in the history
  • Loading branch information
madler committed Sep 10, 2011
1 parent 25e5325 commit 56bcb18
Show file tree
Hide file tree
Showing 33 changed files with 1,836 additions and 778 deletions.
61 changes: 61 additions & 0 deletions ChangeLog
@@ -1,6 +1,67 @@

ChangeLog file for zlib

Changes in 1.0 (15 Jan 96)
- allow preset dictionary shared between compressor and decompressor
- allow compression level 0 (no compression)
- add deflateParams in zlib.h: allow dynamic change of compression level
and compression strategy.
- test large buffers and deflateParams in example.c
- add optional "configure" to build zlib as a shared library
- suppress Makefile.qnx, use configure instead
- fixed deflate for 64-bit systems (detected on Cray)
- fixed inflate_blocks for 64-bit systems (detected on Alpha)
- declare Z_DEFLATED in zlib.h (possible parameter for deflateInit2)
- always return Z_BUF_ERROR when deflate() has nothing to do
- deflateInit and inflateInit are now macros to allow version checking
- prefix all global functions and types with z_ with -DZ_PREFIX
- make falloc completely reentrant (inftrees.c)
- fixed very unlikely race condition in ct_static_init
- free in reverse order of allocation to help memory manager
- use zlib-1.0/* instead of zlib/* inside the tar.gz
- make zlib warning-free with "gcc -O3 -Wall -Wwrite-strings -Wpointer-arith
-Wconversion -Wstrict-prototypes -Wmissing-prototypes"
- allow gzread on concatenated .gz files
- deflateEnd now returns Z_DATA_ERROR if it was premature
- deflate is finally (?) fully deterministic (no matches beyond end of input)
- Document Z_SYNC_FLUSH
- add uninstall in Makefile
- Check for __cpluplus in zlib.h
- Better test in ct_align for partial flush
- avoid harmless warnings for Borland C++
- initialize hash_head in deflate.c
- avoid warning on fdopen (gzio.c) for HP cc -Aa
- include stdlib.h for STDC compilers
- include errno.h for Cray
- ignore error if ranlib doesn't exist
- call ranlib twice for NeXTSTEP
- use exec_prefix instead of prefix for libz.a
- renamed ct_* as _tr_* to avoid conflict with applications
- clear z->msg in inflateInit2 before any error return
- initialize opaque in example.c, gzio.c, deflate.c and inflate.c
- fixed typo in zconf.h (_GNUC__ => __GNUC__)
- check for WIN32 in zconf.h and zutil.c (avoid farmalloc in 32-bit mode)
- fix typo in Make_vms.com (f$trnlnm -> f$getsyi)
- in fcalloc, normalize pointer if size > 65520 bytes
- don't use special fcalloc for 32 bit Borland C++
- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc...
- use Z_BINARY instead of BINARY
- document that gzclose after gzdopen will close the file
- allow "a" as mode in gzopen.
- fix error checking in gzread
- allow skipping .gz extra-field on pipes
- added reference to Perl interface in README
- put the crc table in FAR data (I dislike more and more the medium model :)
- added get_crc_table
- added a dimension to all arrays (Borland C can't count).
- workaround Borland C bug in declaration of inflate_codes_new & inflate_fast
- guard against multiple inclusion of *.h (for precompiled header on Mac)
- Watcom C pretends to be Microsoft C small model even in 32 bit mode.
- don't use unsized arrays to avoid silly warnings by Visual C++:
warning C4746: 'inflate_mask' : unsized array treated as '__far'
(what's wrong with far data in far model?).
- define enum out of inflate_blocks_state to allow compilation with C++

Changes in 0.95 (16 Aug 95)
- fix MSDOS small and medium model (now easier to adapt to any compiler)
- inlined send_bits
Expand Down
2 changes: 1 addition & 1 deletion Make_vms.com
Expand Up @@ -4,7 +4,7 @@ $!
$! Look for the compiler used
$!
$ ccopt = ""
$ if f$trnlnm("HW_MODEL").ge.1024
$ if f$getsyi("HW_MODEL").ge.1024
$ then
$ ccopt = "/prefix=all"+ccopt
$ comp = "__decc__=1"
Expand Down
119 changes: 88 additions & 31 deletions Makefile
@@ -1,73 +1,130 @@
# Makefile for zlib
# Copyright (C) 1995 Jean-loup Gailly.
# Copyright (C) 1995-1996 Jean-loup Gailly.
# For conditions of distribution and use, see copyright notice in zlib.h

# To compile and test, type:
# ./configure; make test
# The call of configure is optional if you don't have special requirements

# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
# make install
# To install in $HOME instead of /usr/local, use:
# make install prefix=$HOME

CC=cc

CFLAGS=-O
#use -O3 for gcc to take advantage of inlining
#CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
#CFLAGS=-g -DDEBUG
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
# -Wstrict-prototypes -Wmissing-prototypes

LDFLAGS=-L. -lz
LDSHARED=$(CC)

VER=1.0
LIBS=libz.a

AR=ar rc
RANLIB=ranlib
TAR=tar

prefix=/usr/local
exec_prefix = $(prefix)

OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o

TEST_OBJS = example.o minigzip.o

DISTFILES = README ChangeLog configure Makefile.in Makefile Makefile.msc \
Makefile.bor Makefile.tc Make_vms.com descrip.mms *.[ch]

all: example minigzip

test: all
./example
echo hello world | ./minigzip | ./minigzip -d

install: libz.a
-@mkdir $(prefix)/include
-@mkdir $(prefix)/lib
cp zlib.h zconf.h $(prefix)/include
chmod 644 $(prefix)/include/zlib.h $(prefix)/include/zconf.h
cp libz.a $(prefix)/lib
chmod 644 $(prefix)/lib/libz.a

libz.a: $(OBJS)
ar rc $@ $(OBJS)
$(RANLIB) $@
$(AR) $@ $(OBJS)
-@ ($(RANLIB) $@ || true) 2>/dev/null

example: example.o libz.a
libz.so.$(VER): $(OBJS)
$(LDSHARED) -o $@ $(OBJS)
rm -f libz.so; ln -s $@ libz.so

example: example.o $(LIBS)
$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)

minigzip: minigzip.o libz.a
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
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; $(RANLIB) libz.a || true) >/dev/null 2>&1
cd $(exec_prefix)/lib; if test -f libz.so.$(VER); then \
ln -s libz.so.$(VER) libz.so; \
fi
# The ranlib in install is needed on NeXTSTEP which checks file times

uninstall:
cd $(exec_prefix)/lib; rm -f $(LIBS); \
if test -f libz.so; then \
v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p'<$(prefix)/include/zlib.h`;\
rm -f libz.so.$$v libz.so; \
fi
cd $(prefix)/include; rm -f zlib.h zconf.h

clean:
rm -f *.o example minigzip libz.a foo.gz
rm -f *.o *~ example minigzip libz.a libz.so* foo.gz

zip:
zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \
descrip.mms *.[ch]

tgz:
cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \
zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch]
mv Makefile Makefile~; cp -p Makefile.in Makefile
v=`sed -n -e 's/\./-/' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
zip -ul9 zlib-$$v $(DISTFILES)
mv Makefile~ Makefile

dist:
mv Makefile Makefile~; cp -p Makefile.in Makefile
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; \
files=""; \
for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
cd ..; \
GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
if test ! -d $$d; then rm -f $$d; fi
mv Makefile~ Makefile

tags:
etags *.[ch]

depend:
makedepend -- $(CFLAGS) -- *.[ch]

# DO NOT DELETE THIS LINE -- make depend depends on it.

adler32.o: zutil.h zlib.h zconf.h
adler32.o: zlib.h zconf.h
compress.o: zlib.h zconf.h
crc32.o: zutil.h zlib.h zconf.h
crc32.o: zlib.h zconf.h
deflate.o: deflate.h zutil.h zlib.h zconf.h
example.o: zlib.h zconf.h
gzio.o: zutil.h zlib.h zconf.h
infblock.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
infcodes.o: zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h
inffast.o: zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
infcodes.o: zutil.h zlib.h zconf.h
infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
inffast.o: zutil.h zlib.h zconf.h inftrees.h
inffast.o: infblock.h infcodes.h infutil.h inffast.h
inflate.o: zutil.h zlib.h zconf.h infblock.h
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
infutil.o: zutil.h zlib.h zconf.h inftrees.h infutil.h
minigzip.o: zlib.h zconf.h
trees.o: deflate.h zutil.h zlib.h zconf.h
infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
minigzip.o: zlib.h zconf.h
trees.o: deflate.h zutil.h zlib.h zconf.h
uncompr.o: zlib.h zconf.h
zutil.o: zutil.h zlib.h zconf.h
zutil.o: zutil.h zlib.h zconf.h
2 changes: 1 addition & 1 deletion Makefile.bor
Expand Up @@ -18,7 +18,7 @@ CFLAGS=-O2 -Z $(MODEL)
CC=bcc
LD=bcc
LIB=tlib
# replace bcc with tcc for Turbo C++ 1.0
# replace bcc with tcc for Turbo C++ 1.0, with bcc32 for the 32 bit version
LDFLAGS=$(MODEL)
O=.obj

Expand Down
130 changes: 130 additions & 0 deletions Makefile.in
@@ -0,0 +1,130 @@
# Makefile for zlib
# Copyright (C) 1995-1996 Jean-loup Gailly.
# For conditions of distribution and use, see copyright notice in zlib.h

# To compile and test, type:
# ./configure; make test
# The call of configure is optional if you don't have special requirements

# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
# make install
# To install in $HOME instead of /usr/local, use:
# make install prefix=$HOME

CC=cc

CFLAGS=-O
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
#CFLAGS=-g -DDEBUG
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
# -Wstrict-prototypes -Wmissing-prototypes

LDFLAGS=-L. -lz
LDSHARED=$(CC)

VER=1.0
LIBS=libz.a

AR=ar rc
RANLIB=ranlib
TAR=tar

prefix=/usr/local
exec_prefix = $(prefix)

OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o

TEST_OBJS = example.o minigzip.o

DISTFILES = README ChangeLog configure Makefile.in Makefile Makefile.msc \
Makefile.bor Makefile.tc Make_vms.com descrip.mms *.[ch]

all: example minigzip

test: all
./example
echo hello world | ./minigzip | ./minigzip -d

libz.a: $(OBJS)
$(AR) $@ $(OBJS)
-@ ($(RANLIB) $@ || true) 2>/dev/null

libz.so.$(VER): $(OBJS)
$(LDSHARED) -o $@ $(OBJS)
rm -f libz.so; ln -s $@ libz.so

example: example.o $(LIBS)
$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)

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
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; $(RANLIB) libz.a || true) >/dev/null 2>&1
cd $(exec_prefix)/lib; if test -f libz.so.$(VER); then \
ln -s libz.so.$(VER) libz.so; \
fi
# The ranlib in install is needed on NeXTSTEP which checks file times

uninstall:
cd $(exec_prefix)/lib; rm -f $(LIBS); \
if test -f libz.so; then \
v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p'<$(prefix)/include/zlib.h`;\
rm -f libz.so.$$v libz.so; \
fi
cd $(prefix)/include; rm -f zlib.h zconf.h

clean:
rm -f *.o *~ example minigzip libz.a libz.so* foo.gz

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

dist:
mv Makefile Makefile~; cp -p Makefile.in Makefile
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; \
files=""; \
for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
cd ..; \
GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
if test ! -d $$d; then rm -f $$d; fi
mv Makefile~ Makefile

tags:
etags *.[ch]

depend:
makedepend -- $(CFLAGS) -- *.[ch]

# DO NOT DELETE THIS LINE -- make depend depends on it.

adler32.o: zlib.h zconf.h
compress.o: zlib.h zconf.h
crc32.o: zlib.h zconf.h
deflate.o: deflate.h zutil.h zlib.h zconf.h
example.o: zlib.h zconf.h
gzio.o: zutil.h zlib.h zconf.h
infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
infcodes.o: zutil.h zlib.h zconf.h
infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
inffast.o: zutil.h zlib.h zconf.h inftrees.h
inffast.o: infblock.h infcodes.h infutil.h inffast.h
inflate.o: zutil.h zlib.h zconf.h infblock.h
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
minigzip.o: zlib.h zconf.h
trees.o: deflate.h zutil.h zlib.h zconf.h
uncompr.o: zlib.h zconf.h
zutil.o: zutil.h zlib.h zconf.h

0 comments on commit 56bcb18

Please sign in to comment.