Commit 43743d63 by Matthias Klose Committed by Matthias Klose

2012-03-02 Matthias Klose <doko@ubuntu.com>

        * Imported zlib 1.2.5; merged local changes.

From-SVN: r184805
parent 5d216c70
cmake_minimum_required(VERSION 2.4.4)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
project(zlib C)
if(NOT DEFINED BUILD_SHARED_LIBS)
option(BUILD_SHARED_LIBS "Build a shared library form of zlib" ON)
endif()
include(CheckTypeSize)
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckCSourceCompiles)
enable_testing()
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stddef.h HAVE_STDDEF_H)
#
# Check to see if we have large file support
#
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
# We add these other definitions here because CheckTypeSize.cmake
# in CMake 2.4.x does not automatically do so and we want
# compatibility with CMake 2.4.x.
if(HAVE_SYS_TYPES_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
endif()
if(HAVE_STDINT_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
endif()
if(HAVE_STDDEF_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
endif()
check_type_size(off64_t OFF64_T)
if(HAVE_OFF64_T)
add_definitions(-D_LARGEFILE64_SOURCE=1)
endif()
set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
#
# Check for fseeko
#
check_function_exists(fseeko HAVE_FSEEKO)
if(NOT HAVE_FSEEKO)
add_definitions(-DNO_FSEEKO)
endif()
#
# Check for unistd.h
#
check_include_file(unistd.h Z_HAVE_UNISTD_H)
if(MSVC)
set(CMAKE_DEBUG_POSTFIX "d")
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
endif()
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
# If we're doing an out of source build and the user has a zconf.h
# in their source tree...
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
message(FATAL_ERROR
"You must remove ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h "
"from the source tree. This file is included with zlib "
"but CMake generates this file for you automatically "
"in the build directory.")
endif()
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein
${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
#============================================================================
# zlib
#============================================================================
set(ZLIB_PUBLIC_HDRS
${CMAKE_CURRENT_BINARY_DIR}/zconf.h
zlib.h
)
set(ZLIB_PRIVATE_HDRS
crc32.h
deflate.h
gzguts.h
inffast.h
inffixed.h
inflate.h
inftrees.h
trees.h
zutil.h
)
set(ZLIB_SRCS
adler32.c
compress.c
crc32.c
deflate.c
gzclose.c
gzlib.c
gzread.c
gzwrite.c
inflate.c
infback.c
inftrees.c
inffast.c
trees.c
uncompr.c
zutil.c
win32/zlib1.rc
)
# parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([0-9A-Za-z.]+)\".*"
"\\1" ZLIB_FULL_VERSION ${_zlib_h_contents})
if(MINGW)
# This gets us DLL resource information when compiling on MinGW.
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
COMMAND windres.exe
-D GCC_WINDRES
-I ${CMAKE_CURRENT_SOURCE_DIR}
-I ${CMAKE_CURRENT_BINARY_DIR}
-o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
-i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
set(ZLIB_SRCS ${ZLIB_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
endif(MINGW)
add_library(zlib ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
set_target_properties(zlib PROPERTIES SOVERSION 1)
if(NOT CYGWIN)
# This property causes shared libraries on Linux to have the full version
# encoded into their final filename. We disable this on Cygwin because
# it causes cygz-${ZLIB_FULL_VERSION}.dll to be created when cygz.dll
# seems to be the default.
#
# This has no effect with MSVC, on that platform the version info for
# the DLL comes from the resource file win32/zlib1.rc
set_target_properties(zlib PROPERTIES VERSION ${ZLIB_FULL_VERSION})
endif()
if(UNIX)
# On unix-like platforms the library is almost always called libz
set_target_properties(zlib PROPERTIES OUTPUT_NAME z)
elseif(BUILD_SHARED_LIBS AND WIN32)
# Creates zlib1.dll when building shared library version
set_target_properties(zlib PROPERTIES SUFFIX "1.dll")
endif()
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
install(TARGETS zlib
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib )
endif()
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION include)
endif()
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
install(FILES zlib.3 DESTINATION share/man/man3)
endif()
#============================================================================
# Example binaries
#============================================================================
add_executable(example example.c)
target_link_libraries(example zlib)
add_test(example example)
add_executable(minigzip minigzip.c)
target_link_libraries(minigzip zlib)
if(HAVE_OFF64_T)
add_executable(example64 example.c)
target_link_libraries(example64 zlib)
set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
add_test(example64 example64)
add_executable(minigzip64 minigzip.c)
target_link_libraries(minigzip64 zlib)
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
endif()
2012-03-02 Matthias Klose <doko@ubuntu.com>
* Imported zlib 1.2.5; merged local changes.
2011-11-21 Andreas Tobler <andreast@fgznet.ch> 2011-11-21 Andreas Tobler <andreast@fgznet.ch>
* configure: Regenerate. * configure: Regenerate.
......
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 dummy Makefile that tells you to ./configure
Makefile.in makefile for Unix (template for configure) Makefile.in template for Unix Makefile
README guess what README guess what
algorithm.txt description of the (de)compression algorithm
configure configure script for Unix configure configure script for Unix
zconf.in.h template for zconf.h (used by configure) make_vms.com makefile for VMS
treebuild.xml XML description of source file dependencies
zconf.h.cmakein zconf.h template for cmake
zconf.h.in zconf.h template for configure
zlib.3 Man page for zlib
zlib.3.pdf Man page in PDF format
zlib.map Linux symbol information
zlib.pc.in Template for pkg-config descriptor
zlib2ansi perl script to convert source files for C++ compilation
amiga/ makefiles for Amiga SAS C amiga/ makefiles for Amiga SAS C
as400/ makefiles for IBM AS/400 doc/ documentation for formats and algorithms
msdos/ makefiles for MSDOS msdos/ makefiles for MSDOS
nintendods/ makefile for Nintendo DS
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
projects/ projects for various Integrated Development Environments
qnx/ makefiles for QNX qnx/ makefiles for QNX
watcom/ makefiles for OpenWatcom
win32/ makefiles for Windows win32/ makefiles for Windows
zlib public header files (must be kept): zlib public header files (required for library use):
zconf.h zconf.h
zlib.h zlib.h
...@@ -28,7 +37,11 @@ crc32.c ...@@ -28,7 +37,11 @@ crc32.c
crc32.h crc32.h
deflate.c deflate.c
deflate.h deflate.h
gzio.c gzclose.c
gzguts.h
gzlib.c
gzread.c
gzwrite.c
infback.c infback.c
inffast.c inffast.c
inffast.h inffast.h
...@@ -46,6 +59,7 @@ zutil.h ...@@ -46,6 +59,7 @@ zutil.h
source files for sample programs: source files for sample programs:
example.c example.c
minigzip.c minigzip.c
See examples/README.examples for more
unsupported contribution by third parties unsupported contribution by third parties
See contrib/README.contrib See contrib/README.contrib
...@@ -5,9 +5,10 @@ AUTOMAKE_OPTIONS = 1.8 cygnus ...@@ -5,9 +5,10 @@ AUTOMAKE_OPTIONS = 1.8 cygnus
ACLOCAL_AMFLAGS = -I .. -I ../config ACLOCAL_AMFLAGS = -I .. -I ../config
ZLIB_SOURCES = adler32.c compress.c crc32.c crc32.h deflate.c \ ZLIB_SOURCES = adler32.c compress.c crc32.c crc32.h deflate.c \
deflate.h gzio.c infback.c inffast.c inffast.h inffixed.h inflate.c \ deflate.h gzguts.h gzread.c gzclose.c gzwrite.c gzlib.c \
infback.c inffast.c inffast.h inffixed.h inflate.c \
inflate.h inftrees.c inftrees.h trees.c trees.h uncompr.c zconf.h \ inflate.h inftrees.c inftrees.h trees.c trees.h uncompr.c zconf.h \
zconf.in.h zlib.h zutil.c zutil.h zconf.h.in zlib.h zutil.c zutil.h
if TARGET_LIBRARY if TARGET_LIBRARY
noinst_LTLIBRARIES = libzgcj_convenience.la noinst_LTLIBRARIES = libzgcj_convenience.la
......
...@@ -84,17 +84,19 @@ libz_a_AR = $(AR) $(ARFLAGS) ...@@ -84,17 +84,19 @@ libz_a_AR = $(AR) $(ARFLAGS)
libz_a_LIBADD = libz_a_LIBADD =
am__objects_1 = libz_a-adler32.$(OBJEXT) libz_a-compress.$(OBJEXT) \ am__objects_1 = libz_a-adler32.$(OBJEXT) libz_a-compress.$(OBJEXT) \
libz_a-crc32.$(OBJEXT) libz_a-deflate.$(OBJEXT) \ libz_a-crc32.$(OBJEXT) libz_a-deflate.$(OBJEXT) \
libz_a-gzio.$(OBJEXT) libz_a-infback.$(OBJEXT) \ libz_a-gzread.$(OBJEXT) libz_a-gzclose.$(OBJEXT) \
libz_a-inffast.$(OBJEXT) libz_a-inflate.$(OBJEXT) \ libz_a-gzwrite.$(OBJEXT) libz_a-gzlib.$(OBJEXT) \
libz_a-inftrees.$(OBJEXT) libz_a-trees.$(OBJEXT) \ libz_a-infback.$(OBJEXT) libz_a-inffast.$(OBJEXT) \
libz_a-uncompr.$(OBJEXT) libz_a-zutil.$(OBJEXT) libz_a-inflate.$(OBJEXT) libz_a-inftrees.$(OBJEXT) \
libz_a-trees.$(OBJEXT) libz_a-uncompr.$(OBJEXT) \
libz_a-zutil.$(OBJEXT)
@TARGET_LIBRARY_FALSE@am_libz_a_OBJECTS = $(am__objects_1) @TARGET_LIBRARY_FALSE@am_libz_a_OBJECTS = $(am__objects_1)
libz_a_OBJECTS = $(am_libz_a_OBJECTS) libz_a_OBJECTS = $(am_libz_a_OBJECTS)
LTLIBRARIES = $(noinst_LTLIBRARIES) LTLIBRARIES = $(noinst_LTLIBRARIES)
libzgcj_convenience_la_LIBADD = libzgcj_convenience_la_LIBADD =
am__objects_2 = adler32.lo compress.lo crc32.lo deflate.lo gzio.lo \ am__objects_2 = adler32.lo compress.lo crc32.lo deflate.lo gzread.lo \
infback.lo inffast.lo inflate.lo inftrees.lo trees.lo \ gzclose.lo gzwrite.lo gzlib.lo infback.lo inffast.lo \
uncompr.lo zutil.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo
@TARGET_LIBRARY_TRUE@am_libzgcj_convenience_la_OBJECTS = \ @TARGET_LIBRARY_TRUE@am_libzgcj_convenience_la_OBJECTS = \
@TARGET_LIBRARY_TRUE@ $(am__objects_2) @TARGET_LIBRARY_TRUE@ $(am__objects_2)
libzgcj_convenience_la_OBJECTS = $(am_libzgcj_convenience_la_OBJECTS) libzgcj_convenience_la_OBJECTS = $(am_libzgcj_convenience_la_OBJECTS)
...@@ -244,9 +246,10 @@ top_srcdir = @top_srcdir@ ...@@ -244,9 +246,10 @@ top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = 1.8 cygnus AUTOMAKE_OPTIONS = 1.8 cygnus
ACLOCAL_AMFLAGS = -I .. -I ../config ACLOCAL_AMFLAGS = -I .. -I ../config
ZLIB_SOURCES = adler32.c compress.c crc32.c crc32.h deflate.c \ ZLIB_SOURCES = adler32.c compress.c crc32.c crc32.h deflate.c \
deflate.h gzio.c infback.c inffast.c inffast.h inffixed.h inflate.c \ deflate.h gzguts.h gzread.c gzclose.c gzwrite.c gzlib.c \
infback.c inffast.c inffast.h inffixed.h inflate.c \
inflate.h inftrees.c inftrees.h trees.c trees.h uncompr.c zconf.h \ inflate.h inftrees.c inftrees.h trees.c trees.h uncompr.c zconf.h \
zconf.in.h zlib.h zutil.c zutil.h zconf.h.in zlib.h zutil.c zutil.h
@TARGET_LIBRARY_TRUE@noinst_LTLIBRARIES = libzgcj_convenience.la @TARGET_LIBRARY_TRUE@noinst_LTLIBRARIES = libzgcj_convenience.la
@TARGET_LIBRARY_TRUE@libzgcj_convenience_la_SOURCES = $(ZLIB_SOURCES) @TARGET_LIBRARY_TRUE@libzgcj_convenience_la_SOURCES = $(ZLIB_SOURCES)
...@@ -420,11 +423,29 @@ libz_a-deflate.o: deflate.c ...@@ -420,11 +423,29 @@ libz_a-deflate.o: deflate.c
libz_a-deflate.obj: deflate.c libz_a-deflate.obj: deflate.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libz_a_CFLAGS) $(CFLAGS) -c -o libz_a-deflate.obj `if test -f 'deflate.c'; then $(CYGPATH_W) 'deflate.c'; else $(CYGPATH_W) '$(srcdir)/deflate.c'; fi` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libz_a_CFLAGS) $(CFLAGS) -c -o libz_a-deflate.obj `if test -f 'deflate.c'; then $(CYGPATH_W) 'deflate.c'; else $(CYGPATH_W) '$(srcdir)/deflate.c'; fi`
libz_a-gzio.o: gzio.c libz_a-gzread.o: gzread.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libz_a_CFLAGS) $(CFLAGS) -c -o libz_a-gzio.o `test -f 'gzio.c' || echo '$(srcdir)/'`gzio.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libz_a_CFLAGS) $(CFLAGS) -c -o libz_a-gzread.o `test -f 'gzread.c' || echo '$(srcdir)/'`gzread.c
libz_a-gzio.obj: gzio.c libz_a-gzread.obj: gzread.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libz_a_CFLAGS) $(CFLAGS) -c -o libz_a-gzio.obj `if test -f 'gzio.c'; then $(CYGPATH_W) 'gzio.c'; else $(CYGPATH_W) '$(srcdir)/gzio.c'; fi` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libz_a_CFLAGS) $(CFLAGS) -c -o libz_a-gzread.obj `if test -f 'gzread.c'; then $(CYGPATH_W) 'gzread.c'; else $(CYGPATH_W) '$(srcdir)/gzread.c'; fi`
libz_a-gzclose.o: gzclose.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libz_a_CFLAGS) $(CFLAGS) -c -o libz_a-gzclose.o `test -f 'gzclose.c' || echo '$(srcdir)/'`gzclose.c
libz_a-gzclose.obj: gzclose.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libz_a_CFLAGS) $(CFLAGS) -c -o libz_a-gzclose.obj `if test -f 'gzclose.c'; then $(CYGPATH_W) 'gzclose.c'; else $(CYGPATH_W) '$(srcdir)/gzclose.c'; fi`
libz_a-gzwrite.o: gzwrite.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libz_a_CFLAGS) $(CFLAGS) -c -o libz_a-gzwrite.o `test -f 'gzwrite.c' || echo '$(srcdir)/'`gzwrite.c
libz_a-gzwrite.obj: gzwrite.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libz_a_CFLAGS) $(CFLAGS) -c -o libz_a-gzwrite.obj `if test -f 'gzwrite.c'; then $(CYGPATH_W) 'gzwrite.c'; else $(CYGPATH_W) '$(srcdir)/gzwrite.c'; fi`
libz_a-gzlib.o: gzlib.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libz_a_CFLAGS) $(CFLAGS) -c -o libz_a-gzlib.o `test -f 'gzlib.c' || echo '$(srcdir)/'`gzlib.c
libz_a-gzlib.obj: gzlib.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libz_a_CFLAGS) $(CFLAGS) -c -o libz_a-gzlib.obj `if test -f 'gzlib.c'; then $(CYGPATH_W) 'gzlib.c'; else $(CYGPATH_W) '$(srcdir)/gzlib.c'; fi`
libz_a-infback.o: infback.c libz_a-infback.o: infback.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libz_a_CFLAGS) $(CFLAGS) -c -o libz_a-infback.o `test -f 'infback.c' || echo '$(srcdir)/'`infback.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libz_a_CFLAGS) $(CFLAGS) -c -o libz_a-infback.o `test -f 'infback.c' || echo '$(srcdir)/'`infback.c
......
...@@ -3,57 +3,53 @@ shipped with GCC as convenience. ...@@ -3,57 +3,53 @@ shipped with GCC as convenience.
ZLIB DATA COMPRESSION LIBRARY ZLIB DATA COMPRESSION LIBRARY
zlib 1.2.3 is a general purpose data compression library. All the code is zlib 1.2.5 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)
and rfc1952.txt (gzip format). These documents are also available in other and rfc1952.txt (gzip format).
formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
All functions of the compression library are documented in the file zlib.h All functions of the compression library are documented in the file zlib.h
(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example (volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
of the library is given in the file example.c which also tests that the library of the library is given in the file example.c which also tests that the library
is working correctly. Another example is given in the file minigzip.c. The is working correctly. Another example is given in the file minigzip.c. The
compression library itself is composed of all source files except example.c and compression library itself is composed of all source files except example.c and
minigzip.c. minigzip.c.
To compile all files and run the test program, follow the instructions given at To compile all files and run the test program, follow the instructions given at
the top of Makefile. In short "make test; make install" should work for most the top of Makefile.in. In short "./configure; make test", and if that goes
machines. For Unix: "./configure; make test; make install". For MSDOS, use one well, "make install" should work for most flavors of Unix. For Windows, use one
of the special makefiles such as Makefile.msc. For VMS, use make_vms.com. of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use
make_vms.com.
Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
<info@winimage.com> for the Windows DLL version. The zlib home page is <info@winimage.com> for the Windows DLL version. The zlib home page is
http://www.zlib.org or http://www.gzip.org/zlib/ Before reporting a problem, http://zlib.net/ . Before reporting a problem, please check this site to
please check this site to verify that you have the latest version of zlib; verify that you have the latest version of zlib; otherwise get the latest
otherwise get the latest version and check whether the problem still exists or version and check whether the problem still exists or not.
not.
PLEASE read the zlib FAQ http://www.gzip.org/zlib/zlib_faq.html before asking PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.
for help.
Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997 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 at
http://dogma.net/markn/articles/zlibtool/zlibtool.htm http://marknelson.us/1997/01/01/zlib-engine/ .
The changes made in version 1.2.3 are documented in the file ChangeLog. The changes made in version 1.2.5 are documented in the file ChangeLog.
Unsupported third party contributions are provided in directory "contrib". Unsupported third party contributions are provided in directory contrib/ .
A Java implementation of zlib is available in the Java Development Kit zlib is available in Java using the java.util.zip package, documented at
http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/package-summary.html http://java.sun.com/developer/technicalArticles/Programming/compression/ .
See the zlib home page http://www.zlib.org for details.
A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is in the A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is available
CPAN (Comprehensive Perl Archive Network) sites at CPAN (Comprehensive Perl Archive Network) sites, including
http://www.cpan.org/modules/by-module/Compress/ http://search.cpan.org/~pmqs/IO-Compress-Zlib/ .
A Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is A Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is
available in Python 1.5 and later versions, see available in Python 1.5 and later versions, see
http://www.python.org/doc/lib/module-zlib.html http://www.python.org/doc/lib/module-zlib.html .
A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com> is zlib is built into tcl: http://wiki.tcl.tk/4610 .
availlable at http://www.oche.de/~akupries/soft/trf/trf_zip.html
An experimental package to read and write files in .zip format, written on top An experimental package to read and write files in .zip format, written on top
of zlib by Gilles Vollant <info@winimage.com>, is available in the of zlib by Gilles Vollant <info@winimage.com>, is available in the
...@@ -77,25 +73,21 @@ Notes for some targets: ...@@ -77,25 +73,21 @@ Notes for some targets:
- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with - zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
other compilers. Use "make test" to check your compiler. other compilers. Use "make test" to check your compiler.
- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers. - gzdopen is not supported on RISCOS or BEOS.
- For PalmOs, see http://palmzlib.sourceforge.net/ - For PalmOs, see http://palmzlib.sourceforge.net/
- When building a shared, i.e. dynamic library on Mac OS X, the library must be
installed before testing (do "make install" before "make test"), since the
library location is specified in the library.
Acknowledgments: Acknowledgments:
The deflate format used by zlib was defined by Phil Katz. The deflate The deflate format used by zlib was defined by Phil Katz. The deflate and
and zlib specifications were written by L. Peter Deutsch. Thanks to all the zlib specifications were written by L. Peter Deutsch. Thanks to all the
people who reported problems and suggested various improvements in zlib; people who reported problems and suggested various improvements in zlib; they
they are too numerous to cite here. are too numerous to cite here.
Copyright notice: Copyright notice:
(C) 1995-2004 Jean-loup Gailly and Mark Adler (C) 1995-2010 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
...@@ -116,13 +108,11 @@ Copyright notice: ...@@ -116,13 +108,11 @@ Copyright notice:
Jean-loup Gailly Mark Adler Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu jloup@gzip.org madler@alumni.caltech.edu
If you use the zlib library in a product, we would appreciate *not* If you use the zlib library in a product, we would appreciate *not* receiving
receiving lengthy legal documents to sign. The sources are provided lengthy legal documents to sign. The sources are provided for free but without
for free but without warranty of any kind. The library has been warranty of any kind. The library has been entirely written by Jean-loup
entirely written by Jean-loup Gailly and Mark Adler; it does not Gailly and Mark Adler; it does not include third-party code.
include third-party code.
If you redistribute modified sources, we would appreciate that you include If you redistribute modified sources, we would appreciate that you include in
in the file ChangeLog history information documenting your changes. Please the file ChangeLog history information documenting your changes. Please read
read the FAQ for more information on the distribution of modified source the FAQ for more information on the distribution of modified source versions.
versions.
/* adler32.c -- compute the Adler-32 checksum of a data stream /* adler32.c -- compute the Adler-32 checksum of a data stream
* Copyright (C) 1995-2004 Mark Adler * Copyright (C) 1995-2007 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
*/ */
/* @(#) $Id: adler32.c,v 1.1.1.2 2002/03/11 21:53:23 tromey Exp $ */ /* @(#) $Id: adler32.c,v 1.1.1.2 2002/03/11 21:53:23 tromey Exp $ */
#define ZLIB_INTERNAL #include "zutil.h"
#include "zlib.h"
#define local static
local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2);
#define BASE 65521UL /* largest prime smaller than 65536 */ #define BASE 65521UL /* largest prime smaller than 65536 */
#define NMAX 5552 #define NMAX 5552
...@@ -125,10 +128,10 @@ uLong ZEXPORT adler32(adler, buf, len) ...@@ -125,10 +128,10 @@ uLong ZEXPORT adler32(adler, buf, len)
} }
/* ========================================================================= */ /* ========================================================================= */
uLong ZEXPORT adler32_combine(adler1, adler2, len2) local uLong adler32_combine_(adler1, adler2, len2)
uLong adler1; uLong adler1;
uLong adler2; uLong adler2;
z_off_t len2; z_off64_t len2;
{ {
unsigned long sum1; unsigned long sum1;
unsigned long sum2; unsigned long sum2;
...@@ -141,9 +144,26 @@ uLong ZEXPORT adler32_combine(adler1, adler2, len2) ...@@ -141,9 +144,26 @@ uLong ZEXPORT adler32_combine(adler1, adler2, len2)
MOD(sum2); MOD(sum2);
sum1 += (adler2 & 0xffff) + BASE - 1; sum1 += (adler2 & 0xffff) + BASE - 1;
sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
if (sum1 > BASE) sum1 -= BASE; if (sum1 >= BASE) sum1 -= BASE;
if (sum1 > BASE) sum1 -= BASE; if (sum1 >= BASE) sum1 -= BASE;
if (sum2 > (BASE << 1)) sum2 -= (BASE << 1); if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1);
if (sum2 > BASE) sum2 -= BASE; if (sum2 >= BASE) sum2 -= BASE;
return sum1 | (sum2 << 16); return sum1 | (sum2 << 16);
} }
/* ========================================================================= */
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off_t len2;
{
return adler32_combine_(adler1, adler2, len2);
}
uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off64_t len2;
{
return adler32_combine_(adler1, adler2, len2);
}
...@@ -14,8 +14,8 @@ LDFLAGS = -o ...@@ -14,8 +14,8 @@ LDFLAGS = -o
LDLIBS = LIB:scppc.a LIB:end.o LDLIBS = LIB:scppc.a LIB:end.o
RM = delete quiet RM = delete quiet
OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \
zutil.o inflate.o infback.o inftrees.o inffast.o uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
TEST_OBJS = example.o minigzip.o TEST_OBJS = example.o minigzip.o
...@@ -55,7 +55,10 @@ compress.o: zlib.h zconf.h ...@@ -55,7 +55,10 @@ compress.o: zlib.h zconf.h
crc32.o: crc32.h zlib.h zconf.h crc32.o: crc32.h zlib.h zconf.h
deflate.o: deflate.h zutil.h zlib.h zconf.h deflate.o: deflate.h zutil.h zlib.h zconf.h
example.o: zlib.h zconf.h example.o: zlib.h zconf.h
gzio.o: zutil.h zlib.h zconf.h gzclose.o: zlib.h zconf.h gzguts.h
gzlib.o: zlib.h zconf.h gzguts.h
gzread.o: zlib.h zconf.h gzguts.h
gzwrite.o: zlib.h zconf.h gzguts.h
inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
......
...@@ -13,8 +13,8 @@ SCOPTIONS=OPTSCHED OPTINLINE OPTALIAS OPTTIME OPTINLOCAL STRMERGE \ ...@@ -13,8 +13,8 @@ SCOPTIONS=OPTSCHED OPTINLINE OPTALIAS OPTTIME OPTINLOCAL STRMERGE \
NOICONS PARMS=BOTH NOSTACKCHECK UTILLIB NOVERSION ERRORREXX \ NOICONS PARMS=BOTH NOSTACKCHECK UTILLIB NOVERSION ERRORREXX \
DEF=POSTINC DEF=POSTINC
OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ OBJS = adler32.o compress.o crc32.o gzclose.o gzlib.o gzread.o gzwrite.o \
zutil.o inflate.o infback.o inftrees.o inffast.o uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
TEST_OBJS = example.o minigzip.o TEST_OBJS = example.o minigzip.o
...@@ -54,7 +54,10 @@ compress.o: zlib.h zconf.h ...@@ -54,7 +54,10 @@ compress.o: zlib.h zconf.h
crc32.o: crc32.h zlib.h zconf.h crc32.o: crc32.h zlib.h zconf.h
deflate.o: deflate.h zutil.h zlib.h zconf.h deflate.o: deflate.h zutil.h zlib.h zconf.h
example.o: zlib.h zconf.h example.o: zlib.h zconf.h
gzio.o: zutil.h zlib.h zconf.h gzclose.o: zlib.h zconf.h gzguts.h
gzlib.o: zlib.h zconf.h gzguts.h
gzread.o: zlib.h zconf.h gzguts.h
gzwrite.o: zlib.h zconf.h gzguts.h
inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
......
/* compress.c -- compress a memory buffer /* compress.c -- compress a memory buffer
* Copyright (C) 1995-2003 Jean-loup Gailly. * Copyright (C) 1995-2005 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
*/ */
...@@ -75,5 +75,6 @@ int ZEXPORT compress (dest, destLen, source, sourceLen) ...@@ -75,5 +75,6 @@ int ZEXPORT compress (dest, destLen, source, sourceLen)
uLong ZEXPORT compressBound (sourceLen) uLong ZEXPORT compressBound (sourceLen)
uLong sourceLen; uLong sourceLen;
{ {
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 11; return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
(sourceLen >> 25) + 13;
} }
...@@ -8,7 +8,10 @@ ada/ by Dmitriy Anisimkov <anisimkov@yahoo.com> ...@@ -8,7 +8,10 @@ ada/ by Dmitriy Anisimkov <anisimkov@yahoo.com>
Support for Ada Support for Ada
See http://zlib-ada.sourceforge.net/ See http://zlib-ada.sourceforge.net/
asm586/ amd64/ by Mikhail Teterin <mi@ALDAN.algebra.com>
asm code for AMD64
See patch at http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/96393
asm686/ by Brian Raiter <breadbox@muppetlabs.com> asm686/ by Brian Raiter <breadbox@muppetlabs.com>
asm code for Pentium and PPro/PII, using the AT&T (GNU as) syntax asm code for Pentium and PPro/PII, using the AT&T (GNU as) syntax
See http://www.muppetlabs.com/~breadbox/software/assembly.html See http://www.muppetlabs.com/~breadbox/software/assembly.html
...@@ -22,6 +25,10 @@ delphi/ by Cosmin Truta <cosmint@cs.ubbcluj.ro> ...@@ -22,6 +25,10 @@ delphi/ by Cosmin Truta <cosmint@cs.ubbcluj.ro>
dotzlib/ by Henrik Ravn <henrik@ravn.com> dotzlib/ by Henrik Ravn <henrik@ravn.com>
Support for Microsoft .Net and Visual C++ .Net Support for Microsoft .Net and Visual C++ .Net
gcc_gvmat64/by Gilles Vollant <info@winimage.com>
GCC Version of x86 64-bit (AMD64 and Intel EM64t) code for x64
assembler to replace longest_match() and inflate_fast()
infback9/ by Mark Adler <madler@alumni.caltech.edu> infback9/ by Mark Adler <madler@alumni.caltech.edu>
Unsupported diffs to infback to decode the deflate64 format Unsupported diffs to infback to decode the deflate64 format
...@@ -38,20 +45,19 @@ iostream3/ by Ludwig Schwardt <schwardt@sun.ac.za> ...@@ -38,20 +45,19 @@ iostream3/ by Ludwig Schwardt <schwardt@sun.ac.za>
and Kevin Ruland <kevin@rodin.wustl.edu> and Kevin Ruland <kevin@rodin.wustl.edu>
Yet another C++ I/O streams interface Yet another C++ I/O streams interface
masm686/ by Dan Higdon <hdan@kinesoft.com>
and Chuck Walbourn <chuckw@kinesoft.com>
asm code for Pentium Pro/PII, using the MASM syntax
masmx64/ by Gilles Vollant <info@winimage.com> masmx64/ by Gilles Vollant <info@winimage.com>
x86 64-bit (AMD64 and Intel EM64t) code for x64 assembler to x86 64-bit (AMD64 and Intel EM64t) code for x64 assembler to
replace longest_match() and inflate_fast() replace longest_match() and inflate_fast(), also masm x86
64-bits translation of Chris Anderson inflate_fast()
masmx86/ by Gilles Vollant <info@winimage.com> masmx86/ by Gilles Vollant <info@winimage.com>
x86 asm code to replace longest_match() and inflate_fast(), x86 asm code to replace longest_match() and inflate_fast(),
for Visual C++ and MASM for Visual C++ and MASM (32 bits).
Based on Brian Raiter (asm686) and Chris Anderson (inflate86)
minizip/ by Gilles Vollant <info@winimage.com> minizip/ by Gilles Vollant <info@winimage.com>
Mini zip and unzip based on zlib Mini zip and unzip based on zlib
Includes Zip64 support by Mathias Svensson <mathias@result42.com>
See http://www.winimage.com/zLibDll/unzip.html See http://www.winimage.com/zLibDll/unzip.html
pascal/ by Bob Dellaca <bobdl@xtra.co.nz> et al. pascal/ by Bob Dellaca <bobdl@xtra.co.nz> et al.
......
This is a patched version of zlib modified to use
Pentium-optimized assembly code in the deflation algorithm. The files
changed/added by this patch are:
README.586
match.S
The effectiveness of these modifications is a bit marginal, as the the
program's bottleneck seems to be mostly L1-cache contention, for which
there is no real way to work around without rewriting the basic
algorithm. The speedup on average is around 5-10% (which is generally
less than the amount of variance between subsequent executions).
However, when used at level 9 compression, the cache contention can
drop enough for the assembly version to achieve 10-20% speedup (and
sometimes more, depending on the amount of overall redundancy in the
files). Even here, though, cache contention can still be the limiting
factor, depending on the nature of the program using the zlib library.
This may also mean that better improvements will be seen on a Pentium
with MMX, which suffers much less from L1-cache contention, but I have
not yet verified this.
Note that this code has been tailored for the Pentium in particular,
and will not perform well on the Pentium Pro (due to the use of a
partial register in the inner loop).
If you are using an assembler other than GNU as, you will have to
translate match.S to use your assembler's syntax. (Have fun.)
Brian Raiter
breadbox@muppetlabs.com
April, 1998
Added for zlib 1.1.3:
The patches come from
http://www.muppetlabs.com/~breadbox/software/assembly.html
To compile zlib with this asm file, copy match.S to the zlib directory
then do:
CFLAGS="-O3 -DASMV" ./configure
make OBJA=match.o
...@@ -32,3 +32,20 @@ then do: ...@@ -32,3 +32,20 @@ then do:
CFLAGS="-O3 -DASMV" ./configure CFLAGS="-O3 -DASMV" ./configure
make OBJA=match.o make OBJA=match.o
Update:
I've been ignoring these assembly routines for years, believing that
gcc's generated code had caught up with it sometime around gcc 2.95
and the major rearchitecting of the Pentium 4. However, I recently
learned that, despite what I believed, this code still has some life
in it. On the Pentium 4 and AMD64 chips, it continues to run about 8%
faster than the code produced by gcc 4.1.
In acknowledgement of its continuing usefulness, I've altered the
license to match that of the rest of zlib. Share and Enjoy!
Brian Raiter
breadbox@muppetlabs.com
April, 2007
/* match.s -- Pentium-Pro-optimized version of longest_match() /* match.S -- x86 assembly version of the zlib longest_match() function.
* Written for zlib 1.1.2 * Optimized for the Intel 686 chips (PPro and later).
* Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
* *
* This is free software; you can redistribute it and/or modify it * Copyright (C) 1998, 2007 Brian Raiter <breadbox@muppetlabs.com>
* under the terms of the GNU General Public License. *
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the author be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/ */
#ifndef NO_UNDERLINE #ifndef NO_UNDERLINE
......
...@@ -152,7 +152,7 @@ procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer; ...@@ -152,7 +152,7 @@ procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer;
const OutBuf: Pointer; BufSize: Integer); const OutBuf: Pointer; BufSize: Integer);
const const
zlib_version = '1.2.3'; zlib_version = '1.2.5';
type type
EZlibError = class(Exception); EZlibError = class(Exception);
......
...@@ -18,10 +18,10 @@ LDFLAGS = ...@@ -18,10 +18,10 @@ LDFLAGS =
# variables # variables
ZLIB_LIB = zlib.lib ZLIB_LIB = zlib.lib
OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infback.obj OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj
OBJ2 = inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzio.obj+infback.obj OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj
OBJP2 = +inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
# targets # targets
...@@ -38,7 +38,13 @@ crc32.obj: crc32.c zlib.h zconf.h crc32.h ...@@ -38,7 +38,13 @@ crc32.obj: crc32.c zlib.h zconf.h crc32.h
deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
gzio.obj: gzio.c zutil.h zlib.h zconf.h gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h
gzread.obj: gzread.c zlib.h zconf.h gzguts.h
gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h
infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
inffast.h inffixed.h inffast.h inffixed.h
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<property name="nunit.location" value="c:/program files/NUnit V2.1/bin" /> <property name="nunit.location" value="c:/program files/NUnit V2.1/bin" />
<property name="build.root" value="bin" /> <property name="build.root" value="bin" />
<property name="debug" value="true" /> <property name="debug" value="true" />
<property name="nunit" value="true" /> <property name="nunit" value="true" />
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</target> </target>
<target name="build" description="compiles the source code"> <target name="build" description="compiles the source code">
<mkdir dir="${build.folder}" /> <mkdir dir="${build.folder}" />
<csc target="library" output="${build.folder}DotZLib.dll" debug="${debug}"> <csc target="library" output="${build.folder}DotZLib.dll" debug="${debug}">
<references basedir="${nunit.location}"> <references basedir="${nunit.location}">
......
...@@ -2,7 +2,7 @@ using System.Reflection; ...@@ -2,7 +2,7 @@ using System.Reflection;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
// //
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
// //
...@@ -13,42 +13,42 @@ using System.Runtime.CompilerServices; ...@@ -13,42 +13,42 @@ using System.Runtime.CompilerServices;
[assembly: AssemblyProduct("")] [assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2004 by Henrik Ravn")] [assembly: AssemblyCopyright("(c) 2004 by Henrik Ravn")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
// //
// Version information for an assembly consists of the following four values: // Version information for an assembly consists of the following four values:
// //
// Major Version // Major Version
// Minor Version // Minor Version
// Build Number // Build Number
// Revision // Revision
// //
// You can specify all the values or you can default the Revision and Build Numbers // You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.*")]
// //
// In order to sign your assembly you must specify a key to use. Refer to the // In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing. // Microsoft .NET Framework documentation for more information on assembly signing.
// //
// Use the attributes below to control which key is used for signing. // Use the attributes below to control which key is used for signing.
// //
// Notes: // Notes:
// (*) If no key is specified, the assembly is not signed. // (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service // (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains // Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key. // a key.
// (*) If the KeyFile and the KeyName values are both specified, the // (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs: // following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used. // (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key // (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used. // in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be // When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is // relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is // %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile // located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this. // documentation for more information on this.
......
// //
// © Copyright Henrik Ravn 2004 // © Copyright Henrik Ravn 2004
// //
// Use, modification and distribution are subject to the Boost Software License, Version 1.0. // Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //
...@@ -25,7 +25,7 @@ namespace DotZLib ...@@ -25,7 +25,7 @@ namespace DotZLib
protected uint _current; protected uint _current;
/// <summary> /// <summary>
/// Initializes a new instance of the checksum generator base - the current checksum is /// Initializes a new instance of the checksum generator base - the current checksum is
/// set to zero /// set to zero
/// </summary> /// </summary>
public ChecksumGeneratorBase() public ChecksumGeneratorBase()
...@@ -61,7 +61,7 @@ namespace DotZLib ...@@ -61,7 +61,7 @@ namespace DotZLib
/// <exception cref="ArgumentException">The sum of offset and count is larger than the length of <c>data</c></exception> /// <exception cref="ArgumentException">The sum of offset and count is larger than the length of <c>data</c></exception>
/// <exception cref="NullReferenceException"><c>data</c> is a null reference</exception> /// <exception cref="NullReferenceException"><c>data</c> is a null reference</exception>
/// <exception cref="ArgumentOutOfRangeException">Offset or count is negative.</exception> /// <exception cref="ArgumentOutOfRangeException">Offset or count is negative.</exception>
/// <remarks>All the other <c>Update</c> methods are implmeneted in terms of this one. /// <remarks>All the other <c>Update</c> methods are implmeneted in terms of this one.
/// This is therefore the only method a derived class has to implement</remarks> /// This is therefore the only method a derived class has to implement</remarks>
public abstract void Update(byte[] data, int offset, int count); public abstract void Update(byte[] data, int offset, int count);
...@@ -101,7 +101,7 @@ namespace DotZLib ...@@ -101,7 +101,7 @@ namespace DotZLib
/// <summary> /// <summary>
/// Implements a CRC32 checksum generator /// Implements a CRC32 checksum generator
/// </summary> /// </summary>
public sealed class CRC32Checksum : ChecksumGeneratorBase public sealed class CRC32Checksum : ChecksumGeneratorBase
{ {
#region DLL imports #region DLL imports
...@@ -152,7 +152,7 @@ namespace DotZLib ...@@ -152,7 +152,7 @@ namespace DotZLib
/// <summary> /// <summary>
/// Implements a checksum generator that computes the Adler checksum on data /// Implements a checksum generator that computes the Adler checksum on data
/// </summary> /// </summary>
public sealed class AdlerChecksum : ChecksumGeneratorBase public sealed class AdlerChecksum : ChecksumGeneratorBase
{ {
#region DLL imports #region DLL imports
......
// //
// Copyright Henrik Ravn 2004 // Copyright Henrik Ravn 2004
// //
// Use, modification and distribution are subject to the Boost Software License, Version 1.0. // Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //
...@@ -25,7 +25,7 @@ namespace DotZLib ...@@ -25,7 +25,7 @@ namespace DotZLib
#endregion #endregion
public CircularBuffer(int capacity) public CircularBuffer(int capacity)
{ {
Debug.Assert( capacity > 0 ); Debug.Assert( capacity > 0 );
_buffer = new byte[capacity]; _buffer = new byte[capacity];
_capacity = capacity; _capacity = capacity;
......
// //
// Copyright Henrik Ravn 2004 // Copyright Henrik Ravn 2004
// //
// Use, modification and distribution are subject to the Boost Software License, Version 1.0. // Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //
...@@ -19,7 +19,7 @@ namespace DotZLib ...@@ -19,7 +19,7 @@ namespace DotZLib
#region Data members #region Data members
/// <summary> /// <summary>
/// Instance of the internal zlib buffer structure that is /// Instance of the internal zlib buffer structure that is
/// passed to all functions in the zlib dll /// passed to all functions in the zlib dll
/// </summary> /// </summary>
internal ZStream _ztream = new ZStream(); internal ZStream _ztream = new ZStream();
...@@ -45,7 +45,7 @@ namespace DotZLib ...@@ -45,7 +45,7 @@ namespace DotZLib
#endregion #endregion
/// <summary> /// <summary>
/// Initializes a new instance of the <c>CodeBase</c> class. /// Initializes a new instance of the <c>CodeBase</c> class.
/// </summary> /// </summary>
public CodecBase() public CodecBase()
{ {
...@@ -77,7 +77,7 @@ namespace DotZLib ...@@ -77,7 +77,7 @@ namespace DotZLib
if (_ztream.total_out > 0) if (_ztream.total_out > 0)
{ {
if (DataAvailable != null) if (DataAvailable != null)
DataAvailable( _outBuffer, 0, (int)_ztream.total_out); DataAvailable( _outBuffer, 0, (int)_ztream.total_out);
resetOutput(); resetOutput();
} }
} }
......
// //
// Copyright Henrik Ravn 2004 // Copyright Henrik Ravn 2004
// //
// Use, modification and distribution are subject to the Boost Software License, Version 1.0. // Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //
...@@ -56,7 +56,7 @@ namespace DotZLib ...@@ -56,7 +56,7 @@ namespace DotZLib
if (data == null) throw new ArgumentNullException(); if (data == null) throw new ArgumentNullException();
if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException(); if (offset < 0 || count < 0) throw new ArgumentOutOfRangeException();
if ((offset+count) > data.Length) throw new ArgumentException(); if ((offset+count) > data.Length) throw new ArgumentException();
int total = count; int total = count;
int inputIndex = offset; int inputIndex = offset;
int err = 0; int err = 0;
...@@ -86,7 +86,7 @@ namespace DotZLib ...@@ -86,7 +86,7 @@ namespace DotZLib
public override void Finish() public override void Finish()
{ {
int err; int err;
do do
{ {
err = deflate(ref _ztream, (int)FlushTypes.Finish); err = deflate(ref _ztream, (int)FlushTypes.Finish);
OnDataAvailable(); OnDataAvailable();
......
// //
// © Copyright Henrik Ravn 2004 // © Copyright Henrik Ravn 2004
// //
// Use, modification and distribution are subject to the Boost Software License, Version 1.0. // Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //
...@@ -19,7 +19,7 @@ namespace DotZLib ...@@ -19,7 +19,7 @@ namespace DotZLib
/// <summary> /// <summary>
/// Defines constants for the various flush types used with zlib /// Defines constants for the various flush types used with zlib
/// </summary> /// </summary>
internal enum FlushTypes internal enum FlushTypes
{ {
None, Partial, Sync, Full, Finish, Block None, Partial, Sync, Full, Finish, Block
} }
...@@ -38,7 +38,7 @@ namespace DotZLib ...@@ -38,7 +38,7 @@ namespace DotZLib
public uint total_out; public uint total_out;
[MarshalAs(UnmanagedType.LPStr)] [MarshalAs(UnmanagedType.LPStr)]
string msg; string msg;
uint state; uint state;
uint zalloc; uint zalloc;
...@@ -51,7 +51,7 @@ namespace DotZLib ...@@ -51,7 +51,7 @@ namespace DotZLib
} }
#endregion #endregion
#endregion #endregion
#region Public enums #region Public enums
...@@ -63,7 +63,7 @@ namespace DotZLib ...@@ -63,7 +63,7 @@ namespace DotZLib
/// <summary> /// <summary>
/// The default compression level with a reasonable compromise between compression and speed /// The default compression level with a reasonable compromise between compression and speed
/// </summary> /// </summary>
Default = -1, Default = -1,
/// <summary> /// <summary>
/// No compression at all. The data are passed straight through. /// No compression at all. The data are passed straight through.
/// </summary> /// </summary>
...@@ -71,7 +71,7 @@ namespace DotZLib ...@@ -71,7 +71,7 @@ namespace DotZLib
/// <summary> /// <summary>
/// The maximum compression rate available. /// The maximum compression rate available.
/// </summary> /// </summary>
Best = 9, Best = 9,
/// <summary> /// <summary>
/// The fastest available compression level. /// The fastest available compression level.
/// </summary> /// </summary>
...@@ -86,7 +86,7 @@ namespace DotZLib ...@@ -86,7 +86,7 @@ namespace DotZLib
public class ZLibException : ApplicationException public class ZLibException : ApplicationException
{ {
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ZLibException"/> class with a specified /// Initializes a new instance of the <see cref="ZLibException"/> class with a specified
/// error message and error code /// error message and error code
/// </summary> /// </summary>
/// <param name="errorCode">The zlib error code that caused the exception</param> /// <param name="errorCode">The zlib error code that caused the exception</param>
...@@ -96,7 +96,7 @@ namespace DotZLib ...@@ -96,7 +96,7 @@ namespace DotZLib
} }
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ZLibException"/> class with a specified /// Initializes a new instance of the <see cref="ZLibException"/> class with a specified
/// error code /// error code
/// </summary> /// </summary>
/// <param name="errorCode">The zlib error code that caused the exception</param> /// <param name="errorCode">The zlib error code that caused the exception</param>
...@@ -109,7 +109,7 @@ namespace DotZLib ...@@ -109,7 +109,7 @@ namespace DotZLib
#region Interfaces #region Interfaces
/// <summary> /// <summary>
/// Declares methods and properties that enables a running checksum to be calculated /// Declares methods and properties that enables a running checksum to be calculated
/// </summary> /// </summary>
public interface ChecksumGenerator public interface ChecksumGenerator
{ {
...@@ -163,7 +163,7 @@ namespace DotZLib ...@@ -163,7 +163,7 @@ namespace DotZLib
/// <paramref name="data">The byte array containing the processed data</paramref> /// <paramref name="data">The byte array containing the processed data</paramref>
/// <paramref name="startIndex">The index of the first processed byte in <c>data</c></paramref> /// <paramref name="startIndex">The index of the first processed byte in <c>data</c></paramref>
/// <paramref name="count">The number of processed bytes available</paramref> /// <paramref name="count">The number of processed bytes available</paramref>
/// <remarks>On return from this method, the data may be overwritten, so grab it while you can. /// <remarks>On return from this method, the data may be overwritten, so grab it while you can.
/// You cannot assume that startIndex will be zero. /// You cannot assume that startIndex will be zero.
/// </remarks> /// </remarks>
public delegate void DataAvailableHandler(byte[] data, int startIndex, int count); public delegate void DataAvailableHandler(byte[] data, int startIndex, int count);
......
// //
// Copyright Henrik Ravn 2004 // Copyright Henrik Ravn 2004
// //
// Use, modification and distribution are subject to the Boost Software License, Version 1.0. // Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //
...@@ -84,7 +84,7 @@ namespace DotZLib ...@@ -84,7 +84,7 @@ namespace DotZLib
return !_isWriting; return !_isWriting;
} }
} }
/// <summary> /// <summary>
/// Returns false. /// Returns false.
...@@ -96,7 +96,7 @@ namespace DotZLib ...@@ -96,7 +96,7 @@ namespace DotZLib
return false; return false;
} }
} }
/// <summary> /// <summary>
/// Returns true if this tsream is writeable, false otherwise /// Returns true if this tsream is writeable, false otherwise
/// </summary> /// </summary>
...@@ -108,7 +108,7 @@ namespace DotZLib ...@@ -108,7 +108,7 @@ namespace DotZLib
} }
} }
#endregion #endregion
#region Destructor & IDispose stuff #region Destructor & IDispose stuff
/// <summary> /// <summary>
...@@ -137,7 +137,7 @@ namespace DotZLib ...@@ -137,7 +137,7 @@ namespace DotZLib
} }
} }
#endregion #endregion
#region Basic reading and writing #region Basic reading and writing
/// <summary> /// <summary>
/// Attempts to read a number of bytes from the stream. /// Attempts to read a number of bytes from the stream.
...@@ -244,7 +244,7 @@ namespace DotZLib ...@@ -244,7 +244,7 @@ namespace DotZLib
{ {
throw new NotSupportedException(); throw new NotSupportedException();
} }
/// <summary> /// <summary>
/// Not suppported. /// Not suppported.
/// </summary> /// </summary>
...@@ -256,7 +256,7 @@ namespace DotZLib ...@@ -256,7 +256,7 @@ namespace DotZLib
{ {
throw new NotSupportedException(); throw new NotSupportedException();
} }
/// <summary> /// <summary>
/// Flushes the <c>GZipStream</c>. /// Flushes the <c>GZipStream</c>.
/// </summary> /// </summary>
...@@ -266,7 +266,7 @@ namespace DotZLib ...@@ -266,7 +266,7 @@ namespace DotZLib
{ {
// left empty on purpose // left empty on purpose
} }
/// <summary> /// <summary>
/// Gets/sets the current position in the <c>GZipStream</c>. Not suppported. /// Gets/sets the current position in the <c>GZipStream</c>. Not suppported.
/// </summary> /// </summary>
...@@ -283,7 +283,7 @@ namespace DotZLib ...@@ -283,7 +283,7 @@ namespace DotZLib
throw new NotSupportedException(); throw new NotSupportedException();
} }
} }
/// <summary> /// <summary>
/// Gets the size of the stream. Not suppported. /// Gets the size of the stream. Not suppported.
/// </summary> /// </summary>
......
// //
// © Copyright Henrik Ravn 2004 // © Copyright Henrik Ravn 2004
// //
// Use, modification and distribution are subject to the Boost Software License, Version 1.0. // Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //
...@@ -11,7 +11,7 @@ using System.Runtime.InteropServices; ...@@ -11,7 +11,7 @@ using System.Runtime.InteropServices;
namespace DotZLib namespace DotZLib
{ {
/// <summary> /// <summary>
/// Implements a data decompressor, using the inflate algorithm in the ZLib dll /// Implements a data decompressor, using the inflate algorithm in the ZLib dll
/// </summary> /// </summary>
...@@ -84,7 +84,7 @@ namespace DotZLib ...@@ -84,7 +84,7 @@ namespace DotZLib
public override void Finish() public override void Finish()
{ {
int err; int err;
do do
{ {
err = inflate(ref _ztream, (int)FlushTypes.Finish); err = inflate(ref _ztream, (int)FlushTypes.Finish);
OnDataAvailable(); OnDataAvailable();
......
// //
// Copyright Henrik Ravn 2004 // Copyright Henrik Ravn 2004
// //
// Use, modification and distribution are subject to the Boost Software License, Version 1.0. // Use, modification and distribution are subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// //
...@@ -156,7 +156,7 @@ namespace DotZLibTests ...@@ -156,7 +156,7 @@ namespace DotZLibTests
public void Info_Version() public void Info_Version()
{ {
Info info = new Info(); Info info = new Info();
Assert.AreEqual("1.2.3", Info.Version); Assert.AreEqual("1.2.5", Info.Version);
Assert.AreEqual(32, info.SizeOfUInt); Assert.AreEqual(32, info.SizeOfUInt);
Assert.AreEqual(32, info.SizeOfULong); Assert.AreEqual(32, info.SizeOfULong);
Assert.AreEqual(32, info.SizeOfPointer); Assert.AreEqual(32, info.SizeOfPointer);
...@@ -225,7 +225,7 @@ namespace DotZLibTests ...@@ -225,7 +225,7 @@ namespace DotZLibTests
[Test] [Test]
public void Inflate_Expand() public void Inflate_Expand()
{ {
uncompressedData.Clear(); uncompressedData.Clear();
using (Inflater inf = new Inflater()) using (Inflater inf = new Inflater())
...@@ -271,4 +271,4 @@ namespace DotZLibTests ...@@ -271,4 +271,4 @@ namespace DotZLibTests
} }
} }
#endif #endif
\ No newline at end of file
This directory contains a .Net wrapper class library for the ZLib1.dll This directory contains a .Net wrapper class library for the ZLib1.dll
The wrapper includes support for inflating/deflating memory buffers, The wrapper includes support for inflating/deflating memory buffers,
.Net streaming wrappers for the gz streams part of zlib, and wrappers .Net streaming wrappers for the gz streams part of zlib, and wrappers
for the checksum parts of zlib. See DotZLib/UnitTests.cs for examples. for the checksum parts of zlib. See DotZLib/UnitTests.cs for examples.
...@@ -26,11 +26,11 @@ Build instructions: ...@@ -26,11 +26,11 @@ Build instructions:
1. Using Visual Studio.Net 2003: 1. Using Visual Studio.Net 2003:
Open DotZLib.sln in VS.Net and build from there. Output file (DotZLib.dll) Open DotZLib.sln in VS.Net and build from there. Output file (DotZLib.dll)
will be found ./DotZLib/bin/release or ./DotZLib/bin/debug, depending on will be found ./DotZLib/bin/release or ./DotZLib/bin/debug, depending on
you are building the release or debug version of the library. Check you are building the release or debug version of the library. Check
DotZLib/UnitTests.cs for instructions on how to include unit tests in the DotZLib/UnitTests.cs for instructions on how to include unit tests in the
build. build.
2. Using NAnt: 2. Using NAnt:
Open a command prompt with access to the build environment and run nant Open a command prompt with access to the build environment and run nant
in the same directory as the DotZLib.build file. in the same directory as the DotZLib.build file.
...@@ -38,15 +38,15 @@ Build instructions: ...@@ -38,15 +38,15 @@ Build instructions:
debug={true|false} to toggle between release/debug builds (default=true). debug={true|false} to toggle between release/debug builds (default=true).
nunit={true|false} to include or esclude unit tests (default=true). nunit={true|false} to include or esclude unit tests (default=true).
Also the target clean will remove binaries. Also the target clean will remove binaries.
Output file (DotZLib.dll) will be found in either ./DotZLib/bin/release Output file (DotZLib.dll) will be found in either ./DotZLib/bin/release
or ./DotZLib/bin/debug, depending on whether you are building the release or ./DotZLib/bin/debug, depending on whether you are building the release
or debug version of the library. or debug version of the library.
Examples: Examples:
nant -D:debug=false -D:nunit=false nant -D:debug=false -D:nunit=false
will build a release mode version of the library without unit tests. will build a release mode version of the library without unit tests.
nant nant
will build a debug version of the library with unit tests will build a debug version of the library with unit tests
nant clean nant clean
will remove all previously built files. will remove all previously built files.
...@@ -54,5 +54,5 @@ Build instructions: ...@@ -54,5 +54,5 @@ Build instructions:
--------------------------------- ---------------------------------
Copyright (c) Henrik Ravn 2004 Copyright (c) Henrik Ravn 2004
Use, modification and distribution are subject to the Boost Software License, Version 1.0. Use, modification and distribution are subject to the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/* infback9.c -- inflate deflate64 data using a call-back interface /* infback9.c -- inflate deflate64 data using a call-back interface
* Copyright (C) 1995-2003 Mark Adler * Copyright (C) 1995-2008 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
*/ */
...@@ -242,7 +242,7 @@ void FAR *out_desc; ...@@ -242,7 +242,7 @@ void FAR *out_desc;
code const FAR *distcode; /* starting table for distance codes */ code const FAR *distcode; /* starting table for distance codes */
unsigned lenbits; /* index bits for lencode */ unsigned lenbits; /* index bits for lencode */
unsigned distbits; /* index bits for distcode */ unsigned distbits; /* index bits for distcode */
code this; /* current decoding table entry */ code here; /* current decoding table entry */
code last; /* parent table entry */ code last; /* parent table entry */
unsigned len; /* length to copy for repeats, bits to drop */ unsigned len; /* length to copy for repeats, bits to drop */
int ret; /* return code */ int ret; /* return code */
...@@ -384,19 +384,19 @@ void FAR *out_desc; ...@@ -384,19 +384,19 @@ void FAR *out_desc;
state->have = 0; state->have = 0;
while (state->have < state->nlen + state->ndist) { while (state->have < state->nlen + state->ndist) {
for (;;) { for (;;) {
this = lencode[BITS(lenbits)]; here = lencode[BITS(lenbits)];
if ((unsigned)(this.bits) <= bits) break; if ((unsigned)(here.bits) <= bits) break;
PULLBYTE(); PULLBYTE();
} }
if (this.val < 16) { if (here.val < 16) {
NEEDBITS(this.bits); NEEDBITS(here.bits);
DROPBITS(this.bits); DROPBITS(here.bits);
state->lens[state->have++] = this.val; state->lens[state->have++] = here.val;
} }
else { else {
if (this.val == 16) { if (here.val == 16) {
NEEDBITS(this.bits + 2); NEEDBITS(here.bits + 2);
DROPBITS(this.bits); DROPBITS(here.bits);
if (state->have == 0) { if (state->have == 0) {
strm->msg = (char *)"invalid bit length repeat"; strm->msg = (char *)"invalid bit length repeat";
mode = BAD; mode = BAD;
...@@ -406,16 +406,16 @@ void FAR *out_desc; ...@@ -406,16 +406,16 @@ void FAR *out_desc;
copy = 3 + BITS(2); copy = 3 + BITS(2);
DROPBITS(2); DROPBITS(2);
} }
else if (this.val == 17) { else if (here.val == 17) {
NEEDBITS(this.bits + 3); NEEDBITS(here.bits + 3);
DROPBITS(this.bits); DROPBITS(here.bits);
len = 0; len = 0;
copy = 3 + BITS(3); copy = 3 + BITS(3);
DROPBITS(3); DROPBITS(3);
} }
else { else {
NEEDBITS(this.bits + 7); NEEDBITS(here.bits + 7);
DROPBITS(this.bits); DROPBITS(here.bits);
len = 0; len = 0;
copy = 11 + BITS(7); copy = 11 + BITS(7);
DROPBITS(7); DROPBITS(7);
...@@ -433,7 +433,16 @@ void FAR *out_desc; ...@@ -433,7 +433,16 @@ void FAR *out_desc;
/* handle error breaks in while */ /* handle error breaks in while */
if (mode == BAD) break; if (mode == BAD) break;
/* build code tables */ /* check for end-of-block code (better have one) */
if (state->lens[256] == 0) {
strm->msg = (char *)"invalid code -- missing end-of-block";
mode = BAD;
break;
}
/* build code tables -- note: do not change the lenbits or distbits
values here (9 and 6) without reading the comments in inftree9.h
concerning the ENOUGH constants, which depend on those values */
state->next = state->codes; state->next = state->codes;
lencode = (code const FAR *)(state->next); lencode = (code const FAR *)(state->next);
lenbits = 9; lenbits = 9;
...@@ -460,28 +469,28 @@ void FAR *out_desc; ...@@ -460,28 +469,28 @@ void FAR *out_desc;
case LEN: case LEN:
/* get a literal, length, or end-of-block code */ /* get a literal, length, or end-of-block code */
for (;;) { for (;;) {
this = lencode[BITS(lenbits)]; here = lencode[BITS(lenbits)];
if ((unsigned)(this.bits) <= bits) break; if ((unsigned)(here.bits) <= bits) break;
PULLBYTE(); PULLBYTE();
} }
if (this.op && (this.op & 0xf0) == 0) { if (here.op && (here.op & 0xf0) == 0) {
last = this; last = here;
for (;;) { for (;;) {
this = lencode[last.val + here = lencode[last.val +
(BITS(last.bits + last.op) >> last.bits)]; (BITS(last.bits + last.op) >> last.bits)];
if ((unsigned)(last.bits + this.bits) <= bits) break; if ((unsigned)(last.bits + here.bits) <= bits) break;
PULLBYTE(); PULLBYTE();
} }
DROPBITS(last.bits); DROPBITS(last.bits);
} }
DROPBITS(this.bits); DROPBITS(here.bits);
length = (unsigned)this.val; length = (unsigned)here.val;
/* process literal */ /* process literal */
if (this.op == 0) { if (here.op == 0) {
Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
"inflate: literal '%c'\n" : "inflate: literal '%c'\n" :
"inflate: literal 0x%02x\n", this.val)); "inflate: literal 0x%02x\n", here.val));
ROOM(); ROOM();
*put++ = (unsigned char)(length); *put++ = (unsigned char)(length);
left--; left--;
...@@ -490,21 +499,21 @@ void FAR *out_desc; ...@@ -490,21 +499,21 @@ void FAR *out_desc;
} }
/* process end of block */ /* process end of block */
if (this.op & 32) { if (here.op & 32) {
Tracevv((stderr, "inflate: end of block\n")); Tracevv((stderr, "inflate: end of block\n"));
mode = TYPE; mode = TYPE;
break; break;
} }
/* invalid code */ /* invalid code */
if (this.op & 64) { if (here.op & 64) {
strm->msg = (char *)"invalid literal/length code"; strm->msg = (char *)"invalid literal/length code";
mode = BAD; mode = BAD;
break; break;
} }
/* length code -- get extra bits, if any */ /* length code -- get extra bits, if any */
extra = (unsigned)(this.op) & 31; extra = (unsigned)(here.op) & 31;
if (extra != 0) { if (extra != 0) {
NEEDBITS(extra); NEEDBITS(extra);
length += BITS(extra); length += BITS(extra);
...@@ -514,30 +523,30 @@ void FAR *out_desc; ...@@ -514,30 +523,30 @@ void FAR *out_desc;
/* get distance code */ /* get distance code */
for (;;) { for (;;) {
this = distcode[BITS(distbits)]; here = distcode[BITS(distbits)];
if ((unsigned)(this.bits) <= bits) break; if ((unsigned)(here.bits) <= bits) break;
PULLBYTE(); PULLBYTE();
} }
if ((this.op & 0xf0) == 0) { if ((here.op & 0xf0) == 0) {
last = this; last = here;
for (;;) { for (;;) {
this = distcode[last.val + here = distcode[last.val +
(BITS(last.bits + last.op) >> last.bits)]; (BITS(last.bits + last.op) >> last.bits)];
if ((unsigned)(last.bits + this.bits) <= bits) break; if ((unsigned)(last.bits + here.bits) <= bits) break;
PULLBYTE(); PULLBYTE();
} }
DROPBITS(last.bits); DROPBITS(last.bits);
} }
DROPBITS(this.bits); DROPBITS(here.bits);
if (this.op & 64) { if (here.op & 64) {
strm->msg = (char *)"invalid distance code"; strm->msg = (char *)"invalid distance code";
mode = BAD; mode = BAD;
break; break;
} }
offset = (unsigned)this.val; offset = (unsigned)here.val;
/* get distance extra bits, if any */ /* get distance extra bits, if any */
extra = (unsigned)(this.op) & 15; extra = (unsigned)(here.op) & 15;
if (extra != 0) { if (extra != 0) {
NEEDBITS(extra); NEEDBITS(extra);
offset += BITS(extra); offset += BITS(extra);
......
/* inftree9.c -- generate Huffman trees for efficient decoding /* inftree9.c -- generate Huffman trees for efficient decoding
* Copyright (C) 1995-2005 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
*/ */
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#define MAXBITS 15 #define MAXBITS 15
const char inflate9_copyright[] = const char inflate9_copyright[] =
" inflate9 1.2.3 Copyright 1995-2005 Mark Adler "; " inflate9 1.2.5 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; ...@@ -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, 201, 196}; 133, 133, 133, 133, 144, 73, 195};
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,
...@@ -160,11 +160,10 @@ unsigned short FAR *work; ...@@ -160,11 +160,10 @@ unsigned short FAR *work;
entered in the tables. entered in the tables.
used keeps track of how many table entries have been allocated from the used keeps track of how many table entries have been allocated from the
provided *table space. It is checked when a LENS table is being made provided *table space. It is checked for LENS and DIST tables against
against the space in *table, ENOUGH, minus the maximum space needed by the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
the worst case distance code, MAXD. This should never happen, but the the initial root table size constants. See the comments in inftree9.h
sufficiency of ENOUGH has not been proven exhaustively, hence the check. for more information.
This assumes that when type == LENS, bits == 9.
sym increments through all symbols, and the loop terminates when sym increments through all symbols, and the loop terminates when
all codes of length max, i.e. all codes, have been processed. This all codes of length max, i.e. all codes, have been processed. This
...@@ -203,7 +202,8 @@ unsigned short FAR *work; ...@@ -203,7 +202,8 @@ unsigned short FAR *work;
mask = used - 1; /* mask for comparing low */ mask = used - 1; /* mask for comparing low */
/* check available table space */ /* check available table space */
if (type == LENS && used >= ENOUGH - MAXD) if ((type == LENS && used >= ENOUGH_LENS) ||
(type == DISTS && used >= ENOUGH_DISTS))
return 1; return 1;
/* process all codes and make table entries */ /* process all codes and make table entries */
...@@ -270,7 +270,8 @@ unsigned short FAR *work; ...@@ -270,7 +270,8 @@ unsigned short FAR *work;
/* check for enough space */ /* check for enough space */
used += 1U << curr; used += 1U << curr;
if (type == LENS && used >= ENOUGH - MAXD) if ((type == LENS && used >= ENOUGH_LENS) ||
(type == DISTS && used >= ENOUGH_DISTS))
return 1; return 1;
/* point entry in root table to sub-table */ /* point entry in root table to sub-table */
......
/* inftree9.h -- header to use inftree9.c /* inftree9.h -- header to use inftree9.c
* Copyright (C) 1995-2003 Mark Adler * Copyright (C) 1995-2008 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
*/ */
...@@ -35,15 +35,21 @@ typedef struct { ...@@ -35,15 +35,21 @@ typedef struct {
01000000 - invalid code 01000000 - invalid code
*/ */
/* Maximum size of dynamic tree. The maximum found in a long but non- /* Maximum size of the dynamic table. The maximum number of code structures is
exhaustive search was 1444 code structures (852 for length/literals 1446, which is the sum of 852 for literal/length codes and 594 for distance
and 592 for distances, the latter actually the result of an codes. These values were found by exhaustive searches using the program
exhaustive search). The true maximum is not known, but the value examples/enough.c found in the zlib distribtution. The arguments to that
below is more than safe. */ program are the number of symbols, the initial root table size, and the
#define ENOUGH 2048 maximum bit length of a code. "enough 286 9 15" for literal/length codes
#define MAXD 592 returns returns 852, and "enough 32 6 15" for distance codes returns 594.
The initial root table size (9 or 6) is found in the fifth argument of the
inflate_table() calls in infback9.c. If the root table size is changed,
then these maximum sizes would be need to be recalculated and updated. */
#define ENOUGH_LENS 852
#define ENOUGH_DISTS 594
#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
/* Type of code to build for inftable() */ /* Type of code to build for inflate_table9() */
typedef enum { typedef enum {
CODES, CODES,
LENS, LENS,
......
...@@ -113,7 +113,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ ...@@ -113,7 +113,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
ar.beg = ar.out - (start - strm->avail_out); ar.beg = ar.out - (start - strm->avail_out);
ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT); ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT);
ar.wsize = state->wsize; ar.wsize = state->wsize;
ar.write = state->write; ar.write = state->wnext;
ar.window = state->window; ar.window = state->window;
ar.hold = state->hold; ar.hold = state->hold;
ar.bits = state->bits; ar.bits = state->bits;
......
...@@ -2,8 +2,10 @@ ...@@ -2,8 +2,10 @@
; deflate_state *s, ; deflate_state *s,
; IPos cur_match); /* current match */ ; IPos cur_match); /* current match */
; gvmat64.asm -- Asm portion of the optimized longest_match for 32 bits x86 ; gvmat64.asm -- Asm portion of the optimized longest_match for 32 bits x86_64
; Copyright (C) 1995-2005 Jean-loup Gailly, Brian Raiter and Gilles Vollant. ; (AMD64 on Athlon 64, Opteron, Phenom
; and Intel EM64T on Pentium 4 with EM64T, Pentium D, Core 2 Duo, Core I5/I7)
; Copyright (C) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant.
; ;
; File written by Gilles Vollant, by converting to assembly the longest_match ; File written by Gilles Vollant, by converting to assembly the longest_match
; from Jean-loup Gailly in deflate.c of zLib and infoZip zip. ; from Jean-loup Gailly in deflate.c of zLib and infoZip zip.
...@@ -11,6 +13,24 @@ ...@@ -11,6 +13,24 @@
; and by taking inspiration on asm686 with masm, optimised assembly code ; and by taking inspiration on asm686 with masm, optimised assembly code
; from Brian Raiter, written 1998 ; from Brian Raiter, written 1998
; ;
; This software is provided 'as-is', without any express or implied
; warranty. In no event will the authors be held liable for any damages
; arising from the use of this software.
;
; Permission is granted to anyone to use this software for any purpose,
; including commercial applications, and to alter it and redistribute it
; freely, subject to the following restrictions:
;
; 1. The origin of this software must not be misrepresented; you must not
; claim that you wrote the original software. If you use this software
; in a product, an acknowledgment in the product documentation would be
; appreciated but is not required.
; 2. Altered source versions must be plainly marked as such, and must not be
; misrepresented as being the original software
; 3. This notice may not be removed or altered from any source distribution.
;
;
;
; http://www.zlib.net ; http://www.zlib.net
; http://www.winimage.com/zLibDll ; http://www.winimage.com/zLibDll
; http://www.muppetlabs.com/~breadbox/software/assembly.html ; http://www.muppetlabs.com/~breadbox/software/assembly.html
...@@ -26,10 +46,10 @@ ...@@ -26,10 +46,10 @@
; ;
; This file compile with Microsoft Macro Assembler (x64) for AMD64 ; This file compile with Microsoft Macro Assembler (x64) for AMD64
; ;
; ml64.exe is given with Visual Studio 2005 and Windows 2003 server DDK ; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK
; ;
; (you can get Windows 2003 server DDK with ml64 and cl for AMD64 from ; (you can get Windows WDK with ml64 for AMD64 from
; http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price) ; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price)
; ;
...@@ -71,6 +91,25 @@ save_r13 equ rsp + 64 - LocalVarsSize ...@@ -71,6 +91,25 @@ save_r13 equ rsp + 64 - LocalVarsSize
;save_r15 equ rsp + 80 - LocalVarsSize ;save_r15 equ rsp + 80 - LocalVarsSize
; summary of register usage
; scanend ebx
; scanendw bx
; chainlenwmask edx
; curmatch rsi
; curmatchd esi
; windowbestlen r8
; scanalign r9
; scanalignd r9d
; window r10
; bestlen r11
; bestlend r11d
; scanstart r12d
; scanstartw r12w
; scan r13
; nicematch r14d
; limit r15
; limitd r15d
; prev rcx
; all the +4 offsets are due to the addition of pending_buf_size (in zlib ; all the +4 offsets are due to the addition of pending_buf_size (in zlib
; in the deflate_state structure since the asm code was first written ; in the deflate_state structure since the asm code was first written
...@@ -406,7 +445,8 @@ LoopCmps: ...@@ -406,7 +445,8 @@ LoopCmps:
add rdx,8+8+8 add rdx,8+8+8
jmp short LoopCmps jnz short LoopCmps
jmp short LenMaximum
LeaveLoopCmps16: add rdx,8 LeaveLoopCmps16: add rdx,8
LeaveLoopCmps8: add rdx,8 LeaveLoopCmps8: add rdx,8
LeaveLoopCmps: LeaveLoopCmps:
......
...@@ -111,11 +111,11 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ ...@@ -111,11 +111,11 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
type_ar ar; type_ar ar;
void inffas8664fnc(struct inffast_ar * par); void inffas8664fnc(struct inffast_ar * par);
#if (defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 )) || (defined(_MSC_VER) && defined(_M_AMD64)) #if (defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 )) || (defined(_MSC_VER) && defined(_M_AMD64))
#define PAD_AVAIL_IN 6 #define PAD_AVAIL_IN 6
#define PAD_AVAIL_OUT 258 #define PAD_AVAIL_OUT 258
#else #else
#define PAD_AVAIL_IN 5 #define PAD_AVAIL_IN 5
#define PAD_AVAIL_OUT 257 #define PAD_AVAIL_OUT 257
...@@ -130,7 +130,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ ...@@ -130,7 +130,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
ar.beg = ar.out - (start - strm->avail_out); ar.beg = ar.out - (start - strm->avail_out);
ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT); ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT);
ar.wsize = state->wsize; ar.wsize = state->wsize;
ar.write = state->write; ar.write = state->wnext;
ar.window = state->window; ar.window = state->window;
ar.hold = state->hold; ar.hold = state->hold;
ar.bits = state->bits; ar.bits = state->bits;
......
...@@ -9,12 +9,16 @@ ...@@ -9,12 +9,16 @@
; ml64.exe /Flinffasx64 /c /Zi inffasx64.asm ; ml64.exe /Flinffasx64 /c /Zi inffasx64.asm
; with Microsoft Macro Assembler (x64) for AMD64 ; with Microsoft Macro Assembler (x64) for AMD64
; ;
; ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK
; This file compile with Microsoft Macro Assembler (x64) for AMD64
;
; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK
; ;
; (you can get Windows 2003 server DDK with ml64 and cl.exe for AMD64 from ; (you can get Windows WDK with ml64 for AMD64 from
; http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price) ; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price)
; ;
.code .code
inffas8664fnc PROC inffas8664fnc PROC
...@@ -379,7 +383,7 @@ L_break_loop_with_status: ...@@ -379,7 +383,7 @@ L_break_loop_with_status:
mov r14,[rsp-40] mov r14,[rsp-40]
mov r15,[rsp-48] mov r15,[rsp-48]
mov rbx,[rsp-56] mov rbx,[rsp-56]
ret 0 ret 0
; : ; :
; : "m" (ar) ; : "m" (ar)
......
...@@ -12,7 +12,10 @@ inffasx64.asm and inffas8664.c were written by Chris Anderson, by optimizing ...@@ -12,7 +12,10 @@ inffasx64.asm and inffas8664.c were written by Chris Anderson, by optimizing
Use instructions Use instructions
---------------- ----------------
Copy these files into the zlib source directory. Assemble the .asm files using MASM and put the object files into the zlib source
directory. You can also get object files here:
http://www.winimage.com/zLibDll/zlib124_masm_obj.zip
define ASMV and ASMINF in your project. Include inffas8664.c in your source tree, define ASMV and ASMINF in your project. Include inffas8664.c in your source tree,
and inffasx64.obj and gvmat64.obj as object to link. and inffasx64.obj and gvmat64.obj as object to link.
...@@ -24,5 +27,5 @@ run bld_64.bat with Microsoft Macro Assembler (x64) for AMD64 (ml64.exe) ...@@ -24,5 +27,5 @@ run bld_64.bat with Microsoft Macro Assembler (x64) for AMD64 (ml64.exe)
ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK
You can get Windows 2003 server DDK with ml64 and cl for AMD64 from You can get Windows 2003 server DDK with ml64 and cl for AMD64 from
http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price) http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price)
ml /coff /Zi /c /Flgvmat32.lst gvmat32.asm ml /coff /Zi /c /Flmatch686.lst match686.asm
ml /coff /Zi /c /Flinffas32.lst inffas32.asm ml /coff /Zi /c /Flinffas32.lst inffas32.asm
/* gvmat32.c -- C portion of the optimized longest_match for 32 bits x86
* Copyright (C) 1995-1996 Jean-loup Gailly and Gilles Vollant.
* File written by Gilles Vollant, by modifiying the longest_match
* from Jean-loup Gailly in deflate.c
* it prepare all parameters and call the assembly longest_match_gvasm
* longest_match execute standard C code is wmask != 0x7fff
* (assembly code is faster with a fixed wmask)
*
* Read comment at beginning of gvmat32.asm for more information
*/
#if defined(ASMV) && (!defined(NOOLDPENTIUMCODE))
#include "deflate.h"
/* if your C compiler don't add underline before function name,
define ADD_UNDERLINE_ASMFUNC */
#ifdef ADD_UNDERLINE_ASMFUNC
#define longest_match_7fff _longest_match_7fff
#define longest_match_686 _longest_match_686
#define cpudetect32 _cpudetect32
#endif
unsigned long cpudetect32();
uInt longest_match_c(
deflate_state *s,
IPos cur_match); /* current match */
uInt longest_match_7fff(
deflate_state *s,
IPos cur_match); /* current match */
uInt longest_match_686(
deflate_state *s,
IPos cur_match); /* current match */
static uInt iIsPPro=2;
void match_init ()
{
iIsPPro = (((cpudetect32()/0x100)&0xf)>=6) ? 1 : 0;
}
uInt longest_match(
deflate_state *s,
IPos cur_match) /* current match */
{
if (iIsPPro!=0)
return longest_match_686(s,cur_match);
if (s->w_mask != 0x7fff)
return longest_match_686(s,cur_match);
/* now ((s->w_mask == 0x7fff) && (iIsPPro==0)) */
return longest_match_7fff(s,cur_match);
}
#endif /* defined(ASMV) && (!defined(NOOLDPENTIUMCODE)) */
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
; * enabled. I will attempt to merge the MMX code into this version. Newer ; * enabled. I will attempt to merge the MMX code into this version. Newer
; * versions of this and inffast.S can be found at ; * versions of this and inffast.S can be found at
; * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/ ; * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/
; * ; *
; * 2005 : modification by Gilles Vollant ; * 2005 : modification by Gilles Vollant
; */ ; */
; For Visual C++ 4.x and higher and ML 6.x and higher ; For Visual C++ 4.x and higher and ML 6.x and higher
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
; zlib122sup is 0 fort zlib 1.2.2.1 and lower ; zlib122sup is 0 fort zlib 1.2.2.1 and lower
; zlib122sup is 8 fort zlib 1.2.2.2 and more (with addition of dmax and head ; zlib122sup is 8 fort zlib 1.2.2.2 and more (with addition of dmax and head
; in inflate_state in inflate.h) ; in inflate_state in inflate.h)
zlib1222sup equ 8 zlib1222sup equ 8
...@@ -644,9 +644,9 @@ L_init_mmx: ...@@ -644,9 +644,9 @@ L_init_mmx:
movd mm0,ebp movd mm0,ebp
mov ebp,ebx mov ebp,ebx
; 896 "inffast.S" ; 896 "inffast.S"
movd mm4,[esp+0] movd mm4,dword ptr [esp+0]
movq mm3,mm4 movq mm3,mm4
movd mm5,[esp+4] movd mm5,dword ptr [esp+4]
movq mm2,mm5 movq mm2,mm5
pxor mm1,mm1 pxor mm1,mm1
mov ebx, [esp+8] mov ebx, [esp+8]
...@@ -660,7 +660,7 @@ L_do_loop_mmx: ...@@ -660,7 +660,7 @@ L_do_loop_mmx:
ja L_get_length_code_mmx ja L_get_length_code_mmx
movd mm6,ebp movd mm6,ebp
movd mm7,[esi] movd mm7,dword ptr [esi]
add esi,4 add esi,4
psllq mm7,mm6 psllq mm7,mm6
add ebp,32 add ebp,32
...@@ -717,7 +717,7 @@ L_decode_distance_mmx: ...@@ -717,7 +717,7 @@ L_decode_distance_mmx:
ja L_get_dist_code_mmx ja L_get_dist_code_mmx
movd mm6,ebp movd mm6,ebp
movd mm7,[esi] movd mm7,dword ptr [esi]
add esi,4 add esi,4
psllq mm7,mm6 psllq mm7,mm6
add ebp,32 add ebp,32
......
cl /DASMV /I..\.. /O2 /c gvmat32c.c
ml /coff /Zi /c /Flgvmat32.lst gvmat32.asm
ml /coff /Zi /c /Flinffas32.lst inffas32.asm
Summary Summary
------- -------
This directory contains ASM implementations of the functions This directory contains ASM implementations of the functions
longest_match() and inflate_fast(). longest_match() and inflate_fast().
Use instructions Use instructions
---------------- ----------------
Copy these files into the zlib source directory, then run the Assemble using MASM, and copy the object files into the zlib source
appropriate makefile, as suggested below. directory, then run the appropriate makefile, as suggested below. You can
donwload MASM from here:
Build instructions http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64
------------------
* With Microsoft C and MASM: You can also get objects files here:
nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="gvmat32c.obj gvmat32.obj inffas32.obj"
http://www.winimage.com/zLibDll/zlib124_masm_obj.zip
* With Borland C and TASM:
make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="gvmat32c.obj gvmat32.obj inffas32.obj" OBJPA="+gvmat32c.obj+gvmat32.obj+inffas32.obj" Build instructions
------------------
* With Microsoft C and MASM:
nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj"
* With Borland C and TASM:
make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" OBJPA="+match686c.obj+match686.obj+inffas32.obj"
Change in 1.01e (12 feb 05)
- Fix in zipOpen2 for globalcomment (Rolf Kalbermatter)
- Fix possible memory leak in unzip.c (Zoran Stevanovic)
Change in 1.01b (20 may 04)
- Integrate patch from Debian package (submited by Mark Brown)
- Add tools mztools from Xavier Roche
Change in 1.01 (8 may 04)
- fix buffer overrun risk in unzip.c (Xavier Roche)
- fix a minor buffer insecurity in minizip.c (Mike Whittaker)
Change in 1.00: (10 sept 03)
- rename to 1.00
- cosmetic code change
Change in 0.22: (19 May 03)
- crypting support (unless you define NOCRYPT)
- append file in existing zipfile
Change in 0.21: (10 Mar 03)
- bug fixes
Change in 0.17: (27 Jan 02)
- bug fixes
Change in 0.16: (19 Jan 02)
- Support of ioapi for virtualize zip file access
Change in 0.15: (19 Mar 98)
- fix memory leak in minizip.c
Change in 0.14: (10 Mar 98)
- fix bugs in minizip.c sample for zipping big file
- fix problem in month in date handling
- fix bug in unzlocal_GetCurrentFileInfoInternal in unzip.c for
comment handling
Change in 0.13: (6 Mar 98)
- fix bugs in zip.c
- add real minizip sample
Change in 0.12: (4 Mar 98)
- add zip.c and zip.h for creates .zip file
- fix change_file_date in miniunz.c for Unix (Jean-loup Gailly)
- fix miniunz.c for file without specific record for directory
Change in 0.11: (3 Mar 98)
- fix bug in unzGetCurrentFileInfo for get extra field and comment
- enhance miniunz sample, remove the bad unztst.c sample
Change in 0.10: (2 Mar 98)
- fix bug in unzReadCurrentFile
- rename unzip* to unz* function and structure
- remove Windows-like hungary notation variable name
- modify some structure in unzip.h
- add somes comment in source
- remove unzipGetcCurrentFile function
- replace ZUNZEXPORT by ZEXPORT
- add unzGetLocalExtrafield for get the local extrafield info
- add a new sample, miniunz.c
Change in 0.4: (25 Feb 98)
- suppress the type unzipFileInZip.
Only on file in the zipfile can be open at the same time
- fix somes typo in code
- added tm_unz structure in unzip_file_info (date/time in readable format)
MiniZip 1.1 was derrived from MiniZip at version 1.01f
Change in 1.0 (Okt 2009)
- **TODO - Add history**
MiniZip - Copyright (c) 1998-2010 - by Gilles Vollant - version 1.1 64 bits from Mathias Svensson
Introduction
---------------------
MiniZip 1.1 is built from MiniZip 1.0 by Gilles Vollant ( http://www.winimage.com/zLibDll/minizip.html )
When adding ZIP64 support into minizip it would result into risk of breaking compatibility with minizip 1.0.
All possible work was done for compatibility.
Background
---------------------
When adding ZIP64 support Mathias Svensson found that Even Rouault have added ZIP64
support for unzip.c into minizip for a open source project called gdal ( http://www.gdal.org/ )
That was used as a starting point. And after that ZIP64 support was added to zip.c
some refactoring and code cleanup was also done.
Changed from MiniZip 1.0 to MiniZip 1.1
---------------------------------------
* Added ZIP64 support for unzip ( by Even Rouault )
* Added ZIP64 support for zip ( by Mathias Svensson )
* Reverted some changed that Even Rouault did.
* Bunch of patches received from Gulles Vollant that he received for MiniZip from various users.
* Added unzip patch for BZIP Compression method (patch create by Daniel Borca)
* Added BZIP Compress method for zip
* Did some refactoring and code cleanup
Credits
Gilles Vollant - Original MiniZip author
Even Rouault - ZIP64 unzip Support
Daniel Borca - BZip Compression method support in unzip
Mathias Svensson - ZIP64 zip support
Mathias Svensson - BZip Compression method support in zip
Resources
ZipLayout http://result42.com/projects/ZipFileLayout
Command line tool for Windows that shows the layout and information of the headers in a zip archive.
Used when debugging and validating the creation of zip files using MiniZip64
ZIP App Note http://www.pkware.com/documents/casestudies/APPNOTE.TXT
Zip File specification
Notes.
* To be able to use BZip compression method in zip64.c or unzip64.c the BZIP2 lib is needed and HAVE_BZIP2 need to be defined.
License
----------------------------------------------------------
Condition of use and distribution are the same than zlib :
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
----------------------------------------------------------
...@@ -87,13 +87,12 @@ static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned lon ...@@ -87,13 +87,12 @@ static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned lon
# define ZCR_SEED2 3141592654UL /* use PI as default pattern */ # define ZCR_SEED2 3141592654UL /* use PI as default pattern */
# endif # endif
static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting) static int crypthead(const char* passwd, /* password string */
const char *passwd; /* password string */ unsigned char* buf, /* where to write header */
unsigned char *buf; /* where to write header */ int bufSize,
int bufSize; unsigned long* pkeys,
unsigned long* pkeys; const unsigned long* pcrc_32_tab,
const unsigned long* pcrc_32_tab; unsigned long crcForCrypting)
unsigned long crcForCrypting;
{ {
int n; /* index in random header */ int n; /* index in random header */
int t; /* temporary */ int t; /* temporary */
...@@ -124,8 +123,8 @@ static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting) ...@@ -124,8 +123,8 @@ static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting)
{ {
buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t);
} }
buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
return n; return n;
} }
......
/* ioapi.c -- IO base function header for compress/uncompress .zip /* ioapi.h -- IO base function header for compress/uncompress .zip
files using zlib + zip or unzip API part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Version 1.01e, February 12th, 2005 Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2005 Gilles Vollant
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "zlib.h"
#include "ioapi.h"
Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ */
#ifndef SEEK_CUR #if (defined(_WIN32))
#define SEEK_CUR 1 #define _CRT_SECURE_NO_WARNINGS
#endif #endif
#ifndef SEEK_END #include "ioapi.h"
#define SEEK_END 2
#endif
#ifndef SEEK_SET voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)
#define SEEK_SET 0 {
#endif if (pfilefunc->zfile_func64.zopen64_file != NULL)
return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode);
else
{
return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode);
}
}
voidpf ZCALLBACK fopen_file_func OF(( long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)
voidpf opaque, {
const char* filename, if (pfilefunc->zfile_func64.zseek64_file != NULL)
int mode)); return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin);
else
{
uLong offsetTruncated = (uLong)offset;
if (offsetTruncated != offset)
return -1;
else
return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin);
}
}
uLong ZCALLBACK fread_file_func OF(( ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)
voidpf opaque, {
voidpf stream, if (pfilefunc->zfile_func64.zseek64_file != NULL)
void* buf, return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream);
uLong size)); else
{
uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream);
if ((tell_uLong) == ((uLong)-1))
return (ZPOS64_T)-1;
else
return tell_uLong;
}
}
uLong ZCALLBACK fwrite_file_func OF(( void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32)
voidpf opaque, {
voidpf stream, p_filefunc64_32->zfile_func64.zopen64_file = NULL;
const void* buf, p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file;
uLong size)); p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file;
p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file;
p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file;
p_filefunc64_32->zfile_func64.ztell64_file = NULL;
p_filefunc64_32->zfile_func64.zseek64_file = NULL;
p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file;
p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file;
p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque;
p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file;
p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file;
}
long ZCALLBACK ftell_file_func OF((
voidpf opaque,
voidpf stream));
long ZCALLBACK fseek_file_func OF((
voidpf opaque,
voidpf stream,
uLong offset,
int origin));
int ZCALLBACK fclose_file_func OF(( static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode));
voidpf opaque, static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
voidpf stream)); static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size));
static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream));
static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream));
static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));
int ZCALLBACK ferror_file_func OF(( static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode)
voidpf opaque, {
voidpf stream)); FILE* file = NULL;
const char* mode_fopen = NULL;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
mode_fopen = "rb";
else
if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
mode_fopen = "r+b";
else
if (mode & ZLIB_FILEFUNC_MODE_CREATE)
mode_fopen = "wb";
if ((filename!=NULL) && (mode_fopen != NULL))
file = fopen(filename, mode_fopen);
return file;
}
voidpf ZCALLBACK fopen_file_func (opaque, filename, mode) static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode)
voidpf opaque;
const char* filename;
int mode;
{ {
FILE* file = NULL; FILE* file = NULL;
const char* mode_fopen = NULL; const char* mode_fopen = NULL;
...@@ -82,48 +112,41 @@ voidpf ZCALLBACK fopen_file_func (opaque, filename, mode) ...@@ -82,48 +112,41 @@ voidpf ZCALLBACK fopen_file_func (opaque, filename, mode)
mode_fopen = "wb"; mode_fopen = "wb";
if ((filename!=NULL) && (mode_fopen != NULL)) if ((filename!=NULL) && (mode_fopen != NULL))
file = fopen(filename, mode_fopen); file = fopen64((const char*)filename, mode_fopen);
return file; return file;
} }
uLong ZCALLBACK fread_file_func (opaque, stream, buf, size) static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)
voidpf opaque;
voidpf stream;
void* buf;
uLong size;
{ {
uLong ret; uLong ret;
ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
return ret; return ret;
} }
static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size)
uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size)
voidpf opaque;
voidpf stream;
const void* buf;
uLong size;
{ {
uLong ret; uLong ret;
ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
return ret; return ret;
} }
long ZCALLBACK ftell_file_func (opaque, stream) static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
voidpf opaque;
voidpf stream;
{ {
long ret; long ret;
ret = ftell((FILE *)stream); ret = ftell((FILE *)stream);
return ret; return ret;
} }
long ZCALLBACK fseek_file_func (opaque, stream, offset, origin)
voidpf opaque; static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
voidpf stream; {
uLong offset; ZPOS64_T ret;
int origin; ret = ftello64((FILE *)stream);
return ret;
}
static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin)
{ {
int fseek_origin=0; int fseek_origin=0;
long ret; long ret;
...@@ -141,22 +164,45 @@ long ZCALLBACK fseek_file_func (opaque, stream, offset, origin) ...@@ -141,22 +164,45 @@ long ZCALLBACK fseek_file_func (opaque, stream, offset, origin)
default: return -1; default: return -1;
} }
ret = 0; ret = 0;
fseek((FILE *)stream, offset, fseek_origin); if (fseek((FILE *)stream, offset, fseek_origin) != 0)
ret = -1;
return ret; return ret;
} }
int ZCALLBACK fclose_file_func (opaque, stream) static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)
voidpf opaque; {
voidpf stream; int fseek_origin=0;
long ret;
switch (origin)
{
case ZLIB_FILEFUNC_SEEK_CUR :
fseek_origin = SEEK_CUR;
break;
case ZLIB_FILEFUNC_SEEK_END :
fseek_origin = SEEK_END;
break;
case ZLIB_FILEFUNC_SEEK_SET :
fseek_origin = SEEK_SET;
break;
default: return -1;
}
ret = 0;
if(fseeko64((FILE *)stream, offset, fseek_origin) != 0)
ret = -1;
return ret;
}
static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
{ {
int ret; int ret;
ret = fclose((FILE *)stream); ret = fclose((FILE *)stream);
return ret; return ret;
} }
int ZCALLBACK ferror_file_func (opaque, stream) static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream)
voidpf opaque;
voidpf stream;
{ {
int ret; int ret;
ret = ferror((FILE *)stream); ret = ferror((FILE *)stream);
...@@ -175,3 +221,15 @@ void fill_fopen_filefunc (pzlib_filefunc_def) ...@@ -175,3 +221,15 @@ void fill_fopen_filefunc (pzlib_filefunc_def)
pzlib_filefunc_def->zerror_file = ferror_file_func; pzlib_filefunc_def->zerror_file = ferror_file_func;
pzlib_filefunc_def->opaque = NULL; pzlib_filefunc_def->opaque = NULL;
} }
void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def)
{
pzlib_filefunc_def->zopen64_file = fopen64_file_func;
pzlib_filefunc_def->zread_file = fread_file_func;
pzlib_filefunc_def->zwrite_file = fwrite_file_func;
pzlib_filefunc_def->ztell64_file = ftell64_file_func;
pzlib_filefunc_def->zseek64_file = fseek64_file_func;
pzlib_filefunc_def->zclose_file = fclose_file_func;
pzlib_filefunc_def->zerror_file = ferror_file_func;
pzlib_filefunc_def->opaque = NULL;
}
/* ioapi.h -- IO base function header for compress/uncompress .zip /* ioapi.h -- IO base function header for compress/uncompress .zip
files using zlib + zip or unzip API part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Version 1.01e, February 12th, 2005 Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2005 Gilles Vollant Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
Changes
Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this)
Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux.
More if/def section may be needed to support other platforms
Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows.
(but you should use iowin32.c for windows instead)
*/
#ifndef _ZLIBIOAPI64_H
#define _ZLIBIOAPI64_H
#if (!defined(_WIN32)) && (!defined(WIN32))
// Linux needs this to support file operation on files larger then 4+GB
// But might need better if/def to select just the platforms that needs them.
#ifndef __USE_FILE_OFFSET64
#define __USE_FILE_OFFSET64
#endif
#ifndef __USE_LARGEFILE64
#define __USE_LARGEFILE64
#endif
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#ifndef _FILE_OFFSET_BIT
#define _FILE_OFFSET_BIT 64
#endif
#endif
#include <stdio.h>
#include <stdlib.h>
#include "zlib.h"
#if defined(USE_FILE32API)
#define fopen64 fopen
#define ftello64 ftell
#define fseeko64 fseek
#else
#ifdef _MSC_VER
#define fopen64 fopen
#if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC)))
#define ftello64 _ftelli64
#define fseeko64 _fseeki64
#else // old MSC
#define ftello64 ftell
#define fseeko64 fseek
#endif
#endif
#endif
/*
#ifndef ZPOS64_T
#ifdef _WIN32
#define ZPOS64_T fpos_t
#else
#include <stdint.h>
#define ZPOS64_T uint64_t
#endif
#endif
*/ */
#ifndef _ZLIBIOAPI_H #ifdef HAVE_MINIZIP64_CONF_H
#define _ZLIBIOAPI_H #include "mz64conf.h"
#endif
/* a type choosen by DEFINE */
#ifdef HAVE_64BIT_INT_CUSTOM
typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T;
#else
#ifdef HAS_STDINT_H
#include "stdint.h"
typedef uint64_t ZPOS64_T;
#else
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef unsigned __int64 ZPOS64_T;
#else
typedef unsigned long long int ZPOS64_T;
#endif
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define ZLIB_FILEFUNC_SEEK_CUR (1) #define ZLIB_FILEFUNC_SEEK_CUR (1)
...@@ -23,26 +114,27 @@ ...@@ -23,26 +114,27 @@
#ifndef ZCALLBACK #ifndef ZCALLBACK
#if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) #define ZCALLBACK CALLBACK
#define ZCALLBACK CALLBACK #else
#else #define ZCALLBACK
#define ZCALLBACK #endif
#endif
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
/* here is the "old" 32 bits structure structure */
typedef struct zlib_filefunc_def_s typedef struct zlib_filefunc_def_s
{ {
open_file_func zopen_file; open_file_func zopen_file;
...@@ -55,21 +147,54 @@ typedef struct zlib_filefunc_def_s ...@@ -55,21 +147,54 @@ typedef struct zlib_filefunc_def_s
voidpf opaque; voidpf opaque;
} zlib_filefunc_def; } zlib_filefunc_def;
typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream));
typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode));
typedef struct zlib_filefunc64_def_s
{
open64_file_func zopen64_file;
read_file_func zread_file;
write_file_func zwrite_file;
tell64_file_func ztell64_file;
seek64_file_func zseek64_file;
close_file_func zclose_file;
testerror_file_func zerror_file;
voidpf opaque;
} zlib_filefunc64_def;
void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def));
void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) /* now internal definition, only for zip.c and unzip.h */
#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) typedef struct zlib_filefunc64_32_def_s
#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) {
#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) zlib_filefunc64_def zfile_func64;
#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) open_file_func zopen32_file;
#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) tell_file_func ztell32_file;
seek_file_func zseek32_file;
} zlib_filefunc64_32_def;
#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream))
//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode))
#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream))
#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream))
voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode));
long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin));
ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream));
void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32);
#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode)))
#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream)))
#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode)))
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
/* iowin32.h -- IO base function header for compress/uncompress .zip /* iowin32.h -- IO base function header for compress/uncompress .zip
files using zlib + zip or unzip API Version 1.1, February 14h, 2010
This IO API version uses the Win32 API (for Microsoft Windows) part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Version 1.01e, February 12th, 2005 Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
Copyright (C) 1998-2005 Gilles Vollant
*/ */
#include <windows.h> #include <windows.h>
...@@ -15,6 +19,9 @@ extern "C" { ...@@ -15,6 +19,9 @@ extern "C" {
#endif #endif
void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
void fill_win32_filefunc64 OF((zlib_filefunc64_def* pzlib_filefunc_def));
void fill_win32_filefunc64A OF((zlib_filefunc64_def* pzlib_filefunc_def));
void fill_win32_filefunc64W OF((zlib_filefunc64_def* pzlib_filefunc_def));
#ifdef __cplusplus #ifdef __cplusplus
} }
......
$ if f$search("ioapi.h_orig") .eqs. "" then copy ioapi.h ioapi.h_orig
$ open/write zdef vmsdefs.h
$ copy sys$input: zdef
$ deck
#define unix
#define fill_zlib_filefunc64_32_def_from_filefunc32 fillzffunc64from
#define Write_Zip64EndOfCentralDirectoryLocator Write_Zip64EoDLocator
#define Write_Zip64EndOfCentralDirectoryRecord Write_Zip64EoDRecord
#define Write_EndOfCentralDirectoryRecord Write_EoDRecord
$ eod
$ close zdef
$ copy vmsdefs.h,ioapi.h_orig ioapi.h
$ cc/include=[--]/prefix=all ioapi.c
$ cc/include=[--]/prefix=all miniunz.c
$ cc/include=[--]/prefix=all unzip.c
$ cc/include=[--]/prefix=all minizip.c
$ cc/include=[--]/prefix=all zip.c
$ link miniunz,unzip,ioapi,[--]libz.olb/lib
$ link minizip,zip,ioapi,[--]libz.olb/lib
$ mcr []minizip test minizip_info.txt
$ mcr []miniunz -l test.zip
$ rename minizip_info.txt; minizip_info.txt_old
$ mcr []miniunz test.zip
$ delete test.zip;*
$exit
/* /*
miniunz.c miniunz.c
Version 1.01e, February 12th, 2005 Version 1.1, February 14h, 2010
sample part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2005 Gilles Vollant Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Modifications of Unzip for Zip64
Copyright (C) 2007-2008 Even Rouault
Modifications for Zip64 support on both zip and unzip
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
*/ */
#ifndef _WIN32
#ifndef __USE_FILE_OFFSET64
#define __USE_FILE_OFFSET64
#endif
#ifndef __USE_LARGEFILE64
#define __USE_LARGEFILE64
#endif
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#ifndef _FILE_OFFSET_BIT
#define _FILE_OFFSET_BIT 64
#endif
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -27,7 +48,7 @@ ...@@ -27,7 +48,7 @@
#define WRITEBUFFERSIZE (8192) #define WRITEBUFFERSIZE (8192)
#define MAXFILENAME (256) #define MAXFILENAME (256)
#ifdef WIN32 #ifdef _WIN32
#define USEWIN32IOAPI #define USEWIN32IOAPI
#include "iowin32.h" #include "iowin32.h"
#endif #endif
...@@ -51,11 +72,11 @@ void change_file_date(filename,dosdate,tmu_date) ...@@ -51,11 +72,11 @@ void change_file_date(filename,dosdate,tmu_date)
uLong dosdate; uLong dosdate;
tm_unz tmu_date; tm_unz tmu_date;
{ {
#ifdef WIN32 #ifdef _WIN32
HANDLE hFile; HANDLE hFile;
FILETIME ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite; FILETIME ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite;
hFile = CreateFile(filename,GENERIC_READ | GENERIC_WRITE, hFile = CreateFileA(filename,GENERIC_READ | GENERIC_WRITE,
0,NULL,OPEN_EXISTING,0,NULL); 0,NULL,OPEN_EXISTING,0,NULL);
GetFileTime(hFile,&ftCreate,&ftLastAcc,&ftLastWrite); GetFileTime(hFile,&ftCreate,&ftLastAcc,&ftLastWrite);
DosDateTimeToFileTime((WORD)(dosdate>>16),(WORD)dosdate,&ftLocal); DosDateTimeToFileTime((WORD)(dosdate>>16),(WORD)dosdate,&ftLocal);
...@@ -91,8 +112,8 @@ int mymkdir(dirname) ...@@ -91,8 +112,8 @@ int mymkdir(dirname)
const char* dirname; const char* dirname;
{ {
int ret=0; int ret=0;
#ifdef WIN32 #ifdef _WIN32
ret = mkdir(dirname); ret = _mkdir(dirname);
#else #else
#ifdef unix #ifdef unix
ret = mkdir (dirname,0775); ret = mkdir (dirname,0775);
...@@ -112,6 +133,11 @@ int makedir (newdir) ...@@ -112,6 +133,11 @@ int makedir (newdir)
return 0; return 0;
buffer = (char*)malloc(len+1); buffer = (char*)malloc(len+1);
if (buffer==NULL)
{
printf("Error allocating memory\n");
return UNZ_INTERNALERROR;
}
strcpy(buffer,newdir); strcpy(buffer,newdir);
if (buffer[len-1] == '/') { if (buffer[len-1] == '/') {
...@@ -164,34 +190,61 @@ void do_help() ...@@ -164,34 +190,61 @@ void do_help()
" -p extract crypted file using password\n\n"); " -p extract crypted file using password\n\n");
} }
void Display64BitsSize(ZPOS64_T n, int size_char)
{
/* to avoid compatibility problem , we do here the conversion */
char number[21];
int offset=19;
int pos_string = 19;
number[20]=0;
for (;;) {
number[offset]=(char)((n%10)+'0');
if (number[offset] != '0')
pos_string=offset;
n/=10;
if (offset==0)
break;
offset--;
}
{
int size_display_string = 19-pos_string;
while (size_char > size_display_string)
{
size_char--;
printf(" ");
}
}
printf("%s",&number[pos_string]);
}
int do_list(uf) int do_list(uf)
unzFile uf; unzFile uf;
{ {
uLong i; uLong i;
unz_global_info gi; unz_global_info64 gi;
int err; int err;
err = unzGetGlobalInfo (uf,&gi); err = unzGetGlobalInfo64(uf,&gi);
if (err!=UNZ_OK) if (err!=UNZ_OK)
printf("error %d with zipfile in unzGetGlobalInfo \n",err); printf("error %d with zipfile in unzGetGlobalInfo \n",err);
printf(" Length Method Size Ratio Date Time CRC-32 Name\n"); printf(" Length Method Size Ratio Date Time CRC-32 Name\n");
printf(" ------ ------ ---- ----- ---- ---- ------ ----\n"); printf(" ------ ------ ---- ----- ---- ---- ------ ----\n");
for (i=0;i<gi.number_entry;i++) for (i=0;i<gi.number_entry;i++)
{ {
char filename_inzip[256]; char filename_inzip[256];
unz_file_info file_info; unz_file_info64 file_info;
uLong ratio=0; uLong ratio=0;
const char *string_method; const char *string_method;
char charCrypt=' '; char charCrypt=' ';
err = unzGetCurrentFileInfo(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0); err = unzGetCurrentFileInfo64(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
if (err!=UNZ_OK) if (err!=UNZ_OK)
{ {
printf("error %d with zipfile in unzGetCurrentFileInfo\n",err); printf("error %d with zipfile in unzGetCurrentFileInfo\n",err);
break; break;
} }
if (file_info.uncompressed_size>0) if (file_info.uncompressed_size>0)
ratio = (file_info.compressed_size*100)/file_info.uncompressed_size; ratio = (uLong)((file_info.compressed_size*100)/file_info.uncompressed_size);
/* display a '*' if the file is crypted */ /* display a '*' if the file is crypted */
if ((file_info.flag & 1) != 0) if ((file_info.flag & 1) != 0)
...@@ -211,12 +264,17 @@ int do_list(uf) ...@@ -211,12 +264,17 @@ int do_list(uf)
string_method="Defl:F"; /* 2:fast , 3 : extra fast*/ string_method="Defl:F"; /* 2:fast , 3 : extra fast*/
} }
else else
if (file_info.compression_method==Z_BZIP2ED)
{
string_method="BZip2 ";
}
else
string_method="Unkn. "; string_method="Unkn. ";
printf("%7lu %6s%c%7lu %3lu%% %2.2lu-%2.2lu-%2.2lu %2.2lu:%2.2lu %8.8lx %s\n", Display64BitsSize(file_info.uncompressed_size,7);
file_info.uncompressed_size,string_method, printf(" %6s%c",string_method,charCrypt);
charCrypt, Display64BitsSize(file_info.compressed_size,7);
file_info.compressed_size, printf(" %3lu%% %2.2lu-%2.2lu-%2.2lu %2.2lu:%2.2lu %8.8lx %s\n",
ratio, ratio,
(uLong)file_info.tmu_date.tm_mon + 1, (uLong)file_info.tmu_date.tm_mon + 1,
(uLong)file_info.tmu_date.tm_mday, (uLong)file_info.tmu_date.tm_mday,
...@@ -252,9 +310,9 @@ int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password) ...@@ -252,9 +310,9 @@ int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password)
void* buf; void* buf;
uInt size_buf; uInt size_buf;
unz_file_info file_info; unz_file_info64 file_info;
uLong ratio=0; uLong ratio=0;
err = unzGetCurrentFileInfo(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0); err = unzGetCurrentFileInfo64(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
if (err!=UNZ_OK) if (err!=UNZ_OK)
{ {
...@@ -306,7 +364,7 @@ int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password) ...@@ -306,7 +364,7 @@ int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password)
{ {
char rep=0; char rep=0;
FILE* ftestexist; FILE* ftestexist;
ftestexist = fopen(write_filename,"rb"); ftestexist = fopen64(write_filename,"rb");
if (ftestexist!=NULL) if (ftestexist!=NULL)
{ {
fclose(ftestexist); fclose(ftestexist);
...@@ -317,7 +375,7 @@ int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password) ...@@ -317,7 +375,7 @@ int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password)
printf("The file %s exists. Overwrite ? [y]es, [n]o, [A]ll: ",write_filename); printf("The file %s exists. Overwrite ? [y]es, [n]o, [A]ll: ",write_filename);
ret = scanf("%1s",answer); ret = scanf("%1s",answer);
if (ret != 1) if (ret != 1)
{ {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
...@@ -337,7 +395,7 @@ int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password) ...@@ -337,7 +395,7 @@ int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password)
if ((skip==0) && (err==UNZ_OK)) if ((skip==0) && (err==UNZ_OK))
{ {
fout=fopen(write_filename,"wb"); fout=fopen64(write_filename,"wb");
/* some zipfile don't contain directory alone before file */ /* some zipfile don't contain directory alone before file */
if ((fout==NULL) && ((*popt_extract_without_path)==0) && if ((fout==NULL) && ((*popt_extract_without_path)==0) &&
...@@ -347,7 +405,7 @@ int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password) ...@@ -347,7 +405,7 @@ int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password)
*(filename_withoutpath-1)='\0'; *(filename_withoutpath-1)='\0';
makedir(write_filename); makedir(write_filename);
*(filename_withoutpath-1)=c; *(filename_withoutpath-1)=c;
fout=fopen(write_filename,"wb"); fout=fopen64(write_filename,"wb");
} }
if (fout==NULL) if (fout==NULL)
...@@ -409,11 +467,11 @@ int do_extract(uf,opt_extract_without_path,opt_overwrite,password) ...@@ -409,11 +467,11 @@ int do_extract(uf,opt_extract_without_path,opt_overwrite,password)
const char* password; const char* password;
{ {
uLong i; uLong i;
unz_global_info gi; unz_global_info64 gi;
int err; int err;
FILE* fout=NULL; FILE* fout=NULL;
err = unzGetGlobalInfo (uf,&gi); err = unzGetGlobalInfo64(uf,&gi);
if (err!=UNZ_OK) if (err!=UNZ_OK)
printf("error %d with zipfile in unzGetGlobalInfo \n",err); printf("error %d with zipfile in unzGetGlobalInfo \n",err);
...@@ -470,6 +528,7 @@ int main(argc,argv) ...@@ -470,6 +528,7 @@ int main(argc,argv)
const char *password=NULL; const char *password=NULL;
char filename_try[MAXFILENAME+16] = ""; char filename_try[MAXFILENAME+16] = "";
int i; int i;
int ret_value=0;
int opt_do_list=0; int opt_do_list=0;
int opt_do_extract=1; int opt_do_extract=1;
int opt_do_extract_withoutpath=0; int opt_do_extract_withoutpath=0;
...@@ -532,7 +591,7 @@ int main(argc,argv) ...@@ -532,7 +591,7 @@ int main(argc,argv)
{ {
# ifdef USEWIN32IOAPI # ifdef USEWIN32IOAPI
zlib_filefunc_def ffunc; zlib_filefunc64_def ffunc;
# endif # endif
strncpy(filename_try, zipfilename,MAXFILENAME-1); strncpy(filename_try, zipfilename,MAXFILENAME-1);
...@@ -540,18 +599,18 @@ int main(argc,argv) ...@@ -540,18 +599,18 @@ int main(argc,argv)
filename_try[ MAXFILENAME ] = '\0'; filename_try[ MAXFILENAME ] = '\0';
# ifdef USEWIN32IOAPI # ifdef USEWIN32IOAPI
fill_win32_filefunc(&ffunc); fill_win32_filefunc64A(&ffunc);
uf = unzOpen2(zipfilename,&ffunc); uf = unzOpen2_64(zipfilename,&ffunc);
# else # else
uf = unzOpen(zipfilename); uf = unzOpen64(zipfilename);
# endif # endif
if (uf==NULL) if (uf==NULL)
{ {
strcat(filename_try,".zip"); strcat(filename_try,".zip");
# ifdef USEWIN32IOAPI # ifdef USEWIN32IOAPI
uf = unzOpen2(filename_try,&ffunc); uf = unzOpen2_64(filename_try,&ffunc);
# else # else
uf = unzOpen(filename_try); uf = unzOpen64(filename_try);
# endif # endif
} }
} }
...@@ -564,22 +623,26 @@ int main(argc,argv) ...@@ -564,22 +623,26 @@ int main(argc,argv)
printf("%s opened\n",filename_try); printf("%s opened\n",filename_try);
if (opt_do_list==1) if (opt_do_list==1)
return do_list(uf); ret_value = do_list(uf);
else if (opt_do_extract==1) else if (opt_do_extract==1)
{ {
if (opt_extractdir && chdir(dirname)) #ifdef _WIN32
if (opt_extractdir && _chdir(dirname))
#else
if (opt_extractdir && chdir(dirname))
#endif
{ {
printf("Error changing into %s, aborting\n", dirname); printf("Error changing into %s, aborting\n", dirname);
exit(-1); exit(-1);
} }
if (filename_to_extract == NULL) if (filename_to_extract == NULL)
return do_extract(uf,opt_do_extract_withoutpath,opt_overwrite,password); ret_value = do_extract(uf, opt_do_extract_withoutpath, opt_overwrite, password);
else else
return do_extract_onefile(uf,filename_to_extract, ret_value = do_extract_onefile(uf, filename_to_extract, opt_do_extract_withoutpath, opt_overwrite, password);
opt_do_extract_withoutpath,opt_overwrite,password);
} }
unzCloseCurrentFile(uf);
return 0; unzClose(uf);
return ret_value;
} }
/* /*
minizip.c minizip.c
Version 1.01e, February 12th, 2005 Version 1.1, February 14h, 2010
sample part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2005 Gilles Vollant Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Modifications of Unzip for Zip64
Copyright (C) 2007-2008 Even Rouault
Modifications for Zip64 support on both zip and unzip
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
*/ */
#ifndef _WIN32
#ifndef __USE_FILE_OFFSET64
#define __USE_FILE_OFFSET64
#endif
#ifndef __USE_LARGEFILE64
#define __USE_LARGEFILE64
#endif
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#ifndef _FILE_OFFSET_BIT
#define _FILE_OFFSET_BIT 64
#endif
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
...@@ -24,9 +47,9 @@ ...@@ -24,9 +47,9 @@
#include "zip.h" #include "zip.h"
#ifdef WIN32 #ifdef _WIN32
#define USEWIN32IOAPI #define USEWIN32IOAPI
#include "iowin32.h" #include "iowin32.h"
#endif #endif
...@@ -34,7 +57,7 @@ ...@@ -34,7 +57,7 @@
#define WRITEBUFFERSIZE (16384) #define WRITEBUFFERSIZE (16384)
#define MAXFILENAME (256) #define MAXFILENAME (256)
#ifdef WIN32 #ifdef _WIN32
uLong filetime(f, tmzip, dt) uLong filetime(f, tmzip, dt)
char *f; /* name of file to get info on */ char *f; /* name of file to get info on */
tm_zip *tmzip; /* return value: access, modific. and creation times */ tm_zip *tmzip; /* return value: access, modific. and creation times */
...@@ -44,9 +67,9 @@ uLong filetime(f, tmzip, dt) ...@@ -44,9 +67,9 @@ uLong filetime(f, tmzip, dt)
{ {
FILETIME ftLocal; FILETIME ftLocal;
HANDLE hFind; HANDLE hFind;
WIN32_FIND_DATA ff32; WIN32_FIND_DATAA ff32;
hFind = FindFirstFile(f,&ff32); hFind = FindFirstFileA(f,&ff32);
if (hFind != INVALID_HANDLE_VALUE) if (hFind != INVALID_HANDLE_VALUE)
{ {
FileTimeToLocalFileTime(&(ff32.ftLastWriteTime),&ftLocal); FileTimeToLocalFileTime(&(ff32.ftLastWriteTime),&ftLocal);
...@@ -119,7 +142,7 @@ int check_exist_file(filename) ...@@ -119,7 +142,7 @@ int check_exist_file(filename)
{ {
FILE* ftestexist; FILE* ftestexist;
int ret = 1; int ret = 1;
ftestexist = fopen(filename,"rb"); ftestexist = fopen64(filename,"rb");
if (ftestexist==NULL) if (ftestexist==NULL)
ret = 0; ret = 0;
else else
...@@ -129,18 +152,19 @@ int check_exist_file(filename) ...@@ -129,18 +152,19 @@ int check_exist_file(filename)
void do_banner() void do_banner()
{ {
printf("MiniZip 1.01b, demo of zLib + Zip package written by Gilles Vollant\n"); printf("MiniZip 1.1, demo of zLib + MiniZip64 package, written by Gilles Vollant\n");
printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n"); printf("more info on MiniZip at http://www.winimage.com/zLibDll/minizip.html\n\n");
} }
void do_help() void do_help()
{ {
printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] file.zip [files_to_add]\n\n" \ printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] [-j] file.zip [files_to_add]\n\n" \
" -o Overwrite existing file.zip\n" \ " -o Overwrite existing file.zip\n" \
" -a Append to existing file.zip\n" \ " -a Append to existing file.zip\n" \
" -0 Store only\n" \ " -0 Store only\n" \
" -1 Compress faster\n" \ " -1 Compress faster\n" \
" -9 Compress better\n\n"); " -9 Compress better\n\n" \
" -j exclude path. store only the file name.\n\n");
} }
/* calculate the CRC32 of a file, /* calculate the CRC32 of a file,
...@@ -149,7 +173,7 @@ int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigne ...@@ -149,7 +173,7 @@ int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigne
{ {
unsigned long calculate_crc=0; unsigned long calculate_crc=0;
int err=ZIP_OK; int err=ZIP_OK;
FILE * fin = fopen(filenameinzip,"rb"); FILE * fin = fopen64(filenameinzip,"rb");
unsigned long size_read = 0; unsigned long size_read = 0;
unsigned long total_read = 0; unsigned long total_read = 0;
if (fin==NULL) if (fin==NULL)
...@@ -179,10 +203,33 @@ int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigne ...@@ -179,10 +203,33 @@ int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigne
fclose(fin); fclose(fin);
*result_crc=calculate_crc; *result_crc=calculate_crc;
printf("file %s crc %x\n",filenameinzip,calculate_crc); printf("file %s crc %lx\n", filenameinzip, calculate_crc);
return err; return err;
} }
int isLargeFile(const char* filename)
{
int largeFile = 0;
ZPOS64_T pos = 0;
FILE* pFile = fopen64(filename, "rb");
if(pFile != NULL)
{
int n = fseeko64(pFile, 0, SEEK_END);
pos = ftello64(pFile);
printf("File : %s is %lld bytes\n", filename, pos);
if(pos >= 0xffffffff)
largeFile = 1;
fclose(pFile);
}
return largeFile;
}
int main(argc,argv) int main(argc,argv)
int argc; int argc;
char *argv[]; char *argv[];
...@@ -190,6 +237,7 @@ int main(argc,argv) ...@@ -190,6 +237,7 @@ int main(argc,argv)
int i; int i;
int opt_overwrite=0; int opt_overwrite=0;
int opt_compress_level=Z_DEFAULT_COMPRESSION; int opt_compress_level=Z_DEFAULT_COMPRESSION;
int opt_exclude_path=0;
int zipfilenamearg = 0; int zipfilenamearg = 0;
char filename_try[MAXFILENAME+16]; char filename_try[MAXFILENAME+16];
int zipok; int zipok;
...@@ -222,6 +270,8 @@ int main(argc,argv) ...@@ -222,6 +270,8 @@ int main(argc,argv)
opt_overwrite = 2; opt_overwrite = 2;
if ((c>='0') && (c<='9')) if ((c>='0') && (c<='9'))
opt_compress_level = c-'0'; opt_compress_level = c-'0';
if ((c=='j') || (c=='J'))
opt_exclude_path = 1;
if (((c=='p') || (c=='P')) && (i+1<argc)) if (((c=='p') || (c=='P')) && (i+1<argc))
{ {
...@@ -231,8 +281,12 @@ int main(argc,argv) ...@@ -231,8 +281,12 @@ int main(argc,argv)
} }
} }
else else
{
if (zipfilenamearg == 0) if (zipfilenamearg == 0)
{
zipfilenamearg = i ; zipfilenamearg = i ;
}
}
} }
} }
...@@ -245,7 +299,9 @@ int main(argc,argv) ...@@ -245,7 +299,9 @@ int main(argc,argv)
} }
if (zipfilenamearg==0) if (zipfilenamearg==0)
{
zipok=0; zipok=0;
}
else else
{ {
int i,len; int i,len;
...@@ -302,11 +358,11 @@ int main(argc,argv) ...@@ -302,11 +358,11 @@ int main(argc,argv)
zipFile zf; zipFile zf;
int errclose; int errclose;
# ifdef USEWIN32IOAPI # ifdef USEWIN32IOAPI
zlib_filefunc_def ffunc; zlib_filefunc64_def ffunc;
fill_win32_filefunc(&ffunc); fill_win32_filefunc64A(&ffunc);
zf = zipOpen2(filename_try,(opt_overwrite==2) ? 2 : 0,NULL,&ffunc); zf = zipOpen2_64(filename_try,(opt_overwrite==2) ? 2 : 0,NULL,&ffunc);
# else # else
zf = zipOpen(filename_try,(opt_overwrite==2) ? 2 : 0); zf = zipOpen64(filename_try,(opt_overwrite==2) ? 2 : 0);
# endif # endif
if (zf == NULL) if (zf == NULL)
...@@ -329,8 +385,10 @@ int main(argc,argv) ...@@ -329,8 +385,10 @@ int main(argc,argv)
FILE * fin; FILE * fin;
int size_read; int size_read;
const char* filenameinzip = argv[i]; const char* filenameinzip = argv[i];
const char *savefilenameinzip;
zip_fileinfo zi; zip_fileinfo zi;
unsigned long crcFile=0; unsigned long crcFile=0;
int zip64 = 0;
zi.tmz_date.tm_sec = zi.tmz_date.tm_min = zi.tmz_date.tm_hour = zi.tmz_date.tm_sec = zi.tmz_date.tm_min = zi.tmz_date.tm_hour =
zi.tmz_date.tm_mday = zi.tmz_date.tm_mon = zi.tmz_date.tm_year = 0; zi.tmz_date.tm_mday = zi.tmz_date.tm_mon = zi.tmz_date.tm_year = 0;
...@@ -348,19 +406,48 @@ int main(argc,argv) ...@@ -348,19 +406,48 @@ int main(argc,argv)
if ((password != NULL) && (err==ZIP_OK)) if ((password != NULL) && (err==ZIP_OK))
err = getFileCrc(filenameinzip,buf,size_buf,&crcFile); err = getFileCrc(filenameinzip,buf,size_buf,&crcFile);
err = zipOpenNewFileInZip3(zf,filenameinzip,&zi, zip64 = isLargeFile(filenameinzip);
/* The path name saved, should not include a leading slash. */
/*if it did, windows/xp and dynazip couldn't read the zip file. */
savefilenameinzip = filenameinzip;
while( savefilenameinzip[0] == '\\' || savefilenameinzip[0] == '/' )
{
savefilenameinzip++;
}
/*should the zip file contain any path at all?*/
if( opt_exclude_path )
{
const char *tmpptr;
const char *lastslash = 0;
for( tmpptr = savefilenameinzip; *tmpptr; tmpptr++)
{
if( *tmpptr == '\\' || *tmpptr == '/')
{
lastslash = tmpptr;
}
}
if( lastslash != NULL )
{
savefilenameinzip = lastslash+1; // base filename follows last slash.
}
}
/**/
err = zipOpenNewFileInZip3_64(zf,savefilenameinzip,&zi,
NULL,0,NULL,0,NULL /* comment*/, NULL,0,NULL,0,NULL /* comment*/,
(opt_compress_level != 0) ? Z_DEFLATED : 0, (opt_compress_level != 0) ? Z_DEFLATED : 0,
opt_compress_level,0, opt_compress_level,0,
/* -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, */ /* -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, */
-MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
password,crcFile); password,crcFile, zip64);
if (err != ZIP_OK) if (err != ZIP_OK)
printf("error in opening %s in zipfile\n",filenameinzip); printf("error in opening %s in zipfile\n",filenameinzip);
else else
{ {
fin = fopen(filenameinzip,"rb"); fin = fopen64(filenameinzip,"rb");
if (fin==NULL) if (fin==NULL)
{ {
err=ZIP_ERRNO; err=ZIP_ERRNO;
......
...@@ -62,7 +62,7 @@ uLong* bytesRecovered; ...@@ -62,7 +62,7 @@ uLong* bytesRecovered;
unsigned int fnsize = READ_16(header + 26); /* file name length */ unsigned int fnsize = READ_16(header + 26); /* file name length */
unsigned int extsize = READ_16(header + 28); /* extra field length */ unsigned int extsize = READ_16(header + 28); /* extra field length */
filename[0] = extra[0] = '\0'; filename[0] = extra[0] = '\0';
/* Header */ /* Header */
if (fwrite(header, 1, 30, fpOut) == 30) { if (fwrite(header, 1, 30, fpOut) == 30) {
offset += 30; offset += 30;
...@@ -70,7 +70,7 @@ uLong* bytesRecovered; ...@@ -70,7 +70,7 @@ uLong* bytesRecovered;
err = Z_ERRNO; err = Z_ERRNO;
break; break;
} }
/* Filename */ /* Filename */
if (fnsize > 0) { if (fnsize > 0) {
if (fread(filename, 1, fnsize, fpZip) == fnsize) { if (fread(filename, 1, fnsize, fpZip) == fnsize) {
...@@ -103,7 +103,7 @@ uLong* bytesRecovered; ...@@ -103,7 +103,7 @@ uLong* bytesRecovered;
break; break;
} }
} }
/* Data */ /* Data */
{ {
int dataSize = cpsize; int dataSize = cpsize;
...@@ -133,7 +133,7 @@ uLong* bytesRecovered; ...@@ -133,7 +133,7 @@ uLong* bytesRecovered;
} }
} }
} }
/* Central directory entry */ /* Central directory entry */
{ {
char header[46]; char header[46];
...@@ -159,7 +159,7 @@ uLong* bytesRecovered; ...@@ -159,7 +159,7 @@ uLong* bytesRecovered;
/* Header */ /* Header */
if (fwrite(header, 1, 46, fpOutCD) == 46) { if (fwrite(header, 1, 46, fpOutCD) == 46) {
offsetCD += 46; offsetCD += 46;
/* Filename */ /* Filename */
if (fnsize > 0) { if (fnsize > 0) {
if (fwrite(filename, 1, fnsize, fpOutCD) == fnsize) { if (fwrite(filename, 1, fnsize, fpOutCD) == fnsize) {
...@@ -172,7 +172,7 @@ uLong* bytesRecovered; ...@@ -172,7 +172,7 @@ uLong* bytesRecovered;
err = Z_STREAM_ERROR; err = Z_STREAM_ERROR;
break; break;
} }
/* Extra field */ /* Extra field */
if (extsize > 0) { if (extsize > 0) {
if (fwrite(extra, 1, extsize, fpOutCD) == extsize) { if (fwrite(extra, 1, extsize, fpOutCD) == extsize) {
...@@ -182,7 +182,7 @@ uLong* bytesRecovered; ...@@ -182,7 +182,7 @@ uLong* bytesRecovered;
break; break;
} }
} }
/* Comment field */ /* Comment field */
if (comsize > 0) { if (comsize > 0) {
if ((int)fwrite(comment, 1, comsize, fpOutCD) == comsize) { if ((int)fwrite(comment, 1, comsize, fpOutCD) == comsize) {
...@@ -192,8 +192,8 @@ uLong* bytesRecovered; ...@@ -192,8 +192,8 @@ uLong* bytesRecovered;
break; break;
} }
} }
} else { } else {
err = Z_ERRNO; err = Z_ERRNO;
break; break;
...@@ -225,17 +225,17 @@ uLong* bytesRecovered; ...@@ -225,17 +225,17 @@ uLong* bytesRecovered;
WRITE_32(header + 12, offsetCD); /* size of CD */ WRITE_32(header + 12, offsetCD); /* size of CD */
WRITE_32(header + 16, offset); /* offset to CD */ WRITE_32(header + 16, offset); /* offset to CD */
WRITE_16(header + 20, comsize); /* comment */ WRITE_16(header + 20, comsize); /* comment */
/* Header */ /* Header */
if (fwrite(header, 1, 22, fpOutCD) == 22) { if (fwrite(header, 1, 22, fpOutCD) == 22) {
/* Comment field */ /* Comment field */
if (comsize > 0) { if (comsize > 0) {
if ((int)fwrite(comment, 1, comsize, fpOutCD) != comsize) { if ((int)fwrite(comment, 1, comsize, fpOutCD) != comsize) {
err = Z_ERRNO; err = Z_ERRNO;
} }
} }
} else { } else {
err = Z_ERRNO; err = Z_ERRNO;
} }
...@@ -257,14 +257,14 @@ uLong* bytesRecovered; ...@@ -257,14 +257,14 @@ uLong* bytesRecovered;
fclose(fpOutCD); fclose(fpOutCD);
} }
} }
/* Close */ /* Close */
fclose(fpZip); fclose(fpZip);
fclose(fpOut); fclose(fpOut);
/* Wipe temporary file */ /* Wipe temporary file */
(void)remove(fileOutTmp); (void)remove(fileOutTmp);
/* Number of recovered entries */ /* Number of recovered entries */
if (err == Z_OK) { if (err == Z_OK) {
if (nRecovered != NULL) { if (nRecovered != NULL) {
......
...@@ -17,14 +17,14 @@ extern "C" { ...@@ -17,14 +17,14 @@ extern "C" {
#include "unzip.h" #include "unzip.h"
/* Repair a ZIP file (missing central directory) /* Repair a ZIP file (missing central directory)
file: file to recover file: file to recover
fileOut: output file after recovery fileOut: output file after recovery
fileOutTmp: temporary file name used for recovery fileOutTmp: temporary file name used for recovery
*/ */
extern int ZEXPORT unzRepair(const char* file, extern int ZEXPORT unzRepair(const char* file,
const char* fileOut, const char* fileOut,
const char* fileOutTmp, const char* fileOutTmp,
uLong* nRecovered, uLong* nRecovered,
uLong* bytesRecovered); uLong* bytesRecovered);
......
/* unzip.h -- IO for uncompress .zip files using zlib /* unzip.h -- IO for uncompress .zip files using zlib
Version 1.01e, February 12th, 2005 Version 1.1, February 14h, 2010
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2005 Gilles Vollant Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g Modifications of Unzip for Zip64
WinZip, InfoZip tools and compatible. Copyright (C) 2007-2008 Even Rouault
Multi volume ZipFile (span) are not supported. Modifications for Zip64 support on both zip and unzip
Encryption compatible with pkzip 2.04g only supported Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
Old compressions used by old PKZip 1.x are not supported
For more info read MiniZip_info.txt
I WAIT FEEDBACK at mail info@winimage.com ---------------------------------------------------------------------------------
Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
Condition of use and distribution are the same than zlib : Condition of use and distribution are the same than zlib :
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
...@@ -32,18 +32,16 @@ ...@@ -32,18 +32,16 @@
misrepresented as being the original software. misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
---------------------------------------------------------------------------------
*/ Changes
See header of unzip64.c
/* for more info about .ZIP format, see
http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip
http://www.info-zip.org/pub/infozip/doc/
PkWare has also a specification at :
ftp://ftp.pkware.com/probdesc.zip
*/ */
#ifndef _unz_H #ifndef _unz64_H
#define _unz_H #define _unz64_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
...@@ -53,10 +51,16 @@ extern "C" { ...@@ -53,10 +51,16 @@ extern "C" {
#include "zlib.h" #include "zlib.h"
#endif #endif
#ifndef _ZLIBIOAPI_H #ifndef _ZLIBIOAPI_H
#include "ioapi.h" #include "ioapi.h"
#endif #endif
#ifdef HAVE_BZIP2
#include "bzlib.h"
#endif
#define Z_BZIP2ED 12
#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
/* like the STRICT of WIN32, we define a pointer that cannot be converted /* like the STRICT of WIN32, we define a pointer that cannot be converted
from (void*) without cast */ from (void*) without cast */
...@@ -89,15 +93,42 @@ typedef struct tm_unz_s ...@@ -89,15 +93,42 @@ typedef struct tm_unz_s
/* unz_global_info structure contain global data about the ZIPfile /* unz_global_info structure contain global data about the ZIPfile
These data comes from the end of central dir */ These data comes from the end of central dir */
typedef struct unz_global_info64_s
{
ZPOS64_T number_entry; /* total number of entries in
the central dir on this disk */
uLong size_comment; /* size of the global comment of the zipfile */
} unz_global_info64;
typedef struct unz_global_info_s typedef struct unz_global_info_s
{ {
uLong number_entry; /* total number of entries in uLong number_entry; /* total number of entries in
the central dir on this disk */ the central dir on this disk */
uLong size_comment; /* size of the global comment of the zipfile */ uLong size_comment; /* size of the global comment of the zipfile */
} unz_global_info; } unz_global_info;
/* unz_file_info contain information about a file in the zipfile */ /* unz_file_info contain information about a file in the zipfile */
typedef struct unz_file_info64_s
{
uLong version; /* version made by 2 bytes */
uLong version_needed; /* version needed to extract 2 bytes */
uLong flag; /* general purpose bit flag 2 bytes */
uLong compression_method; /* compression method 2 bytes */
uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
uLong crc; /* crc-32 4 bytes */
ZPOS64_T compressed_size; /* compressed size 8 bytes */
ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */
uLong size_filename; /* filename length 2 bytes */
uLong size_file_extra; /* extra field length 2 bytes */
uLong size_file_comment; /* file comment length 2 bytes */
uLong disk_num_start; /* disk number start 2 bytes */
uLong internal_fa; /* internal file attributes 2 bytes */
uLong external_fa; /* external file attributes 4 bytes */
tm_unz tmu_date;
} unz_file_info64;
typedef struct unz_file_info_s typedef struct unz_file_info_s
{ {
uLong version; /* version made by 2 bytes */ uLong version; /* version made by 2 bytes */
...@@ -133,6 +164,7 @@ extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, ...@@ -133,6 +164,7 @@ extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
extern unzFile ZEXPORT unzOpen OF((const char *path)); extern unzFile ZEXPORT unzOpen OF((const char *path));
extern unzFile ZEXPORT unzOpen64 OF((const void *path));
/* /*
Open a Zip file. path contain the full pathname (by example, Open a Zip file. path contain the full pathname (by example,
on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer
...@@ -141,8 +173,14 @@ extern unzFile ZEXPORT unzOpen OF((const char *path)); ...@@ -141,8 +173,14 @@ extern unzFile ZEXPORT unzOpen OF((const char *path));
return value is NULL. return value is NULL.
Else, the return value is a unzFile Handle, usable with other function Else, the return value is a unzFile Handle, usable with other function
of this unzip package. of this unzip package.
the "64" function take a const void* pointer, because the path is just the
value passed to the open64_file_func callback.
Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path
is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char*
does not describe the reality
*/ */
extern unzFile ZEXPORT unzOpen2 OF((const char *path, extern unzFile ZEXPORT unzOpen2 OF((const char *path,
zlib_filefunc_def* pzlib_filefunc_def)); zlib_filefunc_def* pzlib_filefunc_def));
/* /*
...@@ -150,6 +188,13 @@ extern unzFile ZEXPORT unzOpen2 OF((const char *path, ...@@ -150,6 +188,13 @@ extern unzFile ZEXPORT unzOpen2 OF((const char *path,
for read/write the zip file (see ioapi.h) for read/write the zip file (see ioapi.h)
*/ */
extern unzFile ZEXPORT unzOpen2_64 OF((const void *path,
zlib_filefunc64_def* pzlib_filefunc_def));
/*
Open a Zip file, like unz64Open, but provide a set of file low level API
for read/write the zip file (see ioapi.h)
*/
extern int ZEXPORT unzClose OF((unzFile file)); extern int ZEXPORT unzClose OF((unzFile file));
/* /*
Close a ZipFile opened with unzipOpen. Close a ZipFile opened with unzipOpen.
...@@ -159,6 +204,9 @@ extern int ZEXPORT unzClose OF((unzFile file)); ...@@ -159,6 +204,9 @@ extern int ZEXPORT unzClose OF((unzFile file));
extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
unz_global_info *pglobal_info)); unz_global_info *pglobal_info));
extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file,
unz_global_info64 *pglobal_info));
/* /*
Write info about the ZipFile in the *pglobal_info structure. Write info about the ZipFile in the *pglobal_info structure.
No preparation of the structure is needed No preparation of the structure is needed
...@@ -221,8 +269,31 @@ extern int ZEXPORT unzGoToFilePos( ...@@ -221,8 +269,31 @@ extern int ZEXPORT unzGoToFilePos(
unzFile file, unzFile file,
unz_file_pos* file_pos); unz_file_pos* file_pos);
typedef struct unz64_file_pos_s
{
ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */
ZPOS64_T num_of_file; /* # of file */
} unz64_file_pos;
extern int ZEXPORT unzGetFilePos64(
unzFile file,
unz64_file_pos* file_pos);
extern int ZEXPORT unzGoToFilePos64(
unzFile file,
const unz64_file_pos* file_pos);
/* ****************************************** */ /* ****************************************** */
extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file,
unz_file_info64 *pfile_info,
char *szFileName,
uLong fileNameBufferSize,
void *extraField,
uLong extraFieldBufferSize,
char *szComment,
uLong commentBufferSize));
extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
unz_file_info *pfile_info, unz_file_info *pfile_info,
char *szFileName, char *szFileName,
...@@ -244,6 +315,14 @@ extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, ...@@ -244,6 +315,14 @@ extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
(commentBufferSize is the size of the buffer) (commentBufferSize is the size of the buffer)
*/ */
/** Addition for GDAL : START */
extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file));
/** Addition for GDAL : END */
/***************************************************************************/ /***************************************************************************/
/* for reading the content of the current zipfile, you can open it, read data /* for reading the content of the current zipfile, you can open it, read data
from it, and close it (you can close it before reading all the file) from it, and close it (you can close it before reading all the file)
...@@ -312,6 +391,8 @@ extern int ZEXPORT unzReadCurrentFile OF((unzFile file, ...@@ -312,6 +391,8 @@ extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
*/ */
extern z_off_t ZEXPORT unztell OF((unzFile file)); extern z_off_t ZEXPORT unztell OF((unzFile file));
extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file));
/* /*
Give the current position in uncompressed data Give the current position in uncompressed data
*/ */
...@@ -340,9 +421,11 @@ extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, ...@@ -340,9 +421,11 @@ extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
/***************************************************************************/ /***************************************************************************/
/* Get the current file offset */ /* Get the current file offset */
extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file);
extern uLong ZEXPORT unzGetOffset (unzFile file); extern uLong ZEXPORT unzGetOffset (unzFile file);
/* Set the current file offset */ /* Set the current file offset */
extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos);
extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
...@@ -351,4 +434,4 @@ extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); ...@@ -351,4 +434,4 @@ extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
} }
#endif #endif
#endif /* _unz_H */ #endif /* _unz64_H */
...@@ -18,10 +18,10 @@ LDFLAGS = ...@@ -18,10 +18,10 @@ LDFLAGS =
# variables # variables
ZLIB_LIB = zlib.lib ZLIB_LIB = zlib.lib
OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infback.obj OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj
OBJ2 = inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzio.obj+infback.obj OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj
OBJP2 = +inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
# targets # targets
...@@ -38,7 +38,13 @@ crc32.obj: crc32.c zlib.h zconf.h crc32.h ...@@ -38,7 +38,13 @@ crc32.obj: crc32.c zlib.h zconf.h crc32.h
deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
gzio.obj: gzio.c zutil.h zlib.h zconf.h gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h
gzread.obj: gzread.c zlib.h zconf.h gzguts.h
gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h
infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
inffast.h inffixed.h inffast.h inffixed.h
......
...@@ -10,7 +10,7 @@ unit zlibpas; ...@@ -10,7 +10,7 @@ unit zlibpas;
interface interface
const const
ZLIB_VERSION = '1.2.3'; ZLIB_VERSION = '1.2.5';
type type
alloc_func = function(opaque: Pointer; items, size: Integer): Pointer; alloc_func = function(opaque: Pointer; items, size: Integer): Pointer;
......
/* puff.h /* puff.h
Copyright (C) 2002, 2003 Mark Adler, all rights reserved Copyright (C) 2002-2010 Mark Adler, all rights reserved
version 1.7, 3 Mar 2002 version 2.1, 4 Apr 2010
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages warranty. In no event will the author be held liable for any damages
......
...@@ -103,12 +103,12 @@ DWORD GetMsecSincePerfCounter(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPe ...@@ -103,12 +103,12 @@ DWORD GetMsecSincePerfCounter(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPe
MyDoMinus64(&ticks,endTime64,beginTime64); MyDoMinus64(&ticks,endTime64,beginTime64);
QueryPerformanceFrequency(&ticksPerSecond); QueryPerformanceFrequency(&ticksPerSecond);
{ {
ticksShifted = Int64ShrlMod32(*(DWORDLONG*)&ticks,dwLog); ticksShifted = Int64ShrlMod32(*(DWORDLONG*)&ticks,dwLog);
tickSecShifted = Int64ShrlMod32(*(DWORDLONG*)&ticksPerSecond,dwLog); tickSecShifted = Int64ShrlMod32(*(DWORDLONG*)&ticksPerSecond,dwLog);
} }
dwRet = (DWORD)((((DWORD)ticksShifted)*1000)/(DWORD)(tickSecShifted)); dwRet = (DWORD)((((DWORD)ticksShifted)*1000)/(DWORD)(tickSecShifted));
dwRet *=1; dwRet *=1;
......
Building instructions for the DLL versions of Zlib 1.2.3 Building instructions for the DLL versions of Zlib 1.2.4
======================================================== ========================================================
This directory contains projects that build zlib and minizip using This directory contains projects that build zlib and minizip using
Microsoft Visual C++ 7.0/7.1, and Visual C++ . Microsoft Visual C++ 9.0/10.0, and Visual C++ .
You don't need to build these projects yourself. You can download the You don't need to build these projects yourself. You can download the
binaries from: binaries from:
...@@ -10,36 +10,23 @@ binaries from: ...@@ -10,36 +10,23 @@ binaries from:
More information can be found at this site. More information can be found at this site.
first compile assembly code by running
bld_ml64.bat in contrib\masmx64
bld_ml32.bat in contrib\masmx86
Build instructions for Visual Studio 7.x (32 bits)
--------------------------------------------------
- Uncompress current zlib, including all contrib/* files
- Download the crtdll library from
http://www.winimage.com/zLibDll/crtdll.zip
Unzip crtdll.zip to extract crtdll.lib on contrib\vstudio\vc7.
- Open contrib\vstudio\vc7\zlibvc.sln with Microsoft Visual C++ 7.x
(Visual Studio .Net 2002 or 2003).
Build instructions for Visual Studio 2005 (32 bits or 64 bits)
Build instructions for Visual Studio 2008 (32 bits or 64 bits)
-------------------------------------------------------------- --------------------------------------------------------------
- Uncompress current zlib, including all contrib/* files - Uncompress current zlib, including all contrib/* files
- For 32 bits only: download the crtdll library from - Open contrib\vstudio\vc9\zlibvc.sln with Microsoft Visual C++ 2008.0
http://www.winimage.com/zLibDll/crtdll.zip - Or run: vcbuild /rebuild contrib\vstudio\vc9\zlibvc.sln "Release|Win32"
Unzip crtdll.zip to extract crtdll.lib on contrib\vstudio\vc8.
- Open contrib\vstudio\vc8\zlibvc.sln with Microsoft Visual C++ 8.0
Build instructions for Visual Studio 2005 64 bits, PSDK compiler
----------------------------------------------------------------
at the time of writing this text file, Visual Studio 2005 (and
Microsoft Visual C++ 8.0) is on the beta 2 stage.
Using you can get the free 64 bits compiler from Platform SDK,
which is NOT a beta, and compile using the Visual studio 2005 IDE
see http://www.winimage.com/misc/sdk64onvs2005/ for instruction
Build instructions for Visual Studio 2010 (32 bits or 64 bits)
--------------------------------------------------------------
- Uncompress current zlib, including all contrib/* files - Uncompress current zlib, including all contrib/* files
- start Visual Studio 2005 from a platform SDK command prompt, using - Open contrib\vstudio\vc10\zlibvc.sln with Microsoft Visual C++ 2010.0
the /useenv switch
- Open contrib\vstudio\vc8\zlibvc.sln with Microsoft Visual C++ 8.0
Important Important
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{048af943-022b-4db6-beeb-a54c34774ee2}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{c1d600d2-888f-4aea-b73e-8b0dd9befa0c}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{0844199a-966b-4f19-81db-1e0125e141b9}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\minizip\miniunz.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{c0419b40-bf50-40da-b153-ff74215b79de}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{bb87b070-735b-478e-92ce-7383abb2f36c}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{f46ab6a6-548f-43cb-ae96-681abb5bd5db}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\minizip\minizip.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{c1f6a2e3-5da5-4955-8653-310d3efe05a9}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{c2aaffdc-2c95-4d6f-8466-4bec5890af2c}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{c274fe07-05f2-461c-964b-f6341e4e7eb5}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\adler32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\compress.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\crc32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\deflate.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\infback.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\masmx64\inffas8664.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\inffast.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\inflate.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\inftrees.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\testzlib\testzlib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\trees.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\uncompr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zutil.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{fa61a89f-93fc-4c89-b29e-36224b7592f4}</UniqueIdentifier>
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{d4b85da0-2ba2-4934-b57f-e2584e3848ee}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{e573e075-00bd-4a7d-bd67-a8cc9bfc5aca}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\testzlib\testzlib.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
\ No newline at end of file
...@@ -2,8 +2,8 @@ ...@@ -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,0 FILEVERSION 1,2,5,0
PRODUCTVERSION 1,2,3,0 PRODUCTVERSION 1,2,5,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0 FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32 FILEOS VOS_DOS_WINDOWS32
...@@ -16,13 +16,13 @@ BEGIN ...@@ -16,13 +16,13 @@ BEGIN
//language ID = U.S. English, char set = Windows, Multilingual //language ID = U.S. English, char set = Windows, Multilingual
BEGIN BEGIN
VALUE "FileDescription", "zlib data compression library\0" VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
VALUE "FileVersion", "1.2.3.0\0" VALUE "FileVersion", "1.2.5\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"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
VALUE "LegalCopyright", "(C) 1995-2003 Jean-loup Gailly & Mark Adler\0" VALUE "LegalCopyright", "(C) 1995-2010 Jean-loup Gailly & Mark Adler\0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{174213f6-7f66-4ae8-a3a8-a1e0a1e6ffdd}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\adler32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\compress.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\crc32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\deflate.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\gzclose.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\gzlib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\gzread.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\gzwrite.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\infback.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\masmx64\inffas8664.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\inffast.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\inflate.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\inftrees.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\minizip\ioapi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\trees.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\uncompr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\minizip\unzip.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\minizip\zip.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zutil.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="zlib.rc">
<Filter>Source Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="zlibvc.def">
<Filter>Source Files</Filter>
</None>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
\ No newline at end of file
LIBRARY
; zlib data compression and ZIP file I/O library
VERSION 1.23 VERSION 1.24
HEAPSIZE 1048576,8192
EXPORTS EXPORTS
adler32 @1 adler32 @1
...@@ -90,3 +90,41 @@ EXPORTS ...@@ -90,3 +90,41 @@ EXPORTS
unzGoToFilePos @101 unzGoToFilePos @101
fill_win32_filefunc @110 fill_win32_filefunc @110
; zlibwapi v1.2.4 added:
fill_win32_filefunc64 @111
fill_win32_filefunc64A @112
fill_win32_filefunc64W @113
unzOpen64 @120
unzOpen2_64 @121
unzGetGlobalInfo64 @122
unzGetCurrentFileInfo64 @124
unzGetCurrentFileZStreamPos64 @125
unztell64 @126
unzGetFilePos64 @127
unzGoToFilePos64 @128
zipOpen64 @130
zipOpen2_64 @131
zipOpenNewFileInZip64 @132
zipOpenNewFileInZip2_64 @133
zipOpenNewFileInZip3_64 @134
zipOpenNewFileInZip4_64 @135
zipCloseFileInZipRaw64 @136
; zlib1 v1.2.4 added:
adler32_combine @140
crc32_combine @142
deflateSetHeader @144
deflateTune @145
gzbuffer @146
gzclose_r @147
gzclose_w @148
gzdirect @149
gzoffset @150
inflateGetHeader @156
inflateMark @157
inflatePrime @158
inflateReset2 @159
inflateUndermine @160
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{07934a85-8b61-443d-a0ee-b2eedb74f3cd}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{1d99675b-433d-4a21-9e50-ed4ab8b19762}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;fi;fd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{431c0958-fa71-44d0-9084-2d19d100c0cc}</UniqueIdentifier>
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\adler32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\compress.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\crc32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\deflate.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\gzclose.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\gzlib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\gzread.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\gzwrite.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\infback.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\masmx64\inffas8664.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\inffast.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\inflate.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\inftrees.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\minizip\ioapi.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\minizip\iowin32.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\trees.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\uncompr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\minizip\unzip.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\minizip\zip.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zutil.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="zlib.rc">
<Filter>Source Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="zlibvc.def">
<Filter>Source Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\deflate.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\infblock.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\infcodes.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\inffast.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\inftrees.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\infutil.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zconf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zlib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zutil.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>
\ No newline at end of file
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="miniunz"
ProjectGUID="{C52F9E7B-498A-42BE-8DB4-85A15694382A}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/miniunz.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/miniunz.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/miniunz.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
<File
RelativePath="..\..\minizip\miniunz.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc">
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
<File
RelativePath="ReleaseDll\zlibwapi.lib">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="minizip"
ProjectGUID="{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/minizip.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/minizip.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/minizip.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
<File
RelativePath="..\..\minizip\minizip.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc">
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
<File
RelativePath="ReleaseDll\zlibwapi.lib">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="testZlibDll"
ProjectGUID="{AA6666AA-E09F-4135-9C0C-4FE50C3C654C}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\.."
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/testzlib.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/testzlib.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\..\.."
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/testzlib.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
<File
RelativePath="..\..\testzlib\testzlib.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc">
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
<File
RelativePath="ReleaseDll\zlibwapi.lib">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="zlibstat"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\zlibstatDebug"
IntermediateDirectory=".\zlibstatDebug"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI"
ExceptionHandling="FALSE"
RuntimeLibrary="5"
PrecompiledHeaderFile=".\zlibstatDebug/zlibstat.pch"
AssemblerListingLocation=".\zlibstatDebug/"
ObjectFile=".\zlibstatDebug/"
ProgramDataBaseFileName=".\zlibstatDebug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="1"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/NODEFAULTLIB "
OutputFile=".\zlibstatDebug\zlibstat.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
</Configuration>
<Configuration
Name="ReleaseAxp|Win32"
OutputDirectory=".\zlibsta0"
IntermediateDirectory=".\zlibsta0"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI"
StringPooling="TRUE"
ExceptionHandling="FALSE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
PrecompiledHeaderFile=".\zlibsta0/zlibstat.pch"
AssemblerListingLocation=".\zlibsta0/"
ObjectFile=".\zlibsta0/"
ProgramDataBaseFileName=".\zlibsta0/"
WarningLevel="3"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/NODEFAULTLIB "
OutputFile=".\zlibsta0\zlibstat.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\zlibstat"
IntermediateDirectory=".\zlibstat"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;ASMV;ASMINF"
StringPooling="TRUE"
ExceptionHandling="FALSE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
PrecompiledHeaderFile=".\zlibstat/zlibstat.pch"
AssemblerListingLocation=".\zlibstat/"
ObjectFile=".\zlibstat/"
ProgramDataBaseFileName=".\zlibstat/"
WarningLevel="3"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="..\..\masmx86\gvmat32.obj ..\..\masmx86\inffas32.obj /NODEFAULTLIB "
OutputFile=".\zlibstat\zlibstat.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
</Configuration>
<Configuration
Name="ReleaseWithoutAsm|Win32"
OutputDirectory="zlibstatWithoutAsm"
IntermediateDirectory="zlibstatWithoutAsm"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI"
StringPooling="TRUE"
ExceptionHandling="FALSE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
PrecompiledHeaderFile=".\zlibstat/zlibstat.pch"
AssemblerListingLocation=".\zlibstatWithoutAsm/"
ObjectFile=".\zlibstatWithoutAsm/"
ProgramDataBaseFileName=".\zlibstatWithoutAsm/"
WarningLevel="3"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions=" /NODEFAULTLIB "
OutputFile=".\zlibstatWithoutAsm\zlibstat.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="">
<File
RelativePath="..\..\..\adler32.c">
</File>
<File
RelativePath="..\..\..\compress.c">
</File>
<File
RelativePath="..\..\..\crc32.c">
</File>
<File
RelativePath="..\..\..\deflate.c">
</File>
<File
RelativePath="..\..\masmx86\gvmat32c.c">
</File>
<File
RelativePath="..\..\..\gzio.c">
</File>
<File
RelativePath="..\..\..\infback.c">
</File>
<File
RelativePath="..\..\..\inffast.c">
</File>
<File
RelativePath="..\..\..\inflate.c">
</File>
<File
RelativePath="..\..\..\inftrees.c">
</File>
<File
RelativePath="..\..\minizip\ioapi.c">
</File>
<File
RelativePath="..\..\..\trees.c">
</File>
<File
RelativePath="..\..\..\uncompr.c">
</File>
<File
RelativePath="..\..\minizip\unzip.c">
</File>
<File
RelativePath="..\..\minizip\zip.c">
</File>
<File
RelativePath=".\zlib.rc">
</File>
<File
RelativePath=".\zlibvc.def">
</File>
<File
RelativePath="..\..\..\zutil.c">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment