diff options
| -rw-r--r-- | CMakeLists.txt | 9 | ||||
| -rw-r--r-- | ChangeLog | 22 | ||||
| -rw-r--r-- | INDEX | 8 | ||||
| -rw-r--r-- | Makefile | 243 | ||||
| -rw-r--r-- | Makefile.in | 111 | ||||
| -rw-r--r-- | README | 4 | ||||
| -rw-r--r-- | as400/zlib.inc | 6 | ||||
| -rwxr-xr-x | configure | 28 | ||||
| -rw-r--r-- | contrib/infback9/inftree9.c | 4 | ||||
| -rw-r--r-- | contrib/vstudio/vc7/zlib.rc | 6 | ||||
| -rw-r--r-- | deflate.c | 2 | ||||
| -rw-r--r-- | gzclose.c | 2 | ||||
| -rw-r--r-- | gzguts.h | 14 | ||||
| -rw-r--r-- | gzlib.c | 28 | ||||
| -rw-r--r-- | gzread.c | 64 | ||||
| -rw-r--r-- | gzwrite.c | 32 | ||||
| -rw-r--r-- | inflate.c | 4 | ||||
| -rw-r--r-- | inftrees.c | 4 | ||||
| -rw-r--r-- | make_vms.com | 68 | ||||
| -rw-r--r-- | qnx/package.qpg | 8 | ||||
| -rw-r--r-- | treebuild.xml | 17 | ||||
| -rw-r--r-- | win32/Makefile.gcc | 2 | ||||
| -rw-r--r-- | zconf.h | 29 | ||||
| -rw-r--r-- | zconf.in.h | 411 | ||||
| -rw-r--r-- | zlib.3 | 4 | ||||
| -rw-r--r-- | zlib.h | 152 | ||||
| -rw-r--r-- | zlibdefs.h | 0 | ||||
| -rw-r--r-- | zlibdefs.h.cmakein | 16 |
28 files changed, 745 insertions, 553 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ce81be..ea0fa99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -59,14 +59,6 @@ if(NOT HAVE_ERRNO_H) | |||
| 59 | add_definitions(-DNO_ERRNO_H) | 59 | add_definitions(-DNO_ERRNO_H) |
| 60 | endif() | 60 | endif() |
| 61 | 61 | ||
| 62 | # | ||
| 63 | # Create the zlibdefs.h file. | ||
| 64 | # Note: we create it in CMAKE_CURRENT_SOURCE_DIR instead | ||
| 65 | # of CMAKE_CURRENT_BINARY_DIR because an empty zlibdefs.h | ||
| 66 | # is shipped with zlib in the source tree. | ||
| 67 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zlibdefs.h.cmakein | ||
| 68 | ${CMAKE_CURRENT_SOURCE_DIR}/zlibdefs.h) | ||
| 69 | |||
| 70 | if(MSVC) | 62 | if(MSVC) |
| 71 | set(CMAKE_DEBUG_POSTFIX "d") | 63 | set(CMAKE_DEBUG_POSTFIX "d") |
| 72 | add_definitions(-D_CRT_SECURE_NO_DEPRECATE) | 64 | add_definitions(-D_CRT_SECURE_NO_DEPRECATE) |
| @@ -80,7 +72,6 @@ endif() | |||
| 80 | set(ZLIB_PUBLIC_HDRS | 72 | set(ZLIB_PUBLIC_HDRS |
| 81 | zconf.h | 73 | zconf.h |
| 82 | zlib.h | 74 | zlib.h |
| 83 | zlibdefs.h | ||
| 84 | ) | 75 | ) |
| 85 | set(ZLIB_PRIVATE_HDRS | 76 | set(ZLIB_PRIVATE_HDRS |
| 86 | crc32.h | 77 | crc32.h |
| @@ -1,6 +1,28 @@ | |||
| 1 | 1 | ||
| 2 | ChangeLog file for zlib | 2 | ChangeLog file for zlib |
| 3 | 3 | ||
| 4 | Changes in 1.2.3.7 (24 Jan 2010) | ||
| 5 | - Always gzopen() with O_LARGEFILE if available | ||
| 6 | - Fix gzdirect() to work immediately after gzopen() or gzdopen() | ||
| 7 | - Make gzdirect() more precise when the state changes while reading | ||
| 8 | - Improve zlib.h documentation in many places | ||
| 9 | - Catch memory allocation failure in gz_open() | ||
| 10 | - Complete close operation if seek forward in gzclose_w() fails | ||
| 11 | - Return Z_ERRNO from gzclose_r() if close() fails | ||
| 12 | - Return Z_STREAM_ERROR instead of EOF for gzclose() being passed NULL | ||
| 13 | - Return zero for gzwrite() errors to match zlib.h description | ||
| 14 | - Return -1 on gzputs() error to match zlib.h description | ||
| 15 | - Add zconf.in.h to allow recovery from configure modification [Weigelt] | ||
| 16 | - Fix static library permissions in Makefile.in [Weigelt] | ||
| 17 | - Avoid warnings in configure tests that hide functionality [Weigelt] | ||
| 18 | - Add *BSD and DragonFly to Linux case in configure [gentoo 123571] | ||
| 19 | - Change libzdll.a to libz.dll.a in win32/Makefile.gcc [gentoo 288212] | ||
| 20 | - Avoid access of uninitialized data for first inflateReset2 call [Gomes] | ||
| 21 | - Keep object files in subdirectories to reduce the clutter somewhat | ||
| 22 | - Remove default Makefile and zlibdefs.h, add dummy Makefile | ||
| 23 | - Add new external functions to Z_PREFIX, remove duplicates, z_z_ -> z_ | ||
| 24 | - Remove zlibdefs.h completely -- modify zconf.h instead | ||
| 25 | |||
| 4 | Changes in 1.2.3.6 (17 Jan 2010) | 26 | Changes in 1.2.3.6 (17 Jan 2010) |
| 5 | - Avoid void * arithmetic in gzread.c and gzwrite.c | 27 | - Avoid void * arithmetic in gzread.c and gzwrite.c |
| 6 | - Make compilers happier with const char * for gz_error message | 28 | - Make compilers happier with const char * for gz_error message |
| @@ -2,12 +2,12 @@ CMakeLists.txt cmake build file | |||
| 2 | ChangeLog history of changes | 2 | ChangeLog history of changes |
| 3 | FAQ Frequently Asked Questions about zlib | 3 | FAQ Frequently Asked Questions about zlib |
| 4 | INDEX this file | 4 | INDEX this file |
| 5 | Makefile makefile for Unix (generated by configure) | 5 | Makefile.in template for Unix Makefile |
| 6 | Makefile.in makefile for Unix (template for configure) | ||
| 7 | README guess what | 6 | README guess what |
| 8 | configure configure script for Unix | 7 | configure configure script for Unix |
| 9 | make_vms.com makefile for VMS | 8 | make_vms.com makefile for VMS |
| 10 | treebuild.xml XML description of source file dependencies | 9 | treebuild.xml XML description of source file dependencies |
| 10 | zconf.in.h zconf.h template for configure | ||
| 11 | zlib.3 Man page for zlib | 11 | zlib.3 Man page for zlib |
| 12 | zlib.map Linux symbol information | 12 | zlib.map Linux symbol information |
| 13 | zlib.pc.in Template for pkg-config descriptor | 13 | zlib.pc.in Template for pkg-config descriptor |
| @@ -18,18 +18,18 @@ as400/ makefiles for IBM AS/400 | |||
| 18 | doc/ documentation for formats and algorithms | 18 | doc/ documentation for formats and algorithms |
| 19 | msdos/ makefiles for MSDOS | 19 | msdos/ makefiles for MSDOS |
| 20 | nintendods/ makefile for Nintendo DS | 20 | nintendods/ makefile for Nintendo DS |
| 21 | objs/ destination for object files | ||
| 21 | old/ makefiles for various architectures and zlib documentation | 22 | old/ makefiles for various architectures and zlib documentation |
| 22 | files that have not yet been updated for zlib 1.2.x | 23 | files that have not yet been updated for zlib 1.2.x |
| 24 | pics/ destination for position-independent-code object files | ||
| 23 | projects/ projects for various Integrated Development Environments | 25 | projects/ projects for various Integrated Development Environments |
| 24 | qnx/ makefiles for QNX | 26 | qnx/ makefiles for QNX |
| 25 | watcom/ makefiles for OpenWatcom | 27 | watcom/ makefiles for OpenWatcom |
| 26 | win32/ makefiles for Windows | 28 | win32/ makefiles for Windows |
| 27 | zlibdefs.h.cmakein input file for cmake build | ||
| 28 | 29 | ||
| 29 | zlib public header files (required for library use): | 30 | zlib public header files (required for library use): |
| 30 | zconf.h | 31 | zconf.h |
| 31 | zlib.h | 32 | zlib.h |
| 32 | zlibdefs.h | ||
| 33 | 33 | ||
| 34 | private source files used to build the zlib library: | 34 | private source files used to build the zlib library: |
| 35 | adler32.c | 35 | adler32.c |
| @@ -1,241 +1,2 @@ | |||
| 1 | # Makefile for zlib | 1 | all: |
| 2 | # Copyright (C) 1995-2010 Jean-loup Gailly. | 2 | -@echo "Use ./configure first. Thank you." |
| 3 | # For conditions of distribution and use, see copyright notice in zlib.h | ||
| 4 | |||
| 5 | # To compile and test, type: | ||
| 6 | # ./configure; make test | ||
| 7 | # Normally configure builds both a static and a shared library. | ||
| 8 | # If you want to build just a static library, use: ./configure --static | ||
| 9 | |||
| 10 | # To use the asm code, type: | ||
| 11 | # cp contrib/asm?86/match.S ./match.S | ||
| 12 | # make LOC=-DASMV OBJA=match.o | ||
| 13 | |||
| 14 | # To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type: | ||
| 15 | # make install | ||
| 16 | # To install in $HOME instead of /usr/local, use: | ||
| 17 | # make install prefix=$HOME | ||
| 18 | |||
| 19 | CC=cc | ||
| 20 | |||
| 21 | CFLAGS=-O | ||
| 22 | #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 | ||
| 23 | #CFLAGS=-g -DDEBUG | ||
| 24 | #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ | ||
| 25 | # -Wstrict-prototypes -Wmissing-prototypes | ||
| 26 | |||
| 27 | SFLAGS=-O | ||
| 28 | |||
| 29 | LDFLAGS=-L. libz.a | ||
| 30 | LDSHARED=$(CC) | ||
| 31 | CPP=$(CC) -E | ||
| 32 | |||
| 33 | STATICLIB=libz.a | ||
| 34 | SHAREDLIB=libz.so | ||
| 35 | SHAREDLIBV=libz.so.1.2.3.6 | ||
| 36 | SHAREDLIBM=libz.so.1 | ||
| 37 | LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV) | ||
| 38 | |||
| 39 | AR=ar rc | ||
| 40 | RANLIB=ranlib | ||
| 41 | TAR=tar | ||
| 42 | SHELL=/bin/sh | ||
| 43 | EXE= | ||
| 44 | |||
| 45 | prefix = /usr/local | ||
| 46 | exec_prefix = ${prefix} | ||
| 47 | libdir = ${exec_prefix}/lib | ||
| 48 | includedir = ${prefix}/include | ||
| 49 | mandir = ${prefix}/share/man | ||
| 50 | man3dir = ${mandir}/man3 | ||
| 51 | pkgconfigdir = ${libdir}/pkgconfig | ||
| 52 | |||
| 53 | OBJC = adler32.o compress.o crc32.o deflate.o gzclose.o gzio.o gzlib.o gzread.o \ | ||
| 54 | gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o | ||
| 55 | |||
| 56 | PIC_OBJC = adler32.lo compress.lo crc32.lo deflate.lo gzclose.lo gzio.lo gzlib.lo gzread.lo \ | ||
| 57 | gzwrite.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo | ||
| 58 | |||
| 59 | # to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo | ||
| 60 | OBJA = | ||
| 61 | PIC_OBJA = | ||
| 62 | |||
| 63 | OBJS = $(OBJC) $(OBJA) | ||
| 64 | |||
| 65 | PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA) | ||
| 66 | |||
| 67 | all: static shared | ||
| 68 | |||
| 69 | static: example$(EXE) minigzip$(EXE) | ||
| 70 | |||
| 71 | shared: examplesh$(EXE) minigzipsh$(EXE) | ||
| 72 | |||
| 73 | all64: example64$(EXE) minigzip64$(EXE) | ||
| 74 | |||
| 75 | check: test | ||
| 76 | |||
| 77 | test: all teststatic testshared | ||
| 78 | |||
| 79 | teststatic: static | ||
| 80 | @echo hello world | ./minigzip | ./minigzip -d || \ | ||
| 81 | echo ' *** minigzip test FAILED ***' ; \ | ||
| 82 | if ./example; then \ | ||
| 83 | echo ' *** zlib test OK ***'; \ | ||
| 84 | else \ | ||
| 85 | echo ' *** zlib test FAILED ***'; \ | ||
| 86 | fi | ||
| 87 | |||
| 88 | testshared: shared | ||
| 89 | @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ | ||
| 90 | LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \ | ||
| 91 | DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \ | ||
| 92 | SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \ | ||
| 93 | echo hello world | ./minigzipsh | ./minigzipsh -d || \ | ||
| 94 | echo ' *** minigzip shared test FAILED ***' ; \ | ||
| 95 | if ./examplesh; then \ | ||
| 96 | echo ' *** zlib shared test OK ***'; \ | ||
| 97 | else \ | ||
| 98 | echo ' *** zlib shared test FAILED ***'; \ | ||
| 99 | fi | ||
| 100 | |||
| 101 | test64: all64 | ||
| 102 | @echo hello world | ./minigzip64 | ./minigzip64 -d || \ | ||
| 103 | echo ' *** minigzip 64-bit test FAILED ***' ; \ | ||
| 104 | if ./example64; then \ | ||
| 105 | echo ' *** zlib 64-bit test OK ***'; \ | ||
| 106 | else \ | ||
| 107 | echo ' *** zlib 64-bit test FAILED ***'; \ | ||
| 108 | fi | ||
| 109 | |||
| 110 | libz.a: $(OBJS) | ||
| 111 | $(AR) $@ $(OBJS) | ||
| 112 | -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 | ||
| 113 | |||
| 114 | match.o: match.S | ||
| 115 | $(CPP) match.S > _match.s | ||
| 116 | $(CC) -c _match.s | ||
| 117 | mv _match.o match.o | ||
| 118 | rm -f _match.s | ||
| 119 | |||
| 120 | match.lo: match.S | ||
| 121 | $(CPP) match.S > _match.s | ||
| 122 | $(CC) -c -fPIC _match.s | ||
| 123 | mv _match.o match.lo | ||
| 124 | rm -f _match.s | ||
| 125 | |||
| 126 | example64.o: example.c zlib.h zconf.h zlibdefs.h | ||
| 127 | $(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ example.c | ||
| 128 | |||
| 129 | minigzip64.o: minigzip.c zlib.h zconf.h zlibdefs.h | ||
| 130 | $(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ minigzip.c | ||
| 131 | |||
| 132 | .SUFFIXES: .lo | ||
| 133 | |||
| 134 | .c.lo: | ||
| 135 | -@if [ ! -d objs ]; then mkdir objs; fi | ||
| 136 | $(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $< | ||
| 137 | -@mv objs/$*.o $@ | ||
| 138 | |||
| 139 | $(SHAREDLIBV): $(PIC_OBJS) | ||
| 140 | $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) -lc | ||
| 141 | rm -f $(SHAREDLIB) $(SHAREDLIBM) | ||
| 142 | ln -s $@ $(SHAREDLIB) | ||
| 143 | ln -s $@ $(SHAREDLIBM) | ||
| 144 | -@rmdir objs | ||
| 145 | |||
| 146 | example$(EXE): example.o $(STATICLIB) | ||
| 147 | $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) | ||
| 148 | |||
| 149 | minigzip$(EXE): minigzip.o $(STATICLIB) | ||
| 150 | $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) | ||
| 151 | |||
| 152 | examplesh$(EXE): example.o $(SHAREDLIBV) | ||
| 153 | $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV) | ||
| 154 | |||
| 155 | minigzipsh$(EXE): minigzip.o $(SHAREDLIBV) | ||
| 156 | $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV) | ||
| 157 | |||
| 158 | example64$(EXE): example64.o $(STATICLIB) | ||
| 159 | $(CC) $(CFLAGS) -o $@ example64.o $(LDFLAGS) | ||
| 160 | |||
| 161 | minigzip64$(EXE): minigzip64.o $(STATICLIB) | ||
| 162 | $(CC) $(CFLAGS) -o $@ minigzip64.o $(LDFLAGS) | ||
| 163 | |||
| 164 | install-libs: $(LIBS) | ||
| 165 | -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi | ||
| 166 | -@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi | ||
| 167 | -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi | ||
| 168 | -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi | ||
| 169 | cp $(LIBS) $(DESTDIR)$(libdir) | ||
| 170 | cd $(DESTDIR)$(libdir); chmod 755 $(LIBS) | ||
| 171 | -@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 | ||
| 172 | cd $(DESTDIR)$(libdir); if test -f $(SHAREDLIBV); then \ | ||
| 173 | rm -f $(SHAREDLIB) $(SHAREDLIBM); \ | ||
| 174 | ln -s $(SHAREDLIBV) $(SHAREDLIB); \ | ||
| 175 | ln -s $(SHAREDLIBV) $(SHAREDLIBM); \ | ||
| 176 | (ldconfig || true) >/dev/null 2>&1; \ | ||
| 177 | fi | ||
| 178 | cp zlib.3 $(DESTDIR)$(man3dir) | ||
| 179 | chmod 644 $(DESTDIR)$(man3dir)/zlib.3 | ||
| 180 | cp zlib.pc $(DESTDIR)$(pkgconfigdir) | ||
| 181 | chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc | ||
| 182 | # The ranlib in install is needed on NeXTSTEP which checks file times | ||
| 183 | # ldconfig is for Linux | ||
| 184 | |||
| 185 | install: install-libs | ||
| 186 | -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi | ||
| 187 | cp zlib.h zconf.h zlibdefs.h $(DESTDIR)$(includedir) | ||
| 188 | chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h $(DESTDIR)$(includedir)/zlibdefs.h | ||
| 189 | |||
| 190 | uninstall: | ||
| 191 | cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h zlibdefs.h | ||
| 192 | cd $(DESTDIR)$(libdir); rm -f libz.a; \ | ||
| 193 | if test -f $(SHAREDLIBV); then \ | ||
| 194 | rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \ | ||
| 195 | fi | ||
| 196 | cd $(DESTDIR)$(man3dir); rm -f zlib.3 | ||
| 197 | cd $(DESTDIR)$(pkgconfigdir); rm -f zlib.pc | ||
| 198 | |||
| 199 | mostlyclean: clean | ||
| 200 | clean: | ||
| 201 | rm -f *.o *.lo *~ \ | ||
| 202 | example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \ | ||
| 203 | example64$(EXE) minigzip64$(EXE) \ | ||
| 204 | libz.* foo.gz so_locations \ | ||
| 205 | _match.s maketree contrib/infback9/*.o | ||
| 206 | rm -rf objs | ||
| 207 | |||
| 208 | maintainer-clean: distclean | ||
| 209 | distclean: clean | ||
| 210 | cp -p Makefile.in Makefile | ||
| 211 | rm zlibdefs.h | ||
| 212 | touch -r configure zlibdefs.h | ||
| 213 | rm -f zlib.pc .DS_Store | ||
| 214 | |||
| 215 | tags: | ||
| 216 | etags *.[ch] | ||
| 217 | |||
| 218 | depend: | ||
| 219 | makedepend -- $(CFLAGS) -- *.[ch] | ||
| 220 | |||
| 221 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
| 222 | |||
| 223 | adler32.o gzio.o zutil.o: zutil.h zlib.h zconf.h zlibdefs.h | ||
| 224 | gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h zlibdefs.h gzguts.h | ||
| 225 | compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h zlibdefs.h | ||
| 226 | crc32.o: zutil.h zlib.h zconf.h zlibdefs.h crc32.h | ||
| 227 | deflate.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h | ||
| 228 | infback.o inflate.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h | ||
| 229 | inffast.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h | ||
| 230 | inftrees.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h | ||
| 231 | trees.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h | ||
| 232 | |||
| 233 | adler32.lo gzio.lo zutil.lo: zutil.h zlib.h zconf.h zlibdefs.h | ||
| 234 | gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h zlibdefs.h gzguts.h | ||
| 235 | compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h zlibdefs.h | ||
| 236 | crc32.lo: zutil.h zlib.h zconf.h zlibdefs.h crc32.h | ||
| 237 | deflate.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h | ||
| 238 | infback.lo inflate.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h | ||
| 239 | inffast.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h | ||
| 240 | inftrees.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h | ||
| 241 | trees.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h | ||
diff --git a/Makefile.in b/Makefile.in index 9b81f23..99945a8 100644 --- a/Makefile.in +++ b/Makefile.in | |||
| @@ -32,7 +32,7 @@ CPP=$(CC) -E | |||
| 32 | 32 | ||
| 33 | STATICLIB=libz.a | 33 | STATICLIB=libz.a |
| 34 | SHAREDLIB=libz.so | 34 | SHAREDLIB=libz.so |
| 35 | SHAREDLIBV=libz.so.1.2.3.6 | 35 | SHAREDLIBV=libz.so.1.2.3.7 |
| 36 | SHAREDLIBM=libz.so.1 | 36 | SHAREDLIBM=libz.so.1 |
| 37 | LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV) | 37 | LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV) |
| 38 | 38 | ||
| @@ -53,16 +53,15 @@ pkgconfigdir = ${libdir}/pkgconfig | |||
| 53 | OBJC = adler32.o compress.o crc32.o deflate.o gzclose.o gzio.o gzlib.o gzread.o \ | 53 | OBJC = adler32.o compress.o crc32.o deflate.o gzclose.o gzio.o gzlib.o gzread.o \ |
| 54 | gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o | 54 | gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o |
| 55 | 55 | ||
| 56 | PIC_OBJC = adler32.lo compress.lo crc32.lo deflate.lo gzclose.lo gzio.lo gzlib.lo gzread.lo \ | 56 | # to use the asm code: make OBJA=match.o |
| 57 | gzwrite.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo | ||
| 58 | |||
| 59 | # to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo | ||
| 60 | OBJA = | 57 | OBJA = |
| 61 | PIC_OBJA = | ||
| 62 | 58 | ||
| 63 | OBJS = $(OBJC) $(OBJA) | 59 | objdir = objs/ |
| 60 | picdir = pics/ | ||
| 61 | |||
| 62 | OBJS = $(addprefix $(objdir), $(OBJC) $(OBJA)) | ||
| 64 | 63 | ||
| 65 | PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA) | 64 | PIC_OBJS = $(addprefix $(picdir), $(OBJC) $(OBJA)) |
| 66 | 65 | ||
| 67 | all: static shared | 66 | all: static shared |
| 68 | 67 | ||
| @@ -84,6 +83,7 @@ teststatic: static | |||
| 84 | else \ | 83 | else \ |
| 85 | echo ' *** zlib test FAILED ***'; \ | 84 | echo ' *** zlib test FAILED ***'; \ |
| 86 | fi | 85 | fi |
| 86 | -@rm -f foo.gz | ||
| 87 | 87 | ||
| 88 | testshared: shared | 88 | testshared: shared |
| 89 | @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ | 89 | @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ |
| @@ -97,6 +97,7 @@ testshared: shared | |||
| 97 | else \ | 97 | else \ |
| 98 | echo ' *** zlib shared test FAILED ***'; \ | 98 | echo ' *** zlib shared test FAILED ***'; \ |
| 99 | fi | 99 | fi |
| 100 | -@rm -f foo.gz | ||
| 100 | 101 | ||
| 101 | test64: all64 | 102 | test64: all64 |
| 102 | @echo hello world | ./minigzip64 | ./minigzip64 -d || \ | 103 | @echo hello world | ./minigzip64 | ./minigzip64 -d || \ |
| @@ -106,60 +107,57 @@ test64: all64 | |||
| 106 | else \ | 107 | else \ |
| 107 | echo ' *** zlib 64-bit test FAILED ***'; \ | 108 | echo ' *** zlib 64-bit test FAILED ***'; \ |
| 108 | fi | 109 | fi |
| 110 | -@rm -f foo.gz | ||
| 109 | 111 | ||
| 110 | libz.a: $(OBJS) | 112 | libz.a: $(OBJS) |
| 111 | $(AR) $@ $(OBJS) | 113 | $(AR) $@ $(OBJS) |
| 112 | -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 | 114 | -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 |
| 113 | 115 | ||
| 114 | match.o: match.S | 116 | objs/match.o: match.S |
| 115 | $(CPP) match.S > _match.s | 117 | $(CPP) match.S > _match.s |
| 116 | $(CC) -c _match.s | 118 | $(CC) -c -o $@ _match.s |
| 117 | mv _match.o match.o | ||
| 118 | rm -f _match.s | 119 | rm -f _match.s |
| 119 | 120 | ||
| 120 | match.lo: match.S | 121 | pics/match.o: match.S |
| 121 | $(CPP) match.S > _match.s | 122 | $(CPP) match.S > _match.s |
| 122 | $(CC) -c -fPIC _match.s | 123 | $(CC) -c -o $@ -fPIC _match.s |
| 123 | mv _match.o match.lo | ||
| 124 | rm -f _match.s | 124 | rm -f _match.s |
| 125 | 125 | ||
| 126 | example64.o: example.c zlib.h zconf.h zlibdefs.h | 126 | objs/example64.o: example.c zlib.h zconf.h |
| 127 | $(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ example.c | 127 | $(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ example.c |
| 128 | 128 | ||
| 129 | minigzip64.o: minigzip.c zlib.h zconf.h zlibdefs.h | 129 | objs/minigzip64.o: minigzip.c zlib.h zconf.h |
| 130 | $(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ minigzip.c | 130 | $(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ minigzip.c |
| 131 | 131 | ||
| 132 | .SUFFIXES: .lo | 132 | $(objdir)%.o: %.c |
| 133 | $(CC) $(CFLAGS) -c -o $@ $< | ||
| 133 | 134 | ||
| 134 | .c.lo: | 135 | $(picdir)%.o: %.c |
| 135 | -@if [ ! -d objs ]; then mkdir objs; fi | 136 | $(CC) $(SFLAGS) -DPIC -c -o $@ $< |
| 136 | $(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $< | ||
| 137 | -@mv objs/$*.o $@ | ||
| 138 | 137 | ||
| 139 | $(SHAREDLIBV): $(PIC_OBJS) | 138 | $(SHAREDLIBV): $(PIC_OBJS) |
| 140 | $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) -lc | 139 | $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) -lc |
| 141 | rm -f $(SHAREDLIB) $(SHAREDLIBM) | 140 | rm -f $(SHAREDLIB) $(SHAREDLIBM) |
| 142 | ln -s $@ $(SHAREDLIB) | 141 | ln -s $@ $(SHAREDLIB) |
| 143 | ln -s $@ $(SHAREDLIBM) | 142 | ln -s $@ $(SHAREDLIBM) |
| 144 | -@rmdir objs | ||
| 145 | 143 | ||
| 146 | example$(EXE): example.o $(STATICLIB) | 144 | example$(EXE): objs/example.o $(STATICLIB) |
| 147 | $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) | 145 | $(CC) $(CFLAGS) -o $@ objs/example.o $(LDFLAGS) |
| 148 | 146 | ||
| 149 | minigzip$(EXE): minigzip.o $(STATICLIB) | 147 | minigzip$(EXE): objs/minigzip.o $(STATICLIB) |
| 150 | $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) | 148 | $(CC) $(CFLAGS) -o $@ objs/minigzip.o $(LDFLAGS) |
| 151 | 149 | ||
| 152 | examplesh$(EXE): example.o $(SHAREDLIBV) | 150 | examplesh$(EXE): objs/example.o $(SHAREDLIBV) |
| 153 | $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV) | 151 | $(CC) $(CFLAGS) -o $@ objs/example.o -L. $(SHAREDLIBV) |
| 154 | 152 | ||
| 155 | minigzipsh$(EXE): minigzip.o $(SHAREDLIBV) | 153 | minigzipsh$(EXE): objs/minigzip.o $(SHAREDLIBV) |
| 156 | $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV) | 154 | $(CC) $(CFLAGS) -o $@ objs/minigzip.o -L. $(SHAREDLIBV) |
| 157 | 155 | ||
| 158 | example64$(EXE): example64.o $(STATICLIB) | 156 | example64$(EXE): objs/example64.o $(STATICLIB) |
| 159 | $(CC) $(CFLAGS) -o $@ example64.o $(LDFLAGS) | 157 | $(CC) $(CFLAGS) -o $@ objs/example64.o $(LDFLAGS) |
| 160 | 158 | ||
| 161 | minigzip64$(EXE): minigzip64.o $(STATICLIB) | 159 | minigzip64$(EXE): objs/minigzip64.o $(STATICLIB) |
| 162 | $(CC) $(CFLAGS) -o $@ minigzip64.o $(LDFLAGS) | 160 | $(CC) $(CFLAGS) -o $@ objs/minigzip64.o $(LDFLAGS) |
| 163 | 161 | ||
| 164 | install-libs: $(LIBS) | 162 | install-libs: $(LIBS) |
| 165 | -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi | 163 | -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi |
| @@ -167,7 +165,7 @@ install-libs: $(LIBS) | |||
| 167 | -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi | 165 | -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi |
| 168 | -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi | 166 | -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi |
| 169 | cp $(LIBS) $(DESTDIR)$(libdir) | 167 | cp $(LIBS) $(DESTDIR)$(libdir) |
| 170 | cd $(DESTDIR)$(libdir); chmod 755 $(LIBS) | 168 | cd $(DESTDIR)$(libdir); chmod 755 $(SHAREDLIB) ; chmod u=rw,go=r $(STATICLIB) |
| 171 | -@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 | 169 | -@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 |
| 172 | cd $(DESTDIR)$(libdir); if test -f $(SHAREDLIBV); then \ | 170 | cd $(DESTDIR)$(libdir); if test -f $(SHAREDLIBV); then \ |
| 173 | rm -f $(SHAREDLIB) $(SHAREDLIBM); \ | 171 | rm -f $(SHAREDLIB) $(SHAREDLIBM); \ |
| @@ -184,11 +182,11 @@ install-libs: $(LIBS) | |||
| 184 | 182 | ||
| 185 | install: install-libs | 183 | install: install-libs |
| 186 | -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi | 184 | -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi |
| 187 | cp zlib.h zconf.h zlibdefs.h $(DESTDIR)$(includedir) | 185 | cp zlib.h zconf.h $(DESTDIR)$(includedir) |
| 188 | chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h $(DESTDIR)$(includedir)/zlibdefs.h | 186 | chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h |
| 189 | 187 | ||
| 190 | uninstall: | 188 | uninstall: |
| 191 | cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h zlibdefs.h | 189 | cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h |
| 192 | cd $(DESTDIR)$(libdir); rm -f libz.a; \ | 190 | cd $(DESTDIR)$(libdir); rm -f libz.a; \ |
| 193 | if test -f $(SHAREDLIBV); then \ | 191 | if test -f $(SHAREDLIBV); then \ |
| 194 | rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \ | 192 | rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \ |
| @@ -198,19 +196,18 @@ uninstall: | |||
| 198 | 196 | ||
| 199 | mostlyclean: clean | 197 | mostlyclean: clean |
| 200 | clean: | 198 | clean: |
| 201 | rm -f *.o *.lo *~ \ | 199 | rm -f $(objdir)* $(picdir)* *~ \ |
| 202 | example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \ | 200 | example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \ |
| 203 | example64$(EXE) minigzip64$(EXE) \ | 201 | example64$(EXE) minigzip64$(EXE) \ |
| 204 | libz.* foo.gz so_locations \ | 202 | libz.* foo.gz so_locations \ |
| 205 | _match.s maketree contrib/infback9/*.o | 203 | _match.s maketree contrib/infback9/*.o |
| 206 | rm -rf objs | ||
| 207 | 204 | ||
| 208 | maintainer-clean: distclean | 205 | maintainer-clean: distclean |
| 209 | distclean: clean | 206 | distclean: clean |
| 210 | cp -p Makefile.in Makefile | 207 | cp -p zconf.in.h zconf.h |
| 211 | rm zlibdefs.h | ||
| 212 | touch -r configure zlibdefs.h | ||
| 213 | rm -f zlib.pc .DS_Store | 208 | rm -f zlib.pc .DS_Store |
| 209 | -@printf 'all:\n\t-@echo "Use ./configure first. Thank you."\n' > Makefile | ||
| 210 | -@ touch -r Makefile.in Makefile objs pics | ||
| 214 | 211 | ||
| 215 | tags: | 212 | tags: |
| 216 | etags *.[ch] | 213 | etags *.[ch] |
| @@ -220,22 +217,12 @@ depend: | |||
| 220 | 217 | ||
| 221 | # DO NOT DELETE THIS LINE -- make depend depends on it. | 218 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
| 222 | 219 | ||
| 223 | adler32.o gzio.o zutil.o: zutil.h zlib.h zconf.h zlibdefs.h | 220 | adler32.o gzio.o zutil.o: zutil.h zlib.h zconf.h |
| 224 | gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h zlibdefs.h gzguts.h | 221 | gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h gzguts.h |
| 225 | compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h zlibdefs.h | 222 | compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h |
| 226 | crc32.o: zutil.h zlib.h zconf.h zlibdefs.h crc32.h | 223 | crc32.o: zutil.h zlib.h zconf.h crc32.h |
| 227 | deflate.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h | 224 | deflate.o: deflate.h zutil.h zlib.h zconf.h |
| 228 | infback.o inflate.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h | 225 | infback.o inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h |
| 229 | inffast.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h | 226 | inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h |
| 230 | inftrees.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h | 227 | inftrees.o: zutil.h zlib.h zconf.h inftrees.h |
| 231 | trees.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h | 228 | trees.o: deflate.h zutil.h zlib.h zconf.h trees.h |
| 232 | |||
| 233 | adler32.lo gzio.lo zutil.lo: zutil.h zlib.h zconf.h zlibdefs.h | ||
| 234 | gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h zlibdefs.h gzguts.h | ||
| 235 | compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h zlibdefs.h | ||
| 236 | crc32.lo: zutil.h zlib.h zconf.h zlibdefs.h crc32.h | ||
| 237 | deflate.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h | ||
| 238 | infback.lo inflate.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h | ||
| 239 | inffast.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h | ||
| 240 | inftrees.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h | ||
| 241 | trees.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h | ||
| @@ -1,6 +1,6 @@ | |||
| 1 | ZLIB DATA COMPRESSION LIBRARY | 1 | ZLIB DATA COMPRESSION LIBRARY |
| 2 | 2 | ||
| 3 | zlib 1.2.3.6 is a general purpose data compression library. All the code is | 3 | zlib 1.2.3.7 is a general purpose data compression library. All the code is |
| 4 | thread safe. The data format used by the zlib library is described by RFCs | 4 | thread 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 |
| 6 | http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) | 6 | http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) |
| @@ -33,7 +33,7 @@ Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997 | |||
| 33 | issue of Dr. Dobb's Journal; a copy of the article is available in | 33 | issue of Dr. Dobb's Journal; a copy of the article is available in |
| 34 | http://dogma.net/markn/articles/zlibtool/zlibtool.htm | 34 | http://dogma.net/markn/articles/zlibtool/zlibtool.htm |
| 35 | 35 | ||
| 36 | The changes made in version 1.2.3.6 are documented in the file ChangeLog. | 36 | The changes made in version 1.2.3.7 are documented in the file ChangeLog. |
| 37 | 37 | ||
| 38 | Unsupported third party contributions are provided in directory "contrib". | 38 | Unsupported third party contributions are provided in directory "contrib". |
| 39 | 39 | ||
diff --git a/as400/zlib.inc b/as400/zlib.inc index 7ecea98..cfcbfc8 100644 --- a/as400/zlib.inc +++ b/as400/zlib.inc | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | * ZLIB.INC - Interface to the general purpose compression library | 1 | * ZLIB.INC - Interface to the general purpose compression library |
| 2 | * | 2 | * |
| 3 | * ILE RPG400 version by Patrick Monnerat, DATASPHERE. | 3 | * ILE RPG400 version by Patrick Monnerat, DATASPHERE. |
| 4 | * Version 1.2.3.6 | 4 | * Version 1.2.3.7 |
| 5 | * | 5 | * |
| 6 | * | 6 | * |
| 7 | * WARNING: | 7 | * WARNING: |
| @@ -22,8 +22,8 @@ | |||
| 22 | * | 22 | * |
| 23 | * Versioning information. | 23 | * Versioning information. |
| 24 | * | 24 | * |
| 25 | D ZLIB_VERSION C '1.2.3.6' | 25 | D ZLIB_VERSION C '1.2.3.7' |
| 26 | D ZLIB_VERNUM C X'1236' | 26 | D ZLIB_VERNUM C X'1237' |
| 27 | * | 27 | * |
| 28 | * Other equates. | 28 | * Other equates. |
| 29 | * | 29 | * |
| @@ -85,7 +85,7 @@ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then | |||
| 85 | uname=`(uname -s || echo unknown) 2>/dev/null` | 85 | uname=`(uname -s || echo unknown) 2>/dev/null` |
| 86 | fi | 86 | fi |
| 87 | case "$uname" in | 87 | case "$uname" in |
| 88 | Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;; | 88 | Linux | linux | GNU | GNU/* | *BSD | DragonFly) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;; |
| 89 | CYGWIN* | Cygwin* | cygwin* | OS/2* ) | 89 | CYGWIN* | Cygwin* | cygwin* | OS/2* ) |
| 90 | EXE='.exe' ;; | 90 | EXE='.exe' ;; |
| 91 | QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4 | 91 | QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4 |
| @@ -215,14 +215,6 @@ else | |||
| 215 | TEST="all teststatic testshared" | 215 | TEST="all teststatic testshared" |
| 216 | fi | 216 | fi |
| 217 | 217 | ||
| 218 | cat > zlibdefs.h << EOF | ||
| 219 | /* zlibdefs.h -- compile-time definitions for the zlib compression library | ||
| 220 | * Copyright (C) 1995-2006 Jean-loup Gailly. | ||
| 221 | * For conditions of distribution and use, see copyright notice in zlib.h | ||
| 222 | */ | ||
| 223 | |||
| 224 | EOF | ||
| 225 | |||
| 226 | cat > $test.c <<EOF | 218 | cat > $test.c <<EOF |
| 227 | #include <sys/types.h> | 219 | #include <sys/types.h> |
| 228 | off64_t dummy = 0; | 220 | off64_t dummy = 0; |
| @@ -252,21 +244,15 @@ EOF | |||
| 252 | fi | 244 | fi |
| 253 | fi | 245 | fi |
| 254 | 246 | ||
| 247 | cp -p zconf.in.h zconf.h | ||
| 248 | |||
| 255 | cat > $test.c <<EOF | 249 | cat > $test.c <<EOF |
| 256 | #include <unistd.h> | 250 | #include <unistd.h> |
| 257 | int main() { return 0; } | 251 | int main() { return 0; } |
| 258 | EOF | 252 | EOF |
| 259 | if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | 253 | if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then |
| 260 | cat >> zlibdefs.h <<EOF | 254 | sed < zconf.h "/#ifdef HAVE_UNISTD_H/s/def HAVE_UNISTD_H/ 1/" > zconf.temp.h |
| 261 | #include <sys/types.h> /* for off_t */ | 255 | mv zconf.temp.h zconf.h |
| 262 | #include <unistd.h> /* for SEEK_* and off_t */ | ||
| 263 | #ifdef VMS | ||
| 264 | # include <unixio.h> /* for off_t */ | ||
| 265 | #endif | ||
| 266 | #ifndef z_off_t | ||
| 267 | # define z_off_t off_t | ||
| 268 | #endif | ||
| 269 | EOF | ||
| 270 | echo "Checking for unistd.h... Yes." | 256 | echo "Checking for unistd.h... Yes." |
| 271 | else | 257 | else |
| 272 | echo "Checking for unistd.h... No." | 258 | echo "Checking for unistd.h... No." |
| @@ -300,7 +286,7 @@ if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | |||
| 300 | #include <stdio.h> | 286 | #include <stdio.h> |
| 301 | #include <stdarg.h> | 287 | #include <stdarg.h> |
| 302 | 288 | ||
| 303 | int mytest(char *fmt, ...) | 289 | int mytest(const char *fmt, ...) |
| 304 | { | 290 | { |
| 305 | char buf[20]; | 291 | char buf[20]; |
| 306 | va_list ap; | 292 | va_list ap; |
| @@ -364,7 +350,7 @@ EOF | |||
| 364 | #include <stdio.h> | 350 | #include <stdio.h> |
| 365 | #include <stdarg.h> | 351 | #include <stdarg.h> |
| 366 | 352 | ||
| 367 | int mytest(char *fmt, ...) | 353 | int mytest(const char *fmt, ...) |
| 368 | { | 354 | { |
| 369 | int n; | 355 | int n; |
| 370 | char buf[20]; | 356 | char buf[20]; |
diff --git a/contrib/infback9/inftree9.c b/contrib/infback9/inftree9.c index 2d42f72..2018e4d 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 | ||
| 11 | const char inflate9_copyright[] = | 11 | const char inflate9_copyright[] = |
| 12 | " inflate9 1.2.3.6 Copyright 1995-2010 Mark Adler "; | 12 | " inflate9 1.2.3.7 Copyright 1995-2010 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, 199, 70}; | 67 | 133, 133, 133, 133, 144, 72, 193}; |
| 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/vstudio/vc7/zlib.rc b/contrib/vstudio/vc7/zlib.rc index 418eb7a..68cb9cb 100644 --- a/contrib/vstudio/vc7/zlib.rc +++ b/contrib/vstudio/vc7/zlib.rc | |||
| @@ -2,8 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | #define IDR_VERSION1 1 | 3 | #define IDR_VERSION1 1 |
| 4 | IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE | 4 | IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE |
| 5 | FILEVERSION 1,2,3,6 | 5 | FILEVERSION 1,2,3,7 |
| 6 | PRODUCTVERSION 1,2,3,6 | 6 | PRODUCTVERSION 1,2,3,7 |
| 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK | 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK |
| 8 | FILEFLAGS 0 | 8 | FILEFLAGS 0 |
| 9 | FILEOS VOS_DOS_WINDOWS32 | 9 | FILEOS VOS_DOS_WINDOWS32 |
| @@ -17,7 +17,7 @@ BEGIN | |||
| 17 | 17 | ||
| 18 | BEGIN | 18 | BEGIN |
| 19 | VALUE "FileDescription", "zlib data compression library\0" | 19 | VALUE "FileDescription", "zlib data compression library\0" |
| 20 | VALUE "FileVersion", "1.2.3.6\0" | 20 | VALUE "FileVersion", "1.2.3.7\0" |
| 21 | VALUE "InternalName", "zlib\0" | 21 | VALUE "InternalName", "zlib\0" |
| 22 | VALUE "OriginalFilename", "zlib.dll\0" | 22 | VALUE "OriginalFilename", "zlib.dll\0" |
| 23 | VALUE "ProductName", "ZLib.DLL\0" | 23 | VALUE "ProductName", "ZLib.DLL\0" |
| @@ -52,7 +52,7 @@ | |||
| 52 | #include "deflate.h" | 52 | #include "deflate.h" |
| 53 | 53 | ||
| 54 | const char deflate_copyright[] = | 54 | const char deflate_copyright[] = |
| 55 | " deflate 1.2.3.6 Copyright 1995-2010 Jean-loup Gailly and Mark Adler "; | 55 | " deflate 1.2.3.7 Copyright 1995-2010 Jean-loup Gailly and Mark Adler "; |
| 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 |
| @@ -17,7 +17,7 @@ int ZEXPORT gzclose(file) | |||
| 17 | gz_statep state; | 17 | gz_statep state; |
| 18 | 18 | ||
| 19 | if (file == NULL) | 19 | if (file == NULL) |
| 20 | return EOF; | 20 | return Z_STREAM_ERROR; |
| 21 | state = (gz_statep)file; | 21 | state = (gz_statep)file; |
| 22 | 22 | ||
| 23 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); | 23 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); |
| @@ -76,6 +76,11 @@ | |||
| 76 | #define GZ_WRITE 31153 | 76 | #define GZ_WRITE 31153 |
| 77 | #define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */ | 77 | #define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */ |
| 78 | 78 | ||
| 79 | /* values for gz_state how */ | ||
| 80 | #define LOOK 0 /* look for a gzip header */ | ||
| 81 | #define COPY 1 /* copy input directly */ | ||
| 82 | #define GZIP 2 /* decompress a gzip stream */ | ||
| 83 | |||
| 79 | /* internal gzip file state data structure */ | 84 | /* internal gzip file state data structure */ |
| 80 | typedef struct { | 85 | typedef struct { |
| 81 | /* used for both reading and writing */ | 86 | /* used for both reading and writing */ |
| @@ -89,17 +94,18 @@ typedef struct { | |||
| 89 | unsigned char *out; /* output buffer (double-sized when reading) */ | 94 | unsigned char *out; /* output buffer (double-sized when reading) */ |
| 90 | unsigned char *next; /* next output data to deliver or write */ | 95 | unsigned char *next; /* next output data to deliver or write */ |
| 91 | /* just for reading */ | 96 | /* just for reading */ |
| 92 | int how; /* 0: get header, 1: copy, 2: decompress */ | 97 | unsigned have; /* amount of output data unused at next */ |
| 93 | unsigned have; /* amount of output data unused */ | 98 | int eof; /* true if end of input file reached */ |
| 94 | z_off64_t start; /* where the gzip data started, for rewinding */ | 99 | z_off64_t start; /* where the gzip data started, for rewinding */ |
| 95 | z_off64_t raw; /* where the raw data started, for seeking */ | 100 | z_off64_t raw; /* where the raw data started, for seeking */ |
| 96 | int eof; /* true if end of input file reached */ | 101 | int how; /* 0: get header, 1: copy, 2: decompress */ |
| 102 | int direct; /* true if last read direct, false if gzip */ | ||
| 97 | /* just for writing */ | 103 | /* just for writing */ |
| 98 | int level; /* compression level */ | 104 | int level; /* compression level */ |
| 99 | int strategy; /* compression strategy */ | 105 | int strategy; /* compression strategy */ |
| 100 | /* seek request */ | 106 | /* seek request */ |
| 101 | int seek; /* true if seek request pending */ | ||
| 102 | z_off64_t skip; /* amount to skip (already rewound if backwards) */ | 107 | z_off64_t skip; /* amount to skip (already rewound if backwards) */ |
| 108 | int seek; /* true if seek request pending */ | ||
| 103 | /* error information */ | 109 | /* error information */ |
| 104 | int err; /* error code */ | 110 | int err; /* error code */ |
| 105 | char *msg; /* error message */ | 111 | char *msg; /* error message */ |
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | /* Local functions */ | 16 | /* Local functions */ |
| 17 | local void gz_reset OF((gz_statep)); | 17 | local void gz_reset OF((gz_statep)); |
| 18 | local gzFile gz_open OF((const char *, int, const char *, int)); | 18 | local gzFile gz_open OF((const char *, int, const char *)); |
| 19 | 19 | ||
| 20 | #if defined UNDER_CE && defined NO_ERRNO_H | 20 | #if defined UNDER_CE && defined NO_ERRNO_H |
| 21 | 21 | ||
| @@ -73,10 +73,11 @@ char ZEXPORT *gz_strwinerror (error) | |||
| 73 | local void gz_reset(state) | 73 | local void gz_reset(state) |
| 74 | gz_statep state; | 74 | gz_statep state; |
| 75 | { | 75 | { |
| 76 | state->how = 0; /* look for gzip header */ | ||
| 77 | if (state->mode == GZ_READ) { /* for reading ... */ | 76 | if (state->mode == GZ_READ) { /* for reading ... */ |
| 78 | state->have = 0; /* no output data available */ | 77 | state->have = 0; /* no output data available */ |
| 79 | state->eof = 0; /* not at end of file */ | 78 | state->eof = 0; /* not at end of file */ |
| 79 | state->how = LOOK; /* look for gzip header */ | ||
| 80 | state->direct = 1; /* default for empty file */ | ||
| 80 | } | 81 | } |
| 81 | state->seek = 0; /* no seek request pending */ | 82 | state->seek = 0; /* no seek request pending */ |
| 82 | gz_error(state, Z_OK, NULL); /* clear error */ | 83 | gz_error(state, Z_OK, NULL); /* clear error */ |
| @@ -85,11 +86,10 @@ local void gz_reset(state) | |||
| 85 | } | 86 | } |
| 86 | 87 | ||
| 87 | /* Open a gzip file either by name or file descriptor. */ | 88 | /* Open a gzip file either by name or file descriptor. */ |
| 88 | local gzFile gz_open(path, fd, mode, large) | 89 | local gzFile gz_open(path, fd, mode) |
| 89 | const char *path; | 90 | const char *path; |
| 90 | int fd; | 91 | int fd; |
| 91 | const char *mode; | 92 | const char *mode; |
| 92 | int large; | ||
| 93 | { | 93 | { |
| 94 | gz_statep state; | 94 | gz_statep state; |
| 95 | 95 | ||
| @@ -152,13 +152,9 @@ local gzFile gz_open(path, fd, mode, large) | |||
| 152 | /* open the file with the appropriate mode (or just use fd) */ | 152 | /* open the file with the appropriate mode (or just use fd) */ |
| 153 | state->fd = fd != -1 ? fd : | 153 | state->fd = fd != -1 ? fd : |
| 154 | open(path, | 154 | open(path, |
| 155 | (large ? | ||
| 156 | #ifdef O_LARGEFILE | 155 | #ifdef O_LARGEFILE |
| 157 | O_LARGEFILE | 156 | O_LARGEFILE | |
| 158 | #else | ||
| 159 | 0 | ||
| 160 | #endif | 157 | #endif |
| 161 | : 0) | | ||
| 162 | #ifdef O_BINARY | 158 | #ifdef O_BINARY |
| 163 | O_BINARY | | 159 | O_BINARY | |
| 164 | #endif | 160 | #endif |
| @@ -178,6 +174,10 @@ local gzFile gz_open(path, fd, mode, large) | |||
| 178 | 174 | ||
| 179 | /* save the path name for error messages */ | 175 | /* save the path name for error messages */ |
| 180 | state->path = malloc(strlen(path) + 1); | 176 | state->path = malloc(strlen(path) + 1); |
| 177 | if (state->path == NULL) { | ||
| 178 | free(state); | ||
| 179 | return NULL; | ||
| 180 | } | ||
| 181 | strcpy(state->path, path); | 181 | strcpy(state->path, path); |
| 182 | 182 | ||
| 183 | /* save the current position for rewinding (only if reading) */ | 183 | /* save the current position for rewinding (only if reading) */ |
| @@ -198,7 +198,7 @@ gzFile ZEXPORT gzopen(path, mode) | |||
| 198 | const char *path; | 198 | const char *path; |
| 199 | const char *mode; | 199 | const char *mode; |
| 200 | { | 200 | { |
| 201 | return gz_open(path, -1, mode, 0); | 201 | return gz_open(path, -1, mode); |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | /* -- see zlib.h -- */ | 204 | /* -- see zlib.h -- */ |
| @@ -206,7 +206,7 @@ gzFile ZEXPORT gzopen64(path, mode) | |||
| 206 | const char *path; | 206 | const char *path; |
| 207 | const char *mode; | 207 | const char *mode; |
| 208 | { | 208 | { |
| 209 | return gz_open(path, -1, mode, 1); | 209 | return gz_open(path, -1, mode); |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | /* -- see zlib.h -- */ | 212 | /* -- see zlib.h -- */ |
| @@ -216,14 +216,14 @@ gzFile ZEXPORT gzdopen(fd, mode) | |||
| 216 | { | 216 | { |
| 217 | char path[46]; /* identifier for error messages */ | 217 | char path[46]; /* identifier for error messages */ |
| 218 | 218 | ||
| 219 | if (fd < 0) | 219 | if (fd == -1) |
| 220 | return NULL; | 220 | return NULL; |
| 221 | #ifdef NO_snprintf | 221 | #ifdef NO_snprintf |
| 222 | sprintf(path, "<fd:%d>", fd); /* big enough for 128-bit integers */ | 222 | sprintf(path, "<fd:%d>", fd); /* big enough for 128-bit integers */ |
| 223 | #else | 223 | #else |
| 224 | snprintf(path, sizeof(path), "<fd:%d>", fd); | 224 | snprintf(path, sizeof(path), "<fd:%d>", fd); |
| 225 | #endif | 225 | #endif |
| 226 | return gz_open(path, fd, mode, 0); | 226 | return gz_open(path, fd, mode); |
| 227 | } | 227 | } |
| 228 | 228 | ||
| 229 | /* -- see zlib.h -- */ | 229 | /* -- see zlib.h -- */ |
| @@ -303,7 +303,7 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence) | |||
| 303 | offset -= state->pos; | 303 | offset -= state->pos; |
| 304 | 304 | ||
| 305 | /* if within raw area while reading, just go there */ | 305 | /* if within raw area while reading, just go there */ |
| 306 | if (state->mode == GZ_READ && state->how == 1 && | 306 | if (state->mode == GZ_READ && state->how == COPY && |
| 307 | state->pos + offset >= state->raw) { | 307 | state->pos + offset >= state->raw) { |
| 308 | ret = LSEEK(state->fd, offset, SEEK_CUR); | 308 | ret = LSEEK(state->fd, offset, SEEK_CUR); |
| 309 | if (ret == -1) | 309 | if (ret == -1) |
| @@ -92,15 +92,16 @@ local int gz_next4(state, ret) | |||
| 92 | 92 | ||
| 93 | /* Look for gzip header, set up for inflate or copy. state->have must be zero. | 93 | /* Look for gzip header, set up for inflate or copy. state->have must be zero. |
| 94 | If this is the first time in, allocate required memory. state->how will be | 94 | If this is the first time in, allocate required memory. state->how will be |
| 95 | left unchanged if there is no more input data available, will be set to 1 if | 95 | left unchanged if there is no more input data available, will be set to COPY |
| 96 | there is no gzip header and direct copying will be performed, or it will be | 96 | if there is no gzip header and direct copying will be performed, or it will |
| 97 | set to 2 for decompression, and the gzip header will be skipped so that the | 97 | be set to GZIP for decompression, and the gzip header will be skipped so |
| 98 | next available input data is the raw deflate stream. If direct copying, | 98 | that the next available input data is the raw deflate stream. If direct |
| 99 | then leftover input data from the input buffer will be copied to the output | 99 | copying, then leftover input data from the input buffer will be copied to |
| 100 | buffer. In that case, all further file reads will be directly to either the | 100 | the output buffer. In that case, all further file reads will be directly to |
| 101 | output buffer or a user buffer. If decompressing, the inflate state and the | 101 | either the output buffer or a user buffer. If decompressing, the inflate |
| 102 | check value will be initialized. gz_head() will return 0 on success or -1 | 102 | state and the check value will be initialized. gz_head() will return 0 on |
| 103 | on failure. Failures may include read errors or gzip header errors. */ | 103 | success or -1 on failure. Failures may include read errors or gzip header |
| 104 | errors. */ | ||
| 104 | local int gz_head(state) | 105 | local int gz_head(state) |
| 105 | gz_statep state; | 106 | gz_statep state; |
| 106 | { | 107 | { |
| @@ -196,7 +197,8 @@ local int gz_head(state) | |||
| 196 | /* set up for decompression */ | 197 | /* set up for decompression */ |
| 197 | inflateReset(strm); | 198 | inflateReset(strm); |
| 198 | strm->adler = crc32(0L, Z_NULL, 0); | 199 | strm->adler = crc32(0L, Z_NULL, 0); |
| 199 | state->how = 2; | 200 | state->how = GZIP; |
| 201 | state->direct = 0; | ||
| 200 | return 0; | 202 | return 0; |
| 201 | } | 203 | } |
| 202 | else { | 204 | else { |
| @@ -216,7 +218,8 @@ local int gz_head(state) | |||
| 216 | state->have += strm->avail_in; | 218 | state->have += strm->avail_in; |
| 217 | strm->avail_in = 0; | 219 | strm->avail_in = 0; |
| 218 | } | 220 | } |
| 219 | state->how = 1; | 221 | state->how = COPY; |
| 222 | state->direct = 1; | ||
| 220 | return 0; | 223 | return 0; |
| 221 | } | 224 | } |
| 222 | 225 | ||
| @@ -224,7 +227,7 @@ local int gz_head(state) | |||
| 224 | If the end of the compressed data is reached, then verify the gzip trailer | 227 | If the end of the compressed data is reached, then verify the gzip trailer |
| 225 | check value and length (modulo 2^32). state->have and state->next are set | 228 | check value and length (modulo 2^32). state->have and state->next are set |
| 226 | to point to the just decompressed data, and the crc is updated. If the | 229 | to point to the just decompressed data, and the crc is updated. If the |
| 227 | trailer is verified, state->how is reset to zero to look for the next gzip | 230 | trailer is verified, state->how is reset to LOOK to look for the next gzip |
| 228 | stream or raw data, once state->have is depleted. Returns 0 on success, -1 | 231 | stream or raw data, once state->have is depleted. Returns 0 on success, -1 |
| 229 | on failure. Failures may include invalid compressed data or a failed gzip | 232 | on failure. Failures may include invalid compressed data or a failed gzip |
| 230 | trailer verification. */ | 233 | trailer verification. */ |
| @@ -284,7 +287,8 @@ local int gz_decomp(state) | |||
| 284 | gz_error(state, Z_DATA_ERROR, "incorrect length check"); | 287 | gz_error(state, Z_DATA_ERROR, "incorrect length check"); |
| 285 | return -1; | 288 | return -1; |
| 286 | } | 289 | } |
| 287 | state->how = 0; /* ready for next stream, once have is 0 */ | 290 | state->how = LOOK; /* ready for next stream, once have is 0 (leave |
| 291 | state->direct unchanged to remember how) */ | ||
| 288 | } | 292 | } |
| 289 | 293 | ||
| 290 | /* good decompression */ | 294 | /* good decompression */ |
| @@ -293,28 +297,28 @@ local int gz_decomp(state) | |||
| 293 | 297 | ||
| 294 | /* Make data and put in the output buffer. Assumes that state->have == 0. | 298 | /* Make data and put in the output buffer. Assumes that state->have == 0. |
| 295 | Data is either copied from the input file or decompressed from the input | 299 | Data is either copied from the input file or decompressed from the input |
| 296 | file depending on state->how. If state->how is zero, then a gzip header is | 300 | file depending on state->how. If state->how is LOOK, then a gzip header is |
| 297 | looked for (and skipped if found) to determine wither to copy or decompress. | 301 | looked for (and skipped if found) to determine wither to copy or decompress. |
| 298 | Returns -1 on error, otherwise 0. gz_make() will leave state->have non-zero | 302 | Returns -1 on error, otherwise 0. gz_make() will leave state->have as COPY |
| 299 | unless the end of the input file has been reached and all data has been | 303 | or GZIP unless the end of the input file has been reached and all data has |
| 300 | processed. */ | 304 | been processed. */ |
| 301 | local int gz_make(state) | 305 | local int gz_make(state) |
| 302 | gz_statep state; | 306 | gz_statep state; |
| 303 | { | 307 | { |
| 304 | z_streamp strm = &(state->strm); | 308 | z_streamp strm = &(state->strm); |
| 305 | 309 | ||
| 306 | if (state->how == 0) { /* look for gzip header */ | 310 | if (state->how == LOOK) { /* look for gzip header */ |
| 307 | if (gz_head(state) == -1) | 311 | if (gz_head(state) == -1) |
| 308 | return -1; | 312 | return -1; |
| 309 | if (state->have) /* got some data from gz_head() */ | 313 | if (state->have) /* got some data from gz_head() */ |
| 310 | return 0; | 314 | return 0; |
| 311 | } | 315 | } |
| 312 | if (state->how == 1) { /* straight copy */ | 316 | if (state->how == COPY) { /* straight copy */ |
| 313 | if (gz_load(state, state->out, state->size << 1, &(state->have)) == -1) | 317 | if (gz_load(state, state->out, state->size << 1, &(state->have)) == -1) |
| 314 | return -1; | 318 | return -1; |
| 315 | state->next = state->out; | 319 | state->next = state->out; |
| 316 | } | 320 | } |
| 317 | else if (state->how == 2) { /* decompress */ | 321 | else if (state->how == GZIP) { /* decompress */ |
| 318 | strm->avail_out = state->size << 1; | 322 | strm->avail_out = state->size << 1; |
| 319 | strm->next_out = state->out; | 323 | strm->next_out = state->out; |
| 320 | if (gz_decomp(state) == -1) | 324 | if (gz_decomp(state) == -1) |
| @@ -409,7 +413,7 @@ int ZEXPORT gzread(file, buf, len) | |||
| 409 | 413 | ||
| 410 | /* need output data -- for small len or new stream load up our output | 414 | /* need output data -- for small len or new stream load up our output |
| 411 | buffer */ | 415 | buffer */ |
| 412 | else if (state->how == 0 || len < (state->size << 1)) { | 416 | else if (state->how == LOOK || len < (state->size << 1)) { |
| 413 | /* get more output, looking for header if required */ | 417 | /* get more output, looking for header if required */ |
| 414 | if (gz_make(state) == -1) | 418 | if (gz_make(state) == -1) |
| 415 | return -1; | 419 | return -1; |
| @@ -419,13 +423,13 @@ int ZEXPORT gzread(file, buf, len) | |||
| 419 | } | 423 | } |
| 420 | 424 | ||
| 421 | /* large len -- read directly into user buffer */ | 425 | /* large len -- read directly into user buffer */ |
| 422 | else if (state->how == 1) { /* read directly */ | 426 | else if (state->how == COPY) { /* read directly */ |
| 423 | if (gz_load(state, buf, len, &n) == -1) | 427 | if (gz_load(state, buf, len, &n) == -1) |
| 424 | return -1; | 428 | return -1; |
| 425 | } | 429 | } |
| 426 | 430 | ||
| 427 | /* large len -- decompress directly into user buffer */ | 431 | /* large len -- decompress directly into user buffer */ |
| 428 | else { /* state->how == 2 */ | 432 | else { /* state->how == GZIP */ |
| 429 | strm->avail_out = len; | 433 | strm->avail_out = len; |
| 430 | strm->next_out = buf; | 434 | strm->next_out = buf; |
| 431 | if (gz_decomp(state) == -1) | 435 | if (gz_decomp(state) == -1) |
| @@ -614,14 +618,20 @@ int ZEXPORT gzdirect(file) | |||
| 614 | if (state->mode != GZ_READ) | 618 | if (state->mode != GZ_READ) |
| 615 | return 0; | 619 | return 0; |
| 616 | 620 | ||
| 617 | /* return true if reading without decompression */ | 621 | /* if the state is not known, but we can find out, then do so (this is |
| 618 | return state->how == 1; | 622 | mainly for right after a gzopen() or gzdopen()) */ |
| 623 | if (state->how == LOOK && state->have == 0) | ||
| 624 | (void)gz_head(state); | ||
| 625 | |||
| 626 | /* return 1 if reading direct, 0 if decompressing a gzip stream */ | ||
| 627 | return state->direct; | ||
| 619 | } | 628 | } |
| 620 | 629 | ||
| 621 | /* -- see zlib.h -- */ | 630 | /* -- see zlib.h -- */ |
| 622 | int ZEXPORT gzclose_r(file) | 631 | int ZEXPORT gzclose_r(file) |
| 623 | gzFile file; | 632 | gzFile file; |
| 624 | { | 633 | { |
| 634 | int ret; | ||
| 625 | gz_statep state; | 635 | gz_statep state; |
| 626 | 636 | ||
| 627 | /* get internal structure */ | 637 | /* get internal structure */ |
| @@ -640,9 +650,9 @@ int ZEXPORT gzclose_r(file) | |||
| 640 | free(state->in); | 650 | free(state->in); |
| 641 | } | 651 | } |
| 642 | gz_error(state, Z_OK, NULL); | 652 | gz_error(state, Z_OK, NULL); |
| 643 | close(state->fd); | 653 | ret = close(state->fd); |
| 644 | free(state); | 654 | free(state); |
| 645 | return Z_OK; | 655 | return ret ? Z_ERRNO : Z_OK; |
| 646 | } | 656 | } |
| 647 | 657 | ||
| 648 | #endif /* !OLD_GZIO */ | 658 | #endif /* !OLD_GZIO */ |
| @@ -152,19 +152,19 @@ int ZEXPORT gzwrite(file, buf, len) | |||
| 152 | 152 | ||
| 153 | /* get internal structure */ | 153 | /* get internal structure */ |
| 154 | if (file == NULL) | 154 | if (file == NULL) |
| 155 | return -1; | 155 | return 0; |
| 156 | state = (gz_statep)file; | 156 | state = (gz_statep)file; |
| 157 | strm = &(state->strm); | 157 | strm = &(state->strm); |
| 158 | 158 | ||
| 159 | /* check that we're writing and that there's no error */ | 159 | /* check that we're writing and that there's no error */ |
| 160 | if (state->mode != GZ_WRITE || state->err != Z_OK) | 160 | if (state->mode != GZ_WRITE || state->err != Z_OK) |
| 161 | return -1; | 161 | return 0; |
| 162 | 162 | ||
| 163 | /* since an int is returned, make sure len fits in one, otherwise return | 163 | /* since an int is returned, make sure len fits in one, otherwise return |
| 164 | with an error (this avoids the flaw in the interface) */ | 164 | with an error (this avoids the flaw in the interface) */ |
| 165 | if ((int)len < 0) { | 165 | if ((int)len < 0) { |
| 166 | gz_error(state, Z_BUF_ERROR, "requested length does not fit in int"); | 166 | gz_error(state, Z_BUF_ERROR, "requested length does not fit in int"); |
| 167 | return -1; | 167 | return 0; |
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | /* if len is zero, avoid unnecessary operations */ | 170 | /* if len is zero, avoid unnecessary operations */ |
| @@ -173,13 +173,13 @@ int ZEXPORT gzwrite(file, buf, len) | |||
| 173 | 173 | ||
| 174 | /* allocate memory if this is the first time through */ | 174 | /* allocate memory if this is the first time through */ |
| 175 | if (state->size == 0 && gz_init(state) == -1) | 175 | if (state->size == 0 && gz_init(state) == -1) |
| 176 | return -1; | 176 | return 0; |
| 177 | 177 | ||
| 178 | /* check for seek request */ | 178 | /* check for seek request */ |
| 179 | if (state->seek) { | 179 | if (state->seek) { |
| 180 | state->seek = 0; | 180 | state->seek = 0; |
| 181 | if (gz_zero(state, state->skip) == -1) | 181 | if (gz_zero(state, state->skip) == -1) |
| 182 | return -1; | 182 | return 0; |
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | /* for small len, copy to input buffer, otherwise compress directly */ | 185 | /* for small len, copy to input buffer, otherwise compress directly */ |
| @@ -197,20 +197,20 @@ int ZEXPORT gzwrite(file, buf, len) | |||
| 197 | buf = (char *)buf + n; | 197 | buf = (char *)buf + n; |
| 198 | len -= n; | 198 | len -= n; |
| 199 | if (len && gz_comp(state, Z_NO_FLUSH) == -1) | 199 | if (len && gz_comp(state, Z_NO_FLUSH) == -1) |
| 200 | return -1; | 200 | return 0; |
| 201 | } while (len); | 201 | } while (len); |
| 202 | } | 202 | } |
| 203 | else { | 203 | else { |
| 204 | /* consume whatever's left in the input buffer */ | 204 | /* consume whatever's left in the input buffer */ |
| 205 | if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1) | 205 | if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1) |
| 206 | return -1; | 206 | return 0; |
| 207 | 207 | ||
| 208 | /* directly compress user buffer to file */ | 208 | /* directly compress user buffer to file */ |
| 209 | strm->avail_in = len; | 209 | strm->avail_in = len; |
| 210 | strm->next_in = (voidp)buf; | 210 | strm->next_in = (voidp)buf; |
| 211 | state->pos += len; | 211 | state->pos += len; |
| 212 | if (gz_comp(state, Z_NO_FLUSH) == -1) | 212 | if (gz_comp(state, Z_NO_FLUSH) == -1) |
| 213 | return -1; | 213 | return 0; |
| 214 | } | 214 | } |
| 215 | 215 | ||
| 216 | /* input was all buffered or compressed (put will fit in int) */ | 216 | /* input was all buffered or compressed (put will fit in int) */ |
| @@ -265,8 +265,13 @@ int ZEXPORT gzputs(file, str) | |||
| 265 | gzFile file; | 265 | gzFile file; |
| 266 | const char *str; | 266 | const char *str; |
| 267 | { | 267 | { |
| 268 | int ret; | ||
| 269 | unsigned len; | ||
| 270 | |||
| 268 | /* write string */ | 271 | /* write string */ |
| 269 | return gzwrite(file, str, strlen(str)); | 272 | len = strlen(str); |
| 273 | ret = gzwrite(file, str, len); | ||
| 274 | return ret == 0 && len != 0 ? -1 : ret; | ||
| 270 | } | 275 | } |
| 271 | 276 | ||
| 272 | #ifdef STDC | 277 | #ifdef STDC |
| @@ -494,7 +499,7 @@ int ZEXPORT gzsetparams(file, level, strategy) | |||
| 494 | int ZEXPORT gzclose_w(file) | 499 | int ZEXPORT gzclose_w(file) |
| 495 | gzFile file; | 500 | gzFile file; |
| 496 | { | 501 | { |
| 497 | int ret; | 502 | int ret = 0; |
| 498 | gz_statep state; | 503 | gz_statep state; |
| 499 | 504 | ||
| 500 | /* get internal structure */ | 505 | /* get internal structure */ |
| @@ -509,13 +514,12 @@ int ZEXPORT gzclose_w(file) | |||
| 509 | /* check for seek request */ | 514 | /* check for seek request */ |
| 510 | if (state->seek) { | 515 | if (state->seek) { |
| 511 | state->seek = 0; | 516 | state->seek = 0; |
| 512 | if (gz_zero(state, state->skip) == -1) | 517 | ret += gz_zero(state, state->skip); |
| 513 | return -1; | ||
| 514 | } | 518 | } |
| 515 | 519 | ||
| 516 | /* flush, free memory, and close file */ | 520 | /* flush, free memory, and close file */ |
| 517 | ret = gz_comp(state, Z_FINISH); | 521 | ret += gz_comp(state, Z_FINISH); |
| 518 | deflateEnd(&(state->strm)); | 522 | (void)deflateEnd(&(state->strm)); |
| 519 | free(state->out); | 523 | free(state->out); |
| 520 | free(state->in); | 524 | free(state->in); |
| 521 | ret += close(state->fd); | 525 | ret += close(state->fd); |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* inflate.c -- zlib decompression | 1 | /* inflate.c -- zlib decompression |
| 2 | * Copyright (C) 1995-2009 Mark Adler | 2 | * Copyright (C) 1995-2010 Mark Adler |
| 3 | * For conditions of distribution and use, see copyright notice in zlib.h | 3 | * For conditions of distribution and use, see copyright notice in zlib.h |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| @@ -154,7 +154,7 @@ int windowBits; | |||
| 154 | /* set number of window bits, free window if different */ | 154 | /* set number of window bits, free window if different */ |
| 155 | if (windowBits && (windowBits < 8 || windowBits > 15)) | 155 | if (windowBits && (windowBits < 8 || windowBits > 15)) |
| 156 | return Z_STREAM_ERROR; | 156 | return Z_STREAM_ERROR; |
| 157 | if (state->wbits != (unsigned)windowBits && state->window != Z_NULL) { | 157 | if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) { |
| 158 | ZFREE(strm, state->window); | 158 | ZFREE(strm, state->window); |
| 159 | state->window = Z_NULL; | 159 | state->window = Z_NULL; |
| 160 | } | 160 | } |
| @@ -9,7 +9,7 @@ | |||
| 9 | #define MAXBITS 15 | 9 | #define MAXBITS 15 |
| 10 | 10 | ||
| 11 | const char inflate_copyright[] = | 11 | const char inflate_copyright[] = |
| 12 | " inflate 1.2.3.6 Copyright 1995-2010 Mark Adler "; | 12 | " inflate 1.2.3.7 Copyright 1995-2010 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, 199, 70}; | 65 | 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 193}; |
| 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/make_vms.com b/make_vms.com index fc5fd0c..8e5b7b5 100644 --- a/make_vms.com +++ b/make_vms.com | |||
| @@ -137,48 +137,48 @@ $ if make.eqs."" | |||
| 137 | $ then | 137 | $ then |
| 138 | $ dele example.obj;*,minigzip.obj;* | 138 | $ dele example.obj;*,minigzip.obj;* |
| 139 | $ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" - | 139 | $ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" - |
| 140 | adler32.c zlib.h zconf.h zlibdefs.h | 140 | adler32.c zlib.h zconf.h |
| 141 | $ CALL MAKE compress.OBJ "CC ''CCOPT' compress" - | 141 | $ CALL MAKE compress.OBJ "CC ''CCOPT' compress" - |
| 142 | compress.c zlib.h zconf.h zlibdefs.h | 142 | compress.c zlib.h zconf.h |
| 143 | $ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" - | 143 | $ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" - |
| 144 | crc32.c zlib.h zconf.h zlibdefs.h | 144 | crc32.c zlib.h zconf.h |
| 145 | $ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" - | 145 | $ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" - |
| 146 | deflate.c deflate.h zutil.h zlib.h zconf.h zlibdefs.h | 146 | deflate.c deflate.h zutil.h zlib.h zconf.h |
| 147 | $ CALL MAKE gzclose.OBJ "CC ''CCOPT' gzclose" - | 147 | $ CALL MAKE gzclose.OBJ "CC ''CCOPT' gzclose" - |
| 148 | gzclose.c zutil.h zlib.h zconf.h zlibdefs.h | 148 | gzclose.c zutil.h zlib.h zconf.h |
| 149 | $ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" - | 149 | $ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" - |
| 150 | gzio.c zutil.h zlib.h zconf.h zlibdefs.h | 150 | gzio.c zutil.h zlib.h zconf.h |
| 151 | $ CALL MAKE gzlib.OBJ "CC ''CCOPT' gzlib" - | 151 | $ CALL MAKE gzlib.OBJ "CC ''CCOPT' gzlib" - |
| 152 | gzlib.c zutil.h zlib.h zconf.h zlibdefs.h | 152 | gzlib.c zutil.h zlib.h zconf.h |
| 153 | $ CALL MAKE gzread.OBJ "CC ''CCOPT' gzread" - | 153 | $ CALL MAKE gzread.OBJ "CC ''CCOPT' gzread" - |
| 154 | gzread.c zutil.h zlib.h zconf.h zlibdefs.h | 154 | gzread.c zutil.h zlib.h zconf.h |
| 155 | $ CALL MAKE gzwrite.OBJ "CC ''CCOPT' gzwrite" - | 155 | $ CALL MAKE gzwrite.OBJ "CC ''CCOPT' gzwrite" - |
| 156 | gzwrite.c zutil.h zlib.h zconf.h zlibdefs.h | 156 | gzwrite.c zutil.h zlib.h zconf.h |
| 157 | $ CALL MAKE infback.OBJ "CC ''CCOPT' infback" - | 157 | $ CALL MAKE infback.OBJ "CC ''CCOPT' infback" - |
| 158 | infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h | 158 | infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h |
| 159 | $ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" - | 159 | $ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" - |
| 160 | inffast.c zutil.h zlib.h zconf.h zlibdefs.h inffast.h | 160 | inffast.c zutil.h zlib.h zconf.h inffast.h |
| 161 | $ CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" - | 161 | $ CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" - |
| 162 | inflate.c zutil.h zlib.h zconf.h zlibdefs.h infblock.h | 162 | inflate.c zutil.h zlib.h zconf.h infblock.h |
| 163 | $ CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" - | 163 | $ CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" - |
| 164 | inftrees.c zutil.h zlib.h zconf.h zlibdefs.h inftrees.h | 164 | inftrees.c zutil.h zlib.h zconf.h inftrees.h |
| 165 | $ CALL MAKE trees.OBJ "CC ''CCOPT' trees" - | 165 | $ CALL MAKE trees.OBJ "CC ''CCOPT' trees" - |
| 166 | trees.c deflate.h zutil.h zlib.h zconf.h zlibdefs.h | 166 | trees.c deflate.h zutil.h zlib.h zconf.h |
| 167 | $ CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" - | 167 | $ CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" - |
| 168 | uncompr.c zlib.h zconf.h zlibdefs.h | 168 | uncompr.c zlib.h zconf.h |
| 169 | $ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" - | 169 | $ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" - |
| 170 | zutil.c zutil.h zlib.h zconf.h zlibdefs.h | 170 | zutil.c zutil.h zlib.h zconf.h |
| 171 | $ write sys$output "Building Zlib ..." | 171 | $ write sys$output "Building Zlib ..." |
| 172 | $ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ | 172 | $ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ |
| 173 | $ write sys$output "Building example..." | 173 | $ write sys$output "Building example..." |
| 174 | $ CALL MAKE example.OBJ "CC ''CCOPT' example" - | 174 | $ CALL MAKE example.OBJ "CC ''CCOPT' example" - |
| 175 | example.c zlib.h zconf.h zlibdefs.h | 175 | example.c zlib.h zconf.h |
| 176 | $ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb | 176 | $ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb |
| 177 | $ if f$search("x11vms:xvmsutils.olb") .nes. "" | 177 | $ if f$search("x11vms:xvmsutils.olb") .nes. "" |
| 178 | $ then | 178 | $ then |
| 179 | $ write sys$output "Building minigzip..." | 179 | $ write sys$output "Building minigzip..." |
| 180 | $ CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" - | 180 | $ CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" - |
| 181 | minigzip.c zlib.h zconf.h zlibdefs.h | 181 | minigzip.c zlib.h zconf.h |
| 182 | $ call make minigzip.exe - | 182 | $ call make minigzip.exe - |
| 183 | "LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" - | 183 | "LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" - |
| 184 | minigzip.obj libz.olb | 184 | minigzip.obj libz.olb |
| @@ -424,23 +424,23 @@ clean : | |||
| 424 | 424 | ||
| 425 | 425 | ||
| 426 | # Other dependencies. | 426 | # Other dependencies. |
| 427 | adler32.obj : adler32.c zutil.h zlib.h zconf.h zlibdefs.h | 427 | adler32.obj : adler32.c zutil.h zlib.h zconf.h |
| 428 | compress.obj : compress.c zlib.h zconf.h zlibdefs.h | 428 | compress.obj : compress.c zlib.h zconf.h |
| 429 | crc32.obj : crc32.c zutil.h zlib.h zconf.h zlibdefs.h | 429 | crc32.obj : crc32.c zutil.h zlib.h zconf.h |
| 430 | deflate.obj : deflate.c deflate.h zutil.h zlib.h zconf.h zlibdefs.h | 430 | deflate.obj : deflate.c deflate.h zutil.h zlib.h zconf.h |
| 431 | example.obj : example.c zlib.h zconf.h zlibdefs.h | 431 | example.obj : example.c zlib.h zconf.h |
| 432 | gzclose.obj : gzclose.c zutil.h zlib.h zconf.h zlibdefs.h | 432 | gzclose.obj : gzclose.c zutil.h zlib.h zconf.h |
| 433 | gzio.obj : gzio.c zutil.h zlib.h zconf.h zlibdefs.h | 433 | gzio.obj : gzio.c zutil.h zlib.h zconf.h |
| 434 | gzlib.obj : gzlib.c zutil.h zlib.h zconf.h zlibdefs.h | 434 | gzlib.obj : gzlib.c zutil.h zlib.h zconf.h |
| 435 | gzread.obj : gzread.c zutil.h zlib.h zconf.h zlibdefs.h | 435 | gzread.obj : gzread.c zutil.h zlib.h zconf.h |
| 436 | gzwrite.obj : gzwrite.c zutil.h zlib.h zconf.h zlibdefs.h | 436 | gzwrite.obj : gzwrite.c zutil.h zlib.h zconf.h |
| 437 | inffast.obj : inffast.c zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inffast.h | 437 | inffast.obj : inffast.c zutil.h zlib.h zconf.h inftrees.h inffast.h |
| 438 | inflate.obj : inflate.c zutil.h zlib.h zconf.h zlibdefs.h | 438 | inflate.obj : inflate.c zutil.h zlib.h zconf.h |
| 439 | inftrees.obj : inftrees.c zutil.h zlib.h zconf.h zlibdefs.h inftrees.h | 439 | inftrees.obj : inftrees.c zutil.h zlib.h zconf.h inftrees.h |
| 440 | minigzip.obj : minigzip.c zlib.h zconf.h zlibdefs.h | 440 | minigzip.obj : minigzip.c zlib.h zconf.h |
| 441 | trees.obj : trees.c deflate.h zutil.h zlib.h zconf.h zlibdefs.h | 441 | trees.obj : trees.c deflate.h zutil.h zlib.h zconf.h |
| 442 | uncompr.obj : uncompr.c zlib.h zconf.h zlibdefs.h | 442 | uncompr.obj : uncompr.c zlib.h zconf.h |
| 443 | zutil.obj : zutil.c zutil.h zlib.h zconf.h zlibdefs.h | 443 | zutil.obj : zutil.c zutil.h zlib.h zconf.h |
| 444 | infback.obj : infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h | 444 | infback.obj : infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h |
| 445 | $ eod | 445 | $ eod |
| 446 | $ close out | 446 | $ close out |
diff --git a/qnx/package.qpg b/qnx/package.qpg index 384bcf2..74bdb21 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.3.6" install="/opt/lib/" user="root:bin" permission="644"/> | 28 | <QPG:Add file="../libz.so.1.2.3.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.3.6"/> | 29 | <QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.3.7"/> |
| 30 | <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.3.6"/> | 30 | <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.3.6"/> |
| 31 | <QPG:Add file="../libz.so.1.2.3.6" install="/opt/lib/" component="slib"/> | 31 | <QPG:Add file="../libz.so.1.2.3.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.3.6</QPM:ReleaseVersion> | 66 | <QPM:ReleaseVersion>1.2.3.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/treebuild.xml b/treebuild.xml index 679570d..387336e 100644 --- a/treebuild.xml +++ b/treebuild.xml | |||
| @@ -9,70 +9,58 @@ | |||
| 9 | 9 | ||
| 10 | <include-file name="zlib.h" scope="public" mode="644" /> | 10 | <include-file name="zlib.h" scope="public" mode="644" /> |
| 11 | <include-file name="zconf.h" scope="public" mode="644" /> | 11 | <include-file name="zconf.h" scope="public" mode="644" /> |
| 12 | <include-file name="zlibdefs.h" scope="public" mode="644" /> | ||
| 13 | 12 | ||
| 14 | <source name="adler32.c"> | 13 | <source name="adler32.c"> |
| 15 | <depend name="zlib.h" /> | 14 | <depend name="zlib.h" /> |
| 16 | <depend name="zconf.h" /> | 15 | <depend name="zconf.h" /> |
| 17 | <depend name="zlibdefs.h" /> | ||
| 18 | </source> | 16 | </source> |
| 19 | <source name="compress.c"> | 17 | <source name="compress.c"> |
| 20 | <depend name="zlib.h" /> | 18 | <depend name="zlib.h" /> |
| 21 | <depend name="zconf.h" /> | 19 | <depend name="zconf.h" /> |
| 22 | <depend name="zlibdefs.h" /> | ||
| 23 | </source> | 20 | </source> |
| 24 | <source name="crc32.c"> | 21 | <source name="crc32.c"> |
| 25 | <depend name="zlib.h" /> | 22 | <depend name="zlib.h" /> |
| 26 | <depend name="zconf.h" /> | 23 | <depend name="zconf.h" /> |
| 27 | <depend name="zlibdefs.h" /> | ||
| 28 | <depend name="crc32.h" /> | 24 | <depend name="crc32.h" /> |
| 29 | </source> | 25 | </source> |
| 30 | <source name="gzclose.c"> | 26 | <source name="gzclose.c"> |
| 31 | <depend name="zlib.h" /> | 27 | <depend name="zlib.h" /> |
| 32 | <depend name="zconf.h" /> | 28 | <depend name="zconf.h" /> |
| 33 | <depend name="zlibdefs.h" /> | ||
| 34 | <depend name="gzguts.h" /> | 29 | <depend name="gzguts.h" /> |
| 35 | </source> | 30 | </source> |
| 36 | <source name="gzio.c"> | 31 | <source name="gzio.c"> |
| 37 | <depend name="zlib.h" /> | 32 | <depend name="zlib.h" /> |
| 38 | <depend name="zconf.h" /> | 33 | <depend name="zconf.h" /> |
| 39 | <depend name="zlibdefs.h" /> | ||
| 40 | <depend name="zutil.h" /> | 34 | <depend name="zutil.h" /> |
| 41 | </source> | 35 | </source> |
| 42 | <source name="gzlib.c"> | 36 | <source name="gzlib.c"> |
| 43 | <depend name="zlib.h" /> | 37 | <depend name="zlib.h" /> |
| 44 | <depend name="zconf.h" /> | 38 | <depend name="zconf.h" /> |
| 45 | <depend name="zlibdefs.h" /> | ||
| 46 | <depend name="gzguts.h" /> | 39 | <depend name="gzguts.h" /> |
| 47 | </source> | 40 | </source> |
| 48 | <source name="gzread.c"> | 41 | <source name="gzread.c"> |
| 49 | <depend name="zlib.h" /> | 42 | <depend name="zlib.h" /> |
| 50 | <depend name="zconf.h" /> | 43 | <depend name="zconf.h" /> |
| 51 | <depend name="zlibdefs.h" /> | ||
| 52 | <depend name="gzguts.h" /> | 44 | <depend name="gzguts.h" /> |
| 53 | </source> | 45 | </source> |
| 54 | <source name="gzwrite.c"> | 46 | <source name="gzwrite.c"> |
| 55 | <depend name="zlib.h" /> | 47 | <depend name="zlib.h" /> |
| 56 | <depend name="zconf.h" /> | 48 | <depend name="zconf.h" /> |
| 57 | <depend name="zlibdefs.h" /> | ||
| 58 | <depend name="gzguts.h" /> | 49 | <depend name="gzguts.h" /> |
| 59 | </source> | 50 | </source> |
| 60 | <source name="uncompr.c"> | 51 | <source name="uncompr.c"> |
| 61 | <depend name="zlib.h" /> | 52 | <depend name="zlib.h" /> |
| 62 | <depend name="zconf.h" /> | 53 | <depend name="zconf.h" /> |
| 63 | <depend name="zlibdefs.h" /> | ||
| 64 | </source> | 54 | </source> |
| 65 | <source name="deflate.c"> | 55 | <source name="deflate.c"> |
| 66 | <depend name="zlib.h" /> | 56 | <depend name="zlib.h" /> |
| 67 | <depend name="zconf.h" /> | 57 | <depend name="zconf.h" /> |
| 68 | <depend name="zlibdefs.h" /> | ||
| 69 | <depend name="zutil.h" /> | 58 | <depend name="zutil.h" /> |
| 70 | <depend name="deflate.h" /> | 59 | <depend name="deflate.h" /> |
| 71 | </source> | 60 | </source> |
| 72 | <source name="trees.c"> | 61 | <source name="trees.c"> |
| 73 | <depend name="zlib.h" /> | 62 | <depend name="zlib.h" /> |
| 74 | <depend name="zconf.h" /> | 63 | <depend name="zconf.h" /> |
| 75 | <depend name="zlibdefs.h" /> | ||
| 76 | <depend name="zutil.h" /> | 64 | <depend name="zutil.h" /> |
| 77 | <depend name="deflate.h" /> | 65 | <depend name="deflate.h" /> |
| 78 | <depend name="trees.h" /> | 66 | <depend name="trees.h" /> |
| @@ -80,13 +68,11 @@ | |||
| 80 | <source name="zutil.c"> | 68 | <source name="zutil.c"> |
| 81 | <depend name="zlib.h" /> | 69 | <depend name="zlib.h" /> |
| 82 | <depend name="zconf.h" /> | 70 | <depend name="zconf.h" /> |
| 83 | <depend name="zlibdefs.h" /> | ||
| 84 | <depend name="zutil.h" /> | 71 | <depend name="zutil.h" /> |
| 85 | </source> | 72 | </source> |
| 86 | <source name="inflate.c"> | 73 | <source name="inflate.c"> |
| 87 | <depend name="zlib.h" /> | 74 | <depend name="zlib.h" /> |
| 88 | <depend name="zconf.h" /> | 75 | <depend name="zconf.h" /> |
| 89 | <depend name="zlibdefs.h" /> | ||
| 90 | <depend name="zutil.h" /> | 76 | <depend name="zutil.h" /> |
| 91 | <depend name="inftrees.h" /> | 77 | <depend name="inftrees.h" /> |
| 92 | <depend name="inflate.h" /> | 78 | <depend name="inflate.h" /> |
| @@ -95,7 +81,6 @@ | |||
| 95 | <source name="infback.c"> | 81 | <source name="infback.c"> |
| 96 | <depend name="zlib.h" /> | 82 | <depend name="zlib.h" /> |
| 97 | <depend name="zconf.h" /> | 83 | <depend name="zconf.h" /> |
| 98 | <depend name="zlibdefs.h" /> | ||
| 99 | <depend name="zutil.h" /> | 84 | <depend name="zutil.h" /> |
| 100 | <depend name="inftrees.h" /> | 85 | <depend name="inftrees.h" /> |
| 101 | <depend name="inflate.h" /> | 86 | <depend name="inflate.h" /> |
| @@ -104,14 +89,12 @@ | |||
| 104 | <source name="inftrees.c"> | 89 | <source name="inftrees.c"> |
| 105 | <depend name="zlib.h" /> | 90 | <depend name="zlib.h" /> |
| 106 | <depend name="zconf.h" /> | 91 | <depend name="zconf.h" /> |
| 107 | <depend name="zlibdefs.h" /> | ||
| 108 | <depend name="zutil.h" /> | 92 | <depend name="zutil.h" /> |
| 109 | <depend name="inftrees.h" /> | 93 | <depend name="inftrees.h" /> |
| 110 | </source> | 94 | </source> |
| 111 | <source name="inffast.c"> | 95 | <source name="inffast.c"> |
| 112 | <depend name="zlib.h" /> | 96 | <depend name="zlib.h" /> |
| 113 | <depend name="zconf.h" /> | 97 | <depend name="zconf.h" /> |
| 114 | <depend name="zlibdefs.h" /> | ||
| 115 | <depend name="zutil.h" /> | 98 | <depend name="zutil.h" /> |
| 116 | <depend name="inftrees.h" /> | 99 | <depend name="inftrees.h" /> |
| 117 | <depend name="inflate.h" /> | 100 | <depend name="inflate.h" /> |
diff --git a/win32/Makefile.gcc b/win32/Makefile.gcc index 4cc8625..4e3d1f2 100644 --- a/win32/Makefile.gcc +++ b/win32/Makefile.gcc | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | STATICLIB = libz.a | 26 | STATICLIB = libz.a |
| 27 | SHAREDLIB = zlib1.dll | 27 | SHAREDLIB = zlib1.dll |
| 28 | IMPLIB = libzdll.a | 28 | IMPLIB = libz.dll.a |
| 29 | 29 | ||
| 30 | #LOC = -DASMV | 30 | #LOC = -DASMV |
| 31 | #LOC = -DDEBUG -g | 31 | #LOC = -DDEBUG -g |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* zconf.h -- configuration of the zlib compression library | 1 | /* zconf.h -- configuration of the zlib compression library |
| 2 | * Copyright (C) 1995-2007 Jean-loup Gailly. | 2 | * Copyright (C) 1995-2010 Jean-loup Gailly. |
| 3 | * For conditions of distribution and use, see copyright notice in zlib.h | 3 | * For conditions of distribution and use, see copyright notice in zlib.h |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| @@ -26,11 +26,13 @@ | |||
| 26 | # define _tr_tally z__tr_tally | 26 | # define _tr_tally z__tr_tally |
| 27 | # define adler32 z_adler32 | 27 | # define adler32 z_adler32 |
| 28 | # define adler32_combine z_adler32_combine | 28 | # define adler32_combine z_adler32_combine |
| 29 | # define adler32_combine64 z_adler32_combine64 | ||
| 29 | # define compress z_compress | 30 | # define compress z_compress |
| 30 | # define compress2 z_compress2 | 31 | # define compress2 z_compress2 |
| 31 | # define compressBound z_compressBound | 32 | # define compressBound z_compressBound |
| 32 | # define crc32 z_crc32 | 33 | # define crc32 z_crc32 |
| 33 | # define crc32_combine z_crc32_combine | 34 | # define crc32_combine z_crc32_combine |
| 35 | # define crc32_combine64 z_crc32_combine64 | ||
| 34 | # define deflate z_deflate | 36 | # define deflate z_deflate |
| 35 | # define deflateBound z_deflateBound | 37 | # define deflateBound z_deflateBound |
| 36 | # define deflateCopy z_deflateCopy | 38 | # define deflateCopy z_deflateCopy |
| @@ -45,6 +47,8 @@ | |||
| 45 | # define deflateTune z_deflateTune | 47 | # define deflateTune z_deflateTune |
| 46 | # define deflate_copyright z_deflate_copyright | 48 | # define deflate_copyright z_deflate_copyright |
| 47 | # define get_crc_table z_get_crc_table | 49 | # define get_crc_table z_get_crc_table |
| 50 | # define gz_error z_gz_error | ||
| 51 | # define gz_strwinerror z_gz_strwinerror | ||
| 48 | # define gzbuffer z_gzbuffer | 52 | # define gzbuffer z_gzbuffer |
| 49 | # define gzclearerr z_gzclearerr | 53 | # define gzclearerr z_gzclearerr |
| 50 | # define gzclose z_gzclose | 54 | # define gzclose z_gzclose |
| @@ -58,15 +62,19 @@ | |||
| 58 | # define gzgetc z_gzgetc | 62 | # define gzgetc z_gzgetc |
| 59 | # define gzgets z_gzgets | 63 | # define gzgets z_gzgets |
| 60 | # define gzoffset z_gzoffset | 64 | # define gzoffset z_gzoffset |
| 65 | # define gzoffset64 z_gzoffset64 | ||
| 61 | # define gzopen z_gzopen | 66 | # define gzopen z_gzopen |
| 67 | # define gzopen64 z_gzopen64 | ||
| 62 | # define gzprintf z_gzprintf | 68 | # define gzprintf z_gzprintf |
| 63 | # define gzputc z_gzputc | 69 | # define gzputc z_gzputc |
| 64 | # define gzputs z_gzputs | 70 | # define gzputs z_gzputs |
| 65 | # define gzread z_gzread | 71 | # define gzread z_gzread |
| 66 | # define gzrewind z_gzrewind | 72 | # define gzrewind z_gzrewind |
| 67 | # define gzseek z_gzseek | 73 | # define gzseek z_gzseek |
| 74 | # define gzseek64 z_gzseek64 | ||
| 68 | # define gzsetparams z_gzsetparams | 75 | # define gzsetparams z_gzsetparams |
| 69 | # define gztell z_gztell | 76 | # define gztell z_gztell |
| 77 | # define gztell64 z_gztell64 | ||
| 70 | # define gzungetc z_gzungetc | 78 | # define gzungetc z_gzungetc |
| 71 | # define gzwrite z_gzwrite | 79 | # define gzwrite z_gzwrite |
| 72 | # define inflate z_inflate | 80 | # define inflate z_inflate |
| @@ -85,12 +93,12 @@ | |||
| 85 | # define inflateSetDictionary z_inflateSetDictionary | 93 | # define inflateSetDictionary z_inflateSetDictionary |
| 86 | # define inflateSync z_inflateSync | 94 | # define inflateSync z_inflateSync |
| 87 | # define inflateSyncPoint z_inflateSyncPoint | 95 | # define inflateSyncPoint z_inflateSyncPoint |
| 96 | # define inflateUndermine z_inflateUndermine | ||
| 88 | # define inflate_copyright z_inflate_copyright | 97 | # define inflate_copyright z_inflate_copyright |
| 89 | # define inflate_fast z_inflate_fast | 98 | # define inflate_fast z_inflate_fast |
| 90 | # define inflate_table z_inflate_table | 99 | # define inflate_table z_inflate_table |
| 91 | # define uncompress z_uncompress | 100 | # define uncompress z_uncompress |
| 92 | # define zError z_zError | 101 | # define zError z_zError |
| 93 | # define z_errmsg z_z_errmsg | ||
| 94 | # define zcalloc z_zcalloc | 102 | # define zcalloc z_zcalloc |
| 95 | # define zcfree z_zcfree | 103 | # define zcfree z_zcfree |
| 96 | # define zlibCompileFlags z_zlibCompileFlags | 104 | # define zlibCompileFlags z_zlibCompileFlags |
| @@ -113,18 +121,12 @@ | |||
| 113 | # define uLong z_uLong | 121 | # define uLong z_uLong |
| 114 | # define uLongf z_uLongf | 122 | # define uLongf z_uLongf |
| 115 | # define voidp z_voidp | 123 | # define voidp z_voidp |
| 116 | # define voidp z_voidp | ||
| 117 | # define voidpc z_voidpc | ||
| 118 | # define voidpc z_voidpc | 124 | # define voidpc z_voidpc |
| 119 | # define voidpf z_voidpf | 125 | # define voidpf z_voidpf |
| 120 | # define voidpf z_voidpf | ||
| 121 | # define z_stream z_z_stream | ||
| 122 | # define z_streamp z_z_streamp | ||
| 123 | 126 | ||
| 124 | /* all zlib structs in zlib.h and zconf.h */ | 127 | /* all zlib structs in zlib.h and zconf.h */ |
| 125 | # define gz_header_s z_gz_header_s | 128 | # define gz_header_s z_gz_header_s |
| 126 | # define internal_state z_internal_state | 129 | # define internal_state z_internal_state |
| 127 | # define z_stream_s z_z_stream_s | ||
| 128 | 130 | ||
| 129 | #endif | 131 | #endif |
| 130 | 132 | ||
| @@ -357,7 +359,16 @@ typedef uLong FAR uLongf; | |||
| 357 | typedef Byte *voidp; | 359 | typedef Byte *voidp; |
| 358 | #endif | 360 | #endif |
| 359 | 361 | ||
| 360 | #include "zlibdefs.h" /* created by configure */ | 362 | #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ |
| 363 | # include <sys/types.h> /* for off_t */ | ||
| 364 | # include <unistd.h> /* for SEEK_* and off_t */ | ||
| 365 | # ifdef VMS | ||
| 366 | # include <unixio.h> /* for off_t */ | ||
| 367 | # endif | ||
| 368 | # ifndef z_off_t | ||
| 369 | # define z_off_t off_t | ||
| 370 | # endif | ||
| 371 | #endif | ||
| 361 | 372 | ||
| 362 | #ifdef _LARGEFILE64_SOURCE | 373 | #ifdef _LARGEFILE64_SOURCE |
| 363 | # include <sys/types.h> | 374 | # include <sys/types.h> |
diff --git a/zconf.in.h b/zconf.in.h new file mode 100644 index 0000000..df24759 --- /dev/null +++ b/zconf.in.h | |||
| @@ -0,0 +1,411 @@ | |||
| 1 | /* zconf.h -- configuration of the zlib compression library | ||
| 2 | * Copyright (C) 1995-2010 Jean-loup Gailly. | ||
| 3 | * For conditions of distribution and use, see copyright notice in zlib.h | ||
| 4 | */ | ||
| 5 | |||
| 6 | /* @(#) $Id$ */ | ||
| 7 | |||
| 8 | #ifndef ZCONF_H | ||
| 9 | #define ZCONF_H | ||
| 10 | |||
| 11 | /* | ||
| 12 | * If you *really* need a unique prefix for all types and library functions, | ||
| 13 | * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. | ||
| 14 | * Even better than compiling with -DZ_PREFIX would be to use configure to set | ||
| 15 | * this permanently in zconf.h using "./configure --zprefix". | ||
| 16 | */ | ||
| 17 | #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ | ||
| 18 | |||
| 19 | /* all linked symbols */ | ||
| 20 | # define _dist_code z__dist_code | ||
| 21 | # define _length_code z__length_code | ||
| 22 | # define _tr_align z__tr_align | ||
| 23 | # define _tr_flush_block z__tr_flush_block | ||
| 24 | # define _tr_init z__tr_init | ||
| 25 | # define _tr_stored_block z__tr_stored_block | ||
| 26 | # define _tr_tally z__tr_tally | ||
| 27 | # define adler32 z_adler32 | ||
| 28 | # define adler32_combine z_adler32_combine | ||
| 29 | # define adler32_combine64 z_adler32_combine64 | ||
| 30 | # define compress z_compress | ||
| 31 | # define compress2 z_compress2 | ||
| 32 | # define compressBound z_compressBound | ||
| 33 | # define crc32 z_crc32 | ||
| 34 | # define crc32_combine z_crc32_combine | ||
| 35 | # define crc32_combine64 z_crc32_combine64 | ||
| 36 | # define deflate z_deflate | ||
| 37 | # define deflateBound z_deflateBound | ||
| 38 | # define deflateCopy z_deflateCopy | ||
| 39 | # define deflateEnd z_deflateEnd | ||
| 40 | # define deflateInit2_ z_deflateInit2_ | ||
| 41 | # define deflateInit_ z_deflateInit_ | ||
| 42 | # define deflateParams z_deflateParams | ||
| 43 | # define deflatePrime z_deflatePrime | ||
| 44 | # define deflateReset z_deflateReset | ||
| 45 | # define deflateSetDictionary z_deflateSetDictionary | ||
| 46 | # define deflateSetHeader z_deflateSetHeader | ||
| 47 | # define deflateTune z_deflateTune | ||
| 48 | # define deflate_copyright z_deflate_copyright | ||
| 49 | # define get_crc_table z_get_crc_table | ||
| 50 | # define gz_error z_gz_error | ||
| 51 | # define gz_strwinerror z_gz_strwinerror | ||
| 52 | # define gzbuffer z_gzbuffer | ||
| 53 | # define gzclearerr z_gzclearerr | ||
| 54 | # define gzclose z_gzclose | ||
| 55 | # define gzclose_r z_gzclose_r | ||
| 56 | # define gzclose_w z_gzclose_w | ||
| 57 | # define gzdirect z_gzdirect | ||
| 58 | # define gzdopen z_gzdopen | ||
| 59 | # define gzeof z_gzeof | ||
| 60 | # define gzerror z_gzerror | ||
| 61 | # define gzflush z_gzflush | ||
| 62 | # define gzgetc z_gzgetc | ||
| 63 | # define gzgets z_gzgets | ||
| 64 | # define gzoffset z_gzoffset | ||
| 65 | # define gzoffset64 z_gzoffset64 | ||
| 66 | # define gzopen z_gzopen | ||
| 67 | # define gzopen64 z_gzopen64 | ||
| 68 | # define gzprintf z_gzprintf | ||
| 69 | # define gzputc z_gzputc | ||
| 70 | # define gzputs z_gzputs | ||
| 71 | # define gzread z_gzread | ||
| 72 | # define gzrewind z_gzrewind | ||
| 73 | # define gzseek z_gzseek | ||
| 74 | # define gzseek64 z_gzseek64 | ||
| 75 | # define gzsetparams z_gzsetparams | ||
| 76 | # define gztell z_gztell | ||
| 77 | # define gztell64 z_gztell64 | ||
| 78 | # define gzungetc z_gzungetc | ||
| 79 | # define gzwrite z_gzwrite | ||
| 80 | # define inflate z_inflate | ||
| 81 | # define inflateBack z_inflateBack | ||
| 82 | # define inflateBackEnd z_inflateBackEnd | ||
| 83 | # define inflateBackInit_ z_inflateBackInit_ | ||
| 84 | # define inflateCopy z_inflateCopy | ||
| 85 | # define inflateEnd z_inflateEnd | ||
| 86 | # define inflateGetHeader z_inflateGetHeader | ||
| 87 | # define inflateInit2_ z_inflateInit2_ | ||
| 88 | # define inflateInit_ z_inflateInit_ | ||
| 89 | # define inflateMark z_inflateMark | ||
| 90 | # define inflatePrime z_inflatePrime | ||
| 91 | # define inflateReset z_inflateReset | ||
| 92 | # define inflateReset2 z_inflateReset2 | ||
| 93 | # define inflateSetDictionary z_inflateSetDictionary | ||
| 94 | # define inflateSync z_inflateSync | ||
| 95 | # define inflateSyncPoint z_inflateSyncPoint | ||
| 96 | # define inflateUndermine z_inflateUndermine | ||
| 97 | # define inflate_copyright z_inflate_copyright | ||
| 98 | # define inflate_fast z_inflate_fast | ||
| 99 | # define inflate_table z_inflate_table | ||
| 100 | # define uncompress z_uncompress | ||
| 101 | # define zError z_zError | ||
| 102 | # define zcalloc z_zcalloc | ||
| 103 | # define zcfree z_zcfree | ||
| 104 | # define zlibCompileFlags z_zlibCompileFlags | ||
| 105 | # define zlibVersion z_zlibVersion | ||
| 106 | |||
| 107 | /* all zlib typedefs in zlib.h and zconf.h */ | ||
| 108 | # define Byte z_Byte | ||
| 109 | # define Bytef z_Bytef | ||
| 110 | # define alloc_func z_alloc_func | ||
| 111 | # define charf z_charf | ||
| 112 | # define free_func z_free_func | ||
| 113 | # define gzFile z_gzFile | ||
| 114 | # define gz_header z_gz_header | ||
| 115 | # define gz_headerp z_gz_headerp | ||
| 116 | # define in_func z_in_func | ||
| 117 | # define intf z_intf | ||
| 118 | # define out_func z_out_func | ||
| 119 | # define uInt z_uInt | ||
| 120 | # define uIntf z_uIntf | ||
| 121 | # define uLong z_uLong | ||
| 122 | # define uLongf z_uLongf | ||
| 123 | # define voidp z_voidp | ||
| 124 | # define voidpc z_voidpc | ||
| 125 | # define voidpf z_voidpf | ||
| 126 | |||
| 127 | /* all zlib structs in zlib.h and zconf.h */ | ||
| 128 | # define gz_header_s z_gz_header_s | ||
| 129 | # define internal_state z_internal_state | ||
| 130 | |||
| 131 | #endif | ||
| 132 | |||
| 133 | #if defined(__MSDOS__) && !defined(MSDOS) | ||
| 134 | # define MSDOS | ||
| 135 | #endif | ||
| 136 | #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) | ||
| 137 | # define OS2 | ||
| 138 | #endif | ||
| 139 | #if defined(_WINDOWS) && !defined(WINDOWS) | ||
| 140 | # define WINDOWS | ||
| 141 | #endif | ||
| 142 | #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) | ||
| 143 | # ifndef WIN32 | ||
| 144 | # define WIN32 | ||
| 145 | # endif | ||
| 146 | #endif | ||
| 147 | #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) | ||
| 148 | # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) | ||
| 149 | # ifndef SYS16BIT | ||
| 150 | # define SYS16BIT | ||
| 151 | # endif | ||
| 152 | # endif | ||
| 153 | #endif | ||
| 154 | |||
| 155 | /* | ||
| 156 | * Compile with -DMAXSEG_64K if the alloc function cannot allocate more | ||
| 157 | * than 64k bytes at a time (needed on systems with 16-bit int). | ||
| 158 | */ | ||
| 159 | #ifdef SYS16BIT | ||
| 160 | # define MAXSEG_64K | ||
| 161 | #endif | ||
| 162 | #ifdef MSDOS | ||
| 163 | # define UNALIGNED_OK | ||
| 164 | #endif | ||
| 165 | |||
| 166 | #ifdef __STDC_VERSION__ | ||
| 167 | # ifndef STDC | ||
| 168 | # define STDC | ||
| 169 | # endif | ||
| 170 | # if __STDC_VERSION__ >= 199901L | ||
| 171 | # ifndef STDC99 | ||
| 172 | # define STDC99 | ||
| 173 | # endif | ||
| 174 | # endif | ||
| 175 | #endif | ||
| 176 | #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) | ||
| 177 | # define STDC | ||
| 178 | #endif | ||
| 179 | #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) | ||
| 180 | # define STDC | ||
| 181 | #endif | ||
| 182 | #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) | ||
| 183 | # define STDC | ||
| 184 | #endif | ||
| 185 | #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) | ||
| 186 | # define STDC | ||
| 187 | #endif | ||
| 188 | |||
| 189 | #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ | ||
| 190 | # define STDC | ||
| 191 | #endif | ||
| 192 | |||
| 193 | #ifndef STDC | ||
| 194 | # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ | ||
| 195 | # define const /* note: need a more gentle solution here */ | ||
| 196 | # endif | ||
| 197 | #endif | ||
| 198 | |||
| 199 | /* Some Mac compilers merge all .h files incorrectly: */ | ||
| 200 | #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) | ||
| 201 | # define NO_DUMMY_DECL | ||
| 202 | #endif | ||
| 203 | |||
| 204 | /* Maximum value for memLevel in deflateInit2 */ | ||
| 205 | #ifndef MAX_MEM_LEVEL | ||
| 206 | # ifdef MAXSEG_64K | ||
| 207 | # define MAX_MEM_LEVEL 8 | ||
| 208 | # else | ||
| 209 | # define MAX_MEM_LEVEL 9 | ||
| 210 | # endif | ||
| 211 | #endif | ||
| 212 | |||
| 213 | /* Maximum value for windowBits in deflateInit2 and inflateInit2. | ||
| 214 | * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files | ||
| 215 | * created by gzip. (Files created by minigzip can still be extracted by | ||
| 216 | * gzip.) | ||
| 217 | */ | ||
| 218 | #ifndef MAX_WBITS | ||
| 219 | # define MAX_WBITS 15 /* 32K LZ77 window */ | ||
| 220 | #endif | ||
| 221 | |||
| 222 | /* The memory requirements for deflate are (in bytes): | ||
| 223 | (1 << (windowBits+2)) + (1 << (memLevel+9)) | ||
| 224 | that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) | ||
| 225 | plus a few kilobytes for small objects. For example, if you want to reduce | ||
| 226 | the default memory requirements from 256K to 128K, compile with | ||
| 227 | make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" | ||
| 228 | Of course this will generally degrade compression (there's no free lunch). | ||
| 229 | |||
| 230 | The memory requirements for inflate are (in bytes) 1 << windowBits | ||
| 231 | that is, 32K for windowBits=15 (default value) plus a few kilobytes | ||
| 232 | for small objects. | ||
| 233 | */ | ||
| 234 | |||
| 235 | /* Type declarations */ | ||
| 236 | |||
| 237 | #ifndef OF /* function prototypes */ | ||
| 238 | # ifdef STDC | ||
| 239 | # define OF(args) args | ||
| 240 | # else | ||
| 241 | # define OF(args) () | ||
| 242 | # endif | ||
| 243 | #endif | ||
| 244 | |||
| 245 | /* The following definitions for FAR are needed only for MSDOS mixed | ||
| 246 | * model programming (small or medium model with some far allocations). | ||
| 247 | * This was tested only with MSC; for other MSDOS compilers you may have | ||
| 248 | * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, | ||
| 249 | * just define FAR to be empty. | ||
| 250 | */ | ||
| 251 | #ifdef SYS16BIT | ||
| 252 | # if defined(M_I86SM) || defined(M_I86MM) | ||
| 253 | /* MSC small or medium model */ | ||
| 254 | # define SMALL_MEDIUM | ||
| 255 | # ifdef _MSC_VER | ||
| 256 | # define FAR _far | ||
| 257 | # else | ||
| 258 | # define FAR far | ||
| 259 | # endif | ||
| 260 | # endif | ||
| 261 | # if (defined(__SMALL__) || defined(__MEDIUM__)) | ||
| 262 | /* Turbo C small or medium model */ | ||
| 263 | # define SMALL_MEDIUM | ||
| 264 | # ifdef __BORLANDC__ | ||
| 265 | # define FAR _far | ||
| 266 | # else | ||
| 267 | # define FAR far | ||
| 268 | # endif | ||
| 269 | # endif | ||
| 270 | #endif | ||
| 271 | |||
| 272 | #if defined(WINDOWS) || defined(WIN32) | ||
| 273 | /* If building or using zlib as a DLL, define ZLIB_DLL. | ||
| 274 | * This is not mandatory, but it offers a little performance increase. | ||
| 275 | */ | ||
| 276 | # ifdef ZLIB_DLL | ||
| 277 | # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) | ||
| 278 | # ifdef ZLIB_INTERNAL | ||
| 279 | # define ZEXTERN extern __declspec(dllexport) | ||
| 280 | # else | ||
| 281 | # define ZEXTERN extern __declspec(dllimport) | ||
| 282 | # endif | ||
| 283 | # endif | ||
| 284 | # endif /* ZLIB_DLL */ | ||
| 285 | /* If building or using zlib with the WINAPI/WINAPIV calling convention, | ||
| 286 | * define ZLIB_WINAPI. | ||
| 287 | * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. | ||
| 288 | */ | ||
| 289 | # ifdef ZLIB_WINAPI | ||
| 290 | # ifdef FAR | ||
| 291 | # undef FAR | ||
| 292 | # endif | ||
| 293 | # include <windows.h> | ||
| 294 | /* No need for _export, use ZLIB.DEF instead. */ | ||
| 295 | /* For complete Windows compatibility, use WINAPI, not __stdcall. */ | ||
| 296 | # define ZEXPORT WINAPI | ||
| 297 | # ifdef WIN32 | ||
| 298 | # define ZEXPORTVA WINAPIV | ||
| 299 | # else | ||
| 300 | # define ZEXPORTVA FAR CDECL | ||
| 301 | # endif | ||
| 302 | # endif | ||
| 303 | #endif | ||
| 304 | |||
| 305 | #if defined (__BEOS__) | ||
| 306 | # ifdef ZLIB_DLL | ||
| 307 | # ifdef ZLIB_INTERNAL | ||
| 308 | # define ZEXPORT __declspec(dllexport) | ||
| 309 | # define ZEXPORTVA __declspec(dllexport) | ||
| 310 | # else | ||
| 311 | # define ZEXPORT __declspec(dllimport) | ||
| 312 | # define ZEXPORTVA __declspec(dllimport) | ||
| 313 | # endif | ||
| 314 | # endif | ||
| 315 | #endif | ||
| 316 | |||
| 317 | #ifdef HAVE_VISIBILITY_PRAGMA | ||
| 318 | # define ZEXTERN __attribute__((visibility ("default"))) extern | ||
| 319 | #endif | ||
| 320 | |||
| 321 | #ifndef ZEXTERN | ||
| 322 | # define ZEXTERN extern | ||
| 323 | #endif | ||
| 324 | #ifndef ZEXPORT | ||
| 325 | # define ZEXPORT | ||
| 326 | #endif | ||
| 327 | #ifndef ZEXPORTVA | ||
| 328 | # define ZEXPORTVA | ||
| 329 | #endif | ||
| 330 | |||
| 331 | #ifndef FAR | ||
| 332 | # define FAR | ||
| 333 | #endif | ||
| 334 | |||
| 335 | #if !defined(__MACTYPES__) | ||
| 336 | typedef unsigned char Byte; /* 8 bits */ | ||
| 337 | #endif | ||
| 338 | typedef unsigned int uInt; /* 16 bits or more */ | ||
| 339 | typedef unsigned long uLong; /* 32 bits or more */ | ||
| 340 | |||
| 341 | #ifdef SMALL_MEDIUM | ||
| 342 | /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ | ||
| 343 | # define Bytef Byte FAR | ||
| 344 | #else | ||
| 345 | typedef Byte FAR Bytef; | ||
| 346 | #endif | ||
| 347 | typedef char FAR charf; | ||
| 348 | typedef int FAR intf; | ||
| 349 | typedef uInt FAR uIntf; | ||
| 350 | typedef uLong FAR uLongf; | ||
| 351 | |||
| 352 | #ifdef STDC | ||
| 353 | typedef void const *voidpc; | ||
| 354 | typedef void FAR *voidpf; | ||
| 355 | typedef void *voidp; | ||
| 356 | #else | ||
| 357 | typedef Byte const *voidpc; | ||
| 358 | typedef Byte FAR *voidpf; | ||
| 359 | typedef Byte *voidp; | ||
| 360 | #endif | ||
| 361 | |||
| 362 | #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ | ||
| 363 | # include <sys/types.h> /* for off_t */ | ||
| 364 | # include <unistd.h> /* for SEEK_* and off_t */ | ||
| 365 | # ifdef VMS | ||
| 366 | # include <unixio.h> /* for off_t */ | ||
| 367 | # endif | ||
| 368 | # ifndef z_off_t | ||
| 369 | # define z_off_t off_t | ||
| 370 | # endif | ||
| 371 | #endif | ||
| 372 | |||
| 373 | #ifdef _LARGEFILE64_SOURCE | ||
| 374 | # include <sys/types.h> | ||
| 375 | #endif | ||
| 376 | |||
| 377 | #ifndef SEEK_SET | ||
| 378 | # define SEEK_SET 0 /* Seek from beginning of file. */ | ||
| 379 | # define SEEK_CUR 1 /* Seek from current position. */ | ||
| 380 | # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ | ||
| 381 | #endif | ||
| 382 | #ifndef z_off_t | ||
| 383 | # define z_off_t long | ||
| 384 | #endif | ||
| 385 | |||
| 386 | #if defined(__OS400__) | ||
| 387 | # define NO_vsnprintf | ||
| 388 | #endif | ||
| 389 | |||
| 390 | #if defined(__MVS__) | ||
| 391 | # define NO_vsnprintf | ||
| 392 | #endif | ||
| 393 | |||
| 394 | /* MVS linker does not support external names larger than 8 bytes */ | ||
| 395 | #if defined(__MVS__) | ||
| 396 | #pragma map(deflateInit_,"DEIN") | ||
| 397 | #pragma map(deflateInit2_,"DEIN2") | ||
| 398 | #pragma map(deflateEnd,"DEEND") | ||
| 399 | #pragma map(deflateBound,"DEBND") | ||
| 400 | #pragma map(inflateInit_,"ININ") | ||
| 401 | #pragma map(inflateInit2_,"ININ2") | ||
| 402 | #pragma map(inflateEnd,"INEND") | ||
| 403 | #pragma map(inflateSync,"INSY") | ||
| 404 | #pragma map(inflateSetDictionary,"INSEDI") | ||
| 405 | #pragma map(compressBound,"CMBND") | ||
| 406 | #pragma map(inflate_table,"INTABL") | ||
| 407 | #pragma map(inflate_fast,"INFA") | ||
| 408 | #pragma map(inflate_copyright,"INCOPY") | ||
| 409 | #endif | ||
| 410 | |||
| 411 | #endif /* ZCONF_H */ | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | .TH ZLIB 3 "17 January 2010" | 1 | .TH ZLIB 3 "24 January 2010" |
| 2 | .SH NAME | 2 | .SH NAME |
| 3 | zlib \- compression/decompression library | 3 | zlib \- compression/decompression library |
| 4 | .SH SYNOPSIS | 4 | .SH SYNOPSIS |
| @@ -132,7 +132,7 @@ before asking for help. | |||
| 132 | Send questions and/or comments to zlib@gzip.org, | 132 | Send questions and/or comments to zlib@gzip.org, |
| 133 | or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). | 133 | or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). |
| 134 | .SH AUTHORS | 134 | .SH AUTHORS |
| 135 | Version 1.2.3.6 | 135 | Version 1.2.3.7 |
| 136 | Copyright (C) 1995-2010 Jean-loup Gailly (jloup@gzip.org) | 136 | Copyright (C) 1995-2010 Jean-loup Gailly (jloup@gzip.org) |
| 137 | and Mark Adler (madler@alumni.caltech.edu). | 137 | and Mark Adler (madler@alumni.caltech.edu). |
| 138 | .LP | 138 | .LP |
| @@ -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.3.6, Jan 17th, 2010 | 2 | version 1.2.3.7, Jan 24th, 2010 |
| 3 | 3 | ||
| 4 | Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler | 4 | Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler |
| 5 | 5 | ||
| @@ -37,8 +37,8 @@ | |||
| 37 | extern "C" { | 37 | extern "C" { |
| 38 | #endif | 38 | #endif |
| 39 | 39 | ||
| 40 | #define ZLIB_VERSION "1.2.3.6" | 40 | #define ZLIB_VERSION "1.2.3.7" |
| 41 | #define ZLIB_VERNUM 0x1236 | 41 | #define ZLIB_VERNUM 0x1237 |
| 42 | #define ZLIB_VER_MAJOR 1 | 42 | #define ZLIB_VER_MAJOR 1 |
| 43 | #define ZLIB_VER_MINOR 2 | 43 | #define ZLIB_VER_MINOR 2 |
| 44 | #define ZLIB_VER_REVISION 3 | 44 | #define ZLIB_VER_REVISION 3 |
| @@ -209,6 +209,7 @@ typedef gz_header FAR *gz_headerp; | |||
| 209 | #define zlib_version zlibVersion() | 209 | #define zlib_version zlibVersion() |
| 210 | /* for compatibility with versions < 1.0.2 */ | 210 | /* for compatibility with versions < 1.0.2 */ |
| 211 | 211 | ||
| 212 | |||
| 212 | /* basic functions */ | 213 | /* basic functions */ |
| 213 | 214 | ||
| 214 | ZEXTERN const char * ZEXPORT zlibVersion OF((void)); | 215 | ZEXTERN const char * ZEXPORT zlibVersion OF((void)); |
| @@ -232,8 +233,8 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); | |||
| 232 | requests a default compromise between speed and compression (currently | 233 | requests a default compromise between speed and compression (currently |
| 233 | equivalent to level 6). | 234 | equivalent to level 6). |
| 234 | 235 | ||
| 235 | deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not | 236 | deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough |
| 236 | enough memory, Z_STREAM_ERROR if level is not a valid compression level, | 237 | memory, Z_STREAM_ERROR if level is not a valid compression level, or |
| 237 | Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible | 238 | Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible |
| 238 | with the version assumed by the caller (ZLIB_VERSION). msg is set to null | 239 | with the version assumed by the caller (ZLIB_VERSION). msg is set to null |
| 239 | if there is no error message. deflateInit does not perform any compression: | 240 | if there is no error message. deflateInit does not perform any compression: |
| @@ -505,6 +506,7 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); | |||
| 505 | static string (which must not be deallocated). | 506 | static string (which must not be deallocated). |
| 506 | */ | 507 | */ |
| 507 | 508 | ||
| 509 | |||
| 508 | /* Advanced functions */ | 510 | /* Advanced functions */ |
| 509 | 511 | ||
| 510 | /* | 512 | /* |
| @@ -565,9 +567,11 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, | |||
| 565 | decoder for special applications. | 567 | decoder for special applications. |
| 566 | 568 | ||
| 567 | deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough | 569 | deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough |
| 568 | memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid | 570 | memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid |
| 569 | method). msg is set to null if there is no error message. deflateInit2 | 571 | method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is |
| 570 | does not perform any compression: this will be done by deflate(). | 572 | incompatible with the version assumed by the caller (ZLIB_VERSION). msg is |
| 573 | set to null if there is no error message. deflateInit2 does not perform any | ||
| 574 | compression: this will be done by deflate(). | ||
| 571 | */ | 575 | */ |
| 572 | 576 | ||
| 573 | ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, | 577 | ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, |
| @@ -1087,11 +1091,11 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); | |||
| 1087 | /* utility functions */ | 1091 | /* utility functions */ |
| 1088 | 1092 | ||
| 1089 | /* | 1093 | /* |
| 1090 | The following utility functions are implemented on top of the | 1094 | The following utility functions are implemented on top of the basic |
| 1091 | basic stream-oriented functions. To simplify the interface, some default | 1095 | stream-oriented functions. To simplify the interface, some default options |
| 1092 | options are assumed (compression level and memory usage, standard memory | 1096 | are assumed (compression level and memory usage, standard memory allocation |
| 1093 | allocation functions). The source code of these utility functions can | 1097 | functions). The source code of these utility functions can be modified if |
| 1094 | easily be modified if you need special options. | 1098 | you need special options. |
| 1095 | */ | 1099 | */ |
| 1096 | 1100 | ||
| 1097 | ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, | 1101 | ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, |
| @@ -1147,14 +1151,17 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, | |||
| 1147 | buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. | 1151 | buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. |
| 1148 | */ | 1152 | */ |
| 1149 | 1153 | ||
| 1154 | |||
| 1155 | /* gzip file access functions */ | ||
| 1156 | |||
| 1150 | /* | 1157 | /* |
| 1151 | This library supports reading and writing files in gzip (.gz) format | 1158 | This library supports reading and writing files in gzip (.gz) format with |
| 1152 | with an interface similar to that of stdio using the functions that start | 1159 | an interface similar to that of stdio, using the functions that start with |
| 1153 | with "gz". The gzip format is different from the zlib format. gzip is a | 1160 | "gz". The gzip format is different from the zlib format. gzip is a gzip |
| 1154 | gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. | 1161 | wrapper, documented in RFC 1952, wrapped around a deflate stream. |
| 1155 | */ | 1162 | */ |
| 1156 | 1163 | ||
| 1157 | typedef voidp gzFile; | 1164 | typedef voidp gzFile; /* opaque gzip file descriptor */ |
| 1158 | 1165 | ||
| 1159 | /* | 1166 | /* |
| 1160 | ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); | 1167 | ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); |
| @@ -1172,25 +1179,30 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); | |||
| 1172 | gzopen can be used to read a file which is not in gzip format; in this | 1179 | gzopen can be used to read a file which is not in gzip format; in this |
| 1173 | case gzread will directly read from the file without decompression. | 1180 | case gzread will directly read from the file without decompression. |
| 1174 | 1181 | ||
| 1175 | gzopen returns NULL if the file could not be opened or if there was | 1182 | gzopen returns NULL if the file could not be opened, if there was |
| 1176 | insufficient memory to allocate the (de)compression state; errno can be | 1183 | insufficient memory to allocate the gzFile state, or if an invalid mode was |
| 1177 | checked to distinguish the two cases (if errno is zero, the zlib error is | 1184 | specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). |
| 1178 | Z_MEM_ERROR). | 1185 | errno can be checked to determine if the reason gzopen failed was that the |
| 1186 | file could not be opened. | ||
| 1179 | */ | 1187 | */ |
| 1180 | 1188 | ||
| 1181 | ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); | 1189 | ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); |
| 1182 | /* | 1190 | /* |
| 1183 | gzdopen() associates a gzFile with the file descriptor fd. File | 1191 | gzdopen associates a gzFile with the file descriptor fd. File descriptors |
| 1184 | descriptors are obtained from calls like open, dup, creat, pipe or fileno | 1192 | are obtained from calls like open, dup, creat, pipe or fileno (if the file |
| 1185 | (in the file has been previously opened with fopen). The mode parameter is | 1193 | has been previously opened with fopen). The mode parameter is as in gzopen. |
| 1186 | as in gzopen. | ||
| 1187 | 1194 | ||
| 1188 | The next call of gzclose on the returned gzFile will also close the file | 1195 | The next call of gzclose on the returned gzFile will also close the file |
| 1189 | descriptor fd, just like fclose(fdopen(fd), mode) closes the file descriptor | 1196 | descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor |
| 1190 | fd. If you want to keep fd open, use gzdopen(dup(fd), mode). | 1197 | fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, |
| 1198 | mode);. The duplicated descriptor should be saved to avoid a leak, since | ||
| 1199 | gzdopen does not close fd if it fails. | ||
| 1191 | 1200 | ||
| 1192 | gzdopen returns NULL if there was insufficient memory to allocate the | 1201 | gzdopen returns NULL if there was insufficient memory to allocate the |
| 1193 | (de)compression state. | 1202 | gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not |
| 1203 | provided, or '+' was provided), or if fd is -1. The file descriptor is not | ||
| 1204 | used until the next gz* read, write, seek, or close operation, so gzdopen | ||
| 1205 | will not detect if fd is invalid (unless fd is -1). | ||
| 1194 | */ | 1206 | */ |
| 1195 | 1207 | ||
| 1196 | ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); | 1208 | ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); |
| @@ -1231,16 +1243,16 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); | |||
| 1231 | will be read if gzread is called until it returns less than the requested | 1243 | will be read if gzread is called until it returns less than the requested |
| 1232 | len. | 1244 | len. |
| 1233 | 1245 | ||
| 1234 | gzread returns the number of uncompressed bytes actually read (less than | 1246 | gzread returns the number of uncompressed bytes actually read, less than |
| 1235 | len for end of file, -1 for error). | 1247 | len for end of file, or -1 for error. |
| 1236 | */ | 1248 | */ |
| 1237 | 1249 | ||
| 1238 | ZEXTERN int ZEXPORT gzwrite OF((gzFile file, | 1250 | ZEXTERN int ZEXPORT gzwrite OF((gzFile file, |
| 1239 | voidpc buf, unsigned len)); | 1251 | voidpc buf, unsigned len)); |
| 1240 | /* | 1252 | /* |
| 1241 | Writes the given number of uncompressed bytes into the compressed file. | 1253 | Writes the given number of uncompressed bytes into the compressed file. |
| 1242 | gzwrite returns the number of uncompressed bytes actually written (0 in case | 1254 | gzwrite returns the number of uncompressed bytes written or 0 in case of |
| 1243 | of error). | 1255 | error. |
| 1244 | */ | 1256 | */ |
| 1245 | 1257 | ||
| 1246 | ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); | 1258 | ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); |
| @@ -1254,7 +1266,7 @@ ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); | |||
| 1254 | nothing written. In this case, there may also be a buffer overflow with | 1266 | nothing written. In this case, there may also be a buffer overflow with |
| 1255 | unpredictable consequences, which is possible only if zlib was compiled with | 1267 | unpredictable consequences, which is possible only if zlib was compiled with |
| 1256 | the insecure functions sprintf() or vsprintf() because the secure snprintf() | 1268 | the insecure functions sprintf() or vsprintf() because the secure snprintf() |
| 1257 | or vsnprintf() functions were not available. This can be checked for using | 1269 | or vsnprintf() functions were not available. This can be determined using |
| 1258 | zlibCompileFlags(). | 1270 | zlibCompileFlags(). |
| 1259 | */ | 1271 | */ |
| 1260 | 1272 | ||
| @@ -1273,7 +1285,7 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); | |||
| 1273 | condition is encountered. The string is then terminated with a null | 1285 | condition is encountered. The string is then terminated with a null |
| 1274 | character. | 1286 | character. |
| 1275 | 1287 | ||
| 1276 | gzgets returns buf, or Z_NULL in case of error. | 1288 | gzgets returns buf, or NULL in case of error. |
| 1277 | */ | 1289 | */ |
| 1278 | 1290 | ||
| 1279 | ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); | 1291 | ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); |
| @@ -1290,11 +1302,14 @@ ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); | |||
| 1290 | 1302 | ||
| 1291 | ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); | 1303 | ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); |
| 1292 | /* | 1304 | /* |
| 1293 | Push one character back onto the stream to be read again later. At least | 1305 | Push one character back onto the stream to be read as the first character |
| 1294 | one character of push-back is allowed. gzungetc() returns the character | 1306 | on the next read. At least one character of push-back is allowed. |
| 1295 | pushed, or -1 on failure. gzungetc() will fail if c is -1, and may fail if | 1307 | gzungetc() returns the character pushed, or -1 on failure. gzungetc() will |
| 1296 | a character has been pushed but not read yet. The pushed character will be | 1308 | fail if c is -1, and may fail if a character has been pushed but not read |
| 1297 | discarded if the stream is repositioned with gzseek() or gzrewind(). | 1309 | yet. If gzungetc is used immediately after gzopen or gzdopen, at least the |
| 1310 | output buffer size of pushed characters is allowed. (See gzbuffer above.) | ||
| 1311 | The pushed character will be discarded if the stream is repositioned with | ||
| 1312 | gzseek() or gzrewind(). | ||
| 1298 | */ | 1313 | */ |
| 1299 | 1314 | ||
| 1300 | ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); | 1315 | ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); |
| @@ -1356,43 +1371,63 @@ ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); | |||
| 1356 | Returns the current offset in the file being read or written. This offset | 1371 | Returns the current offset in the file being read or written. This offset |
| 1357 | includes the count of bytes that precede the gzip stream, for example when | 1372 | includes the count of bytes that precede the gzip stream, for example when |
| 1358 | appending or when using gzdopen() for reading. When reading, the offset | 1373 | appending or when using gzdopen() for reading. When reading, the offset |
| 1359 | includes data that has been used to generate what has been provided as | 1374 | does not include as yet unused buffered input. This information can be used |
| 1360 | uncompressed data so far, but does not include as yet unused buffered input. | 1375 | for a progress indicator. On error, gzoffset() returns -1. |
| 1361 | On error, gzoffset() returns -1. | ||
| 1362 | */ | 1376 | */ |
| 1363 | 1377 | ||
| 1364 | ZEXTERN int ZEXPORT gzeof OF((gzFile file)); | 1378 | ZEXTERN int ZEXPORT gzeof OF((gzFile file)); |
| 1365 | /* | 1379 | /* |
| 1366 | Returns 1 when EOF has previously been detected reading the given input | 1380 | Returns true (1) if the end-of-file indicator has been set while reading, |
| 1367 | stream, otherwise zero. | 1381 | false (0) otherwise. Note that the end-of-file indicator is set only if the |
| 1382 | read tried to go past the end of the input, but came up short. Therefore, | ||
| 1383 | just like feof(), gzeof() may return false even if there is no more data to | ||
| 1384 | read, in the event that the last read request was for the exact number of | ||
| 1385 | bytes remaining in the input file. This will happen if the input file size | ||
| 1386 | is an exact multiple of the buffer size. | ||
| 1387 | |||
| 1388 | If gzeof() returns true, then the read functions will return no more data, | ||
| 1389 | unless the end-of-file indicator is reset by gzclearerr() and the input file | ||
| 1390 | has grown since the previous end of file was detected. | ||
| 1368 | */ | 1391 | */ |
| 1369 | 1392 | ||
| 1370 | ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); | 1393 | ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); |
| 1371 | /* | 1394 | /* |
| 1372 | Returns 1 if file is being read directly without decompression, otherwise | 1395 | Returns true (1) if file is being copied directly while reading, or false |
| 1373 | zero. gzdirect() called immediately after gzopen() will always return zero, | 1396 | (0) if file is a gzip stream being decompressed. This state can change from |
| 1374 | since nothing has been read yet. Whether to read the file with | 1397 | false to true while reading the input file if the end of a gzip stream is |
| 1375 | decompression or not is not determined until after the first read operation | 1398 | reached, but is followed by data that is not another gzip stream. |
| 1376 | (e.g. gzread(), gzgetc(), etc.). | 1399 | |
| 1400 | If the input file is empty, gzdirect() will return true, since the input | ||
| 1401 | does not contain a gzip stream. | ||
| 1402 | |||
| 1403 | If gzdirect() is used immediately after gzopen() or gzdopen() it will | ||
| 1404 | cause buffers to be allocated to allow reading the file to determine if it | ||
| 1405 | is a gzip file. Therefore if gzbuffer() is used, it should be called before | ||
| 1406 | gzdirect(). | ||
| 1377 | */ | 1407 | */ |
| 1378 | 1408 | ||
| 1379 | ZEXTERN int ZEXPORT gzclose OF((gzFile file)); | 1409 | ZEXTERN int ZEXPORT gzclose OF((gzFile file)); |
| 1380 | /* | 1410 | /* |
| 1381 | Flushes all pending output if necessary, closes the compressed file and | 1411 | Flushes all pending output if necessary, closes the compressed file and |
| 1382 | deallocates all the (de)compression state. The return value is the zlib | 1412 | deallocates the (de)compression state. Note that once file is closed, you |
| 1383 | error number. Note that once file is closed, you cannot call gzerror with | 1413 | cannot call gzerror with file, since its structures have been deallocated. |
| 1384 | file, since its structures have been deallocated. | 1414 | gzclose must not be called more than once on the same file, just as free |
| 1415 | must not be called more than once on the same allocation. | ||
| 1416 | |||
| 1417 | gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a | ||
| 1418 | file operation error, or Z_OK on success. | ||
| 1385 | */ | 1419 | */ |
| 1386 | 1420 | ||
| 1387 | ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); | 1421 | ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); |
| 1388 | ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); | 1422 | ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); |
| 1389 | /* | 1423 | /* |
| 1390 | Same as gzclose(), but gzclose_r() is only for use when reading, and | 1424 | Same as gzclose(), but gzclose_r() is only for use when reading, and |
| 1391 | gzclose_w() is only for use when writing. The advantage to using these | 1425 | gzclose_w() is only for use when writing or appending. The advantage to |
| 1392 | instead of gzclose() is that they avoid linking in zlib compression or | 1426 | using these instead of gzclose() is that they avoid linking in zlib |
| 1393 | decompression code that is not used when only reading or only writing | 1427 | compression or decompression code that is not used when only reading or only |
| 1394 | respectively. If gzclose() is used, then both compression and decompression | 1428 | writing respectively. If gzclose() is used, then both compression and |
| 1395 | code will be included the application when linking to a static zlib library. | 1429 | decompression code will be included the application when linking to a static |
| 1430 | zlib library. | ||
| 1396 | */ | 1431 | */ |
| 1397 | 1432 | ||
| 1398 | ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); | 1433 | ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); |
| @@ -1415,6 +1450,7 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); | |||
| 1415 | file that is being written concurrently. | 1450 | file that is being written concurrently. |
| 1416 | */ | 1451 | */ |
| 1417 | 1452 | ||
| 1453 | |||
| 1418 | /* checksum functions */ | 1454 | /* checksum functions */ |
| 1419 | 1455 | ||
| 1420 | /* | 1456 | /* |
diff --git a/zlibdefs.h b/zlibdefs.h deleted file mode 100644 index e69de29..0000000 --- a/zlibdefs.h +++ /dev/null | |||
diff --git a/zlibdefs.h.cmakein b/zlibdefs.h.cmakein deleted file mode 100644 index 418bb6b..0000000 --- a/zlibdefs.h.cmakein +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | /* zlibdefs.h -- compile-time definitions for the zlib compression library | ||
| 2 | * Copyright (C) 1995-2006 Jean-loup Gailly. | ||
| 3 | * For conditions of distribution and use, see copyright notice in zlib.h | ||
| 4 | */ | ||
| 5 | |||
| 6 | #cmakedefine HAVE_UNISTD_H | ||
| 7 | #ifdef HAVE_UNISTD_H | ||
| 8 | #include <sys/types.h> /* for off_t */ | ||
| 9 | #include <unistd.h> /* for SEEK_* and off_t */ | ||
| 10 | #ifdef VMS | ||
| 11 | # include <unixio.h> /* for off_t */ | ||
| 12 | #endif | ||
| 13 | #ifndef z_off_t | ||
| 14 | # define z_off_t off_t | ||
| 15 | #endif | ||
| 16 | #endif | ||
