Skip to content

Commit

Permalink
zlib 1.2.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
madler committed Sep 10, 2011
1 parent d623114 commit 639be99
Show file tree
Hide file tree
Showing 22 changed files with 583 additions and 240 deletions.
14 changes: 14 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@

ChangeLog file for zlib

Changes in 1.2.3.3 (2 October 2006)
- Make --shared the default for configure, add a --static option
- Add compile option to permit invalid distance-too-far streams
- Add inflateUndermine() function which is required to enable above
- Remove use of "this" variable name for C++ compatibility [Marquess]
- Add testing of shared library in make test, if shared library built
- Use ftello() and fseeko() if available instead of ftell() and fseek()
- Provide two versions of all functions that use the z_off_t type for
binary compatibility -- a normal version and a 64-bit offset version,
per the Large File Support Extension when _LARGEFILE64_SUPPORT is
defined; use the 64-bit versions by default when _FILE_OFFSET_BITS
is defined to be 64
- Add a --uname= option to configure to perhaps help with cross-compiling

Changes in 1.2.3.2 (3 September 2006)
- Turn off silly Borland warnings [Hay]
- Use off64_t and define _LARGEFILE64_SOURCE when present
Expand Down
41 changes: 32 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ CPP=$(CC) -E

LIBS=libz.a
SHAREDLIB=libz.so
SHAREDLIBV=libz.so.1.2.3.2
SHAREDLIBV=libz.so.1.2.3.3
SHAREDLIBM=libz.so.1

AR=ar
Expand Down Expand Up @@ -61,19 +61,37 @@ PIC_OBJS = $(OBJS:%.o=%.lo)

TEST_OBJS = example.o minigzip.o

all: example$(EXE) minigzip$(EXE)
allstatic: example$(EXE) minigzip$(EXE)

check: test
test: all
@LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
echo hello world | ./minigzip | ./minigzip -d || \
allshared: examplesh$(EXE) minigzipsh$(EXE)

all: allstatic allshared

teststatic: allstatic
@echo hello world | ./minigzip | ./minigzip -d || \
echo ' *** minigzip test FAILED ***' ; \
if ./example; then \
echo ' *** zlib test OK ***'; \
else \
echo ' *** zlib test FAILED ***'; \
fi

testshared: allshared
@LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
echo hello world | ./minigzipsh | ./minigzipsh -d || \
echo ' *** minigzip shared test FAILED ***' ; \
if ./examplesh; then \
echo ' *** zlib shared test OK ***'; \
else \
echo ' *** zlib shared test FAILED ***'; \
fi

test: teststatic testshared

check: test

libz.a: $(OBJS)
$(AR) $@ $(OBJS)
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
Expand Down Expand Up @@ -105,6 +123,12 @@ example$(EXE): example.o $(LIBS)
minigzip$(EXE): minigzip.o $(LIBS)
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)

examplesh$(EXE): example.o $(LIBS)
$(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIB)

minigzipsh$(EXE): minigzip.o $(LIBS)
$(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIB)

install-libs: $(LIBS)
-@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
-@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
Expand Down Expand Up @@ -142,7 +166,8 @@ uninstall:

mostlyclean: clean
clean:
rm -f *.o *.lo *~ example$(EXE) minigzip$(EXE) \
rm -f *.o *.lo *~ \
example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
libz.* foo.gz so_locations \
_match.s maketree contrib/infback9/*.o

Expand Down Expand Up @@ -180,13 +205,11 @@ adler32.lo: zlib.h zconf.h zlibdefs.h
compress.lo: zlib.h zconf.h zlibdefs.h
crc32.lo: crc32.h zlib.h zconf.h zlibdefs.h
deflate.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h
example.lo: zlib.h zconf.h zlibdefs.h
gzio.lo: zutil.h zlib.h zconf.h zlibdefs.h
inffast.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h
inflate.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
infback.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
inftrees.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h
minigzip.lo: zlib.h zconf.h zlibdefs.h
trees.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h
uncompr.lo: zlib.h zconf.h zlibdefs.h
zutil.lo: zutil.h zlib.h zconf.h zlibdefs.h
41 changes: 32 additions & 9 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ CPP=$(CC) -E

LIBS=libz.a
SHAREDLIB=libz.so
SHAREDLIBV=libz.so.1.2.3.2
SHAREDLIBV=libz.so.1.2.3.3
SHAREDLIBM=libz.so.1

AR=ar
Expand Down Expand Up @@ -61,19 +61,37 @@ PIC_OBJS = $(OBJS:%.o=%.lo)

TEST_OBJS = example.o minigzip.o

all: example$(EXE) minigzip$(EXE)
allstatic: example$(EXE) minigzip$(EXE)

check: test
test: all
@LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
echo hello world | ./minigzip | ./minigzip -d || \
allshared: examplesh$(EXE) minigzipsh$(EXE)

all: allstatic allshared

teststatic: allstatic
@echo hello world | ./minigzip | ./minigzip -d || \
echo ' *** minigzip test FAILED ***' ; \
if ./example; then \
echo ' *** zlib test OK ***'; \
else \
echo ' *** zlib test FAILED ***'; \
fi

testshared: allshared
@LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
echo hello world | ./minigzipsh | ./minigzipsh -d || \
echo ' *** minigzip shared test FAILED ***' ; \
if ./examplesh; then \
echo ' *** zlib shared test OK ***'; \
else \
echo ' *** zlib shared test FAILED ***'; \
fi

test: teststatic testshared

check: test

libz.a: $(OBJS)
$(AR) $@ $(OBJS)
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
Expand Down Expand Up @@ -105,6 +123,12 @@ example$(EXE): example.o $(LIBS)
minigzip$(EXE): minigzip.o $(LIBS)
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)

examplesh$(EXE): example.o $(LIBS)
$(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIB)

minigzipsh$(EXE): minigzip.o $(LIBS)
$(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIB)

install-libs: $(LIBS)
-@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
-@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
Expand Down Expand Up @@ -142,7 +166,8 @@ uninstall:

mostlyclean: clean
clean:
rm -f *.o *.lo *~ example$(EXE) minigzip$(EXE) \
rm -f *.o *.lo *~ \
example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
libz.* foo.gz so_locations \
_match.s maketree contrib/infback9/*.o

Expand Down Expand Up @@ -180,13 +205,11 @@ adler32.lo: zlib.h zconf.h zlibdefs.h
compress.lo: zlib.h zconf.h zlibdefs.h
crc32.lo: crc32.h zlib.h zconf.h zlibdefs.h
deflate.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h
example.lo: zlib.h zconf.h zlibdefs.h
gzio.lo: zutil.h zlib.h zconf.h zlibdefs.h
inffast.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h
inflate.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
infback.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
inftrees.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h
minigzip.lo: zlib.h zconf.h zlibdefs.h
trees.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h
uncompr.lo: zlib.h zconf.h zlibdefs.h
zutil.lo: zutil.h zlib.h zconf.h zlibdefs.h
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ZLIB DATA COMPRESSION LIBRARY

zlib 1.2.3.2 is a general purpose data compression library. All the code is
zlib 1.2.3.3 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
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
Expand Down Expand Up @@ -33,7 +33,7 @@ Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
issue of Dr. Dobb's Journal; a copy of the article is available in
http://dogma.net/markn/articles/zlibtool/zlibtool.htm

The changes made in version 1.2.3.2 are documented in the file ChangeLog.
The changes made in version 1.2.3.3 are documented in the file ChangeLog.

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

Expand Down
44 changes: 42 additions & 2 deletions adler32.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* adler32.c -- compute the Adler-32 checksum of a data stream
* Copyright (C) 1995-2004 Mark Adler
* Copyright (C) 1995-2006 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/

Expand All @@ -8,6 +8,15 @@
#define ZLIB_INTERNAL
#include "zlib.h"

#define local static

#ifdef _LARGEFILE64_SOURCE
local uLong adler32_combine_(uLong adler1, uLong adler2, off64_t len2);
#else
local uLong adler32_combine_(uLong adler1, uLong adler2, z_off_t len2);
#endif


#define BASE 65521UL /* largest prime smaller than 65536 */
#define NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
Expand Down Expand Up @@ -125,10 +134,14 @@ uLong ZEXPORT adler32(adler, buf, len)
}

/* ========================================================================= */
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
local uLong adler32_combine_(adler1, adler2, len2)
uLong adler1;
uLong adler2;
#ifdef _LARGEFILE64_SOURCE
off64_t len2;
#else
z_off_t len2;
#endif
{
unsigned long sum1;
unsigned long sum2;
Expand All @@ -147,3 +160,30 @@ uLong ZEXPORT adler32_combine(adler1, adler2, len2)
if (sum2 > BASE) sum2 -= BASE;
return sum1 | (sum2 << 16);
}

/* ========================================================================= */
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off_t len2;
{
return adler32_combine_(adler1, adler2, len2);
}

#ifdef _LARGEFILE64_SOURCE
uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
uLong adler1;
uLong adler2;
off64_t len2;
{
return adler32_combine_(adler1, adler2, len2);
}
#else
uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off_t len2;
{
return adler32_combine_(adler1, adler2, len2);
}
#endif
6 changes: 3 additions & 3 deletions as400/zlib.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
* ZLIB.INC - Interface to the general purpose compression library
*
* ILE RPG400 version by Patrick Monnerat, DATASPHERE.
* Version 1.2.3.2
* Version 1.2.3.3
*
*
* WARNING:
Expand All @@ -22,8 +22,8 @@
*
* Versioning information.
*
D ZLIB_VERSION C '1.2.3.2'
D ZLIB_VERNUM C X'1232'
D ZLIB_VERSION C '1.2.3.3'
D ZLIB_VERNUM C X'1233'
*
* Other equates.
*
Expand Down
Loading

0 comments on commit 639be99

Please sign in to comment.