Skip to content

Commit

Permalink
zlib 1.2.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
madler committed Sep 10, 2011
1 parent b97ec63 commit a250621
Show file tree
Hide file tree
Showing 31 changed files with 1,530 additions and 119 deletions.
21 changes: 20 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@

ChangeLog file for zlib

Changes in 1.2.0.8 (4 November 2003)
- Update version in contrib/delphi/ZLib.pas and contrib/pascal/zlibpas.pas
- Add experimental NO_DIVIDE #define in adler32.c
- Possibly faster on some processors (let me know if it is)
- Correct Z_BLOCK to not return on first inflate call if no wrap
- Fix strm->data_type on inflate() return to correctly indicate EOB
- Add deflatePrime() function for appending in the middle of a byte
- Add contrib/gzappend for an example of appending to a stream
- Update win32/DLL_FAQ.txt [Truta]
- Delete Turbo C comment in README [Truta]
- Improve some indentation in zconf.h [Truta]
- Fix infinite loop on bad input in configure script [Church]
- Fix gzeof() for concatenated gzip files [Johnson]
- Add example to contrib/visual-basic.txt [Michael B.]
- Add -p to mkdir's in Makefile.in [vda]
- Fix configure to properly detect presence or lack of printf functions
- Add AS400 support [Monnerat]
- Added a little Cygwin support [Wilson]

Changes in 1.2.0.7 (21 September 2003)
- Correct some debug formats in contrib/infback9
- Cast a type in a debug statement in trees.c
Expand All @@ -10,7 +29,7 @@ Changes in 1.2.0.7 (21 September 2003)
- Remove some directories in old that have been updated to 1.2
- Add dylib building for Mac OS X in configure and Makefile.in
- Remove old distribution stuff from Makefile
- Update README to point for DLL_FAQ.txt, and add comment on Mac OS X
- Update README to point to DLL_FAQ.txt, and add comment on Mac OS X
- Update links in README

Changes in 1.2.0.6 (13 September 2003)
Expand Down
20 changes: 11 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ CPP=$(CC) -E

LIBS=libz.a
SHAREDLIB=libz.so
SHAREDLIBV=libz.so.1.2.0.7
SHAREDLIBV=libz.so.1.2.0.8
SHAREDLIBM=libz.so.1

AR=ar rc
RANLIB=ranlib
TAR=tar
SHELL=/bin/sh
EXE=

prefix = /usr/local
exec_prefix = ${prefix}
Expand All @@ -53,7 +54,7 @@ OBJA =

TEST_OBJS = example.o minigzip.o

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

check: test
test: all
Expand Down Expand Up @@ -82,17 +83,17 @@ $(SHAREDLIBV): $(OBJS)
ln -s $@ $(SHAREDLIB)
ln -s $@ $(SHAREDLIBM)

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

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

install: $(LIBS)
-@if [ ! -d $(exec_prefix) ]; then mkdir $(exec_prefix); fi
-@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi
-@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
-@if [ ! -d $(man3dir) ]; then mkdir $(man3dir); fi
-@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi
-@if [ ! -d $(includedir) ]; then mkdir -p $(includedir); fi
-@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi
-@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi
cp zlib.h zconf.h $(includedir)
chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
cp $(LIBS) $(libdir)
Expand All @@ -119,7 +120,8 @@ uninstall:

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

maintainer-clean: distclean
Expand Down
20 changes: 11 additions & 9 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ CPP=$(CC) -E

LIBS=libz.a
SHAREDLIB=libz.so
SHAREDLIBV=libz.so.1.2.0.7
SHAREDLIBV=libz.so.1.2.0.8
SHAREDLIBM=libz.so.1

AR=ar rc
RANLIB=ranlib
TAR=tar
SHELL=/bin/sh
EXE=

prefix = /usr/local
exec_prefix = ${prefix}
Expand All @@ -53,7 +54,7 @@ OBJA =

TEST_OBJS = example.o minigzip.o

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

