zlib 1.2.3.7
This commit is contained in:
parent
dc5a43ebfa
commit
7df877eccd
@ -59,14 +59,6 @@ if(NOT HAVE_ERRNO_H)
|
|||||||
add_definitions(-DNO_ERRNO_H)
|
add_definitions(-DNO_ERRNO_H)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#
|
|
||||||
# Create the zlibdefs.h file.
|
|
||||||
# Note: we create it in CMAKE_CURRENT_SOURCE_DIR instead
|
|
||||||
# of CMAKE_CURRENT_BINARY_DIR because an empty zlibdefs.h
|
|
||||||
# is shipped with zlib in the source tree.
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zlibdefs.h.cmakein
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/zlibdefs.h)
|
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(CMAKE_DEBUG_POSTFIX "d")
|
set(CMAKE_DEBUG_POSTFIX "d")
|
||||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||||
@ -80,7 +72,6 @@ endif()
|
|||||||
set(ZLIB_PUBLIC_HDRS
|
set(ZLIB_PUBLIC_HDRS
|
||||||
zconf.h
|
zconf.h
|
||||||
zlib.h
|
zlib.h
|
||||||
zlibdefs.h
|
|
||||||
)
|
)
|
||||||
set(ZLIB_PRIVATE_HDRS
|
set(ZLIB_PRIVATE_HDRS
|
||||||
crc32.h
|
crc32.h
|
||||||
|
22
ChangeLog
22
ChangeLog
@ -1,6 +1,28 @@
|
|||||||
|
|
||||||
ChangeLog file for zlib
|
ChangeLog file for zlib
|
||||||
|
|
||||||
|
Changes in 1.2.3.7 (24 Jan 2010)
|
||||||
|
- Always gzopen() with O_LARGEFILE if available
|
||||||
|
- Fix gzdirect() to work immediately after gzopen() or gzdopen()
|
||||||
|
- Make gzdirect() more precise when the state changes while reading
|
||||||
|
- Improve zlib.h documentation in many places
|
||||||
|
- Catch memory allocation failure in gz_open()
|
||||||
|
- Complete close operation if seek forward in gzclose_w() fails
|
||||||
|
- Return Z_ERRNO from gzclose_r() if close() fails
|
||||||
|
- Return Z_STREAM_ERROR instead of EOF for gzclose() being passed NULL
|
||||||
|
- Return zero for gzwrite() errors to match zlib.h description
|
||||||
|
- Return -1 on gzputs() error to match zlib.h description
|
||||||
|
- Add zconf.in.h to allow recovery from configure modification [Weigelt]
|
||||||
|
- Fix static library permissions in Makefile.in [Weigelt]
|
||||||
|
- Avoid warnings in configure tests that hide functionality [Weigelt]
|
||||||
|
- Add *BSD and DragonFly to Linux case in configure [gentoo 123571]
|
||||||
|
- Change libzdll.a to libz.dll.a in win32/Makefile.gcc [gentoo 288212]
|
||||||
|
- Avoid access of uninitialized data for first inflateReset2 call [Gomes]
|
||||||
|
- Keep object files in subdirectories to reduce the clutter somewhat
|
||||||
|
- Remove default Makefile and zlibdefs.h, add dummy Makefile
|
||||||
|
- Add new external functions to Z_PREFIX, remove duplicates, z_z_ -> z_
|
||||||
|
- Remove zlibdefs.h completely -- modify zconf.h instead
|
||||||
|
|
||||||
Changes in 1.2.3.6 (17 Jan 2010)
|
Changes in 1.2.3.6 (17 Jan 2010)
|
||||||
- Avoid void * arithmetic in gzread.c and gzwrite.c
|
- Avoid void * arithmetic in gzread.c and gzwrite.c
|
||||||
- Make compilers happier with const char * for gz_error message
|
- Make compilers happier with const char * for gz_error message
|
||||||
|
8
INDEX
8
INDEX
@ -2,12 +2,12 @@ CMakeLists.txt cmake build file
|
|||||||
ChangeLog history of changes
|
ChangeLog history of changes
|
||||||
FAQ Frequently Asked Questions about zlib
|
FAQ Frequently Asked Questions about zlib
|
||||||
INDEX this file
|
INDEX this file
|
||||||
Makefile makefile for Unix (generated by configure)
|
Makefile.in template for Unix Makefile
|
||||||
Makefile.in makefile for Unix (template for configure)
|
|
||||||
README guess what
|
README guess what
|
||||||
configure configure script for Unix
|
configure configure script for Unix
|
||||||
make_vms.com makefile for VMS
|
make_vms.com makefile for VMS
|
||||||
treebuild.xml XML description of source file dependencies
|
treebuild.xml XML description of source file dependencies
|
||||||
|
zconf.in.h zconf.h template for configure
|
||||||
zlib.3 Man page for zlib
|
zlib.3 Man page for zlib
|
||||||
zlib.map Linux symbol information
|
zlib.map Linux symbol information
|
||||||
zlib.pc.in Template for pkg-config descriptor
|
zlib.pc.in Template for pkg-config descriptor
|
||||||
@ -18,18 +18,18 @@ as400/ makefiles for IBM AS/400
|
|||||||
doc/ documentation for formats and algorithms
|
doc/ documentation for formats and algorithms
|
||||||
msdos/ makefiles for MSDOS
|
msdos/ makefiles for MSDOS
|
||||||
nintendods/ makefile for Nintendo DS
|
nintendods/ makefile for Nintendo DS
|
||||||
|
objs/ destination for object files
|
||||||
old/ makefiles for various architectures and zlib documentation
|
old/ makefiles for various architectures and zlib documentation
|
||||||
files that have not yet been updated for zlib 1.2.x
|
files that have not yet been updated for zlib 1.2.x
|
||||||
|
pics/ destination for position-independent-code object files
|
||||||
projects/ projects for various Integrated Development Environments
|
projects/ projects for various Integrated Development Environments
|
||||||
qnx/ makefiles for QNX
|
qnx/ makefiles for QNX
|
||||||
watcom/ makefiles for OpenWatcom
|
watcom/ makefiles for OpenWatcom
|
||||||
win32/ makefiles for Windows
|
win32/ makefiles for Windows
|
||||||
zlibdefs.h.cmakein input file for cmake build
|
|
||||||
|
|
||||||
zlib public header files (required for library use):
|
zlib public header files (required for library use):
|
||||||
zconf.h
|
zconf.h
|
||||||
zlib.h
|
zlib.h
|
||||||
zlibdefs.h
|
|
||||||
|
|
||||||
private source files used to build the zlib library:
|
private source files used to build the zlib library:
|
||||||
adler32.c
|
adler32.c
|
||||||
|
243
Makefile
243
Makefile
@ -1,241 +1,2 @@
|
|||||||
# Makefile for zlib
|
all:
|
||||||
# Copyright (C) 1995-2010 Jean-loup Gailly.
|
-@echo "Use ./configure first. Thank you."
|
||||||
# For conditions of distribution and use, see copyright notice in zlib.h
|
|
||||||
|
|
||||||
# To compile and test, type:
|
|
||||||
# ./configure; make test
|
|
||||||
# Normally configure builds both a static and a shared library.
|
|
||||||
# If you want to build just a static library, use: ./configure --static
|
|
||||||
|
|
||||||
# To use the asm code, type:
|
|
||||||
# cp contrib/asm?86/match.S ./match.S
|
|
||||||
# make LOC=-DASMV OBJA=match.o
|
|
||||||
|
|
||||||
# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
|
|
||||||
# make install
|
|
||||||
# To install in $HOME instead of /usr/local, use:
|
|
||||||
# make install prefix=$HOME
|
|
||||||
|
|
||||||
CC=cc
|
|
||||||
|
|
||||||
CFLAGS=-O
|
|
||||||
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
|
|
||||||
#CFLAGS=-g -DDEBUG
|
|
||||||
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
|
|
||||||
# -Wstrict-prototypes -Wmissing-prototypes
|
|
||||||
|
|
||||||
SFLAGS=-O
|
|
||||||
|
|
||||||
LDFLAGS=-L. libz.a
|
|
||||||
LDSHARED=$(CC)
|
|
||||||
CPP=$(CC) -E
|
|
||||||
|
|
||||||
STATICLIB=libz.a
|
|
||||||
SHAREDLIB=libz.so
|
|
||||||
SHAREDLIBV=libz.so.1.2.3.6
|
|
||||||
SHAREDLIBM=libz.so.1
|
|
||||||
LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV)
|
|
||||||
|
|
||||||
AR=ar rc
|
|
||||||
RANLIB=ranlib
|
|
||||||
TAR=tar
|
|
||||||
SHELL=/bin/sh
|
|
||||||
EXE=
|
|
||||||
|
|
||||||
prefix = /usr/local
|
|
||||||
exec_prefix = ${prefix}
|
|
||||||
libdir = ${exec_prefix}/lib
|
|
||||||
includedir = ${prefix}/include
|
|
||||||
mandir = ${prefix}/share/man
|
|
||||||
man3dir = ${mandir}/man3
|
|
||||||
pkgconfigdir = ${libdir}/pkgconfig
|
|
||||||
|
|
||||||
OBJC = adler32.o compress.o crc32.o deflate.o gzclose.o gzio.o gzlib.o gzread.o \
|
|
||||||
gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
|
|
||||||
|
|
||||||
PIC_OBJC = adler32.lo compress.lo crc32.lo deflate.lo gzclose.lo gzio.lo gzlib.lo gzread.lo \
|
|
||||||
gzwrite.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo
|
|
||||||
|
|
||||||
# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
|
|
||||||
OBJA =
|
|
||||||
PIC_OBJA =
|
|
||||||
|
|
||||||
OBJS = $(OBJC) $(OBJA)
|
|
||||||
|
|
||||||
PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
|
|
||||||
|
|
||||||
all: static shared
|
|
||||||
|
|
||||||
static: example$(EXE) minigzip$(EXE)
|
|
||||||
|
|
||||||
shared: examplesh$(EXE) minigzipsh$(EXE)
|
|
||||||
|
|
||||||
all64: example64$(EXE) minigzip64$(EXE)
|
|
||||||
|
|
||||||
check: test
|
|
||||||
|
|
||||||
test: all teststatic testshared
|
|
||||||
|
|
||||||
teststatic: static
|
|
||||||
@echo hello world | ./minigzip | ./minigzip -d || \
|
|
||||||
echo ' *** minigzip test FAILED ***' ; \
|
|
||||||
if ./example; then \
|
|
||||||
echo ' *** zlib test OK ***'; \
|
|
||||||
else \
|
|
||||||
echo ' *** zlib test FAILED ***'; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
testshared: shared
|
|
||||||
@LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
|
|
||||||
LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
|
|
||||||
DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
|
|
||||||
SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
|
|
||||||
echo hello world | ./minigzipsh | ./minigzipsh -d || \
|
|
||||||
echo ' *** minigzip shared test FAILED ***' ; \
|
|
||||||
if ./examplesh; then \
|
|
||||||
echo ' *** zlib shared test OK ***'; \
|
|
||||||
else \
|
|
||||||
echo ' *** zlib shared test FAILED ***'; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
test64: all64
|
|
||||||
@echo hello world | ./minigzip64 | ./minigzip64 -d || \
|
|
||||||
echo ' *** minigzip 64-bit test FAILED ***' ; \
|
|
||||||
if ./example64; then \
|
|
||||||
echo ' *** zlib 64-bit test OK ***'; \
|
|
||||||
else \
|
|
||||||
echo ' *** zlib 64-bit test FAILED ***'; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
libz.a: $(OBJS)
|
|
||||||
$(AR) $@ $(OBJS)
|
|
||||||
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
|
|
||||||
|
|
||||||
match.o: match.S
|
|
||||||
$(CPP) match.S > _match.s
|
|
||||||
$(CC) -c _match.s
|
|
||||||
mv _match.o match.o
|
|
||||||
rm -f _match.s
|
|
||||||
|
|
||||||
match.lo: match.S
|
|
||||||
$(CPP) match.S > _match.s
|
|
||||||
$(CC) -c -fPIC _match.s
|
|
||||||
mv _match.o match.lo
|
|
||||||
rm -f _match.s
|
|
||||||
|
|
||||||
example64.o: example.c zlib.h zconf.h zlibdefs.h
|
|
||||||
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ example.c
|
|
||||||
|
|
||||||
minigzip64.o: minigzip.c zlib.h zconf.h zlibdefs.h
|
|
||||||
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ minigzip.c
|
|
||||||
|
|
||||||
.SUFFIXES: .lo
|
|
||||||
|
|
||||||
.c.lo:
|
|
||||||
-@if [ ! -d objs ]; then mkdir objs; fi
|
|
||||||
$(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $<
|
|
||||||
-@mv objs/$*.o $@
|
|
||||||
|
|
||||||
$(SHAREDLIBV): $(PIC_OBJS)
|
|
||||||
$(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) -lc
|
|
||||||
rm -f $(SHAREDLIB) $(SHAREDLIBM)
|
|
||||||
ln -s $@ $(SHAREDLIB)
|
|
||||||
ln -s $@ $(SHAREDLIBM)
|
|
||||||
-@rmdir objs
|
|
||||||
|
|
||||||
example$(EXE): example.o $(STATICLIB)
|
|
||||||
$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
|
|
||||||
|
|
||||||
minigzip$(EXE): minigzip.o $(STATICLIB)
|
|
||||||
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
|
|
||||||
|
|
||||||
examplesh$(EXE): example.o $(SHAREDLIBV)
|
|
||||||
$(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
|
|
||||||
|
|
||||||
minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
|
|
||||||
$(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
|
|
||||||
|
|
||||||
example64$(EXE): example64.o $(STATICLIB)
|
|
||||||
$(CC) $(CFLAGS) -o $@ example64.o $(LDFLAGS)
|
|
||||||
|
|
||||||
minigzip64$(EXE): minigzip64.o $(STATICLIB)
|
|
||||||
$(CC) $(CFLAGS) -o $@ minigzip64.o $(LDFLAGS)
|
|
||||||
|
|
||||||
install-libs: $(LIBS)
|
|
||||||
-@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
|
|
||||||
-@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
|
|
||||||
-@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
|
|
||||||
-@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
|
|
||||||
cp $(LIBS) $(DESTDIR)$(libdir)
|
|
||||||
cd $(DESTDIR)$(libdir); chmod 755 $(LIBS)
|
|
||||||
-@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
|
|
||||||
cd $(DESTDIR)$(libdir); if test -f $(SHAREDLIBV); then \
|
|
||||||
rm -f $(SHAREDLIB) $(SHAREDLIBM); \
|
|
||||||
ln -s $(SHAREDLIBV) $(SHAREDLIB); \
|
|
||||||
ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
|
|
||||||
(ldconfig || true) >/dev/null 2>&1; \
|
|
||||||
fi
|
|
||||||
cp zlib.3 $(DESTDIR)$(man3dir)
|
|
||||||
chmod 644 $(DESTDIR)$(man3dir)/zlib.3
|
|
||||||
cp zlib.pc $(DESTDIR)$(pkgconfigdir)
|
|
||||||
chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
|
|
||||||
# The ranlib in install is needed on NeXTSTEP which checks file times
|
|
||||||
# ldconfig is for Linux
|
|
||||||
|
|
||||||
install: install-libs
|
|
||||||
-@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
|
|
||||||
cp zlib.h zconf.h zlibdefs.h $(DESTDIR)$(includedir)
|
|
||||||
chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h $(DESTDIR)$(includedir)/zlibdefs.h
|
|
||||||
|
|
||||||
uninstall:
|
|
||||||
cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h zlibdefs.h
|
|
||||||
cd $(DESTDIR)$(libdir); rm -f libz.a; \
|
|
||||||
if test -f $(SHAREDLIBV); then \
|
|
||||||
rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
|
|
||||||
fi
|
|
||||||
cd $(DESTDIR)$(man3dir); rm -f zlib.3
|
|
||||||
cd $(DESTDIR)$(pkgconfigdir); rm -f zlib.pc
|
|
||||||
|
|
||||||
mostlyclean: clean
|
|
||||||
clean:
|
|
||||||
rm -f *.o *.lo *~ \
|
|
||||||
example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
|
|
||||||
example64$(EXE) minigzip64$(EXE) \
|
|
||||||
libz.* foo.gz so_locations \
|
|
||||||
_match.s maketree contrib/infback9/*.o
|
|
||||||
rm -rf objs
|
|
||||||
|
|
||||||
maintainer-clean: distclean
|
|
||||||
distclean: clean
|
|
||||||
cp -p Makefile.in Makefile
|
|
||||||
rm zlibdefs.h
|
|
||||||
touch -r configure zlibdefs.h
|
|
||||||
rm -f zlib.pc .DS_Store
|
|
||||||
|
|
||||||
tags:
|
|
||||||
etags *.[ch]
|
|
||||||
|
|
||||||
depend:
|
|
||||||
makedepend -- $(CFLAGS) -- *.[ch]
|
|
||||||
|
|
||||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
|
||||||
|
|
||||||
adler32.o gzio.o zutil.o: zutil.h zlib.h zconf.h zlibdefs.h
|
|
||||||
gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h zlibdefs.h gzguts.h
|
|
||||||
compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h zlibdefs.h
|
|
||||||
crc32.o: zutil.h zlib.h zconf.h zlibdefs.h crc32.h
|
|
||||||
deflate.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h
|
|
||||||
infback.o inflate.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
|
|
||||||
inffast.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h
|
|
||||||
inftrees.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h
|
|
||||||
trees.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h
|
|
||||||
|
|
||||||
adler32.lo gzio.lo zutil.lo: zutil.h zlib.h zconf.h zlibdefs.h
|
|
||||||
gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h zlibdefs.h gzguts.h
|
|
||||||
compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h zlibdefs.h
|
|
||||||
crc32.lo: zutil.h zlib.h zconf.h zlibdefs.h crc32.h
|
|
||||||
deflate.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h
|
|
||||||
infback.lo inflate.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
|
|
||||||
inffast.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h
|
|
||||||
inftrees.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h
|
|
||||||
trees.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h
|
|
||||||
|
111
Makefile.in
111
Makefile.in
@ -32,7 +32,7 @@ CPP=$(CC) -E
|
|||||||
|
|
||||||
STATICLIB=libz.a
|
STATICLIB=libz.a
|
||||||
SHAREDLIB=libz.so
|
SHAREDLIB=libz.so
|
||||||
SHAREDLIBV=libz.so.1.2.3.6
|
SHAREDLIBV=libz.so.1.2.3.7
|
||||||
SHAREDLIBM=libz.so.1
|
SHAREDLIBM=libz.so.1
|
||||||
LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV)
|
LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV)
|
||||||
|
|
||||||
@ -53,16 +53,15 @@ pkgconfigdir = ${libdir}/pkgconfig
|
|||||||
OBJC = adler32.o compress.o crc32.o deflate.o gzclose.o gzio.o gzlib.o gzread.o \
|
OBJC = adler32.o compress.o crc32.o deflate.o gzclose.o gzio.o gzlib.o gzread.o \
|
||||||
gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
|
gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
|
||||||
|
|
||||||
PIC_OBJC = adler32.lo compress.lo crc32.lo deflate.lo gzclose.lo gzio.lo gzlib.lo gzread.lo \
|
# to use the asm code: make OBJA=match.o
|
||||||
gzwrite.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo
|
|
||||||
|
|
||||||
# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
|
|
||||||
OBJA =
|
OBJA =
|
||||||
PIC_OBJA =
|
|
||||||
|
|
||||||
OBJS = $(OBJC) $(OBJA)
|
objdir = objs/
|
||||||
|
picdir = pics/
|
||||||
|
|
||||||
PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
|
OBJS = $(addprefix $(objdir), $(OBJC) $(OBJA))
|
||||||
|
|
||||||
|
PIC_OBJS = $(addprefix $(picdir), $(OBJC) $(OBJA))
|
||||||
|
|
||||||
all: static shared
|
all: static shared
|
||||||
|
|
||||||
@ -84,6 +83,7 @@ teststatic: static
|
|||||||
else \
|
else \
|
||||||
echo ' *** zlib test FAILED ***'; \
|
echo ' *** zlib test FAILED ***'; \
|
||||||
fi
|
fi
|
||||||
|
-@rm -f foo.gz
|
||||||
|
|
||||||
testshared: shared
|
testshared: shared
|
||||||
@LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
|
@LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
|
||||||
@ -97,6 +97,7 @@ testshared: shared
|
|||||||
else \
|
else \
|
||||||
echo ' *** zlib shared test FAILED ***'; \
|
echo ' *** zlib shared test FAILED ***'; \
|
||||||
fi
|
fi
|
||||||
|
-@rm -f foo.gz
|
||||||
|
|
||||||
test64: all64
|
test64: all64
|
||||||
@echo hello world | ./minigzip64 | ./minigzip64 -d || \
|
@echo hello world | ./minigzip64 | ./minigzip64 -d || \
|
||||||
@ -106,60 +107,57 @@ test64: all64
|
|||||||
else \
|
else \
|
||||||
echo ' *** zlib 64-bit test FAILED ***'; \
|
echo ' *** zlib 64-bit test FAILED ***'; \
|
||||||
fi
|
fi
|
||||||
|
-@rm -f foo.gz
|
||||||
|
|
||||||
libz.a: $(OBJS)
|
libz.a: $(OBJS)
|
||||||
$(AR) $@ $(OBJS)
|
$(AR) $@ $(OBJS)
|
||||||
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
|
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
|
||||||
|
|
||||||
match.o: match.S
|
objs/match.o: match.S
|
||||||
$(CPP) match.S > _match.s
|
$(CPP) match.S > _match.s
|
||||||
$(CC) -c _match.s
|
$(CC) -c -o $@ _match.s
|
||||||
mv _match.o match.o
|
|
||||||
rm -f _match.s
|
rm -f _match.s
|
||||||
|
|
||||||
match.lo: match.S
|
pics/match.o: match.S
|
||||||
$(CPP) match.S > _match.s
|
$(CPP) match.S > _match.s
|
||||||
$(CC) -c -fPIC _match.s
|
$(CC) -c -o $@ -fPIC _match.s
|
||||||
mv _match.o match.lo
|
|
||||||
rm -f _match.s
|
rm -f _match.s
|
||||||
|
|
||||||
example64.o: example.c zlib.h zconf.h zlibdefs.h
|
objs/example64.o: example.c zlib.h zconf.h
|
||||||
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ example.c
|
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ example.c
|
||||||
|
|
||||||
minigzip64.o: minigzip.c zlib.h zconf.h zlibdefs.h
|
objs/minigzip64.o: minigzip.c zlib.h zconf.h
|
||||||
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ minigzip.c
|
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ minigzip.c
|
||||||
|
|
||||||
.SUFFIXES: .lo
|
$(objdir)%.o: %.c
|
||||||
|
$(CC) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
.c.lo:
|
$(picdir)%.o: %.c
|
||||||
-@if [ ! -d objs ]; then mkdir objs; fi
|
$(CC) $(SFLAGS) -DPIC -c -o $@ $<
|
||||||
$(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $<
|
|
||||||
-@mv objs/$*.o $@
|
|
||||||
|
|
||||||
$(SHAREDLIBV): $(PIC_OBJS)
|
$(SHAREDLIBV): $(PIC_OBJS)
|
||||||
$(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) -lc
|
$(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) -lc
|
||||||
rm -f $(SHAREDLIB) $(SHAREDLIBM)
|
rm -f $(SHAREDLIB) $(SHAREDLIBM)
|
||||||
ln -s $@ $(SHAREDLIB)
|
ln -s $@ $(SHAREDLIB)
|
||||||
ln -s $@ $(SHAREDLIBM)
|
ln -s $@ $(SHAREDLIBM)
|
||||||
-@rmdir objs
|
|
||||||
|
|
||||||
example$(EXE): example.o $(STATICLIB)
|
example$(EXE): objs/example.o $(STATICLIB)
|
||||||
$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
|
$(CC) $(CFLAGS) -o $@ objs/example.o $(LDFLAGS)
|
||||||
|
|
||||||
minigzip$(EXE): minigzip.o $(STATICLIB)
|
minigzip$(EXE): objs/minigzip.o $(STATICLIB)
|
||||||
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
|
$(CC) $(CFLAGS) -o $@ objs/minigzip.o $(LDFLAGS)
|
||||||
|
|
||||||
examplesh$(EXE): example.o $(SHAREDLIBV)
|
examplesh$(EXE): objs/example.o $(SHAREDLIBV)
|
||||||
$(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
|
$(CC) $(CFLAGS) -o $@ objs/example.o -L. $(SHAREDLIBV)
|
||||||
|
|
||||||
minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
|
minigzipsh$(EXE): objs/minigzip.o $(SHAREDLIBV)
|
||||||
$(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
|
$(CC) $(CFLAGS) -o $@ objs/minigzip.o -L. $(SHAREDLIBV)
|
||||||
|
|
||||||
example64$(EXE): example64.o $(STATICLIB)
|
example64$(EXE): objs/example64.o $(STATICLIB)
|
||||||
$(CC) $(CFLAGS) -o $@ example64.o $(LDFLAGS)
|
$(CC) $(CFLAGS) -o $@ objs/example64.o $(LDFLAGS)
|
||||||
|
|
||||||
minigzip64$(EXE): minigzip64.o $(STATICLIB)
|
minigzip64$(EXE): objs/minigzip64.o $(STATICLIB)
|
||||||
$(CC) $(CFLAGS) -o $@ minigzip64.o $(LDFLAGS)
|
$(CC) $(CFLAGS) -o $@ objs/minigzip64.o $(LDFLAGS)
|
||||||
|
|
||||||
install-libs: $(LIBS)
|
install-libs: $(LIBS)
|
||||||
-@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
|
-@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
|
||||||
@ -167,7 +165,7 @@ install-libs: $(LIBS)
|
|||||||
-@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
|
-@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
|
||||||
-@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
|
-@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
|
||||||
cp $(LIBS) $(DESTDIR)$(libdir)
|
cp $(LIBS) $(DESTDIR)$(libdir)
|
||||||
cd $(DESTDIR)$(libdir); chmod 755 $(LIBS)
|
cd $(DESTDIR)$(libdir); chmod 755 $(SHAREDLIB) ; chmod u=rw,go=r $(STATICLIB)
|
||||||
-@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
|
-@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
|
||||||
cd $(DESTDIR)$(libdir); if test -f $(SHAREDLIBV); then \
|
cd $(DESTDIR)$(libdir); if test -f $(SHAREDLIBV); then \
|
||||||
rm -f $(SHAREDLIB) $(SHAREDLIBM); \
|
rm -f $(SHAREDLIB) $(SHAREDLIBM); \
|
||||||
@ -184,11 +182,11 @@ install-libs: $(LIBS)
|
|||||||
|
|
||||||
install: install-libs
|
install: install-libs
|
||||||
-@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
|
-@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
|
||||||
cp zlib.h zconf.h zlibdefs.h $(DESTDIR)$(includedir)
|
cp zlib.h zconf.h $(DESTDIR)$(includedir)
|
||||||
chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h $(DESTDIR)$(includedir)/zlibdefs.h
|
chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h zlibdefs.h
|
cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h
|
||||||
cd $(DESTDIR)$(libdir); rm -f libz.a; \
|
cd $(DESTDIR)$(libdir); rm -f libz.a; \
|
||||||
if test -f $(SHAREDLIBV); then \
|
if test -f $(SHAREDLIBV); then \
|
||||||
rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
|
rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
|
||||||
@ -198,19 +196,18 @@ uninstall:
|
|||||||
|
|
||||||
mostlyclean: clean
|
mostlyclean: clean
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o *.lo *~ \
|
rm -f $(objdir)* $(picdir)* *~ \
|
||||||
example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
|
example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
|
||||||
example64$(EXE) minigzip64$(EXE) \
|
example64$(EXE) minigzip64$(EXE) \
|
||||||
libz.* foo.gz so_locations \
|
libz.* foo.gz so_locations \
|
||||||
_match.s maketree contrib/infback9/*.o
|
_match.s maketree contrib/infback9/*.o
|
||||||
rm -rf objs
|
|
||||||
|
|
||||||
maintainer-clean: distclean
|
maintainer-clean: distclean
|
||||||
distclean: clean
|
distclean: clean
|
||||||
cp -p Makefile.in Makefile
|
cp -p zconf.in.h zconf.h
|
||||||
rm zlibdefs.h
|
|
||||||
touch -r configure zlibdefs.h
|
|
||||||
rm -f zlib.pc .DS_Store
|
rm -f zlib.pc .DS_Store
|
||||||
|
-@printf 'all:\n\t-@echo "Use ./configure first. Thank you."\n' > Makefile
|
||||||
|
-@ touch -r Makefile.in Makefile objs pics
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
etags *.[ch]
|
etags *.[ch]
|
||||||
@ -220,22 +217,12 @@ depend:
|
|||||||
|
|
||||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||||
|
|
||||||
adler32.o gzio.o zutil.o: zutil.h zlib.h zconf.h zlibdefs.h
|
adler32.o gzio.o zutil.o: zutil.h zlib.h zconf.h
|
||||||
gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h zlibdefs.h gzguts.h
|
gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h gzguts.h
|
||||||
compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h zlibdefs.h
|
compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h
|
||||||
crc32.o: zutil.h zlib.h zconf.h zlibdefs.h crc32.h
|
crc32.o: zutil.h zlib.h zconf.h crc32.h
|
||||||
deflate.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h
|
deflate.o: deflate.h zutil.h zlib.h zconf.h
|
||||||
infback.o inflate.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
|
infback.o inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
|
||||||
inffast.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h
|
inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
|
||||||
inftrees.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h
|
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
|
||||||
trees.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h
|
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
|
||||||
|
|
||||||
adler32.lo gzio.lo zutil.lo: zutil.h zlib.h zconf.h zlibdefs.h
|
|
||||||
gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h zlibdefs.h gzguts.h
|
|
||||||
compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h zlibdefs.h
|
|
||||||
crc32.lo: zutil.h zlib.h zconf.h zlibdefs.h crc32.h
|
|
||||||
deflate.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h
|
|
||||||
infback.lo inflate.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
|
|
||||||
inffast.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h
|
|
||||||
inftrees.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h
|
|
||||||
trees.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h
|
|
||||||
|
4
README
4
README
@ -1,6 +1,6 @@
|
|||||||
ZLIB DATA COMPRESSION LIBRARY
|
ZLIB DATA COMPRESSION LIBRARY
|
||||||
|
|
||||||
zlib 1.2.3.6 is a general purpose data compression library. All the code is
|
zlib 1.2.3.7 is a general purpose data compression library. All the code is
|
||||||
thread safe. The data format used by the zlib library is described by RFCs
|
thread safe. The data format used by the zlib library is described by RFCs
|
||||||
(Request for Comments) 1950 to 1952 in the files
|
(Request for Comments) 1950 to 1952 in the files
|
||||||
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
|
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
|
|||||||
issue of Dr. Dobb's Journal; a copy of the article is available in
|
issue of Dr. Dobb's Journal; a copy of the article is available in
|
||||||
http://dogma.net/markn/articles/zlibtool/zlibtool.htm
|
http://dogma.net/markn/articles/zlibtool/zlibtool.htm
|
||||||
|
|
||||||
The changes made in version 1.2.3.6 are documented in the file ChangeLog.
|
The changes made in version 1.2.3.7 are documented in the file ChangeLog.
|
||||||
|
|
||||||
Unsupported third party contributions are provided in directory "contrib".
|
Unsupported third party contributions are provided in directory "contrib".
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
* ZLIB.INC - Interface to the general purpose compression library
|
* ZLIB.INC - Interface to the general purpose compression library
|
||||||
*
|
*
|
||||||
* ILE RPG400 version by Patrick Monnerat, DATASPHERE.
|
* ILE RPG400 version by Patrick Monnerat, DATASPHERE.
|
||||||
* Version 1.2.3.6
|
* Version 1.2.3.7
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* WARNING:
|
* WARNING:
|
||||||
@ -22,8 +22,8 @@
|
|||||||
*
|
*
|
||||||
* Versioning information.
|
* Versioning information.
|
||||||
*
|
*
|
||||||
D ZLIB_VERSION C '1.2.3.6'
|
D ZLIB_VERSION C '1.2.3.7'
|
||||||
D ZLIB_VERNUM C X'1236'
|
D ZLIB_VERNUM C X'1237'
|
||||||
*
|
*
|
||||||
* Other equates.
|
* Other equates.
|
||||||
*
|
*
|
||||||
|
28
configure
vendored
28
configure
vendored
@ -85,7 +85,7 @@ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
|
|||||||
uname=`(uname -s || echo unknown) 2>/dev/null`
|
uname=`(uname -s || echo unknown) 2>/dev/null`
|
||||||
fi
|
fi
|
||||||
case "$uname" in
|
case "$uname" in
|
||||||
Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;;
|
Linux | linux | GNU | GNU/* | *BSD | DragonFly) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;;
|
||||||
CYGWIN* | Cygwin* | cygwin* | OS/2* )
|
CYGWIN* | Cygwin* | cygwin* | OS/2* )
|
||||||
EXE='.exe' ;;
|
EXE='.exe' ;;
|
||||||
QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
|
QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
|
||||||
@ -215,14 +215,6 @@ else
|
|||||||
TEST="all teststatic testshared"
|
TEST="all teststatic testshared"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat > zlibdefs.h << EOF
|
|
||||||
/* zlibdefs.h -- compile-time definitions for the zlib compression library
|
|
||||||
* Copyright (C) 1995-2006 Jean-loup Gailly.
|
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat > $test.c <<EOF
|
cat > $test.c <<EOF
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
off64_t dummy = 0;
|
off64_t dummy = 0;
|
||||||
@ -252,21 +244,15 @@ EOF
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cp -p zconf.in.h zconf.h
|
||||||
|
|
||||||
cat > $test.c <<EOF
|
cat > $test.c <<EOF
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
int main() { return 0; }
|
int main() { return 0; }
|
||||||
EOF
|
EOF
|
||||||
if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
|
if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
|
||||||
cat >> zlibdefs.h <<EOF
|
sed < zconf.h "/#ifdef HAVE_UNISTD_H/s/def HAVE_UNISTD_H/ 1/" > zconf.temp.h
|
||||||
#include <sys/types.h> /* for off_t */
|
mv zconf.temp.h zconf.h
|
||||||
#include <unistd.h> /* for SEEK_* and off_t */
|
|
||||||
#ifdef VMS
|
|
||||||
# include <unixio.h> /* for off_t */
|
|
||||||
#endif
|
|
||||||
#ifndef z_off_t
|
|
||||||
# define z_off_t off_t
|
|
||||||
#endif
|
|
||||||
EOF
|
|
||||||
echo "Checking for unistd.h... Yes."
|
echo "Checking for unistd.h... Yes."
|
||||||
else
|
else
|
||||||
echo "Checking for unistd.h... No."
|
echo "Checking for unistd.h... No."
|
||||||
@ -300,7 +286,7 @@ if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
int mytest(char *fmt, ...)
|
int mytest(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
char buf[20];
|
char buf[20];
|
||||||
va_list ap;
|
va_list ap;
|
||||||
@ -364,7 +350,7 @@ EOF
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
int mytest(char *fmt, ...)
|
int mytest(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
char buf[20];
|
char buf[20];
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#define MAXBITS 15
|
#define MAXBITS 15
|
||||||
|
|
||||||
const char inflate9_copyright[] =
|
const char inflate9_copyright[] =
|
||||||
" inflate9 1.2.3.6 Copyright 1995-2010 Mark Adler ";
|
" inflate9 1.2.3.7 Copyright 1995-2010 Mark Adler ";
|
||||||
/*
|
/*
|
||||||
If you use the zlib library in a product, an acknowledgment is welcome
|
If you use the zlib library in a product, an acknowledgment is welcome
|
||||||
in the documentation of your product. If for some reason you cannot
|
in the documentation of your product. If for some reason you cannot
|
||||||
@ -64,7 +64,7 @@ unsigned short FAR *work;
|
|||||||
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
|
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
|
||||||
128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
|
128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
|
||||||
130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
|
130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
|
||||||
133, 133, 133, 133, 144, 199, 70};
|
133, 133, 133, 133, 144, 72, 193};
|
||||||
static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
|
static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
|
||||||
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
|
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
|
||||||
65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,
|
65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
#define IDR_VERSION1 1
|
#define IDR_VERSION1 1
|
||||||
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
|
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
|
||||||
FILEVERSION 1,2,3,6
|
FILEVERSION 1,2,3,7
|
||||||
PRODUCTVERSION 1,2,3,6
|
PRODUCTVERSION 1,2,3,7
|
||||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||||
FILEFLAGS 0
|
FILEFLAGS 0
|
||||||
FILEOS VOS_DOS_WINDOWS32
|
FILEOS VOS_DOS_WINDOWS32
|
||||||
@ -17,7 +17,7 @@ BEGIN
|
|||||||
|
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "FileDescription", "zlib data compression library\0"
|
VALUE "FileDescription", "zlib data compression library\0"
|
||||||
VALUE "FileVersion", "1.2.3.6\0"
|
VALUE "FileVersion", "1.2.3.7\0"
|
||||||
VALUE "InternalName", "zlib\0"
|
VALUE "InternalName", "zlib\0"
|
||||||
VALUE "OriginalFilename", "zlib.dll\0"
|
VALUE "OriginalFilename", "zlib.dll\0"
|
||||||
VALUE "ProductName", "ZLib.DLL\0"
|
VALUE "ProductName", "ZLib.DLL\0"
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
#include "deflate.h"
|
#include "deflate.h"
|
||||||
|
|
||||||
const char deflate_copyright[] =
|
const char deflate_copyright[] =
|
||||||
" deflate 1.2.3.6 Copyright 1995-2010 Jean-loup Gailly and Mark Adler ";
|
" deflate 1.2.3.7 Copyright 1995-2010 Jean-loup Gailly and Mark Adler ";
|
||||||
/*
|
/*
|
||||||
If you use the zlib library in a product, an acknowledgment is welcome
|
If you use the zlib library in a product, an acknowledgment is welcome
|
||||||
in the documentation of your product. If for some reason you cannot
|
in the documentation of your product. If for some reason you cannot
|
||||||
|
@ -17,7 +17,7 @@ int ZEXPORT gzclose(file)
|
|||||||
gz_statep state;
|
gz_statep state;
|
||||||
|
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
return EOF;
|
return Z_STREAM_ERROR;
|
||||||
state = (gz_statep)file;
|
state = (gz_statep)file;
|
||||||
|
|
||||||
return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
|
return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
|
||||||
|
14
gzguts.h
14
gzguts.h
@ -76,6 +76,11 @@
|
|||||||
#define GZ_WRITE 31153
|
#define GZ_WRITE 31153
|
||||||
#define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */
|
#define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */
|
||||||
|
|
||||||
|
/* values for gz_state how */
|
||||||
|
#define LOOK 0 /* look for a gzip header */
|
||||||
|
#define COPY 1 /* copy input directly */
|
||||||
|
#define GZIP 2 /* decompress a gzip stream */
|
||||||
|
|
||||||
/* internal gzip file state data structure */
|
/* internal gzip file state data structure */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* used for both reading and writing */
|
/* used for both reading and writing */
|
||||||
@ -89,17 +94,18 @@ typedef struct {
|
|||||||
unsigned char *out; /* output buffer (double-sized when reading) */
|
unsigned char *out; /* output buffer (double-sized when reading) */
|
||||||
unsigned char *next; /* next output data to deliver or write */
|
unsigned char *next; /* next output data to deliver or write */
|
||||||
/* just for reading */
|
/* just for reading */
|
||||||
int how; /* 0: get header, 1: copy, 2: decompress */
|
unsigned have; /* amount of output data unused at next */
|
||||||
unsigned have; /* amount of output data unused */
|
int eof; /* true if end of input file reached */
|
||||||
z_off64_t start; /* where the gzip data started, for rewinding */
|
z_off64_t start; /* where the gzip data started, for rewinding */
|
||||||
z_off64_t raw; /* where the raw data started, for seeking */
|
z_off64_t raw; /* where the raw data started, for seeking */
|
||||||
int eof; /* true if end of input file reached */
|
int how; /* 0: get header, 1: copy, 2: decompress */
|
||||||
|
int direct; /* true if last read direct, false if gzip */
|
||||||
/* just for writing */
|
/* just for writing */
|
||||||
int level; /* compression level */
|
int level; /* compression level */
|
||||||
int strategy; /* compression strategy */
|
int strategy; /* compression strategy */
|
||||||
/* seek request */
|
/* seek request */
|
||||||
int seek; /* true if seek request pending */
|
|
||||||
z_off64_t skip; /* amount to skip (already rewound if backwards) */
|
z_off64_t skip; /* amount to skip (already rewound if backwards) */
|
||||||
|
int seek; /* true if seek request pending */
|
||||||
/* error information */
|
/* error information */
|
||||||
int err; /* error code */
|
int err; /* error code */
|
||||||
char *msg; /* error message */
|
char *msg; /* error message */
|
||||||
|
28
gzlib.c
28
gzlib.c
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
/* Local functions */
|
/* Local functions */
|
||||||
local void gz_reset OF((gz_statep));
|
local void gz_reset OF((gz_statep));
|
||||||
local gzFile gz_open OF((const char *, int, const char *, int));
|
local gzFile gz_open OF((const char *, int, const char *));
|
||||||
|
|
||||||
#if defined UNDER_CE && defined NO_ERRNO_H
|
#if defined UNDER_CE && defined NO_ERRNO_H
|
||||||
|
|
||||||
@ -73,10 +73,11 @@ char ZEXPORT *gz_strwinerror (error)
|
|||||||
local void gz_reset(state)
|
local void gz_reset(state)
|
||||||
gz_statep state;
|
gz_statep state;
|
||||||
{
|
{
|
||||||
state->how = 0; /* look for gzip header */
|
|
||||||
if (state->mode == GZ_READ) { /* for reading ... */
|
if (state->mode == GZ_READ) { /* for reading ... */
|
||||||
state->have = 0; /* no output data available */
|
state->have = 0; /* no output data available */
|
||||||
state->eof = 0; /* not at end of file */
|
state->eof = 0; /* not at end of file */
|
||||||
|
state->how = LOOK; /* look for gzip header */
|
||||||
|
state->direct = 1; /* default for empty file */
|
||||||
}
|
}
|
||||||
state->seek = 0; /* no seek request pending */
|
state->seek = 0; /* no seek request pending */
|
||||||
gz_error(state, Z_OK, NULL); /* clear error */
|
gz_error(state, Z_OK, NULL); /* clear error */
|
||||||
@ -85,11 +86,10 @@ local void gz_reset(state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Open a gzip file either by name or file descriptor. */
|
/* Open a gzip file either by name or file descriptor. */
|
||||||
local gzFile gz_open(path, fd, mode, large)
|
local gzFile gz_open(path, fd, mode)
|
||||||
const char *path;
|
const char *path;
|
||||||
int fd;
|
int fd;
|
||||||
const char *mode;
|
const char *mode;
|
||||||
int large;
|
|
||||||
{
|
{
|
||||||
gz_statep state;
|
gz_statep state;
|
||||||
|
|
||||||
@ -152,13 +152,9 @@ local gzFile gz_open(path, fd, mode, large)
|
|||||||
/* open the file with the appropriate mode (or just use fd) */
|
/* open the file with the appropriate mode (or just use fd) */
|
||||||
state->fd = fd != -1 ? fd :
|
state->fd = fd != -1 ? fd :
|
||||||
open(path,
|
open(path,
|
||||||
(large ?
|
|
||||||
#ifdef O_LARGEFILE
|
#ifdef O_LARGEFILE
|
||||||
O_LARGEFILE
|
O_LARGEFILE |
|
||||||
#else
|
|
||||||
0
|
|
||||||
#endif
|
#endif
|
||||||
: 0) |
|
|
||||||
#ifdef O_BINARY
|
#ifdef O_BINARY
|
||||||
O_BINARY |
|
O_BINARY |
|
||||||
#endif
|
#endif
|
||||||
@ -178,6 +174,10 @@ local gzFile gz_open(path, fd, mode, large)
|
|||||||
|
|
||||||
/* save the path name for error messages */
|
/* save the path name for error messages */
|
||||||
state->path = malloc(strlen(path) + 1);
|
state->path = malloc(strlen(path) + 1);
|
||||||
|
if (state->path == NULL) {
|
||||||
|
free(state);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
strcpy(state->path, path);
|
strcpy(state->path, path);
|
||||||
|
|
||||||
/* save the current position for rewinding (only if reading) */
|
/* save the current position for rewinding (only if reading) */
|
||||||
@ -198,7 +198,7 @@ gzFile ZEXPORT gzopen(path, mode)
|
|||||||
const char *path;
|
const char *path;
|
||||||
const char *mode;
|
const char *mode;
|
||||||
{
|
{
|
||||||
return gz_open(path, -1, mode, 0);
|
return gz_open(path, -1, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -- see zlib.h -- */
|
/* -- see zlib.h -- */
|
||||||
@ -206,7 +206,7 @@ gzFile ZEXPORT gzopen64(path, mode)
|
|||||||
const char *path;
|
const char *path;
|
||||||
const char *mode;
|
const char *mode;
|
||||||
{
|
{
|
||||||
return gz_open(path, -1, mode, 1);
|
return gz_open(path, -1, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -- see zlib.h -- */
|
/* -- see zlib.h -- */
|
||||||
@ -216,14 +216,14 @@ gzFile ZEXPORT gzdopen(fd, mode)
|
|||||||
{
|
{
|
||||||
char path[46]; /* identifier for error messages */
|
char path[46]; /* identifier for error messages */
|
||||||
|
|
||||||
if (fd < 0)
|
if (fd == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
#ifdef NO_snprintf
|
#ifdef NO_snprintf
|
||||||
sprintf(path, "<fd:%d>", fd); /* big enough for 128-bit integers */
|
sprintf(path, "<fd:%d>", fd); /* big enough for 128-bit integers */
|
||||||
#else
|
#else
|
||||||
snprintf(path, sizeof(path), "<fd:%d>", fd);
|
snprintf(path, sizeof(path), "<fd:%d>", fd);
|
||||||
#endif
|
#endif
|
||||||
return gz_open(path, fd, mode, 0);
|
return gz_open(path, fd, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -- see zlib.h -- */
|
/* -- see zlib.h -- */
|
||||||
@ -303,7 +303,7 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence)
|
|||||||
offset -= state->pos;
|
offset -= state->pos;
|
||||||
|
|
||||||
/* if within raw area while reading, just go there */
|
/* if within raw area while reading, just go there */
|
||||||
if (state->mode == GZ_READ && state->how == 1 &&
|
if (state->mode == GZ_READ && state->how == COPY &&
|
||||||
state->pos + offset >= state->raw) {
|
state->pos + offset >= state->raw) {
|
||||||
ret = LSEEK(state->fd, offset, SEEK_CUR);
|
ret = LSEEK(state->fd, offset, SEEK_CUR);
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
|
64
gzread.c
64
gzread.c
@ -92,15 +92,16 @@ local int gz_next4(state, ret)
|
|||||||
|
|
||||||
/* Look for gzip header, set up for inflate or copy. state->have must be zero.
|
/* Look for gzip header, set up for inflate or copy. state->have must be zero.
|
||||||
If this is the first time in, allocate required memory. state->how will be
|
If this is the first time in, allocate required memory. state->how will be
|
||||||
left unchanged if there is no more input data available, will be set to 1 if
|
left unchanged if there is no more input data available, will be set to COPY
|
||||||
there is no gzip header and direct copying will be performed, or it will be
|
if there is no gzip header and direct copying will be performed, or it will
|
||||||
set to 2 for decompression, and the gzip header will be skipped so that the
|
be set to GZIP for decompression, and the gzip header will be skipped so
|
||||||
next available input data is the raw deflate stream. If direct copying,
|
that the next available input data is the raw deflate stream. If direct
|
||||||
then leftover input data from the input buffer will be copied to the output
|
copying, then leftover input data from the input buffer will be copied to
|
||||||
buffer. In that case, all further file reads will be directly to either the
|
the output buffer. In that case, all further file reads will be directly to
|
||||||
output buffer or a user buffer. If decompressing, the inflate state and the
|
either the output buffer or a user buffer. If decompressing, the inflate
|
||||||
check value will be initialized. gz_head() will return 0 on success or -1
|
state and the check value will be initialized. gz_head() will return 0 on
|
||||||
on failure. Failures may include read errors or gzip header errors. */
|
success or -1 on failure. Failures may include read errors or gzip header
|
||||||
|
errors. */
|
||||||
local int gz_head(state)
|
local int gz_head(state)
|
||||||
gz_statep state;
|
gz_statep state;
|
||||||
{
|
{
|
||||||
@ -196,7 +197,8 @@ local int gz_head(state)
|
|||||||
/* set up for decompression */
|
/* set up for decompression */
|
||||||
inflateReset(strm);
|
inflateReset(strm);
|
||||||
strm->adler = crc32(0L, Z_NULL, 0);
|
strm->adler = crc32(0L, Z_NULL, 0);
|
||||||
state->how = 2;
|
state->how = GZIP;
|
||||||
|
state->direct = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -216,7 +218,8 @@ local int gz_head(state)
|
|||||||
state->have += strm->avail_in;
|
state->have += strm->avail_in;
|
||||||
strm->avail_in = 0;
|
strm->avail_in = 0;
|
||||||
}
|
}
|
||||||
state->how = 1;
|
state->how = COPY;
|
||||||
|
state->direct = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,7 +227,7 @@ local int gz_head(state)
|
|||||||
If the end of the compressed data is reached, then verify the gzip trailer
|
If the end of the compressed data is reached, then verify the gzip trailer
|
||||||
check value and length (modulo 2^32). state->have and state->next are set
|
check value and length (modulo 2^32). state->have and state->next are set
|
||||||
to point to the just decompressed data, and the crc is updated. If the
|
to point to the just decompressed data, and the crc is updated. If the
|
||||||
trailer is verified, state->how is reset to zero to look for the next gzip
|
trailer is verified, state->how is reset to LOOK to look for the next gzip
|
||||||
stream or raw data, once state->have is depleted. Returns 0 on success, -1
|
stream or raw data, once state->have is depleted. Returns 0 on success, -1
|
||||||
on failure. Failures may include invalid compressed data or a failed gzip
|
on failure. Failures may include invalid compressed data or a failed gzip
|
||||||
trailer verification. */
|
trailer verification. */
|
||||||
@ -284,7 +287,8 @@ local int gz_decomp(state)
|
|||||||
gz_error(state, Z_DATA_ERROR, "incorrect length check");
|
gz_error(state, Z_DATA_ERROR, "incorrect length check");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
state->how = 0; /* ready for next stream, once have is 0 */
|
state->how = LOOK; /* ready for next stream, once have is 0 (leave
|
||||||
|
state->direct unchanged to remember how) */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* good decompression */
|
/* good decompression */
|
||||||
@ -293,28 +297,28 @@ local int gz_decomp(state)
|
|||||||
|
|
||||||
/* Make data and put in the output buffer. Assumes that state->have == 0.
|
/* Make data and put in the output buffer. Assumes that state->have == 0.
|
||||||
Data is either copied from the input file or decompressed from the input
|
Data is either copied from the input file or decompressed from the input
|
||||||
file depending on state->how. If state->how is zero, then a gzip header is
|
file depending on state->how. If state->how is LOOK, then a gzip header is
|
||||||
looked for (and skipped if found) to determine wither to copy or decompress.
|
looked for (and skipped if found) to determine wither to copy or decompress.
|
||||||
Returns -1 on error, otherwise 0. gz_make() will leave state->have non-zero
|
Returns -1 on error, otherwise 0. gz_make() will leave state->have as COPY
|
||||||
unless the end of the input file has been reached and all data has been
|
or GZIP unless the end of the input file has been reached and all data has
|
||||||
processed. */
|
been processed. */
|
||||||
local int gz_make(state)
|
local int gz_make(state)
|
||||||
gz_statep state;
|
gz_statep state;
|
||||||
{
|
{
|
||||||
z_streamp strm = &(state->strm);
|
z_streamp strm = &(state->strm);
|
||||||
|
|
||||||
if (state->how == 0) { /* look for gzip header */
|
if (state->how == LOOK) { /* look for gzip header */
|
||||||
if (gz_head(state) == -1)
|
if (gz_head(state) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
if (state->have) /* got some data from gz_head() */
|
if (state->have) /* got some data from gz_head() */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (state->how == 1) { /* straight copy */
|
if (state->how == COPY) { /* straight copy */
|
||||||
if (gz_load(state, state->out, state->size << 1, &(state->have)) == -1)
|
if (gz_load(state, state->out, state->size << 1, &(state->have)) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
state->next = state->out;
|
state->next = state->out;
|
||||||
}
|
}
|
||||||
else if (state->how == 2) { /* decompress */
|
else if (state->how == GZIP) { /* decompress */
|
||||||
strm->avail_out = state->size << 1;
|
strm->avail_out = state->size << 1;
|
||||||
strm->next_out = state->out;
|
strm->next_out = state->out;
|
||||||
if (gz_decomp(state) == -1)
|
if (gz_decomp(state) == -1)
|
||||||
@ -409,7 +413,7 @@ int ZEXPORT gzread(file, buf, len)
|
|||||||
|
|
||||||
/* need output data -- for small len or new stream load up our output
|
/* need output data -- for small len or new stream load up our output
|
||||||
buffer */
|
buffer */
|
||||||
else if (state->how == 0 || len < (state->size << 1)) {
|
else if (state->how == LOOK || len < (state->size << 1)) {
|
||||||
/* get more output, looking for header if required */
|
/* get more output, looking for header if required */
|
||||||
if (gz_make(state) == -1)
|
if (gz_make(state) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
@ -419,13 +423,13 @@ int ZEXPORT gzread(file, buf, len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* large len -- read directly into user buffer */
|
/* large len -- read directly into user buffer */
|
||||||
else if (state->how == 1) { /* read directly */
|
else if (state->how == COPY) { /* read directly */
|
||||||
if (gz_load(state, buf, len, &n) == -1)
|
if (gz_load(state, buf, len, &n) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* large len -- decompress directly into user buffer */
|
/* large len -- decompress directly into user buffer */
|
||||||
else { /* state->how == 2 */
|
else { /* state->how == GZIP */
|
||||||
strm->avail_out = len;
|
strm->avail_out = len;
|
||||||
strm->next_out = buf;
|
strm->next_out = buf;
|
||||||
if (gz_decomp(state) == -1)
|
if (gz_decomp(state) == -1)
|
||||||
@ -614,14 +618,20 @@ int ZEXPORT gzdirect(file)
|
|||||||
if (state->mode != GZ_READ)
|
if (state->mode != GZ_READ)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* return true if reading without decompression */
|
/* if the state is not known, but we can find out, then do so (this is
|
||||||
return state->how == 1;
|
mainly for right after a gzopen() or gzdopen()) */
|
||||||
|
if (state->how == LOOK && state->have == 0)
|
||||||
|
(void)gz_head(state);
|
||||||
|
|
||||||
|
/* return 1 if reading direct, 0 if decompressing a gzip stream */
|
||||||
|
return state->direct;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -- see zlib.h -- */
|
/* -- see zlib.h -- */
|
||||||
int ZEXPORT gzclose_r(file)
|
int ZEXPORT gzclose_r(file)
|
||||||
gzFile file;
|
gzFile file;
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
gz_statep state;
|
gz_statep state;
|
||||||
|
|
||||||
/* get internal structure */
|
/* get internal structure */
|
||||||
@ -640,9 +650,9 @@ int ZEXPORT gzclose_r(file)
|
|||||||
free(state->in);
|
free(state->in);
|
||||||
}
|
}
|
||||||
gz_error(state, Z_OK, NULL);
|
gz_error(state, Z_OK, NULL);
|
||||||
close(state->fd);
|
ret = close(state->fd);
|
||||||
free(state);
|
free(state);
|
||||||
return Z_OK;
|
return ret ? Z_ERRNO : Z_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !OLD_GZIO */
|
#endif /* !OLD_GZIO */
|
||||||
|
32
gzwrite.c
32
gzwrite.c
@ -152,19 +152,19 @@ int ZEXPORT gzwrite(file, buf, len)
|
|||||||
|
|
||||||
/* get internal structure */
|
/* get internal structure */
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
return -1;
|
return 0;
|
||||||
state = (gz_statep)file;
|
state = (gz_statep)file;
|
||||||
strm = &(state->strm);
|
strm = &(state->strm);
|
||||||
|
|
||||||
/* check that we're writing and that there's no error */
|
/* check that we're writing and that there's no error */
|
||||||
if (state->mode != GZ_WRITE || state->err != Z_OK)
|
if (state->mode != GZ_WRITE || state->err != Z_OK)
|
||||||
return -1;
|
return 0;
|
||||||
|
|
||||||
/* since an int is returned, make sure len fits in one, otherwise return
|
/* since an int is returned, make sure len fits in one, otherwise return
|
||||||
with an error (this avoids the flaw in the interface) */
|
with an error (this avoids the flaw in the interface) */
|
||||||
if ((int)len < 0) {
|
if ((int)len < 0) {
|
||||||
gz_error(state, Z_BUF_ERROR, "requested length does not fit in int");
|
gz_error(state, Z_BUF_ERROR, "requested length does not fit in int");
|
||||||
return -1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if len is zero, avoid unnecessary operations */
|
/* if len is zero, avoid unnecessary operations */
|
||||||
@ -173,13 +173,13 @@ int ZEXPORT gzwrite(file, buf, len)
|
|||||||
|
|
||||||
/* allocate memory if this is the first time through */
|
/* allocate memory if this is the first time through */
|
||||||
if (state->size == 0 && gz_init(state) == -1)
|
if (state->size == 0 && gz_init(state) == -1)
|
||||||
return -1;
|
return 0;
|
||||||
|
|
||||||
/* check for seek request */
|
/* check for seek request */
|
||||||
if (state->seek) {
|
if (state->seek) {
|
||||||
state->seek = 0;
|
state->seek = 0;
|
||||||
if (gz_zero(state, state->skip) == -1)
|
if (gz_zero(state, state->skip) == -1)
|
||||||
return -1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* for small len, copy to input buffer, otherwise compress directly */
|
/* for small len, copy to input buffer, otherwise compress directly */
|
||||||
@ -197,20 +197,20 @@ int ZEXPORT gzwrite(file, buf, len)
|
|||||||
buf = (char *)buf + n;
|
buf = (char *)buf + n;
|
||||||
len -= n;
|
len -= n;
|
||||||
if (len && gz_comp(state, Z_NO_FLUSH) == -1)
|
if (len && gz_comp(state, Z_NO_FLUSH) == -1)
|
||||||
return -1;
|
return 0;
|
||||||
} while (len);
|
} while (len);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* consume whatever's left in the input buffer */
|
/* consume whatever's left in the input buffer */
|
||||||
if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
|
if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
|
||||||
return -1;
|
return 0;
|
||||||
|
|
||||||
/* directly compress user buffer to file */
|
/* directly compress user buffer to file */
|
||||||
strm->avail_in = len;
|
strm->avail_in = len;
|
||||||
strm->next_in = (voidp)buf;
|
strm->next_in = (voidp)buf;
|
||||||
state->pos += len;
|
state->pos += len;
|
||||||
if (gz_comp(state, Z_NO_FLUSH) == -1)
|
if (gz_comp(state, Z_NO_FLUSH) == -1)
|
||||||
return -1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* input was all buffered or compressed (put will fit in int) */
|
/* input was all buffered or compressed (put will fit in int) */
|
||||||
@ -265,8 +265,13 @@ int ZEXPORT gzputs(file, str)
|
|||||||
gzFile file;
|
gzFile file;
|
||||||
const char *str;
|
const char *str;
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
|
unsigned len;
|
||||||
|
|
||||||
/* write string */
|
/* write string */
|
||||||
return gzwrite(file, str, strlen(str));
|
len = strlen(str);
|
||||||
|
ret = gzwrite(file, str, len);
|
||||||
|
return ret == 0 && len != 0 ? -1 : ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef STDC
|
#ifdef STDC
|
||||||
@ -494,7 +499,7 @@ int ZEXPORT gzsetparams(file, level, strategy)
|
|||||||
int ZEXPORT gzclose_w(file)
|
int ZEXPORT gzclose_w(file)
|
||||||
gzFile file;
|
gzFile file;
|
||||||
{
|
{
|
||||||
int ret;
|
int ret = 0;
|
||||||
gz_statep state;
|
gz_statep state;
|
||||||
|
|
||||||
/* get internal structure */
|
/* get internal structure */
|
||||||
@ -509,13 +514,12 @@ int ZEXPORT gzclose_w(file)
|
|||||||
/* check for seek request */
|
/* check for seek request */
|
||||||
if (state->seek) {
|
if (state->seek) {
|
||||||
state->seek = 0;
|
state->seek = 0;
|
||||||
if (gz_zero(state, state->skip) == -1)
|
ret += gz_zero(state, state->skip);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* flush, free memory, and close file */
|
/* flush, free memory, and close file */
|
||||||
ret = gz_comp(state, Z_FINISH);
|
ret += gz_comp(state, Z_FINISH);
|
||||||
deflateEnd(&(state->strm));
|
(void)deflateEnd(&(state->strm));
|
||||||
free(state->out);
|
free(state->out);
|
||||||
free(state->in);
|
free(state->in);
|
||||||
ret += close(state->fd);
|
ret += close(state->fd);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* inflate.c -- zlib decompression
|
/* inflate.c -- zlib decompression
|
||||||
* Copyright (C) 1995-2009 Mark Adler
|
* Copyright (C) 1995-2010 Mark Adler
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ int windowBits;
|
|||||||
/* set number of window bits, free window if different */
|
/* set number of window bits, free window if different */
|
||||||
if (windowBits && (windowBits < 8 || windowBits > 15))
|
if (windowBits && (windowBits < 8 || windowBits > 15))
|
||||||
return Z_STREAM_ERROR;
|
return Z_STREAM_ERROR;
|
||||||
if (state->wbits != (unsigned)windowBits && state->window != Z_NULL) {
|
if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
|
||||||
ZFREE(strm, state->window);
|
ZFREE(strm, state->window);
|
||||||
state->window = Z_NULL;
|
state->window = Z_NULL;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#define MAXBITS 15
|
#define MAXBITS 15
|
||||||
|
|
||||||
const char inflate_copyright[] =
|
const char inflate_copyright[] =
|
||||||
" inflate 1.2.3.6 Copyright 1995-2010 Mark Adler ";
|
" inflate 1.2.3.7 Copyright 1995-2010 Mark Adler ";
|
||||||
/*
|
/*
|
||||||
If you use the zlib library in a product, an acknowledgment is welcome
|
If you use the zlib library in a product, an acknowledgment is welcome
|
||||||
in the documentation of your product. If for some reason you cannot
|
in the documentation of your product. If for some reason you cannot
|
||||||
@ -62,7 +62,7 @@ unsigned short FAR *work;
|
|||||||
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
|
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
|
||||||
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
|
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
|
||||||
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
|
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
|
||||||
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 70};
|
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 193};
|
||||||
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
|
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
|
||||||
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
|
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
|
||||||
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
|
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
|
||||||
|
68
make_vms.com
68
make_vms.com
@ -137,48 +137,48 @@ $ if make.eqs.""
|
|||||||
$ then
|
$ then
|
||||||
$ dele example.obj;*,minigzip.obj;*
|
$ dele example.obj;*,minigzip.obj;*
|
||||||
$ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" -
|
$ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" -
|
||||||
adler32.c zlib.h zconf.h zlibdefs.h
|
adler32.c zlib.h zconf.h
|
||||||
$ CALL MAKE compress.OBJ "CC ''CCOPT' compress" -
|
$ CALL MAKE compress.OBJ "CC ''CCOPT' compress" -
|
||||||
compress.c zlib.h zconf.h zlibdefs.h
|
compress.c zlib.h zconf.h
|
||||||
$ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" -
|
$ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" -
|
||||||
crc32.c zlib.h zconf.h zlibdefs.h
|
crc32.c zlib.h zconf.h
|
||||||
$ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" -
|
$ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" -
|
||||||
deflate.c deflate.h zutil.h zlib.h zconf.h zlibdefs.h
|
deflate.c deflate.h zutil.h zlib.h zconf.h
|
||||||
$ CALL MAKE gzclose.OBJ "CC ''CCOPT' gzclose" -
|
$ CALL MAKE gzclose.OBJ "CC ''CCOPT' gzclose" -
|
||||||
gzclose.c zutil.h zlib.h zconf.h zlibdefs.h
|
gzclose.c zutil.h zlib.h zconf.h
|
||||||
$ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" -
|
$ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" -
|
||||||
gzio.c zutil.h zlib.h zconf.h zlibdefs.h
|
gzio.c zutil.h zlib.h zconf.h
|
||||||
$ CALL MAKE gzlib.OBJ "CC ''CCOPT' gzlib" -
|
$ CALL MAKE gzlib.OBJ "CC ''CCOPT' gzlib" -
|
||||||
gzlib.c zutil.h zlib.h zconf.h zlibdefs.h
|
gzlib.c zutil.h zlib.h zconf.h
|
||||||
$ CALL MAKE gzread.OBJ "CC ''CCOPT' gzread" -
|
$ CALL MAKE gzread.OBJ "CC ''CCOPT' gzread" -
|
||||||
gzread.c zutil.h zlib.h zconf.h zlibdefs.h
|
gzread.c zutil.h zlib.h zconf.h
|
||||||
$ CALL MAKE gzwrite.OBJ "CC ''CCOPT' gzwrite" -
|
$ CALL MAKE gzwrite.OBJ "CC ''CCOPT' gzwrite" -
|
||||||
gzwrite.c zutil.h zlib.h zconf.h zlibdefs.h
|
gzwrite.c zutil.h zlib.h zconf.h
|
||||||
$ CALL MAKE infback.OBJ "CC ''CCOPT' infback" -
|
$ CALL MAKE infback.OBJ "CC ''CCOPT' infback" -
|
||||||
infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h
|
infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h
|
||||||
$ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" -
|
$ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" -
|
||||||
inffast.c zutil.h zlib.h zconf.h zlibdefs.h inffast.h
|
inffast.c zutil.h zlib.h zconf.h inffast.h
|
||||||
$ CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" -
|
$ CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" -
|
||||||
inflate.c zutil.h zlib.h zconf.h zlibdefs.h infblock.h
|
inflate.c zutil.h zlib.h zconf.h infblock.h
|
||||||
$ CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" -
|
$ CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" -
|
||||||
inftrees.c zutil.h zlib.h zconf.h zlibdefs.h inftrees.h
|
inftrees.c zutil.h zlib.h zconf.h inftrees.h
|
||||||
$ CALL MAKE trees.OBJ "CC ''CCOPT' trees" -
|
$ CALL MAKE trees.OBJ "CC ''CCOPT' trees" -
|
||||||
trees.c deflate.h zutil.h zlib.h zconf.h zlibdefs.h
|
trees.c deflate.h zutil.h zlib.h zconf.h
|
||||||
$ CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" -
|
$ CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" -
|
||||||
uncompr.c zlib.h zconf.h zlibdefs.h
|
uncompr.c zlib.h zconf.h
|
||||||
$ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" -
|
$ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" -
|
||||||
zutil.c zutil.h zlib.h zconf.h zlibdefs.h
|
zutil.c zutil.h zlib.h zconf.h
|
||||||
$ write sys$output "Building Zlib ..."
|
$ write sys$output "Building Zlib ..."
|
||||||
$ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ
|
$ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ
|
||||||
$ write sys$output "Building example..."
|
$ write sys$output "Building example..."
|
||||||
$ CALL MAKE example.OBJ "CC ''CCOPT' example" -
|
$ CALL MAKE example.OBJ "CC ''CCOPT' example" -
|
||||||
example.c zlib.h zconf.h zlibdefs.h
|
example.c zlib.h zconf.h
|
||||||
$ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb
|
$ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb
|
||||||
$ if f$search("x11vms:xvmsutils.olb") .nes. ""
|
$ if f$search("x11vms:xvmsutils.olb") .nes. ""
|
||||||
$ then
|
$ then
|
||||||
$ write sys$output "Building minigzip..."
|
$ write sys$output "Building minigzip..."
|
||||||
$ CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" -
|
$ CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" -
|
||||||
minigzip.c zlib.h zconf.h zlibdefs.h
|
minigzip.c zlib.h zconf.h
|
||||||
$ call make minigzip.exe -
|
$ call make minigzip.exe -
|
||||||
"LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" -
|
"LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" -
|
||||||
minigzip.obj libz.olb
|
minigzip.obj libz.olb
|
||||||
@ -424,23 +424,23 @@ clean :
|
|||||||
|
|
||||||
|
|
||||||
# Other dependencies.
|
# Other dependencies.
|
||||||
adler32.obj : adler32.c zutil.h zlib.h zconf.h zlibdefs.h
|
adler32.obj : adler32.c zutil.h zlib.h zconf.h
|
||||||
compress.obj : compress.c zlib.h zconf.h zlibdefs.h
|
compress.obj : compress.c zlib.h zconf.h
|
||||||
crc32.obj : crc32.c zutil.h zlib.h zconf.h zlibdefs.h
|
crc32.obj : crc32.c zutil.h zlib.h zconf.h
|
||||||
deflate.obj : deflate.c deflate.h zutil.h zlib.h zconf.h zlibdefs.h
|
deflate.obj : deflate.c deflate.h zutil.h zlib.h zconf.h
|
||||||
example.obj : example.c zlib.h zconf.h zlibdefs.h
|
example.obj : example.c zlib.h zconf.h
|
||||||
gzclose.obj : gzclose.c zutil.h zlib.h zconf.h zlibdefs.h
|
gzclose.obj : gzclose.c zutil.h zlib.h zconf.h
|
||||||
gzio.obj : gzio.c zutil.h zlib.h zconf.h zlibdefs.h
|
gzio.obj : gzio.c zutil.h zlib.h zconf.h
|
||||||
gzlib.obj : gzlib.c zutil.h zlib.h zconf.h zlibdefs.h
|
gzlib.obj : gzlib.c zutil.h zlib.h zconf.h
|
||||||
gzread.obj : gzread.c zutil.h zlib.h zconf.h zlibdefs.h
|
gzread.obj : gzread.c zutil.h zlib.h zconf.h
|
||||||
gzwrite.obj : gzwrite.c zutil.h zlib.h zconf.h zlibdefs.h
|
gzwrite.obj : gzwrite.c zutil.h zlib.h zconf.h
|
||||||
inffast.obj : inffast.c zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inffast.h
|
inffast.obj : inffast.c zutil.h zlib.h zconf.h inftrees.h inffast.h
|
||||||
inflate.obj : inflate.c zutil.h zlib.h zconf.h zlibdefs.h
|
inflate.obj : inflate.c zutil.h zlib.h zconf.h
|
||||||
inftrees.obj : inftrees.c zutil.h zlib.h zconf.h zlibdefs.h inftrees.h
|
inftrees.obj : inftrees.c zutil.h zlib.h zconf.h inftrees.h
|
||||||
minigzip.obj : minigzip.c zlib.h zconf.h zlibdefs.h
|
minigzip.obj : minigzip.c zlib.h zconf.h
|
||||||
trees.obj : trees.c deflate.h zutil.h zlib.h zconf.h zlibdefs.h
|
trees.obj : trees.c deflate.h zutil.h zlib.h zconf.h
|
||||||
uncompr.obj : uncompr.c zlib.h zconf.h zlibdefs.h
|
uncompr.obj : uncompr.c zlib.h zconf.h
|
||||||
zutil.obj : zutil.c zutil.h zlib.h zconf.h zlibdefs.h
|
zutil.obj : zutil.c zutil.h zlib.h zconf.h
|
||||||
infback.obj : infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h
|
infback.obj : infback.c zutil.h inftrees.h inflate.h inffast.h inffixed.h
|
||||||
$ eod
|
$ eod
|
||||||
$ close out
|
$ close out
|
||||||
|
@ -25,10 +25,10 @@
|
|||||||
<QPG:Files>
|
<QPG:Files>
|
||||||
<QPG:Add file="../zconf.h" install="/opt/include/" user="root:sys" permission="644"/>
|
<QPG:Add file="../zconf.h" install="/opt/include/" user="root:sys" permission="644"/>
|
||||||
<QPG:Add file="../zlib.h" install="/opt/include/" user="root:sys" permission="644"/>
|
<QPG:Add file="../zlib.h" install="/opt/include/" user="root:sys" permission="644"/>
|
||||||
<QPG:Add file="../libz.so.1.2.3.6" install="/opt/lib/" user="root:bin" permission="644"/>
|
<QPG:Add file="../libz.so.1.2.3.7" install="/opt/lib/" user="root:bin" permission="644"/>
|
||||||
<QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.3.6"/>
|
<QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.3.7"/>
|
||||||
<QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.3.6"/>
|
<QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.3.6"/>
|
||||||
<QPG:Add file="../libz.so.1.2.3.6" install="/opt/lib/" component="slib"/>
|
<QPG:Add file="../libz.so.1.2.3.7" install="/opt/lib/" component="slib"/>
|
||||||
</QPG:Files>
|
</QPG:Files>
|
||||||
|
|
||||||
<QPG:PackageFilter>
|
<QPG:PackageFilter>
|
||||||
@ -63,7 +63,7 @@
|
|||||||
</QPM:ProductDescription>
|
</QPM:ProductDescription>
|
||||||
|
|
||||||
<QPM:ReleaseDescription>
|
<QPM:ReleaseDescription>
|
||||||
<QPM:ReleaseVersion>1.2.3.6</QPM:ReleaseVersion>
|
<QPM:ReleaseVersion>1.2.3.7</QPM:ReleaseVersion>
|
||||||
<QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
|
<QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
|
||||||
<QPM:ReleaseStability>Stable</QPM:ReleaseStability>
|
<QPM:ReleaseStability>Stable</QPM:ReleaseStability>
|
||||||
<QPM:ReleaseNoteMinor></QPM:ReleaseNoteMinor>
|
<QPM:ReleaseNoteMinor></QPM:ReleaseNoteMinor>
|
||||||
|
@ -9,70 +9,58 @@
|
|||||||
|
|
||||||
<include-file name="zlib.h" scope="public" mode="644" />
|
<include-file name="zlib.h" scope="public" mode="644" />
|
||||||
<include-file name="zconf.h" scope="public" mode="644" />
|
<include-file name="zconf.h" scope="public" mode="644" />
|
||||||
<include-file name="zlibdefs.h" scope="public" mode="644" />
|
|
||||||
|
|
||||||
<source name="adler32.c">
|
<source name="adler32.c">
|
||||||
<depend name="zlib.h" />
|
<depend name="zlib.h" />
|
||||||
<depend name="zconf.h" />
|
<depend name="zconf.h" />
|
||||||
<depend name="zlibdefs.h" />
|
|
||||||
</source>
|
</source>
|
||||||
<source name="compress.c">
|
<source name="compress.c">
|
||||||
<depend name="zlib.h" />
|
<depend name="zlib.h" />
|
||||||
<depend name="zconf.h" />
|
<depend name="zconf.h" />
|
||||||
<depend name="zlibdefs.h" />
|
|
||||||
</source>
|
</source>
|
||||||
<source name="crc32.c">
|
<source name="crc32.c">
|
||||||
<depend name="zlib.h" />
|
<depend name="zlib.h" />
|
||||||
<depend name="zconf.h" />
|
<depend name="zconf.h" />
|
||||||
<depend name="zlibdefs.h" />
|
|
||||||
<depend name="crc32.h" />
|
<depend name="crc32.h" />
|
||||||
</source>
|
</source>
|
||||||
<source name="gzclose.c">
|
<source name="gzclose.c">
|
||||||
<depend name="zlib.h" />
|
<depend name="zlib.h" />
|
||||||
<depend name="zconf.h" />
|
<depend name="zconf.h" />
|
||||||
<depend name="zlibdefs.h" />
|
|
||||||
<depend name="gzguts.h" />
|
<depend name="gzguts.h" />
|
||||||
</source>
|
</source>
|
||||||
<source name="gzio.c">
|
<source name="gzio.c">
|
||||||
<depend name="zlib.h" />
|
<depend name="zlib.h" />
|
||||||
<depend name="zconf.h" />
|
<depend name="zconf.h" />
|
||||||
<depend name="zlibdefs.h" />
|
|
||||||
<depend name="zutil.h" />
|
<depend name="zutil.h" />
|
||||||
</source>
|
</source>
|
||||||
<source name="gzlib.c">
|
<source name="gzlib.c">
|
||||||
<depend name="zlib.h" />
|
<depend name="zlib.h" />
|
||||||
<depend name="zconf.h" />
|
<depend name="zconf.h" />
|
||||||
<depend name="zlibdefs.h" />
|
|
||||||
<depend name="gzguts.h" />
|
<depend name="gzguts.h" />
|
||||||
</source>
|
</source>
|
||||||
<source name="gzread.c">
|
<source name="gzread.c">
|
||||||
<depend name="zlib.h" />
|
<depend name="zlib.h" />
|
||||||
<depend name="zconf.h" />
|
<depend name="zconf.h" />
|
||||||
<depend name="zlibdefs.h" />
|
|
||||||
<depend name="gzguts.h" />
|
<depend name="gzguts.h" />
|
||||||
</source>
|
</source>
|
||||||
<source name="gzwrite.c">
|
<source name="gzwrite.c">
|
||||||
<depend name="zlib.h" />
|
<depend name="zlib.h" />
|
||||||
<depend name="zconf.h" />
|
<depend name="zconf.h" />
|
||||||
<depend name="zlibdefs.h" />
|
|
||||||
<depend name="gzguts.h" />
|
<depend name="gzguts.h" />
|
||||||
</source>
|
</source>
|
||||||
<source name="uncompr.c">
|
<source name="uncompr.c">
|
||||||
<depend name="zlib.h" />
|
<depend name="zlib.h" />
|
||||||
<depend name="zconf.h" />
|
<depend name="zconf.h" />
|
||||||
<depend name="zlibdefs.h" />
|
|
||||||
</source>
|
</source>
|
||||||
<source name="deflate.c">
|
<source name="deflate.c">
|
||||||
<depend name="zlib.h" />
|
<depend name="zlib.h" />
|
||||||
<depend name="zconf.h" />
|
<depend name="zconf.h" />
|
||||||
<depend name="zlibdefs.h" />
|
|
||||||
<depend name="zutil.h" />
|
<depend name="zutil.h" />
|
||||||
<depend name="deflate.h" />
|
<depend name="deflate.h" />
|
||||||
</source>
|
</source>
|
||||||
<source name="trees.c">
|
<source name="trees.c">
|
||||||
<depend name="zlib.h" />
|
<depend name="zlib.h" />
|
||||||
<depend name="zconf.h" />
|
<depend name="zconf.h" />
|
||||||
<depend name="zlibdefs.h" />
|
|
||||||
<depend name="zutil.h" />
|
<depend name="zutil.h" />
|
||||||
<depend name="deflate.h" />
|
<depend name="deflate.h" />
|
||||||
<depend name="trees.h" />
|
<depend name="trees.h" />
|
||||||
@ -80,13 +68,11 @@
|
|||||||
<source name="zutil.c">
|
<source name="zutil.c">
|
||||||
<depend name="zlib.h" />
|
<depend name="zlib.h" />
|
||||||
<depend name="zconf.h" />
|
<depend name="zconf.h" />
|
||||||
<depend name="zlibdefs.h" />
|
|
||||||
<depend name="zutil.h" />
|
<depend name="zutil.h" />
|
||||||
</source>
|
</source>
|
||||||
<source name="inflate.c">
|
<source name="inflate.c">
|
||||||
<depend name="zlib.h" />
|
<depend name="zlib.h" />
|
||||||
<depend name="zconf.h" />
|
<depend name="zconf.h" />
|
||||||
<depend name="zlibdefs.h" />
|
|
||||||
<depend name="zutil.h" />
|
<depend name="zutil.h" />
|
||||||
<depend name="inftrees.h" />
|
<depend name="inftrees.h" />
|
||||||
<depend name="inflate.h" />
|
<depend name="inflate.h" />
|
||||||
@ -95,7 +81,6 @@
|
|||||||
<source name="infback.c">
|
<source name="infback.c">
|
||||||
<depend name="zlib.h" />
|
<depend name="zlib.h" />
|
||||||
<depend name="zconf.h" />
|
<depend name="zconf.h" />
|
||||||
<depend name="zlibdefs.h" />
|
|
||||||
<depend name="zutil.h" />
|
<depend name="zutil.h" />
|
||||||
<depend name="inftrees.h" />
|
<depend name="inftrees.h" />
|
||||||
<depend name="inflate.h" />
|
<depend name="inflate.h" />
|
||||||
@ -104,14 +89,12 @@
|
|||||||
<source name="inftrees.c">
|
<source name="inftrees.c">
|
||||||
<depend name="zlib.h" />
|
<depend name="zlib.h" />
|
||||||
<depend name="zconf.h" />
|
<depend name="zconf.h" />
|
||||||
<depend name="zlibdefs.h" />
|
|
||||||
<depend name="zutil.h" />
|
<depend name="zutil.h" />
|
||||||
<depend name="inftrees.h" />
|
<depend name="inftrees.h" />
|
||||||
</source>
|
</source>
|
||||||
<source name="inffast.c">
|
<source name="inffast.c">
|
||||||
<depend name="zlib.h" />
|
<depend name="zlib.h" />
|
||||||
<depend name="zconf.h" />
|
<depend name="zconf.h" />
|
||||||
<depend name="zlibdefs.h" />
|
|
||||||
<depend name="zutil.h" />
|
<depend name="zutil.h" />
|
||||||
<depend name="inftrees.h" />
|
<depend name="inftrees.h" />
|
||||||
<depend name="inflate.h" />
|
<depend name="inflate.h" />
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
STATICLIB = libz.a
|
STATICLIB = libz.a
|
||||||
SHAREDLIB = zlib1.dll
|
SHAREDLIB = zlib1.dll
|
||||||
IMPLIB = libzdll.a
|
IMPLIB = libz.dll.a
|
||||||
|
|
||||||
#LOC = -DASMV
|
#LOC = -DASMV
|
||||||
#LOC = -DDEBUG -g
|
#LOC = -DDEBUG -g
|
||||||
|
29
zconf.h
29
zconf.h
@ -1,5 +1,5 @@
|
|||||||
/* zconf.h -- configuration of the zlib compression library
|
/* zconf.h -- configuration of the zlib compression library
|
||||||
* Copyright (C) 1995-2007 Jean-loup Gailly.
|
* Copyright (C) 1995-2010 Jean-loup Gailly.
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -26,11 +26,13 @@
|
|||||||
# define _tr_tally z__tr_tally
|
# define _tr_tally z__tr_tally
|
||||||
# define adler32 z_adler32
|
# define adler32 z_adler32
|
||||||
# define adler32_combine z_adler32_combine
|
# define adler32_combine z_adler32_combine
|
||||||
|
# define adler32_combine64 z_adler32_combine64
|
||||||
# define compress z_compress
|
# define compress z_compress
|
||||||
# define compress2 z_compress2
|
# define compress2 z_compress2
|
||||||
# define compressBound z_compressBound
|
# define compressBound z_compressBound
|
||||||
# define crc32 z_crc32
|
# define crc32 z_crc32
|
||||||
# define crc32_combine z_crc32_combine
|
# define crc32_combine z_crc32_combine
|
||||||
|
# define crc32_combine64 z_crc32_combine64
|
||||||
# define deflate z_deflate
|
# define deflate z_deflate
|
||||||
# define deflateBound z_deflateBound
|
# define deflateBound z_deflateBound
|
||||||
# define deflateCopy z_deflateCopy
|
# define deflateCopy z_deflateCopy
|
||||||
@ -45,6 +47,8 @@
|
|||||||
# define deflateTune z_deflateTune
|
# define deflateTune z_deflateTune
|
||||||
# define deflate_copyright z_deflate_copyright
|
# define deflate_copyright z_deflate_copyright
|
||||||
# define get_crc_table z_get_crc_table
|
# define get_crc_table z_get_crc_table
|
||||||
|
# define gz_error z_gz_error
|
||||||
|
# define gz_strwinerror z_gz_strwinerror
|
||||||
# define gzbuffer z_gzbuffer
|
# define gzbuffer z_gzbuffer
|
||||||
# define gzclearerr z_gzclearerr
|
# define gzclearerr z_gzclearerr
|
||||||
# define gzclose z_gzclose
|
# define gzclose z_gzclose
|
||||||
@ -58,15 +62,19 @@
|
|||||||
# define gzgetc z_gzgetc
|
# define gzgetc z_gzgetc
|
||||||
# define gzgets z_gzgets
|
# define gzgets z_gzgets
|
||||||
# define gzoffset z_gzoffset
|
# define gzoffset z_gzoffset
|
||||||
|
# define gzoffset64 z_gzoffset64
|
||||||
# define gzopen z_gzopen
|
# define gzopen z_gzopen
|
||||||
|
# define gzopen64 z_gzopen64
|
||||||
# define gzprintf z_gzprintf
|
# define gzprintf z_gzprintf
|
||||||
# define gzputc z_gzputc
|
# define gzputc z_gzputc
|
||||||
# define gzputs z_gzputs
|
# define gzputs z_gzputs
|
||||||
# define gzread z_gzread
|
# define gzread z_gzread
|
||||||
# define gzrewind z_gzrewind
|
# define gzrewind z_gzrewind
|
||||||
# define gzseek z_gzseek
|
# define gzseek z_gzseek
|
||||||
|
# define gzseek64 z_gzseek64
|
||||||
# define gzsetparams z_gzsetparams
|
# define gzsetparams z_gzsetparams
|
||||||
# define gztell z_gztell
|
# define gztell z_gztell
|
||||||
|
# define gztell64 z_gztell64
|
||||||
# define gzungetc z_gzungetc
|
# define gzungetc z_gzungetc
|
||||||
# define gzwrite z_gzwrite
|
# define gzwrite z_gzwrite
|
||||||
# define inflate z_inflate
|
# define inflate z_inflate
|
||||||
@ -85,12 +93,12 @@
|
|||||||
# define inflateSetDictionary z_inflateSetDictionary
|
# define inflateSetDictionary z_inflateSetDictionary
|
||||||
# define inflateSync z_inflateSync
|
# define inflateSync z_inflateSync
|
||||||
# define inflateSyncPoint z_inflateSyncPoint
|
# define inflateSyncPoint z_inflateSyncPoint
|
||||||
|
# define inflateUndermine z_inflateUndermine
|
||||||
# define inflate_copyright z_inflate_copyright
|
# define inflate_copyright z_inflate_copyright
|
||||||
# define inflate_fast z_inflate_fast
|
# define inflate_fast z_inflate_fast
|
||||||
# define inflate_table z_inflate_table
|
# define inflate_table z_inflate_table
|
||||||
# define uncompress z_uncompress
|
# define uncompress z_uncompress
|
||||||
# define zError z_zError
|
# define zError z_zError
|
||||||
# define z_errmsg z_z_errmsg
|
|
||||||
# define zcalloc z_zcalloc
|
# define zcalloc z_zcalloc
|
||||||
# define zcfree z_zcfree
|
# define zcfree z_zcfree
|
||||||
# define zlibCompileFlags z_zlibCompileFlags
|
# define zlibCompileFlags z_zlibCompileFlags
|
||||||
@ -113,18 +121,12 @@
|
|||||||
# define uLong z_uLong
|
# define uLong z_uLong
|
||||||
# define uLongf z_uLongf
|
# define uLongf z_uLongf
|
||||||
# define voidp z_voidp
|
# define voidp z_voidp
|
||||||
# define voidp z_voidp
|
|
||||||
# define voidpc z_voidpc
|
|
||||||
# define voidpc z_voidpc
|
# define voidpc z_voidpc
|
||||||
# define voidpf z_voidpf
|
# define voidpf z_voidpf
|
||||||
# define voidpf z_voidpf
|
|
||||||
# define z_stream z_z_stream
|
|
||||||
# define z_streamp z_z_streamp
|
|
||||||
|
|
||||||
/* all zlib structs in zlib.h and zconf.h */
|
/* all zlib structs in zlib.h and zconf.h */
|
||||||
# define gz_header_s z_gz_header_s
|
# define gz_header_s z_gz_header_s
|
||||||
# define internal_state z_internal_state
|
# define internal_state z_internal_state
|
||||||
# define z_stream_s z_z_stream_s
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -357,7 +359,16 @@ typedef uLong FAR uLongf;
|
|||||||
typedef Byte *voidp;
|
typedef Byte *voidp;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "zlibdefs.h" /* created by configure */
|
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
|
||||||
|
# include <sys/types.h> /* for off_t */
|
||||||
|
# include <unistd.h> /* for SEEK_* and off_t */
|
||||||
|
# ifdef VMS
|
||||||
|
# include <unixio.h> /* for off_t */
|
||||||
|
# endif
|
||||||
|
# ifndef z_off_t
|
||||||
|
# define z_off_t off_t
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _LARGEFILE64_SOURCE
|
#ifdef _LARGEFILE64_SOURCE
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
|
411
zconf.in.h
Normal file
411
zconf.in.h
Normal file
@ -0,0 +1,411 @@
|
|||||||
|
/* zconf.h -- configuration of the zlib compression library
|
||||||
|
* Copyright (C) 1995-2010 Jean-loup Gailly.
|
||||||
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* @(#) $Id$ */
|
||||||
|
|
||||||
|
#ifndef ZCONF_H
|
||||||
|
#define ZCONF_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If you *really* need a unique prefix for all types and library functions,
|
||||||
|
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
|
||||||
|
* Even better than compiling with -DZ_PREFIX would be to use configure to set
|
||||||
|
* this permanently in zconf.h using "./configure --zprefix".
|
||||||
|
*/
|
||||||
|
#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
|
||||||
|
|
||||||
|
/* all linked symbols */
|
||||||
|
# define _dist_code z__dist_code
|
||||||
|
# define _length_code z__length_code
|
||||||
|
# define _tr_align z__tr_align
|
||||||
|
# define _tr_flush_block z__tr_flush_block
|
||||||
|
# define _tr_init z__tr_init
|
||||||
|
# define _tr_stored_block z__tr_stored_block
|
||||||
|
# define _tr_tally z__tr_tally
|
||||||
|
# define adler32 z_adler32
|
||||||
|
# define adler32_combine z_adler32_combine
|
||||||
|
# define adler32_combine64 z_adler32_combine64
|
||||||
|
# define compress z_compress
|
||||||
|
# define compress2 z_compress2
|
||||||
|
# define compressBound z_compressBound
|
||||||
|
# define crc32 z_crc32
|
||||||
|
# define crc32_combine z_crc32_combine
|
||||||
|
# define crc32_combine64 z_crc32_combine64
|
||||||
|
# define deflate z_deflate
|
||||||
|
# define deflateBound z_deflateBound
|
||||||
|
# define deflateCopy z_deflateCopy
|
||||||
|
# define deflateEnd z_deflateEnd
|
||||||
|
# define deflateInit2_ z_deflateInit2_
|
||||||
|
# define deflateInit_ z_deflateInit_
|
||||||
|
# define deflateParams z_deflateParams
|
||||||
|
# define deflatePrime z_deflatePrime
|
||||||
|
# define deflateReset z_deflateReset
|
||||||
|
# define deflateSetDictionary z_deflateSetDictionary
|
||||||
|
# define deflateSetHeader z_deflateSetHeader
|
||||||
|
# define deflateTune z_deflateTune
|
||||||
|
# define deflate_copyright z_deflate_copyright
|
||||||
|
# define get_crc_table z_get_crc_table
|
||||||
|
# define gz_error z_gz_error
|
||||||
|
# define gz_strwinerror z_gz_strwinerror
|
||||||
|
# define gzbuffer z_gzbuffer
|
||||||
|
# define gzclearerr z_gzclearerr
|
||||||
|
# define gzclose z_gzclose
|
||||||
|
# define gzclose_r z_gzclose_r
|
||||||
|
# define gzclose_w z_gzclose_w
|
||||||
|
# define gzdirect z_gzdirect
|
||||||
|
# define gzdopen z_gzdopen
|
||||||
|
# define gzeof z_gzeof
|
||||||
|
# define gzerror z_gzerror
|
||||||
|
# define gzflush z_gzflush
|
||||||
|
# define gzgetc z_gzgetc
|
||||||
|
# define gzgets z_gzgets
|
||||||
|
# define gzoffset z_gzoffset
|
||||||
|
# define gzoffset64 z_gzoffset64
|
||||||
|
# define gzopen z_gzopen
|
||||||
|
# define gzopen64 z_gzopen64
|
||||||
|
# define gzprintf z_gzprintf
|
||||||
|
# define gzputc z_gzputc
|
||||||
|
# define gzputs z_gzputs
|
||||||
|
# define gzread z_gzread
|
||||||
|
# define gzrewind z_gzrewind
|
||||||
|
# define gzseek z_gzseek
|
||||||
|
# define gzseek64 z_gzseek64
|
||||||
|
# define gzsetparams z_gzsetparams
|
||||||
|
# define gztell z_gztell
|
||||||
|
# define gztell64 z_gztell64
|
||||||
|
# define gzungetc z_gzungetc
|
||||||
|
# define gzwrite z_gzwrite
|
||||||
|
# define inflate z_inflate
|
||||||
|
# define inflateBack z_inflateBack
|
||||||
|
# define inflateBackEnd z_inflateBackEnd
|
||||||
|
# define inflateBackInit_ z_inflateBackInit_
|
||||||
|
# define inflateCopy z_inflateCopy
|
||||||
|
# define inflateEnd z_inflateEnd
|
||||||
|
# define inflateGetHeader z_inflateGetHeader
|
||||||
|
# define inflateInit2_ z_inflateInit2_
|
||||||
|
# define inflateInit_ z_inflateInit_
|
||||||
|
# define inflateMark z_inflateMark
|
||||||
|
# define inflatePrime z_inflatePrime
|
||||||
|
# define inflateReset z_inflateReset
|
||||||
|
# define inflateReset2 z_inflateReset2
|
||||||
|
# define inflateSetDictionary z_inflateSetDictionary
|
||||||
|
# define inflateSync z_inflateSync
|
||||||
|
# define inflateSyncPoint z_inflateSyncPoint
|
||||||
|
# define inflateUndermine z_inflateUndermine
|
||||||
|
# define inflate_copyright z_inflate_copyright
|
||||||
|
# define inflate_fast z_inflate_fast
|
||||||
|
# define inflate_table z_inflate_table
|
||||||
|
# define uncompress z_uncompress
|
||||||
|
# define zError z_zError
|
||||||
|
# define zcalloc z_zcalloc
|
||||||
|
# define zcfree z_zcfree
|
||||||
|
# define zlibCompileFlags z_zlibCompileFlags
|
||||||
|
# define zlibVersion z_zlibVersion
|
||||||
|
|
||||||
|
/* all zlib typedefs in zlib.h and zconf.h */
|
||||||
|
# define Byte z_Byte
|
||||||
|
# define Bytef z_Bytef
|
||||||
|
# define alloc_func z_alloc_func
|
||||||
|
# define charf z_charf
|
||||||
|
# define free_func z_free_func
|
||||||
|
# define gzFile z_gzFile
|
||||||
|
# define gz_header z_gz_header
|
||||||
|
# define gz_headerp z_gz_headerp
|
||||||
|
# define in_func z_in_func
|
||||||
|
# define intf z_intf
|
||||||
|
# define out_func z_out_func
|
||||||
|
# define uInt z_uInt
|
||||||
|
# define uIntf z_uIntf
|
||||||
|
# define uLong z_uLong
|
||||||
|
# define uLongf z_uLongf
|
||||||
|
# define voidp z_voidp
|
||||||
|
# define voidpc z_voidpc
|
||||||
|
# define voidpf z_voidpf
|
||||||
|
|
||||||
|
/* all zlib structs in zlib.h and zconf.h */
|
||||||
|
# define gz_header_s z_gz_header_s
|
||||||
|
# define internal_state z_internal_state
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__MSDOS__) && !defined(MSDOS)
|
||||||
|
# define MSDOS
|
||||||
|
#endif
|
||||||
|
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
|
||||||
|
# define OS2
|
||||||
|
#endif
|
||||||
|
#if defined(_WINDOWS) && !defined(WINDOWS)
|
||||||
|
# define WINDOWS
|
||||||
|
#endif
|
||||||
|
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
|
||||||
|
# ifndef WIN32
|
||||||
|
# define WIN32
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
|
||||||
|
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
|
||||||
|
# ifndef SYS16BIT
|
||||||
|
# define SYS16BIT
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
|
||||||
|
* than 64k bytes at a time (needed on systems with 16-bit int).
|
||||||
|
*/
|
||||||
|
#ifdef SYS16BIT
|
||||||
|
# define MAXSEG_64K
|
||||||
|
#endif
|
||||||
|
#ifdef MSDOS
|
||||||
|
# define UNALIGNED_OK
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __STDC_VERSION__
|
||||||
|
# ifndef STDC
|
||||||
|
# define STDC
|
||||||
|
# endif
|
||||||
|
# if __STDC_VERSION__ >= 199901L
|
||||||
|
# ifndef STDC99
|
||||||
|
# define STDC99
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
|
||||||
|
# define STDC
|
||||||
|
#endif
|
||||||
|
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
|
||||||
|
# define STDC
|
||||||
|
#endif
|
||||||
|
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
|
||||||
|
# define STDC
|
||||||
|
#endif
|
||||||
|
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
|
||||||
|
# define STDC
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
|
||||||
|
# define STDC
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef STDC
|
||||||
|
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
|
||||||
|
# define const /* note: need a more gentle solution here */
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Some Mac compilers merge all .h files incorrectly: */
|
||||||
|
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
|
||||||
|
# define NO_DUMMY_DECL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Maximum value for memLevel in deflateInit2 */
|
||||||
|
#ifndef MAX_MEM_LEVEL
|
||||||
|
# ifdef MAXSEG_64K
|
||||||
|
# define MAX_MEM_LEVEL 8
|
||||||
|
# else
|
||||||
|
# define MAX_MEM_LEVEL 9
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
|
||||||
|
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
|
||||||
|
* created by gzip. (Files created by minigzip can still be extracted by
|
||||||
|
* gzip.)
|
||||||
|
*/
|
||||||
|
#ifndef MAX_WBITS
|
||||||
|
# define MAX_WBITS 15 /* 32K LZ77 window */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* The memory requirements for deflate are (in bytes):
|
||||||
|
(1 << (windowBits+2)) + (1 << (memLevel+9))
|
||||||
|
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
|
||||||
|
plus a few kilobytes for small objects. For example, if you want to reduce
|
||||||
|
the default memory requirements from 256K to 128K, compile with
|
||||||
|
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
|
||||||
|
Of course this will generally degrade compression (there's no free lunch).
|
||||||
|
|
||||||
|
The memory requirements for inflate are (in bytes) 1 << windowBits
|
||||||
|
that is, 32K for windowBits=15 (default value) plus a few kilobytes
|
||||||
|
for small objects.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Type declarations */
|
||||||
|
|
||||||
|
#ifndef OF /* function prototypes */
|
||||||
|
# ifdef STDC
|
||||||
|
# define OF(args) args
|
||||||
|
# else
|
||||||
|
# define OF(args) ()
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* The following definitions for FAR are needed only for MSDOS mixed
|
||||||
|
* model programming (small or medium model with some far allocations).
|
||||||
|
* This was tested only with MSC; for other MSDOS compilers you may have
|
||||||
|
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
|
||||||
|
* just define FAR to be empty.
|
||||||
|
*/
|
||||||
|
#ifdef SYS16BIT
|
||||||
|
# if defined(M_I86SM) || defined(M_I86MM)
|
||||||
|
/* MSC small or medium model */
|
||||||
|
# define SMALL_MEDIUM
|
||||||
|
# ifdef _MSC_VER
|
||||||
|
# define FAR _far
|
||||||
|
# else
|
||||||
|
# define FAR far
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# if (defined(__SMALL__) || defined(__MEDIUM__))
|
||||||
|
/* Turbo C small or medium model */
|
||||||
|
# define SMALL_MEDIUM
|
||||||
|
# ifdef __BORLANDC__
|
||||||
|
# define FAR _far
|
||||||
|
# else
|
||||||
|
# define FAR far
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(WINDOWS) || defined(WIN32)
|
||||||
|
/* If building or using zlib as a DLL, define ZLIB_DLL.
|
||||||
|
* This is not mandatory, but it offers a little performance increase.
|
||||||
|
*/
|
||||||
|
# ifdef ZLIB_DLL
|
||||||
|
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
|
||||||
|
# ifdef ZLIB_INTERNAL
|
||||||
|
# define ZEXTERN extern __declspec(dllexport)
|
||||||
|
# else
|
||||||
|
# define ZEXTERN extern __declspec(dllimport)
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# endif /* ZLIB_DLL */
|
||||||
|
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
|
||||||
|
* define ZLIB_WINAPI.
|
||||||
|
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
|
||||||
|
*/
|
||||||
|
# ifdef ZLIB_WINAPI
|
||||||
|
# ifdef FAR
|
||||||
|
# undef FAR
|
||||||
|
# endif
|
||||||
|
# include <windows.h>
|
||||||
|
/* No need for _export, use ZLIB.DEF instead. */
|
||||||
|
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
||||||
|
# define ZEXPORT WINAPI
|
||||||
|
# ifdef WIN32
|
||||||
|
# define ZEXPORTVA WINAPIV
|
||||||
|
# else
|
||||||
|
# define ZEXPORTVA FAR CDECL
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (__BEOS__)
|
||||||
|
# ifdef ZLIB_DLL
|
||||||
|
# ifdef ZLIB_INTERNAL
|
||||||
|
# define ZEXPORT __declspec(dllexport)
|
||||||
|
# define ZEXPORTVA __declspec(dllexport)
|
||||||
|
# else
|
||||||
|
# define ZEXPORT __declspec(dllimport)
|
||||||
|
# define ZEXPORTVA __declspec(dllimport)
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_VISIBILITY_PRAGMA
|
||||||
|
# define ZEXTERN __attribute__((visibility ("default"))) extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ZEXTERN
|
||||||
|
# define ZEXTERN extern
|
||||||
|
#endif
|
||||||
|
#ifndef ZEXPORT
|
||||||
|
# define ZEXPORT
|
||||||
|
#endif
|
||||||
|
#ifndef ZEXPORTVA
|
||||||
|
# define ZEXPORTVA
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FAR
|
||||||
|
# define FAR
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(__MACTYPES__)
|
||||||
|
typedef unsigned char Byte; /* 8 bits */
|
||||||
|
#endif
|
||||||
|
typedef unsigned int uInt; /* 16 bits or more */
|
||||||
|
typedef unsigned long uLong; /* 32 bits or more */
|
||||||
|
|
||||||
|
#ifdef SMALL_MEDIUM
|
||||||
|
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
|
||||||
|
# define Bytef Byte FAR
|
||||||
|
#else
|
||||||
|
typedef Byte FAR Bytef;
|
||||||
|
#endif
|
||||||
|
typedef char FAR charf;
|
||||||
|
typedef int FAR intf;
|
||||||
|
typedef uInt FAR uIntf;
|
||||||
|
typedef uLong FAR uLongf;
|
||||||
|
|
||||||
|
#ifdef STDC
|
||||||
|
typedef void const *voidpc;
|
||||||
|
typedef void FAR *voidpf;
|
||||||
|
typedef void *voidp;
|
||||||
|
#else
|
||||||
|
typedef Byte const *voidpc;
|
||||||
|
typedef Byte FAR *voidpf;
|
||||||
|
typedef Byte *voidp;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
|
||||||
|
# include <sys/types.h> /* for off_t */
|
||||||
|
# include <unistd.h> /* for SEEK_* and off_t */
|
||||||
|
# ifdef VMS
|
||||||
|
# include <unixio.h> /* for off_t */
|
||||||
|
# endif
|
||||||
|
# ifndef z_off_t
|
||||||
|
# define z_off_t off_t
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _LARGEFILE64_SOURCE
|
||||||
|
# include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SEEK_SET
|
||||||
|
# define SEEK_SET 0 /* Seek from beginning of file. */
|
||||||
|
# define SEEK_CUR 1 /* Seek from current position. */
|
||||||
|
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
|
||||||
|
#endif
|
||||||
|
#ifndef z_off_t
|
||||||
|
# define z_off_t long
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__OS400__)
|
||||||
|
# define NO_vsnprintf
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__MVS__)
|
||||||
|
# define NO_vsnprintf
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* MVS linker does not support external names larger than 8 bytes */
|
||||||
|
#if defined(__MVS__)
|
||||||
|
#pragma map(deflateInit_,"DEIN")
|
||||||
|
#pragma map(deflateInit2_,"DEIN2")
|
||||||
|
#pragma map(deflateEnd,"DEEND")
|
||||||
|
#pragma map(deflateBound,"DEBND")
|
||||||
|
#pragma map(inflateInit_,"ININ")
|
||||||
|
#pragma map(inflateInit2_,"ININ2")
|
||||||
|
#pragma map(inflateEnd,"INEND")
|
||||||
|
#pragma map(inflateSync,"INSY")
|
||||||
|
#pragma map(inflateSetDictionary,"INSEDI")
|
||||||
|
#pragma map(compressBound,"CMBND")
|
||||||
|
#pragma map(inflate_table,"INTABL")
|
||||||
|
#pragma map(inflate_fast,"INFA")
|
||||||
|
#pragma map(inflate_copyright,"INCOPY")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* ZCONF_H */
|
4
zlib.3
4
zlib.3
@ -1,4 +1,4 @@
|
|||||||
.TH ZLIB 3 "17 January 2010"
|
.TH ZLIB 3 "24 January 2010"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
zlib \- compression/decompression library
|
zlib \- compression/decompression library
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -132,7 +132,7 @@ before asking for help.
|
|||||||
Send questions and/or comments to zlib@gzip.org,
|
Send questions and/or comments to zlib@gzip.org,
|
||||||
or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
|
or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
Version 1.2.3.6
|
Version 1.2.3.7
|
||||||
Copyright (C) 1995-2010 Jean-loup Gailly (jloup@gzip.org)
|
Copyright (C) 1995-2010 Jean-loup Gailly (jloup@gzip.org)
|
||||||
and Mark Adler (madler@alumni.caltech.edu).
|
and Mark Adler (madler@alumni.caltech.edu).
|
||||||
.LP
|
.LP
|
||||||
|
152
zlib.h
152
zlib.h
@ -1,5 +1,5 @@
|
|||||||
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
||||||
version 1.2.3.6, Jan 17th, 2010
|
version 1.2.3.7, Jan 24th, 2010
|
||||||
|
|
||||||
Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
|
Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
|
||||||
|
|
||||||
@ -37,8 +37,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ZLIB_VERSION "1.2.3.6"
|
#define ZLIB_VERSION "1.2.3.7"
|
||||||
#define ZLIB_VERNUM 0x1236
|
#define ZLIB_VERNUM 0x1237
|
||||||
#define ZLIB_VER_MAJOR 1
|
#define ZLIB_VER_MAJOR 1
|
||||||
#define ZLIB_VER_MINOR 2
|
#define ZLIB_VER_MINOR 2
|
||||||
#define ZLIB_VER_REVISION 3
|
#define ZLIB_VER_REVISION 3
|
||||||
@ -209,6 +209,7 @@ typedef gz_header FAR *gz_headerp;
|
|||||||
#define zlib_version zlibVersion()
|
#define zlib_version zlibVersion()
|
||||||
/* for compatibility with versions < 1.0.2 */
|
/* for compatibility with versions < 1.0.2 */
|
||||||
|
|
||||||
|
|
||||||
/* basic functions */
|
/* basic functions */
|
||||||
|
|
||||||
ZEXTERN const char * ZEXPORT zlibVersion OF((void));
|
ZEXTERN const char * ZEXPORT zlibVersion OF((void));
|
||||||
@ -232,8 +233,8 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
|
|||||||
requests a default compromise between speed and compression (currently
|
requests a default compromise between speed and compression (currently
|
||||||
equivalent to level 6).
|
equivalent to level 6).
|
||||||
|
|
||||||
deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
|
deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
||||||
enough memory, Z_STREAM_ERROR if level is not a valid compression level,
|
memory, Z_STREAM_ERROR if level is not a valid compression level, or
|
||||||
Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
|
Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
|
||||||
with the version assumed by the caller (ZLIB_VERSION). msg is set to null
|
with the version assumed by the caller (ZLIB_VERSION). msg is set to null
|
||||||
if there is no error message. deflateInit does not perform any compression:
|
if there is no error message. deflateInit does not perform any compression:
|
||||||
@ -505,6 +506,7 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
|
|||||||
static string (which must not be deallocated).
|
static string (which must not be deallocated).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* Advanced functions */
|
/* Advanced functions */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -565,9 +567,11 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
|
|||||||
decoder for special applications.
|
decoder for special applications.
|
||||||
|
|
||||||
deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
||||||
memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
|
memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
|
||||||
method). msg is set to null if there is no error message. deflateInit2
|
method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
|
||||||
does not perform any compression: this will be done by deflate().
|
incompatible with the version assumed by the caller (ZLIB_VERSION). msg is
|
||||||
|
set to null if there is no error message. deflateInit2 does not perform any
|
||||||
|
compression: this will be done by deflate().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
|
ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
|
||||||
@ -1087,11 +1091,11 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
|
|||||||
/* utility functions */
|
/* utility functions */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The following utility functions are implemented on top of the
|
The following utility functions are implemented on top of the basic
|
||||||
basic stream-oriented functions. To simplify the interface, some default
|
stream-oriented functions. To simplify the interface, some default options
|
||||||
options are assumed (compression level and memory usage, standard memory
|
are assumed (compression level and memory usage, standard memory allocation
|
||||||
allocation functions). The source code of these utility functions can
|
functions). The source code of these utility functions can be modified if
|
||||||
easily be modified if you need special options.
|
you need special options.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
|
ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
|
||||||
@ -1147,14 +1151,17 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
|
|||||||
buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
|
buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* gzip file access functions */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This library supports reading and writing files in gzip (.gz) format
|
This library supports reading and writing files in gzip (.gz) format with
|
||||||
with an interface similar to that of stdio using the functions that start
|
an interface similar to that of stdio, using the functions that start with
|
||||||
with "gz". The gzip format is different from the zlib format. gzip is a
|
"gz". The gzip format is different from the zlib format. gzip is a gzip
|
||||||
gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
|
wrapper, documented in RFC 1952, wrapped around a deflate stream.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef voidp gzFile;
|
typedef voidp gzFile; /* opaque gzip file descriptor */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
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));
|
|||||||
gzopen can be used to read a file which is not in gzip format; in this
|
gzopen can be used to read a file which is not in gzip format; in this
|
||||||
case gzread will directly read from the file without decompression.
|
case gzread will directly read from the file without decompression.
|
||||||
|
|
||||||
gzopen returns NULL if the file could not be opened or if there was
|
gzopen returns NULL if the file could not be opened, if there was
|
||||||
insufficient memory to allocate the (de)compression state; errno can be
|
insufficient memory to allocate the gzFile state, or if an invalid mode was
|
||||||
checked to distinguish the two cases (if errno is zero, the zlib error is
|
specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
|
||||||
Z_MEM_ERROR).
|
errno can be checked to determine if the reason gzopen failed was that the
|
||||||
|
file could not be opened.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
||||||
/*
|
/*
|
||||||
gzdopen() associates a gzFile with the file descriptor fd. File
|
gzdopen associates a gzFile with the file descriptor fd. File descriptors
|
||||||
descriptors are obtained from calls like open, dup, creat, pipe or fileno
|
are obtained from calls like open, dup, creat, pipe or fileno (if the file
|
||||||
(in the file has been previously opened with fopen). The mode parameter is
|
has been previously opened with fopen). The mode parameter is as in gzopen.
|
||||||
as in gzopen.
|
|
||||||
|
|
||||||
The next call of gzclose on the returned gzFile will also close the file
|
The next call of gzclose on the returned gzFile will also close the file
|
||||||
descriptor fd, just like fclose(fdopen(fd), mode) closes the file descriptor
|
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
|
||||||
fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
|
fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
|
||||||
|
mode);. The duplicated descriptor should be saved to avoid a leak, since
|
||||||
|
gzdopen does not close fd if it fails.
|
||||||
|
|
||||||
gzdopen returns NULL if there was insufficient memory to allocate the
|
gzdopen returns NULL if there was insufficient memory to allocate the
|
||||||
(de)compression state.
|
gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
|
||||||
|
provided, or '+' was provided), or if fd is -1. The file descriptor is not
|
||||||
|
used until the next gz* read, write, seek, or close operation, so gzdopen
|
||||||
|
will not detect if fd is invalid (unless fd is -1).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
||||||
@ -1231,16 +1243,16 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
|||||||
will be read if gzread is called until it returns less than the requested
|
will be read if gzread is called until it returns less than the requested
|
||||||
len.
|
len.
|
||||||
|
|
||||||
gzread returns the number of uncompressed bytes actually read (less than
|
gzread returns the number of uncompressed bytes actually read, less than
|
||||||
len for end of file, -1 for error).
|
len for end of file, or -1 for error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
|
ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
|
||||||
voidpc buf, unsigned len));
|
voidpc buf, unsigned len));
|
||||||
/*
|
/*
|
||||||
Writes the given number of uncompressed bytes into the compressed file.
|
Writes the given number of uncompressed bytes into the compressed file.
|
||||||
gzwrite returns the number of uncompressed bytes actually written (0 in case
|
gzwrite returns the number of uncompressed bytes written or 0 in case of
|
||||||
of error).
|
error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
|
ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
|
||||||
@ -1254,7 +1266,7 @@ ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
|
|||||||
nothing written. In this case, there may also be a buffer overflow with
|
nothing written. In this case, there may also be a buffer overflow with
|
||||||
unpredictable consequences, which is possible only if zlib was compiled with
|
unpredictable consequences, which is possible only if zlib was compiled with
|
||||||
the insecure functions sprintf() or vsprintf() because the secure snprintf()
|
the insecure functions sprintf() or vsprintf() because the secure snprintf()
|
||||||
or vsnprintf() functions were not available. This can be checked for using
|
or vsnprintf() functions were not available. This can be determined using
|
||||||
zlibCompileFlags().
|
zlibCompileFlags().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -1273,7 +1285,7 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
|||||||
condition is encountered. The string is then terminated with a null
|
condition is encountered. The string is then terminated with a null
|
||||||
character.
|
character.
|
||||||
|
|
||||||
gzgets returns buf, or Z_NULL in case of error.
|
gzgets returns buf, or NULL in case of error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
||||||
@ -1290,11 +1302,14 @@ ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
|||||||
|
|
||||||
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
||||||
/*
|
/*
|
||||||
Push one character back onto the stream to be read again later. At least
|
Push one character back onto the stream to be read as the first character
|
||||||
one character of push-back is allowed. gzungetc() returns the character
|
on the next read. At least one character of push-back is allowed.
|
||||||
pushed, or -1 on failure. gzungetc() will fail if c is -1, and may fail if
|
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
|
||||||
a character has been pushed but not read yet. The pushed character will be
|
fail if c is -1, and may fail if a character has been pushed but not read
|
||||||
discarded if the stream is repositioned with gzseek() or gzrewind().
|
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
|
||||||
|
output buffer size of pushed characters is allowed. (See gzbuffer above.)
|
||||||
|
The pushed character will be discarded if the stream is repositioned with
|
||||||
|
gzseek() or gzrewind().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
||||||
@ -1356,43 +1371,63 @@ ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
|||||||
Returns the current offset in the file being read or written. This offset
|
Returns the current offset in the file being read or written. This offset
|
||||||
includes the count of bytes that precede the gzip stream, for example when
|
includes the count of bytes that precede the gzip stream, for example when
|
||||||
appending or when using gzdopen() for reading. When reading, the offset
|
appending or when using gzdopen() for reading. When reading, the offset
|
||||||
includes data that has been used to generate what has been provided as
|
does not include as yet unused buffered input. This information can be used
|
||||||
uncompressed data so far, but does not include as yet unused buffered input.
|
for a progress indicator. On error, gzoffset() returns -1.
|
||||||
On error, gzoffset() returns -1.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Returns 1 when EOF has previously been detected reading the given input
|
Returns true (1) if the end-of-file indicator has been set while reading,
|
||||||
stream, otherwise zero.
|
false (0) otherwise. Note that the end-of-file indicator is set only if the
|
||||||
|
read tried to go past the end of the input, but came up short. Therefore,
|
||||||
|
just like feof(), gzeof() may return false even if there is no more data to
|
||||||
|
read, in the event that the last read request was for the exact number of
|
||||||
|
bytes remaining in the input file. This will happen if the input file size
|
||||||
|
is an exact multiple of the buffer size.
|
||||||
|
|
||||||
|
If gzeof() returns true, then the read functions will return no more data,
|
||||||
|
unless the end-of-file indicator is reset by gzclearerr() and the input file
|
||||||
|
has grown since the previous end of file was detected.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Returns 1 if file is being read directly without decompression, otherwise
|
Returns true (1) if file is being copied directly while reading, or false
|
||||||
zero. gzdirect() called immediately after gzopen() will always return zero,
|
(0) if file is a gzip stream being decompressed. This state can change from
|
||||||
since nothing has been read yet. Whether to read the file with
|
false to true while reading the input file if the end of a gzip stream is
|
||||||
decompression or not is not determined until after the first read operation
|
reached, but is followed by data that is not another gzip stream.
|
||||||
(e.g. gzread(), gzgetc(), etc.).
|
|
||||||
|
If the input file is empty, gzdirect() will return true, since the input
|
||||||
|
does not contain a gzip stream.
|
||||||
|
|
||||||
|
If gzdirect() is used immediately after gzopen() or gzdopen() it will
|
||||||
|
cause buffers to be allocated to allow reading the file to determine if it
|
||||||
|
is a gzip file. Therefore if gzbuffer() is used, it should be called before
|
||||||
|
gzdirect().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Flushes all pending output if necessary, closes the compressed file and
|
Flushes all pending output if necessary, closes the compressed file and
|
||||||
deallocates all the (de)compression state. The return value is the zlib
|
deallocates the (de)compression state. Note that once file is closed, you
|
||||||
error number. Note that once file is closed, you cannot call gzerror with
|
cannot call gzerror with file, since its structures have been deallocated.
|
||||||
file, since its structures have been deallocated.
|
gzclose must not be called more than once on the same file, just as free
|
||||||
|
must not be called more than once on the same allocation.
|
||||||
|
|
||||||
|
gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
|
||||||
|
file operation error, or Z_OK on success.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
|
ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
|
||||||
ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
|
ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Same as gzclose(), but gzclose_r() is only for use when reading, and
|
Same as gzclose(), but gzclose_r() is only for use when reading, and
|
||||||
gzclose_w() is only for use when writing. The advantage to using these
|
gzclose_w() is only for use when writing or appending. The advantage to
|
||||||
instead of gzclose() is that they avoid linking in zlib compression or
|
using these instead of gzclose() is that they avoid linking in zlib
|
||||||
decompression code that is not used when only reading or only writing
|
compression or decompression code that is not used when only reading or only
|
||||||
respectively. If gzclose() is used, then both compression and decompression
|
writing respectively. If gzclose() is used, then both compression and
|
||||||
code will be included the application when linking to a static zlib library.
|
decompression code will be included the application when linking to a static
|
||||||
|
zlib library.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
||||||
@ -1415,6 +1450,7 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
|||||||
file that is being written concurrently.
|
file that is being written concurrently.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* checksum functions */
|
/* checksum functions */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
/* zlibdefs.h -- compile-time definitions for the zlib compression library
|
|
||||||
* Copyright (C) 1995-2006 Jean-loup Gailly.
|
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
#cmakedefine HAVE_UNISTD_H
|
|
||||||
#ifdef HAVE_UNISTD_H
|
|
||||||
#include <sys/types.h> /* for off_t */
|
|
||||||
#include <unistd.h> /* for SEEK_* and off_t */
|
|
||||||
#ifdef VMS
|
|
||||||
# include <unixio.h> /* for off_t */
|
|
||||||
#endif
|
|
||||||
#ifndef z_off_t
|
|
||||||
# define z_off_t off_t
|
|
||||||
#endif
|
|
||||||
#endif
|
|
Loading…
x
Reference in New Issue
Block a user