check: test
test: all
Expand Down Expand Up @@ -82,17 +83,17 @@ $(SHAREDLIBV): $(OBJS)
ln -s $@ $(SHAREDLIB)
ln -s $@ $(SHAREDLIBM)

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

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

install: $(LIBS)
-@if [ ! -d $(exec_prefix) ]; then mkdir $(exec_prefix); fi
-@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi
-@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
-@if [ ! -d $(man3dir) ]; then mkdir $(man3dir); fi
-@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi
-@if [ ! -d $(includedir) ]; then mkdir -p $(includedir); fi
-@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi
-@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi
cp zlib.h zconf.h $(includedir)
chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
cp $(LIBS) $(libdir)
Expand All @@ -119,7 +120,8 @@ uninstall:

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

maintainer-clean: distclean
Expand Down
7 changes: 2 additions & 5 deletions README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ZLIB DATA COMPRESSION LIBRARY

zlib 1.2.0.7 is a general purpose data compression library. All the code is
zlib 1.2.0.8 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 @@ -34,7 +34,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.0.7 are documented in the file ChangeLog.
The changes made in version 1.2.0.8 are documented in the file ChangeLog.

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

Expand Down Expand Up @@ -77,9 +77,6 @@ Notes for some targets:

- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers.

- For Turbo C the small model is supported only with reduced performance to
avoid any far allocation; it was tested with -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3

- For PalmOs, see http://palmzlib.sourceforge.net/

- When building a shared, i.e. dynamic library on Mac OS X, the library must be
Expand Down
31 changes: 28 additions & 3 deletions adler32.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define ZLIB_INTERNAL
#include "zlib.h"

#define BASE 65521L /* largest prime smaller than 65536 */
#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 All @@ -18,6 +18,31 @@
#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
#define DO16(buf) DO8(buf,0); DO8(buf,8);

#ifdef NO_DIVIDE
# define MOD(a) \
do { \
if (a > (BASE << 16)) a -= (BASE << 16); \
if (a > (BASE << 15)) a -= (BASE << 15); \
if (a > (BASE << 14)) a -= (BASE << 14); \
if (a > (BASE << 13)) a -= (BASE << 13); \
if (a > (BASE << 12)) a -= (BASE << 12); \
if (a > (BASE << 11)) a -= (BASE << 11); \
if (a > (BASE << 10)) a -= (BASE << 10); \
if (a > (BASE << 9)) a -= (BASE << 9); \
if (a > (BASE << 8)) a -= (BASE << 8); \
if (a > (BASE << 7)) a -= (BASE << 7); \
if (a > (BASE << 6)) a -= (BASE << 6); \
if (a > (BASE << 5)) a -= (BASE << 5); \
if (a > (BASE << 4)) a -= (BASE << 4); \
if (a > (BASE << 3)) a -= (BASE << 3); \
if (a > (BASE << 2)) a -= (BASE << 2); \
if (a > (BASE << 1)) a -= (BASE << 1); \
if (a > BASE) a -= BASE; \
} while (0)
#else
# define MOD(a) a %= BASE
#endif

/* ========================================================================= */
uLong ZEXPORT adler32(adler, buf, len)
uLong adler;
Expand All @@ -42,8 +67,8 @@ uLong ZEXPORT adler32(adler, buf, len)
s1 += *buf++;
s2 += s1;
} while (--k);
s1 %= BASE;
s2 %= BASE;
MOD(s1);
MOD(s2);
}
return (s2 << 16) | s1;
}
132 changes: 132 additions & 0 deletions as400/bndsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB')

/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/* Version 1.1.3 entry points. */
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/

/********************************************************************/
/* *MODULE ADLER32 ZLIB 01/02/01 00:15:09 */
/********************************************************************/

EXPORT SYMBOL("adler32")

/********************************************************************/
/* *MODULE COMPRESS ZLIB 01/02/01 00:15:09 */
/********************************************************************/

EXPORT SYMBOL("compress")
EXPORT SYMBOL("compress2")

/********************************************************************/
/* *MODULE CRC32 ZLIB 01/02/01 00:15:09 */
/********************************************************************/

EXPORT SYMBOL("crc32")
EXPORT SYMBOL("get_crc_table")

/********************************************************************/
/* *MODULE DEFLATE ZLIB 01/02/01 00:15:09 */
/********************************************************************/

EXPORT SYMBOL("deflate")
EXPORT SYMBOL("deflateEnd")
EXPORT SYMBOL("deflateSetDictionary")
EXPORT SYMBOL("deflateCopy")
EXPORT SYMBOL("deflateReset")
EXPORT SYMBOL("deflateParams")
EXPORT SYMBOL("deflatePrime")
EXPORT SYMBOL("deflateInit_")
EXPORT SYMBOL("deflateInit2_")

/********************************************************************/
/* *MODULE GZIO ZLIB 01/02/01 00:15:09 */
/********************************************************************/

EXPORT SYMBOL("gzopen")
EXPORT SYMBOL("gzdopen")
EXPORT SYMBOL("gzsetparams")
EXPORT SYMBOL("gzread")
EXPORT SYMBOL("gzwrite")
EXPORT SYMBOL("gzprintf")
EXPORT SYMBOL("gzputs")
EXPORT SYMBOL("gzgets")
EXPORT SYMBOL("gzputc")
EXPORT SYMBOL("gzgetc")
EXPORT SYMBOL("gzflush")
EXPORT SYMBOL("gzseek")
EXPORT SYMBOL("gzrewind")
EXPORT SYMBOL("gztell")
EXPORT SYMBOL("gzeof")
EXPORT SYMBOL("gzclose")
EXPORT SYMBOL("gzerror")

/********************************************************************/
/* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */
/********************************************************************/

EXPORT SYMBOL("inflate")
EXPORT SYMBOL("inflateEnd")
EXPORT SYMBOL("inflateSetDictionary")
EXPORT SYMBOL("inflateSync")
EXPORT SYMBOL("inflateReset")
EXPORT SYMBOL("inflateInit_")
EXPORT SYMBOL("inflateInit2_")
EXPORT SYMBOL("inflateSyncPoint")

/********************************************************************/
/* *MODULE UNCOMPR ZLIB 01/02/01 00:15:09 */
/********************************************************************/

EXPORT SYMBOL("uncompress")

/********************************************************************/
/* *MODULE ZUTIL ZLIB 01/02/01 00:15:09 */
/********************************************************************/

EXPORT SYMBOL("zlibVersion")
EXPORT SYMBOL("zError")

/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
/* Version 1.2.0.7 additional entry points. */
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/

/********************************************************************/
/* *MODULE COMPRESS ZLIB 01/02/01 00:15:09 */
/********************************************************************/

EXPORT SYMBOL("compressBound")

/********************************************************************/
/* *MODULE DEFLATE ZLIB 01/02/01 00:15:09 */
/********************************************************************/

EXPORT SYMBOL("deflateBound")

/********************************************************************/
/* *MODULE GZIO ZLIB 01/02/01 00:15:09 */
/********************************************************************/

EXPORT SYMBOL("gzungetc")
EXPORT SYMBOL("gzclearerr")

/********************************************************************/
/* *MODULE INFBACK ZLIB 01/02/01 00:15:09 */
/********************************************************************/

EXPORT SYMBOL("inflateBack")
EXPORT SYMBOL("inflateBackEnd")
EXPORT SYMBOL("inflateBackInit_")

/********************************************************************/
/* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */
/********************************************************************/

EXPORT SYMBOL("inflateCopy")

/********************************************************************/
/* *MODULE ZUTIL ZLIB 01/02/01 00:15:09 */
/********************************************************************/

EXPORT SYMBOL("zlibCompileFlags")

ENDPGMEXP
Loading

0 comments on commit a250621

Please sign in to comment.