Compare commits

..

9 Commits

Author SHA1 Message Date
Mark Adler
e0ff940e1a zlib 1.2.3.8 2011-09-09 23:27:17 -07:00
Mark Adler
7df877eccd zlib 1.2.3.7 2011-09-09 23:27:08 -07:00
Mark Adler
dc5a43ebfa zlib 1.2.3.6 2011-09-09 23:26:58 -07:00
Mark Adler
d004b04783 zlib 1.2.3.5 2011-09-09 23:26:49 -07:00
Mark Adler
f6194ef39a zlib 1.2.3.4 2011-09-09 23:26:40 -07:00
Mark Adler
639be99788 zlib 1.2.3.3 2011-09-09 23:26:29 -07:00
Mark Adler
d6231142d2 zlib 1.2.3.2 2011-09-09 23:25:38 -07:00
Mark Adler
b1c19ca6d8 zlib 1.2.3.1 2011-09-09 23:25:27 -07:00
Mark Adler
abf180a067 zlib 1.2.3 2011-09-09 23:25:17 -07:00
167 changed files with 28207 additions and 10005 deletions

180
CMakeLists.txt Normal file
View File

@@ -0,0 +1,180 @@
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)
# 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)
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 HAVE_UNISTD_H)
#
# Check for errno.h
check_include_file(errno.h HAVE_ERRNO_H)
if(NOT HAVE_ERRNO_H)
add_definitions(-DNO_ERRNO_H)
endif()
if(MSVC)
set(CMAKE_DEBUG_POSTFIX "d")
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
endif()
#============================================================================
# zlib
#============================================================================
set(ZLIB_PUBLIC_HDRS
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
gzio.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}
-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()

229
ChangeLog
View File

@@ -1,6 +1,235 @@
ChangeLog file for zlib ChangeLog file for zlib
Changes in 1.2.3.8 (13 Feb 2010)
- Clean up text files (tabs, trailing whitespace, etc.) [Oberhumer]
- Use z_off64_t in gz_zero() and gz_skip() to match state->skip
- Avoid comparison problem when sizeof(int) == sizeof(z_off64_t)
- Revert to Makefile.in from 1.2.3.6 (live with the clutter)
- Fix missing error return in gzflush(), add zlib.h note
- Add *64 functions to zlib.map [Levin]
- Fix signed/unsigned comparison in gz_comp()
- Use SFLAGS when testing shared linking in configure
- Add --64 option to ./configure to use -m64 with gcc
- Fix ./configure --help to correctly name options
- Have make fail if a test fails [Levin]
- Avoid buffer overrun in contrib/masmx64/gvmat64.asm [Simpson]
- Remove assembler object files from contrib
Changes in 1.2.3.7 (24 Jan 2010)
- Always gzopen() with O_LARGEFILE if available
- Fix gzdirect() to work immediately after gzopen() or gzdopen()
- Make gzdirect() more precise when the state changes while reading
- Improve zlib.h documentation in many places
- Catch memory allocation failure in gz_open()
- Complete close operation if seek forward in gzclose_w() fails
- Return Z_ERRNO from gzclose_r() if close() fails
- Return Z_STREAM_ERROR instead of EOF for gzclose() being passed NULL
- Return zero for gzwrite() errors to match zlib.h description
- Return -1 on gzputs() error to match zlib.h description
- Add zconf.in.h to allow recovery from configure modification [Weigelt]
- Fix static library permissions in Makefile.in [Weigelt]
- Avoid warnings in configure tests that hide functionality [Weigelt]
- Add *BSD and DragonFly to Linux case in configure [gentoo 123571]
- Change libzdll.a to libz.dll.a in win32/Makefile.gcc [gentoo 288212]
- Avoid access of uninitialized data for first inflateReset2 call [Gomes]
- Keep object files in subdirectories to reduce the clutter somewhat
- Remove default Makefile and zlibdefs.h, add dummy Makefile
- Add new external functions to Z_PREFIX, remove duplicates, z_z_ -> z_
- Remove zlibdefs.h completely -- modify zconf.h instead
Changes in 1.2.3.6 (17 Jan 2010)
- Avoid void * arithmetic in gzread.c and gzwrite.c
- Make compilers happier with const char * for gz_error message
- Avoid unused parameter warning in inflate.c
- Avoid signed-unsigned comparison warning in inflate.c
- Indent #pragma's for traditional C
- Fix usage of strwinerror() in glib.c, change to gz_strwinerror()
- Correct email address in configure for system options
- Update make_vms.com and add make_vms.com to contrib/minizip [Zinser]
- Update zlib.map [Brown]
- Fix Makefile.in for Solaris 10 make of example64 and minizip64 [T<>r<EFBFBD>k]
- Apply various fixes to CMakeLists.txt [Lowman]
- Add checks on len in gzread() and gzwrite()
- Add error message for no more room for gzungetc()
- Remove zlib version check in gzwrite()
- Defer compression of gzprintf() result until need to
- Use snprintf() in gzdopen() if available
- Remove USE_MMAP configuration determination (only used by minigzip)
- Remove examples/pigz.c (available separately)
- Update examples/gun.c to 1.6
Changes in 1.2.3.5 (8 Jan 2010)
- Add space after #if in zutil.h for some compilers
- Fix relatively harmless bug in deflate_fast() [Exarevsky]
- Fix same problem in deflate_slow()
- Add $(SHAREDLIBV) to LIBS in Makefile.in [Brown]
- Add deflate_rle() for faster Z_RLE strategy run-length encoding
- Add deflate_huff() for faster Z_HUFFMAN_ONLY encoding
- Change name of "write" variable in inffast.c to avoid library collisions
- Fix premature EOF from gzread() in gzio.c [Brown]
- Use zlib header window size if windowBits is 0 in inflateInit2()
- Remove compressBound() call in deflate.c to avoid linking compress.o
- Replace use of errno in gz* with functions, support WinCE [Alves]
- Provide alternative to perror() in minigzip.c for WinCE [Alves]
- Don't use _vsnprintf on later versions of MSVC [Lowman]
- Add CMake build script and input file [Lowman]
- Update contrib/minizip to 1.1 [Svensson, Vollant]
- Moved nintendods directory from contrib to .
- Replace gzio.c with a new set of routines with the same functionality
- Add gzbuffer(), gzoffset(), gzclose_r(), gzclose_w() as part of above
- Update contrib/minizip to 1.1b
- Change gzeof() to return 0 on error instead of -1 to agree with zlib.h
Changes in 1.2.3.4 (21 Dec 2009)
- Use old school .SUFFIXES in Makefile.in for FreeBSD compatibility
- Update comments in configure and Makefile.in for default --shared
- Fix test -z's in configure [Marquess]
- Build examplesh and minigzipsh when not testing
- Change NULL's to Z_NULL's in deflate.c and in comments in zlib.h
- Import LDFLAGS from the environment in configure
- Fix configure to populate SFLAGS with discovered CFLAGS options
- Adapt make_vms.com to the new Makefile.in [Zinser]
- Add zlib2ansi script for C++ compilation [Marquess]
- Add _FILE_OFFSET_BITS=64 test to make test (when applicable)
- Add AMD64 assembler code for longest match to contrib [Teterin]
- Include options from $SFLAGS when doing $LDSHARED
- Simplify 64-bit file support by introducing z_off64_t type
- Make shared object files in objs directory to work around old Sun cc
- Use only three-part version number for Darwin shared compiles
- Add rc option to ar in Makefile.in for when ./configure not run
- Add -WI,-rpath,. to LDFLAGS for OSF 1 V4*
- Set LD_LIBRARYN32_PATH for SGI IRIX shared compile
- Protect against _FILE_OFFSET_BITS being defined when compiling zlib
- Rename Makefile.in targets allstatic to static and allshared to shared
- Fix static and shared Makefile.in targets to be independent
- Correct error return bug in gz_open() by setting state [Brown]
- Put spaces before ;;'s in configure for better sh compatibility
- Add pigz.c (parallel implementation of gzip) to examples/
- Correct constant in crc32.c to UL [Leventhal]
- Reject negative lengths in crc32_combine()
- Add inflateReset2() function to work like inflateEnd()/inflateInit2()
- Include sys/types.h for _LARGEFILE64_SOURCE [Brown]
- Correct typo in doc/algorithm.txt [Janik]
- Fix bug in adler32_combine() [Zhu]
- Catch missing-end-of-block-code error in all inflates and in puff
Assures that random input to inflate eventually results in an error
- Added enough.c (calculation of ENOUGH for inftrees.h) to examples/
- Update ENOUGH and its usage to reflect discovered bounds
- Fix gzerror() error report on empty input file [Brown]
- Add ush casts in trees.c to avoid pedantic runtime errors
- Fix typo in zlib.h uncompress() description [Reiss]
- Correct inflate() comments with regard to automatic header detection
- Remove deprecation comment on Z_PARTIAL_FLUSH (it stays)
- Put new version of gzlog (2.0) in examples with interruption recovery
- Add puff compile option to permit invalid distance-too-far streams
- Add puff TEST command options, ability to read piped input
- Prototype the *64 functions in zlib.h when _FILE_OFFSET_BITS == 64, but
_LARGEFILE64_SOURCE not defined
- Fix Z_FULL_FLUSH to truly erase the past by resetting s->strstart
- Fix deflateSetDictionary() to use all 32K for output consistency
- Remove extraneous #define MIN_LOOKAHEAD in deflate.c (in deflate.h)
- Clear bytes after deflate lookahead to avoid use of uninitialized data
- Change a limit in inftrees.c to be more transparent to Coverity Prevent
- Update win32/zlib.def with exported symbols from zlib.h
- Correct spelling error in zlib.h [Willem]
- Allow Z_BLOCK for deflate() to force a new block
- Allow negative bits in inflatePrime() to delete existing bit buffer
- Add Z_TREES flush option to inflate() to return at end of trees
- Add inflateMark() to return current state information for random access
- Add Makefile for NintendoDS to contrib [Costa]
- Add -w in configure compile tests to avoid spurious warnings [Beucler]
- Fix typos in zlib.h comments for deflateSetDictionary()
- Fix EOF detection in transparent gzread() [Maier]
Changes in 1.2.3.3 (2 October 2006)
- Make --shared the default for configure, add a --static option
- Add compile option to permit invalid distance-too-far streams
- Add inflateUndermine() function which is required to enable above
- Remove use of "this" variable name for C++ compatibility [Marquess]
- Add testing of shared library in make test, if shared library built
- Use ftello() and fseeko() if available instead of ftell() and fseek()
- Provide two versions of all functions that use the z_off_t type for
binary compatibility -- a normal version and a 64-bit offset version,
per the Large File Support Extension when _LARGEFILE64_SOURCE is
defined; use the 64-bit versions by default when _FILE_OFFSET_BITS
is defined to be 64
- Add a --uname= option to configure to perhaps help with cross-compiling
Changes in 1.2.3.2 (3 September 2006)
- Turn off silly Borland warnings [Hay]
- Use off64_t and define _LARGEFILE64_SOURCE when present
- Fix missing dependency on inffixed.h in Makefile.in
- Rig configure --shared to build both shared and static [Teredesai, Truta]
- Remove zconf.in.h and instead create a new zlibdefs.h file
- Fix contrib/minizip/unzip.c non-encrypted after encrypted [Vollant]
- Add treebuild.xml (see http://treebuild.metux.de/) [Weigelt]
Changes in 1.2.3.1 (16 August 2006)
- Add watcom directory with OpenWatcom make files [Daniel]
- Remove #undef of FAR in zconf.in.h for MVS [Fedtke]
- Update make_vms.com [Zinser]
- Use -fPIC for shared build in configure [Teredesai, Nicholson]
- Use only major version number for libz.so on IRIX and OSF1 [Reinholdtsen]
- Use fdopen() (not _fdopen()) for Interix in zutil.h [B<>ck]
- Add some FAQ entries about the contrib directory
- Update the MVS question in the FAQ
- Avoid extraneous reads after EOF in gzio.c [Brown]
- Correct spelling of "successfully" in gzio.c [Randers-Pehrson]
- Add comments to zlib.h about gzerror() usage [Brown]
- Set extra flags in gzip header in gzopen() like deflate() does
- Make configure options more compatible with double-dash conventions
[Weigelt]
- Clean up compilation under Solaris SunStudio cc [Rowe, Reinholdtsen]
- Fix uninstall target in Makefile.in [Truta]
- Add pkgconfig support [Weigelt]
- Use $(DESTDIR) macro in Makefile.in [Reinholdtsen, Weigelt]
- Replace set_data_type() with a more accurate detect_data_type() in
trees.c, according to the txtvsbin.txt document [Truta]
- Swap the order of #include <stdio.h> and #include "zlib.h" in
gzio.c, example.c and minigzip.c [Truta]
- Shut up annoying VS2005 warnings about standard C deprecation [Rowe,
Truta] (where?)
- Fix target "clean" from win32/Makefile.bor [Truta]
- Create .pdb and .manifest files in win32/makefile.msc [Ziegler, Rowe]
- Update zlib www home address in win32/DLL_FAQ.txt [Truta]
- Update contrib/masmx86/inffas32.asm for VS2005 [Vollant, Van Wassenhove]
- Enable browse info in the "Debug" and "ASM Debug" configurations in
the Visual C++ 6 project, and set (non-ASM) "Debug" as default [Truta]
- Add pkgconfig support [Weigelt]
- Add ZLIB_VER_MAJOR, ZLIB_VER_MINOR and ZLIB_VER_REVISION in zlib.h,
for use in win32/zlib1.rc [Polushin, Rowe, Truta]
- Add a document that explains the new text detection scheme to
doc/txtvsbin.txt [Truta]
- Add rfc1950.txt, rfc1951.txt and rfc1952.txt to doc/ [Truta]
- Move algorithm.txt into doc/ [Truta]
- Synchronize FAQ with website
- Fix compressBound(), was low for some pathological cases [Fearnley]
- Take into account wrapper variations in deflateBound()
- Set examples/zpipe.c input and output to binary mode for Windows
- Update examples/zlib_how.html with new zpipe.c (also web site)
- Fix some warnings in examples/gzlog.c and examples/zran.c (it seems
that gcc became pickier in 4.0)
- Add zlib.map for Linux: "All symbols from zlib-1.1.4 remain
un-versioned, the patch adds versioning only for symbols introduced in
zlib-1.2.0 or later. It also declares as local those symbols which are
not designed to be exported." [Levin]
- Update Z_PREFIX list in zconf.in.h, add --zprefix option to configure
- Do not initialize global static by default in trees.c, add a response
NO_INIT_GLOBAL_POINTERS to initialize them if needed [Marquess]
- Don't use strerror() in gzio.c under WinCE [Yakimov]
- Don't use errno.h in zutil.h under WinCE [Yakimov]
- Move arguments for AR to its usage to allow replacing ar [Marot]
- Add HAVE_VISIBILITY_PRAGMA in zconf.in.h for Mozilla [Randers-Pehrson]
- Improve inflateInit() and inflateInit2() documentation
- Fix structure size comment in inflate.h
- Change configure help option from --h* to --help [Santos]
Changes in 1.2.3 (18 July 2005)
- Apply security vulnerability fixes to contrib/infback9 as well
- Clean up some text files (carriage returns, trailing space)
- Update testzlib, vstudio, masmx64, and masmx86 in contrib [Vollant]
Changes in 1.2.2.4 (11 July 2005) Changes in 1.2.2.4 (11 July 2005)
- Add inflatePrime() function for starting inflation at bit boundary - Add inflatePrime() function for starting inflation at bit boundary
- Avoid some Visual C warnings in deflate.c - Avoid some Visual C warnings in deflate.c

40
FAQ
View File

@@ -77,7 +77,7 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
11. Can zlib handle .zip archives? 11. Can zlib handle .zip archives?
Not by itself, no. See the directory contrib/minizip in the zlib Not by itself, no. See the directory contrib/minizip in the zlib
distribution. distribution.
12. Can zlib handle .Z files? 12. Can zlib handle .Z files?
@@ -217,10 +217,14 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
29. Does zlib work on MVS, OS/390, CICS, etc.? 29. Does zlib work on MVS, OS/390, CICS, etc.?
We don't know for sure. We have heard occasional reports of success on Yes, there are working ports of zlib 1.1.4 to MVS which you can find
these systems. If you do use it on one of these, please provide us with here:
a report, instructions, and patches that we can reference when we get
these questions. Thanks. http://www.homerow.net/asm/zlib390.htm
http://www.homerow.net/asm/zlibLE.htm
If these are updated to more recent versions of zlib, please let us
know. Thanks.
30. Is there some simpler, easier to read version of inflate I can look at 30. Is there some simpler, easier to read version of inflate I can look at
to understand the deflate format? to understand the deflate format?
@@ -271,7 +275,9 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
http://www.ijs.si/software/snprintf/ http://www.ijs.si/software/snprintf/
Note that you should be using the most recent version of zlib. Versions Note that you should be using the most recent version of zlib. Versions
1.1.3 and before were subject to a double-free vulnerability. 1.1.3 and before were subject to a double-free vulnerability, and version
1.2.1 was subject to an access exception when decompressing invalid
compressed data.
34. Is there a Java version of zlib? 34. Is there a Java version of zlib?
@@ -292,8 +298,8 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
performing a conditional jump that depends on an uninitialized value. performing a conditional jump that depends on an uninitialized value.
Isn't that a bug? Isn't that a bug?
No. That is intentional for performance reasons, and the output of No. That is intentional for performance reasons, and the output of
deflate is not affected. This only started showing up recently since deflate is not affected. This only started showing up recently since
zlib 1.2.x uses malloc() by default for allocations, whereas earlier zlib 1.2.x uses malloc() by default for allocations, whereas earlier
versions used calloc(), which zeros out the allocated memory. versions used calloc(), which zeros out the allocated memory.
@@ -333,7 +339,23 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
In any case, the compression improvements are so modest compared to other In any case, the compression improvements are so modest compared to other
more modern approaches, that it's not worth the effort to implement. more modern approaches, that it's not worth the effort to implement.
41. Can you please sign these lengthy legal documents and fax them back to us 41. I'm having a problem with the zip functions in zlib, can you help?
There are no zip functions in zlib. You are probably using minizip by
Giles Vollant, which is found in the contrib directory of zlib. It is not
part of zlib. In fact none of the stuff in contrib is part of zlib. The
files in there are not supported by the zlib authors. You need to contact
the authors of the contribution for help.
42. The match.asm code in contrib is under the GNU General Public License.
Since it's part of zlib, doesn't that mean that all of zlib falls under the
GNU GPL?
No. The files in contrib are not part of zlib. They were contributed by
other authors and are provided as a convenience to the user within the zlib
distribution. Each of the items in contrib have their own license.
43. Can you please sign these lengthy legal documents and fax them back to us
so that we can use your software in our product? so that we can use your software in our product?
No. Go away. Shoo. No. Go away. Shoo.

26
INDEX
View File

@@ -1,23 +1,33 @@
CMakeLists.txt cmake build file
ChangeLog history of changes ChangeLog history of changes
FAQ Frequently Asked Questions about zlib FAQ Frequently Asked Questions about zlib
INDEX this file INDEX this file
Makefile makefile for Unix (generated by configure) Makefile.in template for Unix Makefile
Makefile.in makefile for Unix (template for configure)
README guess what README guess what
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.in.h zconf.h template for configure
zlib.3 Man page for zlib
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 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
objs/ destination for object files
old/ makefiles for various architectures and zlib documentation old/ makefiles for various architectures and zlib documentation
files that have not yet been updated for zlib 1.2.x files that have not yet been updated for zlib 1.2.x
pics/ destination for position-independent-code object files
projects/ projects for various Integrated Development Environments projects/ projects for various Integrated Development Environments
qnx/ makefiles for QNX qnx/ makefiles for QNX
watcom/ makefiles for OpenWatcom
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 +38,12 @@ crc32.c
crc32.h crc32.h
deflate.c deflate.c
deflate.h deflate.h
gzclose.c
gzguts.h
gzio.c gzio.c
gzlib.c
gzread.c
gzwrite.c
infback.c infback.c
inffast.c inffast.c
inffast.h inffast.h
@@ -46,6 +61,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

156
Makefile
View File

@@ -1,154 +1,2 @@
# Makefile for zlib all:
# Copyright (C) 1995-2005 Jean-loup Gailly. -@echo "Use ./configure first. Thank you."
# For conditions of distribution and use, see copyright notice in zlib.h
# To compile and test, type:
# ./configure; make test
# The call of configure is optional if you don't have special requirements
# If you wish to build zlib as a shared library, use: ./configure -s
# To use the asm code, type:
# cp contrib/asm?86/match.S ./match.S
# make LOC=-DASMV OBJA=match.o
# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
# make install
# To install in $HOME instead of /usr/local, use:
# make install prefix=$HOME
CC=cc
CFLAGS=-O
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
#CFLAGS=-g -DDEBUG
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
# -Wstrict-prototypes -Wmissing-prototypes
LDFLAGS=libz.a
LDSHARED=$(CC)
CPP=$(CC) -E
LIBS=libz.a
SHAREDLIB=libz.so
SHAREDLIBV=libz.so.1.2.2.4
SHAREDLIBM=libz.so.1
AR=ar rc
RANLIB=ranlib
TAR=tar
SHELL=/bin/sh
EXE=
prefix = /usr/local
exec_prefix = ${prefix}
libdir = ${exec_prefix}/lib
includedir = ${prefix}/include
mandir = ${prefix}/share/man
man3dir = ${mandir}/man3
OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
zutil.o inflate.o infback.o inftrees.o inffast.o
OBJA =
# to use the asm code: make OBJA=match.o
TEST_OBJS = example.o minigzip.o
all: example$(EXE) minigzip$(EXE)
check: test
test: all
@LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
echo hello world | ./minigzip | ./minigzip -d || \
echo ' *** minigzip test FAILED ***' ; \
if ./example; then \
echo ' *** zlib test OK ***'; \
else \
echo ' *** zlib test FAILED ***'; \
fi
libz.a: $(OBJS) $(OBJA)
$(AR) $@ $(OBJS) $(OBJA)
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
match.o: match.S
$(CPP) match.S > _match.s
$(CC) -c _match.s
mv _match.o match.o
rm -f _match.s
$(SHAREDLIBV): $(OBJS)
$(LDSHARED) -o $@ $(OBJS)
rm -f $(SHAREDLIB) $(SHAREDLIBM)
ln -s $@ $(SHAREDLIB)
ln -s $@ $(SHAREDLIBM)
example$(EXE): example.o $(LIBS)
$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
minigzip$(EXE): minigzip.o $(LIBS)
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
install: $(LIBS)
-@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi
-@if [ ! -d $(includedir) ]; then mkdir -p $(includedir); fi
-@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi
-@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi
cp zlib.h zconf.h $(includedir)
chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
cp $(LIBS) $(libdir)
cd $(libdir); chmod 755 $(LIBS)
-@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
cd $(libdir); if test -f $(SHAREDLIBV); then \
rm -f $(SHAREDLIB) $(SHAREDLIBM); \
ln -s $(SHAREDLIBV) $(SHAREDLIB); \
ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
(ldconfig || true) >/dev/null 2>&1; \
fi
cp zlib.3 $(man3dir)
chmod 644 $(man3dir)/zlib.3
# The ranlib in install is needed on NeXTSTEP which checks file times
# ldconfig is for Linux
uninstall:
cd $(includedir); \
cd $(libdir); rm -f libz.a; \
if test -f $(SHAREDLIBV); then \
rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
fi
cd $(man3dir); rm -f zlib.3
mostlyclean: clean
clean:
rm -f *.o *~ example$(EXE) minigzip$(EXE) \
libz.* foo.gz so_locations \
_match.s maketree contrib/infback9/*.o
maintainer-clean: distclean
distclean: clean
cp -p Makefile.in Makefile
cp -p zconf.in.h zconf.h
rm -f .DS_Store
tags:
etags *.[ch]
depend:
makedepend -- $(CFLAGS) -- *.[ch]
# DO NOT DELETE THIS LINE -- make depend depends on it.
adler32.o: zlib.h zconf.h
compress.o: zlib.h zconf.h
crc32.o: crc32.h zlib.h zconf.h
deflate.o: deflate.h zutil.h zlib.h zconf.h
example.o: zlib.h zconf.h
gzio.o: zutil.h zlib.h zconf.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
infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
minigzip.o: zlib.h zconf.h
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
uncompr.o: zlib.h zconf.h
zutil.o: zutil.h zlib.h zconf.h

View File

@@ -1,11 +1,11 @@
# Makefile for zlib # Makefile for zlib
# Copyright (C) 1995-2005 Jean-loup Gailly. # Copyright (C) 1995-2010 Jean-loup Gailly.
# For conditions of distribution and use, see copyright notice in zlib.h # For conditions of distribution and use, see copyright notice in zlib.h
# To compile and test, type: # To compile and test, type:
# ./configure; make test # ./configure; make test
# The call of configure is optional if you don't have special requirements # Normally configure builds both a static and a shared library.
# If you wish to build zlib as a shared library, use: ./configure -s # If you want to build just a static library, use: ./configure --static
# To use the asm code, type: # To use the asm code, type:
# cp contrib/asm?86/match.S ./match.S # cp contrib/asm?86/match.S ./match.S
@@ -24,14 +24,17 @@ CFLAGS=-O
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
# -Wstrict-prototypes -Wmissing-prototypes # -Wstrict-prototypes -Wmissing-prototypes
LDFLAGS=libz.a SFLAGS=-O
LDFLAGS=-L. libz.a
LDSHARED=$(CC) LDSHARED=$(CC)
CPP=$(CC) -E CPP=$(CC) -E
LIBS=libz.a STATICLIB=libz.a
SHAREDLIB=libz.so SHAREDLIB=libz.so
SHAREDLIBV=libz.so.1.2.2.4 SHAREDLIBV=libz.so.1.2.3.8
SHAREDLIBM=libz.so.1 SHAREDLIBM=libz.so.1
LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV)
AR=ar rc AR=ar rc
RANLIB=ranlib RANLIB=ranlib
@@ -45,30 +48,64 @@ libdir = ${exec_prefix}/lib
includedir = ${prefix}/include includedir = ${prefix}/include
mandir = ${prefix}/share/man mandir = ${prefix}/share/man
man3dir = ${mandir}/man3 man3dir = ${mandir}/man3
pkgconfigdir = ${libdir}/pkgconfig
OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ OBJC = adler32.o compress.o crc32.o deflate.o gzclose.o gzio.o gzlib.o gzread.o \
zutil.o inflate.o infback.o inftrees.o inffast.o gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
PIC_OBJC = adler32.lo compress.lo crc32.lo deflate.lo gzclose.lo gzio.lo gzlib.lo gzread.lo \
gzwrite.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo
# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
OBJA = OBJA =
# to use the asm code: make OBJA=match.o PIC_OBJA =
TEST_OBJS = example.o minigzip.o OBJS = $(OBJC) $(OBJA)
all: example$(EXE) minigzip$(EXE) PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
all: static shared
static: example$(EXE) minigzip$(EXE)
shared: examplesh$(EXE) minigzipsh$(EXE)
all64: example64$(EXE) minigzip64$(EXE)
check: test check: test
test: all
@LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ test: all teststatic testshared
echo hello world | ./minigzip | ./minigzip -d || \
echo ' *** minigzip test FAILED ***' ; \ teststatic: static
if ./example; then \ @if echo hello world | ./minigzip | ./minigzip -d && ./example; then \
echo ' *** zlib test OK ***'; \ echo ' *** zlib test OK ***'; \
else \ else \
echo ' *** zlib test FAILED ***'; \ echo ' *** zlib test FAILED ***'; false; \
fi fi
-@rm -f foo.gz
libz.a: $(OBJS) $(OBJA) testshared: shared
$(AR) $@ $(OBJS) $(OBJA) @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh; then \
echo ' *** zlib shared test OK ***'; \
else \
echo ' *** zlib shared test FAILED ***'; false; \
fi
-@rm -f foo.gz
test64: all64
@if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64; then \
echo ' *** zlib 64-bit test OK ***'; \
else \
echo ' *** zlib 64-bit test FAILED ***'; false; \
fi
-@rm -f foo.gz
libz.a: $(OBJS)
$(AR) $@ $(OBJS)
-@ ($(RANLIB) $@ || true) >/dev/null 2>&1 -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
match.o: match.S match.o: match.S
@@ -77,58 +114,100 @@ match.o: match.S
mv _match.o match.o mv _match.o match.o
rm -f _match.s rm -f _match.s
$(SHAREDLIBV): $(OBJS) match.lo: match.S
$(LDSHARED) -o $@ $(OBJS) $(CPP) match.S > _match.s
$(CC) -c -fPIC _match.s
mv _match.o match.lo
rm -f _match.s
example64.o: example.c zlib.h zconf.h
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ example.c
minigzip64.o: minigzip.c zlib.h zconf.h
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ minigzip.c
.SUFFIXES: .lo
.c.lo:
-@if [ ! -d objs ]; then mkdir objs; fi
$(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $<
-@mv objs/$*.o $@
$(SHAREDLIBV): $(PIC_OBJS)
$(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) -lc
rm -f $(SHAREDLIB) $(SHAREDLIBM) rm -f $(SHAREDLIB) $(SHAREDLIBM)
ln -s $@ $(SHAREDLIB) ln -s $@ $(SHAREDLIB)
ln -s $@ $(SHAREDLIBM) ln -s $@ $(SHAREDLIBM)
-@rmdir objs
example$(EXE): example.o $(LIBS) example$(EXE): example.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
minigzip$(EXE): minigzip.o $(LIBS) minigzip$(EXE): minigzip.o $(STATICLIB)
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
install: $(LIBS) examplesh$(EXE): example.o $(SHAREDLIBV)
-@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
-@if [ ! -d $(includedir) ]; then mkdir -p $(includedir); fi
-@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
-@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
cp zlib.h zconf.h $(includedir)
chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h example64$(EXE): example64.o $(STATICLIB)
cp $(LIBS) $(libdir) $(CC) $(CFLAGS) -o $@ example64.o $(LDFLAGS)
cd $(libdir); chmod 755 $(LIBS)
-@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 minigzip64$(EXE): minigzip64.o $(STATICLIB)
cd $(libdir); if test -f $(SHAREDLIBV); then \ $(CC) $(CFLAGS) -o $@ minigzip64.o $(LDFLAGS)
install-libs: $(LIBS)
-@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
-@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
-@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
-@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
cp $(LIBS) $(DESTDIR)$(libdir)
cd $(DESTDIR)$(libdir); chmod 755 $(SHAREDLIB) ; chmod u=rw,go=r $(STATICLIB)
-@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
cd $(DESTDIR)$(libdir); if test -f $(SHAREDLIBV); then \
rm -f $(SHAREDLIB) $(SHAREDLIBM); \ rm -f $(SHAREDLIB) $(SHAREDLIBM); \
ln -s $(SHAREDLIBV) $(SHAREDLIB); \ ln -s $(SHAREDLIBV) $(SHAREDLIB); \
ln -s $(SHAREDLIBV) $(SHAREDLIBM); \ ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
(ldconfig || true) >/dev/null 2>&1; \ (ldconfig || true) >/dev/null 2>&1; \
fi fi
cp zlib.3 $(man3dir) cp zlib.3 $(DESTDIR)$(man3dir)
chmod 644 $(man3dir)/zlib.3 chmod 644 $(DESTDIR)$(man3dir)/zlib.3
cp zlib.pc $(DESTDIR)$(pkgconfigdir)
chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
# The ranlib in install is needed on NeXTSTEP which checks file times # The ranlib in install is needed on NeXTSTEP which checks file times
# ldconfig is for Linux # ldconfig is for Linux
install: install-libs
-@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
cp zlib.h zconf.h $(DESTDIR)$(includedir)
chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
uninstall: uninstall:
cd $(includedir); \ cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h
cd $(libdir); rm -f libz.a; \ cd $(DESTDIR)$(libdir); rm -f libz.a; \
if test -f $(SHAREDLIBV); then \ if test -f $(SHAREDLIBV); then \
rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \ rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
fi fi
cd $(man3dir); rm -f zlib.3 cd $(DESTDIR)$(man3dir); rm -f zlib.3
cd $(DESTDIR)$(pkgconfigdir); rm -f zlib.pc
mostlyclean: clean mostlyclean: clean
clean: clean:
rm -f *.o *~ example$(EXE) minigzip$(EXE) \ rm -f *.o *.lo *~ \
example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
example64$(EXE) minigzip64$(EXE) \
libz.* foo.gz so_locations \ libz.* foo.gz so_locations \
_match.s maketree contrib/infback9/*.o _match.s maketree contrib/infback9/*.o
rm -rf objs
maintainer-clean: distclean maintainer-clean: distclean
distclean: clean distclean: clean
cp -p Makefile.in Makefile
cp -p zconf.in.h zconf.h cp -p zconf.in.h zconf.h
rm -f .DS_Store rm -f zlib.pc .DS_Store
-@printf 'all:\n\t-@echo "Use ./configure first. Thank you."\n' > Makefile
-@touch -r Makefile.in Makefile
tags: tags:
etags *.[ch] etags *.[ch]
@@ -138,17 +217,22 @@ depend:
# DO NOT DELETE THIS LINE -- make depend depends on it. # DO NOT DELETE THIS LINE -- make depend depends on it.
adler32.o: zlib.h zconf.h adler32.o gzio.o zutil.o: zutil.h zlib.h zconf.h
compress.o: zlib.h zconf.h gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h gzguts.h
crc32.o: crc32.h zlib.h zconf.h compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h
crc32.o: zutil.h zlib.h zconf.h crc32.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 infback.o inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
gzio.o: zutil.h zlib.h zconf.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
infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inftrees.o: zutil.h zlib.h zconf.h inftrees.h inftrees.o: zutil.h zlib.h zconf.h inftrees.h
minigzip.o: zlib.h zconf.h
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
uncompr.o: zlib.h zconf.h
zutil.o: zutil.h zlib.h zconf.h adler32.lo gzio.lo zutil.lo: zutil.h zlib.h zconf.h
gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h gzguts.h
compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h
crc32.lo: zutil.h zlib.h zconf.h crc32.h
deflate.lo: deflate.h zutil.h zlib.h zconf.h
infback.lo inflate.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
inffast.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inftrees.lo: zutil.h zlib.h zconf.h inftrees.h
trees.lo: deflate.h zutil.h zlib.h zconf.h trees.h

4
README
View File

@@ -1,6 +1,6 @@
ZLIB DATA COMPRESSION LIBRARY ZLIB DATA COMPRESSION LIBRARY
zlib 1.2.2.4 is a general purpose data compression library. All the code is zlib 1.2.3.8 is a general purpose data compression library. All the code is
thread safe. The data format used by the zlib library is described by RFCs thread safe. The data format used by the zlib library is described by RFCs
(Request for Comments) 1950 to 1952 in the files (Request for Comments) 1950 to 1952 in the files
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
@@ -33,7 +33,7 @@ Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
issue of Dr. Dobb's Journal; a copy of the article is available in issue of Dr. Dobb's Journal; a copy of the article is available in
http://dogma.net/markn/articles/zlibtool/zlibtool.htm http://dogma.net/markn/articles/zlibtool/zlibtool.htm
The changes made in version 1.2.2.4 are documented in the file ChangeLog. The changes made in version 1.2.3.8 are documented in the file ChangeLog.
Unsupported third party contributions are provided in directory "contrib". Unsupported third party contributions are provided in directory "contrib".

View File

@@ -1,12 +1,15 @@
/* 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$ */ /* @(#) $Id$ */
#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)
} }
/* ========================================================================= */ /* ========================================================================= */
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)
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);
}

View File

@@ -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 gzio.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,11 @@ 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
gzclose.o: zlib.h zconf.h gzguts.h
gzio.o: zutil.h zlib.h zconf.h gzio.o: zutil.h zlib.h zconf.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

View File

@@ -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 gzio.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
@@ -23,7 +23,7 @@ all: SCOPTIONS example minigzip
check: test check: test
test: all test: all
example example
echo hello world | minigzip | minigzip -d echo hello world | minigzip | minigzip -d
install: z.lib install: z.lib
copy clone zlib.h zconf.h INCLUDE: copy clone zlib.h zconf.h INCLUDE:
@@ -54,7 +54,11 @@ 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
gzclose.o: zlib.h zconf.h gzguts.h
gzio.o: zutil.h zlib.h zconf.h gzio.o: zutil.h zlib.h zconf.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

View File

@@ -118,6 +118,6 @@
&MODLIB/INFTREES &MODLIB/TREES + &MODLIB/INFTREES &MODLIB/TREES +
&MODLIB/UNCOMPR &MODLIB/ZUTIL) + &MODLIB/UNCOMPR &MODLIB/ZUTIL) +
SRCFILE(&SRCLIB/&CTLFILE) SRCMBR(BNDSRC) + SRCFILE(&SRCLIB/&CTLFILE) SRCMBR(BNDSRC) +
TEXT('ZLIB 1.2.2') TGTRLS(V4R4M0) TEXT('ZLIB 1.2.3') TGTRLS(V4R4M0)
ENDPGM ENDPGM

View File

@@ -1,4 +1,4 @@
ZLIB version 1.2.2 for AS400 installation instructions ZLIB version 1.2.3 for AS400 installation instructions
I) From an AS400 *SAVF file: I) From an AS400 *SAVF file:

View File

@@ -1,7 +1,7 @@
* ZLIB.INC - Interface to the general purpose compression library * ZLIB.INC - Interface to the general purpose compression library
* *
* ILE RPG400 version by Patrick Monnerat, DATASPHERE. * ILE RPG400 version by Patrick Monnerat, DATASPHERE.
* Version 1.2.2.4 * Version 1.2.3.8
* *
* *
* WARNING: * WARNING:
@@ -22,8 +22,8 @@
* *
* Versioning information. * Versioning information.
* *
D ZLIB_VERSION C '1.2.2.4' D ZLIB_VERSION C '1.2.3.8'
D ZLIB_VERNUM C X'1224' D ZLIB_VERNUM C X'1238'
* *
* Other equates. * Other equates.
* *

View File

@@ -1,5 +1,5 @@
/* 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)
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;
} }

268
configure vendored
View File

@@ -1,29 +1,26 @@
#!/bin/sh #!/bin/sh
# configure script for zlib. This script is needed only if # configure script for zlib.
# you wish to build a shared library and your system supports them,
# of if you need special compiler, flags or install directory.
# Otherwise, you can just use directly "make test; make install"
# #
# To create a shared library, use "configure --shared"; by default a static # Normally configure builds both a static and a shared library.
# library is created. If the primitive shared library support provided here # If you want to build just a static library, use: ./configure --static
# does not work, use ftp://prep.ai.mit.edu/pub/gnu/libtool-*.tar.gz
# #
# To impose specific compiler or flags or install directory, use for example: # To impose specific compiler or flags or install directory, use for example:
# prefix=$HOME CC=cc CFLAGS="-O4" ./configure # prefix=$HOME CC=cc CFLAGS="-O4" ./configure
# or for csh/tcsh users: # or for csh/tcsh users:
# (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure) # (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
# LDSHARED is the command to be used to create a shared library
# Incorrect settings of CC or CFLAGS may prevent creating a shared library. # Incorrect settings of CC or CFLAGS may prevent creating a shared library.
# If you have problems, try without defining CC and CFLAGS before reporting # If you have problems, try without defining CC and CFLAGS before reporting
# an error. # an error.
LIBS=libz.a STATICLIB=libz.a
LDFLAGS="-L. ${LIBS}" LDFLAGS="${LDFLAGS} -L. ${STATICLIB}"
VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h` VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h`
VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h` VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h`
VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h` VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h`
AR=${AR-"ar rc"} AR=${AR-"ar"}
AR_RC="${AR} rc"
RANLIB=${RANLIB-"ranlib"} RANLIB=${RANLIB-"ranlib"}
prefix=${prefix-/usr/local} prefix=${prefix-/usr/local}
exec_prefix=${exec_prefix-'${prefix}'} exec_prefix=${exec_prefix-'${prefix}'}
@@ -31,7 +28,9 @@ libdir=${libdir-'${exec_prefix}/lib'}
includedir=${includedir-'${prefix}/include'} includedir=${includedir-'${prefix}/include'}
mandir=${mandir-'${prefix}/share/man'} mandir=${mandir-'${prefix}/share/man'}
shared_ext='.so' shared_ext='.so'
shared=0 shared=1
zprefix=0
build64=0
gcc=0 gcc=0
old_cc="$CC" old_cc="$CC"
old_cflags="$CFLAGS" old_cflags="$CFLAGS"
@@ -39,21 +38,27 @@ old_cflags="$CFLAGS"
while test $# -ge 1 while test $# -ge 1
do do
case "$1" in case "$1" in
-h* | --h*) -h* | --help)
echo 'usage:' echo 'usage:'
echo ' configure [--shared] [--prefix=PREFIX] [--exec_prefix=EXPREFIX]' echo ' configure [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX]'
echo ' [--libdir=LIBDIR] [--includedir=INCLUDEDIR]' echo ' [--static] [--64] [--libdir=LIBDIR] [--includedir=INCLUDEDIR]'
exit 0;; exit 0 ;;
-p*=* | --p*=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;; -p*=* | --prefix=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift ;;
-e*=* | --e*=*) exec_prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;; -e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift ;;
-l*=* | --libdir=*) libdir=`echo $1 | sed 's/[-a-z_]*=//'`; shift;; -l*=* | --libdir=*) libdir=`echo $1 | sed 's/[-a-z_]*=//'`; shift ;;
-i*=* | --includedir=*) includedir=`echo $1 | sed 's/[-a-z_]*=//'`;shift;; -i*=* | --includedir=*) includedir=`echo $1 | sed 's/[-a-z_]*=//'`;shift ;;
-p* | --p*) prefix="$2"; shift; shift;; -u*=* | --uname=*) uname=`echo $1 | sed 's/[-a-z_]*=//'`;shift ;;
-e* | --e*) exec_prefix="$2"; shift; shift;; -p* | --prefix) prefix="$2"; shift; shift ;;
-l* | --l*) libdir="$2"; shift; shift;; -e* | --eprefix) exec_prefix="$2"; shift; shift ;;
-i* | --i*) includedir="$2"; shift; shift;; -l* | --libdir) libdir="$2"; shift; shift ;;
-s* | --s*) shared=1; shift;; -i* | --includedir) includedir="$2"; shift; shift ;;
*) echo "unknown option: $1"; echo "$0 --help for help"; exit 1;; -s* | --shared | --enable-shared) shared=1; shift ;;
-t | --static) shared=0; shift ;;
-z* | --zprefix) zprefix=1; shift ;;
-6* | --64) build64=1; shift ;;
--sysconfdir=*) echo "ignored option: --sysconfdir"; shift ;;
--localstatedir=*) echo "ignored option: --localstatedir"; shift ;;
*) echo "unknown option: $1"; echo "$0 --help for help"; exit 1 ;;
esac esac
done done
@@ -68,41 +73,54 @@ cc=${CC-gcc}
cflags=${CFLAGS-"-O3"} cflags=${CFLAGS-"-O3"}
# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
case "$cc" in case "$cc" in
*gcc*) gcc=1;; *gcc*) gcc=1 ;;
esac esac
if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
CC="$cc" CC="$cc"
SFLAGS=${CFLAGS-"-fPIC -O3"} SFLAGS="${CFLAGS-"-O3"} -fPIC"
CFLAGS="$cflags" CFLAGS="${CFLAGS-"-O3"}"
case `(uname -s || echo unknown) 2>/dev/null` in if test $build64 -eq 1; then
Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};; CFLAGS="${CFLAGS} -m64"
SFLAGS="${SFLAGS} -m64"
fi
if test "${ZLIBGCCWARN}" = "YES"; then
CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
fi
if test -z "$uname"; then
uname=`(uname -s || echo unknown) 2>/dev/null`
fi
case "$uname" in
Linux | linux | GNU | GNU/* | *BSD | DragonFly) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;;
CYGWIN* | Cygwin* | cygwin* | OS/2* ) CYGWIN* | Cygwin* | cygwin* | OS/2* )
EXE='.exe';; EXE='.exe' ;;
QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4 QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
# (alain.bonnefoy@icbt.com) # (alain.bonnefoy@icbt.com)
LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"};; LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"} ;;
HP-UX*) HP-UX*)
LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"} LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"}
case `(uname -m || echo unknown) 2>/dev/null` in case `(uname -m || echo unknown) 2>/dev/null` in
ia64) ia64)
shared_ext='.so' shared_ext='.so'
SHAREDLIB='libz.so';; SHAREDLIB='libz.so' ;;
*) *)
shared_ext='.sl' shared_ext='.sl'
SHAREDLIB='libz.sl';; SHAREDLIB='libz.sl' ;;
esac;; esac ;;
Darwin*) shared_ext='.dylib' Darwin*) shared_ext='.dylib'
SHAREDLIB=libz$shared_ext SHAREDLIB=libz$shared_ext
SHAREDLIBV=libz.$VER$shared_ext SHAREDLIBV=libz.$VER$shared_ext
SHAREDLIBM=libz.$VER1$shared_ext SHAREDLIBM=libz.$VER1$shared_ext
LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER"};; LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"} ;;
*) LDSHARED=${LDSHARED-"$cc -shared"};; *) LDSHARED=${LDSHARED-"$cc -shared"} ;;
esac esac
else else
# find system name and corresponding cc options # find system name and corresponding cc options
CC=${CC-cc} CC=${CC-cc}
case `(uname -sr || echo unknown) 2>/dev/null` in if test -z "$uname"; then
uname=`(uname -sr || echo unknown) 2>/dev/null`
fi
case "$uname" in
HP-UX*) SFLAGS=${CFLAGS-"-O +z"} HP-UX*) SFLAGS=${CFLAGS-"-O +z"}
CFLAGS=${CFLAGS-"-O"} CFLAGS=${CFLAGS-"-O"}
# LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"} # LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"}
@@ -110,57 +128,64 @@ else
case `(uname -m || echo unknown) 2>/dev/null` in case `(uname -m || echo unknown) 2>/dev/null` in
ia64) ia64)
shared_ext='.so' shared_ext='.so'
SHAREDLIB='libz.so';; SHAREDLIB='libz.so' ;;
*) *)
shared_ext='.sl' shared_ext='.sl'
SHAREDLIB='libz.sl';; SHAREDLIB='libz.sl' ;;
esac;; esac ;;
IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."} IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
CFLAGS=${CFLAGS-"-ansi -O2"} CFLAGS=${CFLAGS-"-ansi -O2"}
LDSHARED=${LDSHARED-"cc -shared"};; LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"} OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
CFLAGS=${CFLAGS-"-O -std1"} CFLAGS=${CFLAGS-"-O -std1"}
LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};; LDFLAGS="${LDFLAGS} -Wl,-rpath,."
LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"} ;;
OSF1*) SFLAGS=${CFLAGS-"-O -std1"} OSF1*) SFLAGS=${CFLAGS-"-O -std1"}
CFLAGS=${CFLAGS-"-O -std1"} CFLAGS=${CFLAGS-"-O -std1"}
LDSHARED=${LDSHARED-"cc -shared"};; LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
QNX*) SFLAGS=${CFLAGS-"-4 -O"} QNX*) SFLAGS=${CFLAGS-"-4 -O"}
CFLAGS=${CFLAGS-"-4 -O"} CFLAGS=${CFLAGS-"-4 -O"}
LDSHARED=${LDSHARED-"cc"} LDSHARED=${LDSHARED-"cc"}
RANLIB=${RANLIB-"true"} RANLIB=${RANLIB-"true"}
AR="cc -A";; AR_RC="cc -A" ;;
SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "} SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
CFLAGS=${CFLAGS-"-O3"} CFLAGS=${CFLAGS-"-O3"}
LDSHARED=${LDSHARED-"cc -dy -KPIC -G"};; LDSHARED=${LDSHARED-"cc -dy -KPIC -G"} ;;
SunOS\ 5*) SFLAGS=${CFLAGS-"-fast -xcg89 -KPIC -R."} SunOS\ 5*) LDSHARED=${LDSHARED-"cc -G"}
CFLAGS=${CFLAGS-"-fast -xcg89"} case `(uname -m || echo unknown) 2>/dev/null` in
LDSHARED=${LDSHARED-"cc -G"};; i86*)
SFLAGS=${CFLAGS-"-xpentium -fast -KPIC -R."}
CFLAGS=${CFLAGS-"-xpentium -fast"} ;;
*)
SFLAGS=${CFLAGS-"-fast -xcg92 -KPIC -R."}
CFLAGS=${CFLAGS-"-fast -xcg92"} ;;
esac ;;
SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"} SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
CFLAGS=${CFLAGS-"-O2"} CFLAGS=${CFLAGS-"-O2"}
LDSHARED=${LDSHARED-"ld"};; LDSHARED=${LDSHARED-"ld"} ;;
SunStudio\ 9*) SFLAGS=${CFLAGS-"-DUSE_MMAP -fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"} SunStudio\ 9*) SFLAGS=${CFLAGS-"-fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"}
CFLAGS=${CFLAGS-"-DUSE_MMAP -fast -xtarget=ultra3 -xarch=v9b"} CFLAGS=${CFLAGS-"-fast -xtarget=ultra3 -xarch=v9b"}
LDSHARED=${LDSHARED-"cc -xarch=v9b"};; LDSHARED=${LDSHARED-"cc -xarch=v9b"} ;;
UNIX_System_V\ 4.2.0) UNIX_System_V\ 4.2.0)
SFLAGS=${CFLAGS-"-KPIC -O"} SFLAGS=${CFLAGS-"-KPIC -O"}
CFLAGS=${CFLAGS-"-O"} CFLAGS=${CFLAGS-"-O"}
LDSHARED=${LDSHARED-"cc -G"};; LDSHARED=${LDSHARED-"cc -G"} ;;
UNIX_SV\ 4.2MP) UNIX_SV\ 4.2MP)
SFLAGS=${CFLAGS-"-Kconform_pic -O"} SFLAGS=${CFLAGS-"-Kconform_pic -O"}
CFLAGS=${CFLAGS-"-O"} CFLAGS=${CFLAGS-"-O"}
LDSHARED=${LDSHARED-"cc -G"};; LDSHARED=${LDSHARED-"cc -G"} ;;
OpenUNIX\ 5) OpenUNIX\ 5)
SFLAGS=${CFLAGS-"-KPIC -O"} SFLAGS=${CFLAGS-"-KPIC -O"}
CFLAGS=${CFLAGS-"-O"} CFLAGS=${CFLAGS-"-O"}
LDSHARED=${LDSHARED-"cc -G"};; LDSHARED=${LDSHARED-"cc -G"} ;;
AIX*) # Courtesy of dbakker@arrayasolutions.com AIX*) # Courtesy of dbakker@arrayasolutions.com
SFLAGS=${CFLAGS-"-O -qmaxmem=8192"} SFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
CFLAGS=${CFLAGS-"-O -qmaxmem=8192"} CFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
LDSHARED=${LDSHARED-"xlc -G"};; LDSHARED=${LDSHARED-"xlc -G"} ;;
# send working options for other systems to support@gzip.org # send working options for other systems to zlib@gzip.org
*) SFLAGS=${CFLAGS-"-O"} *) SFLAGS=${CFLAGS-"-O"}
CFLAGS=${CFLAGS-"-O"} CFLAGS=${CFLAGS-"-O"}
LDSHARED=${LDSHARED-"cc -shared"};; LDSHARED=${LDSHARED-"cc -shared"} ;;
esac esac
fi fi
@@ -171,38 +196,80 @@ SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"}
if test $shared -eq 1; then if test $shared -eq 1; then
echo Checking for shared library support... echo Checking for shared library support...
# we must test in two steps (cc then ld), required at least on SunOS 4.x # we must test in two steps (cc then ld), required at least on SunOS 4.x
if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" && if test "`($CC -w -c $SFLAGS $test.c) 2>&1`" = "" &&
test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then test "`($LDSHARED $SFLAGS -o $test$shared_ext $test.o) 2>&1`" = ""; then
CFLAGS="$SFLAGS"
LIBS="$SHAREDLIBV"
echo Building shared library $SHAREDLIBV with $CC. echo Building shared library $SHAREDLIBV with $CC.
elif test -z "$old_cc" -a -z "$old_cflags"; then elif test -z "$old_cc" -a -z "$old_cflags"; then
echo No shared library support. echo No shared library support.
shared=0; shared=0;
else else
echo Tested $CC -w -c $SFLAGS $test.c
$CC -w -c $SFLAGS $test.c
echo Tested $LDSHARED $SFLAGS -o $test$shared_ext $test.o
$LDSHARED $SFLAGS -o $test$shared_ext $test.o
echo 'No shared library support; try without defining CC and CFLAGS' echo 'No shared library support; try without defining CC and CFLAGS'
shared=0; shared=0;
fi fi
fi fi
if test $shared -eq 0; then if test $shared -eq 0; then
LDSHARED="$CC" LDSHARED="$CC"
echo Building static library $LIBS version $VER with $CC. ALL="static"
TEST="all teststatic"
echo Building static library $STATICLIB version $VER with $CC.
else else
LDFLAGS="-L. ${SHAREDLIBV}" ALL="static shared"
TEST="all teststatic testshared"
fi fi
cat > $test.c <<EOF
#include <sys/types.h>
off64_t dummy = 0;
EOF
if test "`($CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c) 2>&1`" = ""; then
CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1"
SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1"
ALL="${ALL} all64"
TEST="${TEST} test64"
echo "Checking for off64_t... Yes."
echo "Checking for fseeko... Yes."
else
echo "Checking for off64_t... No."
cat > $test.c <<EOF
#include <stdio.h>
int main(void) {
fseeko(NULL, 0, 0);
return 0;
}
EOF
if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then
echo "Checking for fseeko... Yes."
else
CFLAGS="${CFLAGS} -DNO_FSEEKO"
SFLAGS="${SFLAGS} -DNO_FSEEKO"
echo "Checking for fseeko... No."
fi
fi
cp -p zconf.in.h zconf.h
cat > $test.c <<EOF cat > $test.c <<EOF
#include <unistd.h> #include <unistd.h>
int main() { return 0; } int main() { return 0; }
EOF EOF
if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
sed < zconf.in.h "/HAVE_UNISTD_H/s%0%1%" > zconf.h sed < zconf.h "/#ifdef HAVE_UNISTD_H/s/def HAVE_UNISTD_H/ 1/" > zconf.temp.h
mv zconf.temp.h zconf.h
echo "Checking for unistd.h... Yes." echo "Checking for unistd.h... Yes."
else else
cp -p zconf.in.h zconf.h
echo "Checking for unistd.h... No." echo "Checking for unistd.h... No."
fi fi
if test $zprefix -eq 1; then
sed < zconf.h "/#ifdef Z_PREFIX/s/def Z_PREFIX/ 1/" > zconf.temp.h
mv zconf.temp.h zconf.h
echo "Using z_ prefix on all symbols."
fi
cat > $test.c <<EOF cat > $test.c <<EOF
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
@@ -219,13 +286,13 @@ int main()
EOF EOF
if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()" echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()."
cat > $test.c <<EOF cat > $test.c <<EOF
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
int mytest(char *fmt, ...) int mytest(const char *fmt, ...)
{ {
char buf[20]; char buf[20];
va_list ap; va_list ap;
@@ -271,6 +338,7 @@ EOF
echo "Checking for return value of vsnprintf()... Yes." echo "Checking for return value of vsnprintf()... Yes."
else else
CFLAGS="$CFLAGS -DHAS_vsnprintf_void" CFLAGS="$CFLAGS -DHAS_vsnprintf_void"
SFLAGS="$SFLAGS -DHAS_vsnprintf_void"
echo "Checking for return value of vsnprintf()... No." echo "Checking for return value of vsnprintf()... No."
echo " WARNING: apparently vsnprintf() does not return a value. zlib" echo " WARNING: apparently vsnprintf() does not return a value. zlib"
echo " can build but will be open to possible string-format security" echo " can build but will be open to possible string-format security"
@@ -278,6 +346,7 @@ EOF
fi fi
else else
CFLAGS="$CFLAGS -DNO_vsnprintf" CFLAGS="$CFLAGS -DNO_vsnprintf"
SFLAGS="$SFLAGS -DNO_vsnprintf"
echo "Checking for vsnprintf() in stdio.h... No." echo "Checking for vsnprintf() in stdio.h... No."
echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib" echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib"
echo " can build but will be open to possible buffer-overflow security" echo " can build but will be open to possible buffer-overflow security"
@@ -287,7 +356,7 @@ EOF
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
int mytest(char *fmt, ...) int mytest(const char *fmt, ...)
{ {
int n; int n;
char buf[20]; char buf[20];
@@ -309,6 +378,7 @@ EOF
echo "Checking for return value of vsprintf()... Yes." echo "Checking for return value of vsprintf()... Yes."
else else
CFLAGS="$CFLAGS -DHAS_vsprintf_void" CFLAGS="$CFLAGS -DHAS_vsprintf_void"
SFLAGS="$SFLAGS -DHAS_vsprintf_void"
echo "Checking for return value of vsprintf()... No." echo "Checking for return value of vsprintf()... No."
echo " WARNING: apparently vsprintf() does not return a value. zlib" echo " WARNING: apparently vsprintf() does not return a value. zlib"
echo " can build but will be open to possible string-format security" echo " can build but will be open to possible string-format security"
@@ -316,7 +386,7 @@ EOF
fi fi
fi fi
else else
echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()" echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()."
cat >$test.c <<EOF cat >$test.c <<EOF
#include <stdio.h> #include <stdio.h>
@@ -358,6 +428,7 @@ EOF
echo "Checking for return value of snprintf()... Yes." echo "Checking for return value of snprintf()... Yes."
else else
CFLAGS="$CFLAGS -DHAS_snprintf_void" CFLAGS="$CFLAGS -DHAS_snprintf_void"
SFLAGS="$SFLAGS -DHAS_snprintf_void"
echo "Checking for return value of snprintf()... No." echo "Checking for return value of snprintf()... No."
echo " WARNING: apparently snprintf() does not return a value. zlib" echo " WARNING: apparently snprintf() does not return a value. zlib"
echo " can build but will be open to possible string-format security" echo " can build but will be open to possible string-format security"
@@ -365,6 +436,7 @@ EOF
fi fi
else else
CFLAGS="$CFLAGS -DNO_snprintf" CFLAGS="$CFLAGS -DNO_snprintf"
SFLAGS="$SFLAGS -DNO_snprintf"
echo "Checking for snprintf() in stdio.h... No." echo "Checking for snprintf() in stdio.h... No."
echo " WARNING: snprintf() not found, falling back to sprintf(). zlib" echo " WARNING: snprintf() not found, falling back to sprintf(). zlib"
echo " can build but will be open to possible buffer-overflow security" echo " can build but will be open to possible buffer-overflow security"
@@ -390,6 +462,7 @@ EOF
echo "Checking for return value of sprintf()... Yes." echo "Checking for return value of sprintf()... Yes."
else else
CFLAGS="$CFLAGS -DHAS_sprintf_void" CFLAGS="$CFLAGS -DHAS_sprintf_void"
SFLAGS="$SFLAGS -DHAS_sprintf_void"
echo "Checking for return value of sprintf()... No." echo "Checking for return value of sprintf()... No."
echo " WARNING: apparently sprintf() does not return a value. zlib" echo " WARNING: apparently sprintf() does not return a value. zlib"
echo " can build but will be open to possible string-format security" echo " can build but will be open to possible string-format security"
@@ -407,21 +480,7 @@ if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
else else
echo "Checking for errno.h... No." echo "Checking for errno.h... No."
CFLAGS="$CFLAGS -DNO_ERRNO_H" CFLAGS="$CFLAGS -DNO_ERRNO_H"
fi SFLAGS="$SFLAGS -DNO_ERRNO_H"
cat > $test.c <<EOF
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
caddr_t hello() {
return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0);
}
EOF
if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
CFLAGS="$CFLAGS -DUSE_MMAP"
echo Checking for mmap support... Yes.
else
echo Checking for mmap support... No.
fi fi
CPP=${CPP-"$CC -E"} CPP=${CPP-"$CC -E"}
@@ -432,7 +491,7 @@ case $CFLAGS in
echo Checking for underline in external names... No. echo Checking for underline in external names... No.
else else
echo Checking for underline in external names... Yes. echo Checking for underline in external names... Yes.
fi;; fi ;;
esac esac
rm -f $test.[co] $test $test$shared_ext rm -f $test.[co] $test $test$shared_ext
@@ -441,13 +500,36 @@ rm -f $test.[co] $test $test$shared_ext
sed < Makefile.in " sed < Makefile.in "
/^CC *=/s#=.*#=$CC# /^CC *=/s#=.*#=$CC#
/^CFLAGS *=/s#=.*#=$CFLAGS# /^CFLAGS *=/s#=.*#=$CFLAGS#
/^CPP *=/s#=.*#=$CPP# /^SFLAGS *=/s#=.*#=$SFLAGS#
/^LDFLAGS *=/s#=.*#=$LDFLAGS#
/^LDSHARED *=/s#=.*#=$LDSHARED# /^LDSHARED *=/s#=.*#=$LDSHARED#
/^LIBS *=/s#=.*#=$LIBS# /^CPP *=/s#=.*#=$CPP#
/^STATICLIB *=/s#=.*#=$STATICLIB#
/^SHAREDLIB *=/s#=.*#=$SHAREDLIB# /^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV# /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM# /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
/^AR *=/s#=.*#=$AR# /^AR *=/s#=.*#=$AR_RC#
/^RANLIB *=/s#=.*#=$RANLIB#
/^EXE *=/s#=.*#=$EXE#
/^prefix *=/s#=.*#=$prefix#
/^exec_prefix *=/s#=.*#=$exec_prefix#
/^libdir *=/s#=.*#=$libdir#
/^includedir *=/s#=.*#=$includedir#
/^mandir *=/s#=.*#=$mandir#
/^all: */s#:.*#: $ALL#
/^test: */s#:.*#: $TEST#
" > Makefile
sed < zlib.pc.in "
/^CC *=/s#=.*#=$CC#
/^CFLAGS *=/s#=.*#=$CFLAGS#
/^CPP *=/s#=.*#=$CPP#
/^LDSHARED *=/s#=.*#=$LDSHARED#
/^STATICLIB *=/s#=.*#=$STATICLIB#
/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
/^AR *=/s#=.*#=$AR_RC#
/^RANLIB *=/s#=.*#=$RANLIB# /^RANLIB *=/s#=.*#=$RANLIB#
/^EXE *=/s#=.*#=$EXE# /^EXE *=/s#=.*#=$EXE#
/^prefix *=/s#=.*#=$prefix# /^prefix *=/s#=.*#=$prefix#
@@ -456,4 +538,6 @@ sed < Makefile.in "
/^includedir *=/s#=.*#=$includedir# /^includedir *=/s#=.*#=$includedir#
/^mandir *=/s#=.*#=$mandir# /^mandir *=/s#=.*#=$mandir#
/^LDFLAGS *=/s#=.*#=$LDFLAGS# /^LDFLAGS *=/s#=.*#=$LDFLAGS#
" > Makefile " | sed -e "
s/\@VERSION\@/$VER/g;
" > zlib.pc

View File

@@ -8,6 +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/
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
asm586/ asm586/
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
@@ -52,6 +56,7 @@ masmx86/ by Gilles Vollant <info@winimage.com>
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.

357
contrib/amd64/amd64-match.S Normal file
View File

@@ -0,0 +1,357 @@
/*
* match.S -- optimized version of longest_match()
* based on the similar work by Gilles Vollant, and Brian Raiter, written 1998
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the BSD License. Use by owners of Che Guevarra
* parafernalia is prohibited, where possible, and highly discouraged
* elsewhere.
*/
#ifndef NO_UNDERLINE
# define match_init _match_init
# define longest_match _longest_match
#endif
#define scanend ebx
#define scanendw bx
#define chainlenwmask edx /* high word: current chain len low word: s->wmask */
#define curmatch rsi
#define curmatchd esi
#define windowbestlen r8
#define scanalign r9
#define scanalignd r9d
#define window r10
#define bestlen r11
#define bestlend r11d
#define scanstart r12d
#define scanstartw r12w
#define scan r13
#define nicematch r14d
#define limit r15
#define limitd r15d
#define prev rcx
/*
* The 258 is a "magic number, not a parameter -- changing it
* breaks the hell loose
*/
#define MAX_MATCH (258)
#define MIN_MATCH (3)
#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1)
#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7)
/* stack frame offsets */
#define LocalVarsSize (112)
#define _chainlenwmask ( 8-LocalVarsSize)(%rsp)
#define _windowbestlen (16-LocalVarsSize)(%rsp)
#define save_r14 (24-LocalVarsSize)(%rsp)
#define save_rsi (32-LocalVarsSize)(%rsp)
#define save_rbx (40-LocalVarsSize)(%rsp)
#define save_r12 (56-LocalVarsSize)(%rsp)
#define save_r13 (64-LocalVarsSize)(%rsp)
#define save_r15 (80-LocalVarsSize)(%rsp)
/*
* On AMD64 the first argument of a function (in our case -- the pointer to
* deflate_state structure) is passed in %rdi, hence our offsets below are
* all off of that.
*/
#ifndef STRUCT_OFFSET
# define STRUCT_OFFSET (0)
#endif
#define dsWSize ( 56 + STRUCT_OFFSET)(%rdi)
#define dsWMask ( 64 + STRUCT_OFFSET)(%rdi)
#define dsWindow ( 72 + STRUCT_OFFSET)(%rdi)
#define dsPrev ( 88 + STRUCT_OFFSET)(%rdi)
#define dsMatchLen (136 + STRUCT_OFFSET)(%rdi)
#define dsPrevMatch (140 + STRUCT_OFFSET)(%rdi)
#define dsStrStart (148 + STRUCT_OFFSET)(%rdi)
#define dsMatchStart (152 + STRUCT_OFFSET)(%rdi)
#define dsLookahead (156 + STRUCT_OFFSET)(%rdi)
#define dsPrevLen (160 + STRUCT_OFFSET)(%rdi)
#define dsMaxChainLen (164 + STRUCT_OFFSET)(%rdi)
#define dsGoodMatch (180 + STRUCT_OFFSET)(%rdi)
#define dsNiceMatch (184 + STRUCT_OFFSET)(%rdi)
.globl match_init, longest_match
.text
/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */
longest_match:
/*
* Retrieve the function arguments. %curmatch will hold cur_match
* throughout the entire function (passed via rsi on amd64).
* rdi will hold the pointer to the deflate_state (first arg on amd64)
*/
mov %rsi, save_rsi
mov %rbx, save_rbx
mov %r12, save_r12
mov %r13, save_r13
mov %r14, save_r14
mov %r15, save_r15
/* uInt wmask = s->w_mask; */
/* unsigned chain_length = s->max_chain_length; */
/* if (s->prev_length >= s->good_match) { */
/* chain_length >>= 2; */
/* } */
movl dsPrevLen, %eax
movl dsGoodMatch, %ebx
cmpl %ebx, %eax
movl dsWMask, %eax
movl dsMaxChainLen, %chainlenwmask
jl LastMatchGood
shrl $2, %chainlenwmask
LastMatchGood:
/* chainlen is decremented once beforehand so that the function can */
/* use the sign flag instead of the zero flag for the exit test. */
/* It is then shifted into the high word, to make room for the wmask */
/* value, which it will always accompany. */
decl %chainlenwmask
shll $16, %chainlenwmask
orl %eax, %chainlenwmask
/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */
movl dsNiceMatch, %eax
movl dsLookahead, %ebx
cmpl %eax, %ebx
jl LookaheadLess
movl %eax, %ebx
LookaheadLess: movl %ebx, %nicematch
/* register Bytef *scan = s->window + s->strstart; */
mov dsWindow, %window
movl dsStrStart, %limitd
lea (%limit, %window), %scan
/* Determine how many bytes the scan ptr is off from being */
/* dword-aligned. */
mov %scan, %scanalign
negl %scanalignd
andl $3, %scanalignd
/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */
/* s->strstart - (IPos)MAX_DIST(s) : NIL; */
movl dsWSize, %eax
subl $MIN_LOOKAHEAD, %eax
xorl %ecx, %ecx
subl %eax, %limitd
cmovng %ecx, %limitd
/* int best_len = s->prev_length; */
movl dsPrevLen, %bestlend
/* Store the sum of s->window + best_len in %windowbestlen locally, and in memory. */
lea (%window, %bestlen), %windowbestlen
mov %windowbestlen, _windowbestlen
/* register ush scan_start = *(ushf*)scan; */
/* register ush scan_end = *(ushf*)(scan+best_len-1); */
/* Posf *prev = s->prev; */
movzwl (%scan), %scanstart
movzwl -1(%scan, %bestlen), %scanend
mov dsPrev, %prev
/* Jump into the main loop. */
movl %chainlenwmask, _chainlenwmask
jmp LoopEntry
.balign 16
/* do {
* match = s->window + cur_match;
* if (*(ushf*)(match+best_len-1) != scan_end ||
* *(ushf*)match != scan_start) continue;
* [...]
* } while ((cur_match = prev[cur_match & wmask]) > limit
* && --chain_length != 0);
*
* Here is the inner loop of the function. The function will spend the
* majority of its time in this loop, and majority of that time will
* be spent in the first ten instructions.
*/
LookupLoop:
andl %chainlenwmask, %curmatchd
movzwl (%prev, %curmatch, 2), %curmatchd
cmpl %limitd, %curmatchd
jbe LeaveNow
subl $0x00010000, %chainlenwmask
js LeaveNow
LoopEntry: cmpw -1(%windowbestlen, %curmatch), %scanendw
jne LookupLoop
cmpw %scanstartw, (%window, %curmatch)
jne LookupLoop
/* Store the current value of chainlen. */
movl %chainlenwmask, _chainlenwmask
/* %scan is the string under scrutiny, and %prev to the string we */
/* are hoping to match it up with. In actuality, %esi and %edi are */
/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */
/* initialized to -(MAX_MATCH_8 - scanalign). */
mov $(-MAX_MATCH_8), %rdx
lea (%curmatch, %window), %windowbestlen
lea MAX_MATCH_8(%windowbestlen, %scanalign), %windowbestlen
lea MAX_MATCH_8(%scan, %scanalign), %prev
/* the prefetching below makes very little difference... */
prefetcht1 (%windowbestlen, %rdx)
prefetcht1 (%prev, %rdx)
/*
* Test the strings for equality, 8 bytes at a time. At the end,
* adjust %rdx so that it is offset to the exact byte that mismatched.
*
* It should be confessed that this loop usually does not represent
* much of the total running time. Replacing it with a more
* straightforward "rep cmpsb" would not drastically degrade
* performance -- unrolling it, for example, makes no difference.
*/
#undef USE_SSE /* works, but is 6-7% slower, than non-SSE... */
LoopCmps:
#ifdef USE_SSE
/* Preload the SSE registers */
movdqu (%windowbestlen, %rdx), %xmm1
movdqu (%prev, %rdx), %xmm2
pcmpeqb %xmm2, %xmm1
movdqu 16(%windowbestlen, %rdx), %xmm3
movdqu 16(%prev, %rdx), %xmm4
pcmpeqb %xmm4, %xmm3
movdqu 32(%windowbestlen, %rdx), %xmm5
movdqu 32(%prev, %rdx), %xmm6
pcmpeqb %xmm6, %xmm5
movdqu 48(%windowbestlen, %rdx), %xmm7
movdqu 48(%prev, %rdx), %xmm8
pcmpeqb %xmm8, %xmm7
/* Check the comparisions' results */
pmovmskb %xmm1, %rax
notw %ax
bsfw %ax, %ax
jnz LeaveLoopCmps
add $16, %rdx
pmovmskb %xmm3, %rax
notw %ax
bsfw %ax, %ax
jnz LeaveLoopCmps
add $16, %rdx
pmovmskb %xmm5, %rax
notw %ax
bsfw %ax, %ax
jnz LeaveLoopCmps
add $16, %rdx
pmovmskb %xmm7, %rax
notw %ax
bsfw %ax, %ax
jnz LeaveLoopCmps
add $16, %rdx
jmp LoopCmps
LeaveLoopCmps: add %rax, %rdx
#else
mov (%windowbestlen, %rdx), %rax
xor (%prev, %rdx), %rax
jnz LeaveLoopCmps
add $8, %rdx
jnz LoopCmps
jmp LenMaximum
# if 0
/*
* This three-liner is tantalizingly simple, but bsf is a slow instruction,
* and the complicated alternative down below is quite a bit faster. Sad...
*/
LeaveLoopCmps: bsf %rax, %rax /* find the first non-zero bit */
shrl $3, %eax /* divide by 8 to get the byte */
add %rax, %rdx
# else
LeaveLoopCmps: testl $0xFFFFFFFF, %eax /* Check the first 4 bytes */
jnz Check16
add $4, %rdx
shr $32, %rax
Check16: testw $0xFFFF, %ax
jnz LenLower
add $2, %rdx
shrl $16, %eax
LenLower: subb $1, %al
adc $0, %rdx
# endif
#endif
/* Calculate the length of the match. If it is longer than MAX_MATCH, */
/* then automatically accept it as the best possible match and leave. */
lea (%prev, %rdx), %rax
sub %scan, %rax
cmpl $MAX_MATCH, %eax
jge LenMaximum
/* If the length of the match is not longer than the best match we */
/* have so far, then forget it and return to the lookup loop. */
cmpl %bestlend, %eax
jg LongerMatch
mov _windowbestlen, %windowbestlen
mov dsPrev, %prev
movl _chainlenwmask, %edx
jmp LookupLoop
/* s->match_start = cur_match; */
/* best_len = len; */
/* if (len >= nice_match) break; */
/* scan_end = *(ushf*)(scan+best_len-1); */
LongerMatch:
movl %eax, %bestlend
movl %curmatchd, dsMatchStart
cmpl %nicematch, %eax
jge LeaveNow
lea (%window, %bestlen), %windowbestlen
mov %windowbestlen, _windowbestlen
movzwl -1(%scan, %rax), %scanend
mov dsPrev, %prev
movl _chainlenwmask, %chainlenwmask
jmp LookupLoop
/* Accept the current string, with the maximum possible length. */
LenMaximum:
movl $MAX_MATCH, %bestlend
movl %curmatchd, dsMatchStart
/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */
/* return s->lookahead; */
LeaveNow:
movl dsLookahead, %eax
cmpl %eax, %bestlend
cmovngl %bestlend, %eax
LookaheadRet:
/* Restore the registers and return from whence we came. */
mov save_rsi, %rsi
mov save_rbx, %rbx
mov save_r12, %r12
mov save_r13, %r13
mov save_r14, %r14
mov save_r15, %r15
ret
match_init: ret

View File

@@ -1,364 +1,364 @@
/* match.s -- Pentium-optimized version of longest_match() /* match.s -- Pentium-optimized version of longest_match()
* Written for zlib 1.1.2 * Written for zlib 1.1.2
* Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com> * Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
* *
* This is free software; you can redistribute it and/or modify it * This is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License. * under the terms of the GNU General Public License.
*/ */
#ifndef NO_UNDERLINE #ifndef NO_UNDERLINE
#define match_init _match_init #define match_init _match_init
#define longest_match _longest_match #define longest_match _longest_match
#endif #endif
#define MAX_MATCH (258) #define MAX_MATCH (258)
#define MIN_MATCH (3) #define MIN_MATCH (3)
#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1) #define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1)
#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7) #define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7)
/* stack frame offsets */ /* stack frame offsets */
#define wmask 0 /* local copy of s->wmask */ #define wmask 0 /* local copy of s->wmask */
#define window 4 /* local copy of s->window */ #define window 4 /* local copy of s->window */
#define windowbestlen 8 /* s->window + bestlen */ #define windowbestlen 8 /* s->window + bestlen */
#define chainlenscanend 12 /* high word: current chain len */ #define chainlenscanend 12 /* high word: current chain len */
/* low word: last bytes sought */ /* low word: last bytes sought */
#define scanstart 16 /* first two bytes of string */ #define scanstart 16 /* first two bytes of string */
#define scanalign 20 /* dword-misalignment of string */ #define scanalign 20 /* dword-misalignment of string */
#define nicematch 24 /* a good enough match size */ #define nicematch 24 /* a good enough match size */
#define bestlen 28 /* size of best match so far */ #define bestlen 28 /* size of best match so far */
#define scan 32 /* ptr to string wanting match */ #define scan 32 /* ptr to string wanting match */
#define LocalVarsSize (36) #define LocalVarsSize (36)
/* saved ebx 36 */ /* saved ebx 36 */
/* saved edi 40 */ /* saved edi 40 */
/* saved esi 44 */ /* saved esi 44 */
/* saved ebp 48 */ /* saved ebp 48 */
/* return address 52 */ /* return address 52 */
#define deflatestate 56 /* the function arguments */ #define deflatestate 56 /* the function arguments */
#define curmatch 60 #define curmatch 60
/* Offsets for fields in the deflate_state structure. These numbers /* Offsets for fields in the deflate_state structure. These numbers
* are calculated from the definition of deflate_state, with the * are calculated from the definition of deflate_state, with the
* assumption that the compiler will dword-align the fields. (Thus, * assumption that the compiler will dword-align the fields. (Thus,
* changing the definition of deflate_state could easily cause this * changing the definition of deflate_state could easily cause this
* program to crash horribly, without so much as a warning at * program to crash horribly, without so much as a warning at
* compile time. Sigh.) * compile time. Sigh.)
*/ */
/* All the +zlib1222add offsets are due to the addition of fields /* All the +zlib1222add offsets are due to the addition of fields
* in zlib in the deflate_state structure since the asm code was first written * in zlib in the deflate_state structure since the asm code was first written
* (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)"). * (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)").
* (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). * (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
* if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). * if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
*/ */
#define zlib1222add (8) #define zlib1222add (8)
#define dsWSize (36+zlib1222add) #define dsWSize (36+zlib1222add)
#define dsWMask (44+zlib1222add) #define dsWMask (44+zlib1222add)
#define dsWindow (48+zlib1222add) #define dsWindow (48+zlib1222add)
#define dsPrev (56+zlib1222add) #define dsPrev (56+zlib1222add)
#define dsMatchLen (88+zlib1222add) #define dsMatchLen (88+zlib1222add)
#define dsPrevMatch (92+zlib1222add) #define dsPrevMatch (92+zlib1222add)
#define dsStrStart (100+zlib1222add) #define dsStrStart (100+zlib1222add)
#define dsMatchStart (104+zlib1222add) #define dsMatchStart (104+zlib1222add)
#define dsLookahead (108+zlib1222add) #define dsLookahead (108+zlib1222add)
#define dsPrevLen (112+zlib1222add) #define dsPrevLen (112+zlib1222add)
#define dsMaxChainLen (116+zlib1222add) #define dsMaxChainLen (116+zlib1222add)
#define dsGoodMatch (132+zlib1222add) #define dsGoodMatch (132+zlib1222add)
#define dsNiceMatch (136+zlib1222add) #define dsNiceMatch (136+zlib1222add)
.file "match.S" .file "match.S"
.globl match_init, longest_match .globl match_init, longest_match
.text .text
/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */ /* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */
longest_match: longest_match:
/* Save registers that the compiler may be using, and adjust %esp to */ /* Save registers that the compiler may be using, and adjust %esp to */
/* make room for our stack frame. */ /* make room for our stack frame. */
pushl %ebp pushl %ebp
pushl %edi pushl %edi
pushl %esi pushl %esi
pushl %ebx pushl %ebx
subl $LocalVarsSize, %esp subl $LocalVarsSize, %esp
/* Retrieve the function arguments. %ecx will hold cur_match */ /* Retrieve the function arguments. %ecx will hold cur_match */
/* throughout the entire function. %edx will hold the pointer to the */ /* throughout the entire function. %edx will hold the pointer to the */
/* deflate_state structure during the function's setup (before */ /* deflate_state structure during the function's setup (before */
/* entering the main loop). */ /* entering the main loop). */
movl deflatestate(%esp), %edx movl deflatestate(%esp), %edx
movl curmatch(%esp), %ecx movl curmatch(%esp), %ecx
/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */ /* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */
movl dsNiceMatch(%edx), %eax movl dsNiceMatch(%edx), %eax
movl dsLookahead(%edx), %ebx movl dsLookahead(%edx), %ebx
cmpl %eax, %ebx cmpl %eax, %ebx
jl LookaheadLess jl LookaheadLess
movl %eax, %ebx movl %eax, %ebx
LookaheadLess: movl %ebx, nicematch(%esp) LookaheadLess: movl %ebx, nicematch(%esp)
/* register Bytef *scan = s->window + s->strstart; */ /* register Bytef *scan = s->window + s->strstart; */
movl dsWindow(%edx), %esi movl dsWindow(%edx), %esi
movl %esi, window(%esp) movl %esi, window(%esp)
movl dsStrStart(%edx), %ebp movl dsStrStart(%edx), %ebp
lea (%esi,%ebp), %edi lea (%esi,%ebp), %edi
movl %edi, scan(%esp) movl %edi, scan(%esp)
/* Determine how many bytes the scan ptr is off from being */ /* Determine how many bytes the scan ptr is off from being */
/* dword-aligned. */ /* dword-aligned. */
movl %edi, %eax movl %edi, %eax
negl %eax negl %eax
andl $3, %eax andl $3, %eax
movl %eax, scanalign(%esp) movl %eax, scanalign(%esp)
/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */ /* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */
/* s->strstart - (IPos)MAX_DIST(s) : NIL; */ /* s->strstart - (IPos)MAX_DIST(s) : NIL; */
movl dsWSize(%edx), %eax movl dsWSize(%edx), %eax
subl $MIN_LOOKAHEAD, %eax subl $MIN_LOOKAHEAD, %eax
subl %eax, %ebp subl %eax, %ebp
jg LimitPositive jg LimitPositive
xorl %ebp, %ebp xorl %ebp, %ebp
LimitPositive: LimitPositive:
/* unsigned chain_length = s->max_chain_length; */ /* unsigned chain_length = s->max_chain_length; */
/* if (s->prev_length >= s->good_match) { */ /* if (s->prev_length >= s->good_match) { */
/* chain_length >>= 2; */ /* chain_length >>= 2; */
/* } */ /* } */
movl dsPrevLen(%edx), %eax movl dsPrevLen(%edx), %eax
movl dsGoodMatch(%edx), %ebx movl dsGoodMatch(%edx), %ebx
cmpl %ebx, %eax cmpl %ebx, %eax
movl dsMaxChainLen(%edx), %ebx movl dsMaxChainLen(%edx), %ebx
jl LastMatchGood jl LastMatchGood
shrl $2, %ebx shrl $2, %ebx
LastMatchGood: LastMatchGood:
/* chainlen is decremented once beforehand so that the function can */ /* chainlen is decremented once beforehand so that the function can */
/* use the sign flag instead of the zero flag for the exit test. */ /* use the sign flag instead of the zero flag for the exit test. */
/* It is then shifted into the high word, to make room for the scanend */ /* It is then shifted into the high word, to make room for the scanend */
/* scanend value, which it will always accompany. */ /* scanend value, which it will always accompany. */
decl %ebx decl %ebx
shll $16, %ebx shll $16, %ebx
/* int best_len = s->prev_length; */ /* int best_len = s->prev_length; */
movl dsPrevLen(%edx), %eax movl dsPrevLen(%edx), %eax
movl %eax, bestlen(%esp) movl %eax, bestlen(%esp)
/* Store the sum of s->window + best_len in %esi locally, and in %esi. */ /* Store the sum of s->window + best_len in %esi locally, and in %esi. */
addl %eax, %esi addl %eax, %esi
movl %esi, windowbestlen(%esp) movl %esi, windowbestlen(%esp)
/* register ush scan_start = *(ushf*)scan; */ /* register ush scan_start = *(ushf*)scan; */
/* register ush scan_end = *(ushf*)(scan+best_len-1); */ /* register ush scan_end = *(ushf*)(scan+best_len-1); */
movw (%edi), %bx movw (%edi), %bx
movw %bx, scanstart(%esp) movw %bx, scanstart(%esp)
movw -1(%edi,%eax), %bx movw -1(%edi,%eax), %bx
movl %ebx, chainlenscanend(%esp) movl %ebx, chainlenscanend(%esp)
/* Posf *prev = s->prev; */ /* Posf *prev = s->prev; */
/* uInt wmask = s->w_mask; */ /* uInt wmask = s->w_mask; */
movl dsPrev(%edx), %edi movl dsPrev(%edx), %edi
movl dsWMask(%edx), %edx movl dsWMask(%edx), %edx
mov %edx, wmask(%esp) mov %edx, wmask(%esp)
/* Jump into the main loop. */ /* Jump into the main loop. */
jmp LoopEntry jmp LoopEntry
.balign 16 .balign 16
/* do { /* do {
* match = s->window + cur_match; * match = s->window + cur_match;
* if (*(ushf*)(match+best_len-1) != scan_end || * if (*(ushf*)(match+best_len-1) != scan_end ||
* *(ushf*)match != scan_start) continue; * *(ushf*)match != scan_start) continue;
* [...] * [...]
* } while ((cur_match = prev[cur_match & wmask]) > limit * } while ((cur_match = prev[cur_match & wmask]) > limit
* && --chain_length != 0); * && --chain_length != 0);
* *
* Here is the inner loop of the function. The function will spend the * Here is the inner loop of the function. The function will spend the
* majority of its time in this loop, and majority of that time will * majority of its time in this loop, and majority of that time will
* be spent in the first ten instructions. * be spent in the first ten instructions.
* *
* Within this loop: * Within this loop:
* %ebx = chainlenscanend - i.e., ((chainlen << 16) | scanend) * %ebx = chainlenscanend - i.e., ((chainlen << 16) | scanend)
* %ecx = curmatch * %ecx = curmatch
* %edx = curmatch & wmask * %edx = curmatch & wmask
* %esi = windowbestlen - i.e., (window + bestlen) * %esi = windowbestlen - i.e., (window + bestlen)
* %edi = prev * %edi = prev
* %ebp = limit * %ebp = limit
* *
* Two optimization notes on the choice of instructions: * Two optimization notes on the choice of instructions:
* *
* The first instruction uses a 16-bit address, which costs an extra, * The first instruction uses a 16-bit address, which costs an extra,
* unpairable cycle. This is cheaper than doing a 32-bit access and * unpairable cycle. This is cheaper than doing a 32-bit access and
* zeroing the high word, due to the 3-cycle misalignment penalty which * zeroing the high word, due to the 3-cycle misalignment penalty which
* would occur half the time. This also turns out to be cheaper than * would occur half the time. This also turns out to be cheaper than
* doing two separate 8-bit accesses, as the memory is so rarely in the * doing two separate 8-bit accesses, as the memory is so rarely in the
* L1 cache. * L1 cache.
* *
* The window buffer, however, apparently spends a lot of time in the * The window buffer, however, apparently spends a lot of time in the
* cache, and so it is faster to retrieve the word at the end of the * cache, and so it is faster to retrieve the word at the end of the
* match string with two 8-bit loads. The instructions that test the * match string with two 8-bit loads. The instructions that test the
* word at the beginning of the match string, however, are executed * word at the beginning of the match string, however, are executed
* much less frequently, and there it was cheaper to use 16-bit * much less frequently, and there it was cheaper to use 16-bit
* instructions, which avoided the necessity of saving off and * instructions, which avoided the necessity of saving off and
* subsequently reloading one of the other registers. * subsequently reloading one of the other registers.
*/ */
LookupLoop: LookupLoop:
/* 1 U & V */ /* 1 U & V */
movw (%edi,%edx,2), %cx /* 2 U pipe */ movw (%edi,%edx,2), %cx /* 2 U pipe */
movl wmask(%esp), %edx /* 2 V pipe */ movl wmask(%esp), %edx /* 2 V pipe */
cmpl %ebp, %ecx /* 3 U pipe */ cmpl %ebp, %ecx /* 3 U pipe */
jbe LeaveNow /* 3 V pipe */ jbe LeaveNow /* 3 V pipe */
subl $0x00010000, %ebx /* 4 U pipe */ subl $0x00010000, %ebx /* 4 U pipe */
js LeaveNow /* 4 V pipe */ js LeaveNow /* 4 V pipe */
LoopEntry: movb -1(%esi,%ecx), %al /* 5 U pipe */ LoopEntry: movb -1(%esi,%ecx), %al /* 5 U pipe */
andl %ecx, %edx /* 5 V pipe */ andl %ecx, %edx /* 5 V pipe */
cmpb %bl, %al /* 6 U pipe */ cmpb %bl, %al /* 6 U pipe */
jnz LookupLoop /* 6 V pipe */ jnz LookupLoop /* 6 V pipe */
movb (%esi,%ecx), %ah movb (%esi,%ecx), %ah
cmpb %bh, %ah cmpb %bh, %ah
jnz LookupLoop jnz LookupLoop
movl window(%esp), %eax movl window(%esp), %eax
movw (%eax,%ecx), %ax movw (%eax,%ecx), %ax
cmpw scanstart(%esp), %ax cmpw scanstart(%esp), %ax
jnz LookupLoop jnz LookupLoop
/* Store the current value of chainlen. */ /* Store the current value of chainlen. */
movl %ebx, chainlenscanend(%esp) movl %ebx, chainlenscanend(%esp)
/* Point %edi to the string under scrutiny, and %esi to the string we */ /* Point %edi to the string under scrutiny, and %esi to the string we */
/* are hoping to match it up with. In actuality, %esi and %edi are */ /* are hoping to match it up with. In actuality, %esi and %edi are */
/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */ /* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */
/* initialized to -(MAX_MATCH_8 - scanalign). */ /* initialized to -(MAX_MATCH_8 - scanalign). */
movl window(%esp), %esi movl window(%esp), %esi
movl scan(%esp), %edi movl scan(%esp), %edi
addl %ecx, %esi addl %ecx, %esi
movl scanalign(%esp), %eax movl scanalign(%esp), %eax
movl $(-MAX_MATCH_8), %edx movl $(-MAX_MATCH_8), %edx
lea MAX_MATCH_8(%edi,%eax), %edi lea MAX_MATCH_8(%edi,%eax), %edi
lea MAX_MATCH_8(%esi,%eax), %esi lea MAX_MATCH_8(%esi,%eax), %esi
/* Test the strings for equality, 8 bytes at a time. At the end, /* Test the strings for equality, 8 bytes at a time. At the end,
* adjust %edx so that it is offset to the exact byte that mismatched. * adjust %edx so that it is offset to the exact byte that mismatched.
* *
* We already know at this point that the first three bytes of the * We already know at this point that the first three bytes of the
* strings match each other, and they can be safely passed over before * strings match each other, and they can be safely passed over before
* starting the compare loop. So what this code does is skip over 0-3 * starting the compare loop. So what this code does is skip over 0-3
* bytes, as much as necessary in order to dword-align the %edi * bytes, as much as necessary in order to dword-align the %edi
* pointer. (%esi will still be misaligned three times out of four.) * pointer. (%esi will still be misaligned three times out of four.)
* *
* It should be confessed that this loop usually does not represent * It should be confessed that this loop usually does not represent
* much of the total running time. Replacing it with a more * much of the total running time. Replacing it with a more
* straightforward "rep cmpsb" would not drastically degrade * straightforward "rep cmpsb" would not drastically degrade
* performance. * performance.
*/ */
LoopCmps: LoopCmps:
movl (%esi,%edx), %eax movl (%esi,%edx), %eax
movl (%edi,%edx), %ebx movl (%edi,%edx), %ebx
xorl %ebx, %eax xorl %ebx, %eax
jnz LeaveLoopCmps jnz LeaveLoopCmps
movl 4(%esi,%edx), %eax movl 4(%esi,%edx), %eax
movl 4(%edi,%edx), %ebx movl 4(%edi,%edx), %ebx
xorl %ebx, %eax xorl %ebx, %eax
jnz LeaveLoopCmps4 jnz LeaveLoopCmps4
addl $8, %edx addl $8, %edx
jnz LoopCmps jnz LoopCmps
jmp LenMaximum jmp LenMaximum
LeaveLoopCmps4: addl $4, %edx LeaveLoopCmps4: addl $4, %edx
LeaveLoopCmps: testl $0x0000FFFF, %eax LeaveLoopCmps: testl $0x0000FFFF, %eax
jnz LenLower jnz LenLower
addl $2, %edx addl $2, %edx
shrl $16, %eax shrl $16, %eax
LenLower: subb $1, %al LenLower: subb $1, %al
adcl $0, %edx adcl $0, %edx
/* Calculate the length of the match. If it is longer than MAX_MATCH, */ /* Calculate the length of the match. If it is longer than MAX_MATCH, */
/* then automatically accept it as the best possible match and leave. */ /* then automatically accept it as the best possible match and leave. */
lea (%edi,%edx), %eax lea (%edi,%edx), %eax
movl scan(%esp), %edi movl scan(%esp), %edi
subl %edi, %eax subl %edi, %eax
cmpl $MAX_MATCH, %eax cmpl $MAX_MATCH, %eax
jge LenMaximum jge LenMaximum
/* If the length of the match is not longer than the best match we */ /* If the length of the match is not longer than the best match we */
/* have so far, then forget it and return to the lookup loop. */ /* have so far, then forget it and return to the lookup loop. */
movl deflatestate(%esp), %edx movl deflatestate(%esp), %edx
movl bestlen(%esp), %ebx movl bestlen(%esp), %ebx
cmpl %ebx, %eax cmpl %ebx, %eax
jg LongerMatch jg LongerMatch
movl chainlenscanend(%esp), %ebx movl chainlenscanend(%esp), %ebx
movl windowbestlen(%esp), %esi movl windowbestlen(%esp), %esi
movl dsPrev(%edx), %edi movl dsPrev(%edx), %edi
movl wmask(%esp), %edx movl wmask(%esp), %edx
andl %ecx, %edx andl %ecx, %edx
jmp LookupLoop jmp LookupLoop
/* s->match_start = cur_match; */ /* s->match_start = cur_match; */
/* best_len = len; */ /* best_len = len; */
/* if (len >= nice_match) break; */ /* if (len >= nice_match) break; */
/* scan_end = *(ushf*)(scan+best_len-1); */ /* scan_end = *(ushf*)(scan+best_len-1); */
LongerMatch: movl nicematch(%esp), %ebx LongerMatch: movl nicematch(%esp), %ebx
movl %eax, bestlen(%esp) movl %eax, bestlen(%esp)
movl %ecx, dsMatchStart(%edx) movl %ecx, dsMatchStart(%edx)
cmpl %ebx, %eax cmpl %ebx, %eax
jge LeaveNow jge LeaveNow
movl window(%esp), %esi movl window(%esp), %esi
addl %eax, %esi addl %eax, %esi
movl %esi, windowbestlen(%esp) movl %esi, windowbestlen(%esp)
movl chainlenscanend(%esp), %ebx movl chainlenscanend(%esp), %ebx
movw -1(%edi,%eax), %bx movw -1(%edi,%eax), %bx
movl dsPrev(%edx), %edi movl dsPrev(%edx), %edi
movl %ebx, chainlenscanend(%esp) movl %ebx, chainlenscanend(%esp)
movl wmask(%esp), %edx movl wmask(%esp), %edx
andl %ecx, %edx andl %ecx, %edx
jmp LookupLoop jmp LookupLoop
/* Accept the current string, with the maximum possible length. */ /* Accept the current string, with the maximum possible length. */
LenMaximum: movl deflatestate(%esp), %edx LenMaximum: movl deflatestate(%esp), %edx
movl $MAX_MATCH, bestlen(%esp) movl $MAX_MATCH, bestlen(%esp)
movl %ecx, dsMatchStart(%edx) movl %ecx, dsMatchStart(%edx)
/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */ /* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */
/* return s->lookahead; */ /* return s->lookahead; */
LeaveNow: LeaveNow:
movl deflatestate(%esp), %edx movl deflatestate(%esp), %edx
movl bestlen(%esp), %ebx movl bestlen(%esp), %ebx
movl dsLookahead(%edx), %eax movl dsLookahead(%edx), %eax
cmpl %eax, %ebx cmpl %eax, %ebx
jg LookaheadRet jg LookaheadRet
movl %ebx, %eax movl %ebx, %eax
LookaheadRet: LookaheadRet:
/* Restore the stack and return from whence we came. */ /* Restore the stack and return from whence we came. */
addl $LocalVarsSize, %esp addl $LocalVarsSize, %esp
popl %ebx popl %ebx
popl %esi popl %esi
popl %edi popl %edi
popl %ebp popl %ebp
match_init: ret match_init: ret

View File

@@ -1,329 +1,329 @@
/* match.s -- Pentium-Pro-optimized version of longest_match() /* match.s -- Pentium-Pro-optimized version of longest_match()
* Written for zlib 1.1.2 * Written for zlib 1.1.2
* Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com> * Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
* *
* This is free software; you can redistribute it and/or modify it * This is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License. * under the terms of the GNU General Public License.
*/ */
#ifndef NO_UNDERLINE #ifndef NO_UNDERLINE
#define match_init _match_init #define match_init _match_init
#define longest_match _longest_match #define longest_match _longest_match
#endif #endif
#define MAX_MATCH (258) #define MAX_MATCH (258)
#define MIN_MATCH (3) #define MIN_MATCH (3)
#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1) #define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1)
#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7) #define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7)
/* stack frame offsets */ /* stack frame offsets */
#define chainlenwmask 0 /* high word: current chain len */ #define chainlenwmask 0 /* high word: current chain len */
/* low word: s->wmask */ /* low word: s->wmask */
#define window 4 /* local copy of s->window */ #define window 4 /* local copy of s->window */
#define windowbestlen 8 /* s->window + bestlen */ #define windowbestlen 8 /* s->window + bestlen */
#define scanstart 16 /* first two bytes of string */ #define scanstart 16 /* first two bytes of string */
#define scanend 12 /* last two bytes of string */ #define scanend 12 /* last two bytes of string */
#define scanalign 20 /* dword-misalignment of string */ #define scanalign 20 /* dword-misalignment of string */
#define nicematch 24 /* a good enough match size */ #define nicematch 24 /* a good enough match size */
#define bestlen 28 /* size of best match so far */ #define bestlen 28 /* size of best match so far */
#define scan 32 /* ptr to string wanting match */ #define scan 32 /* ptr to string wanting match */
#define LocalVarsSize (36) #define LocalVarsSize (36)
/* saved ebx 36 */ /* saved ebx 36 */
/* saved edi 40 */ /* saved edi 40 */
/* saved esi 44 */ /* saved esi 44 */
/* saved ebp 48 */ /* saved ebp 48 */
/* return address 52 */ /* return address 52 */
#define deflatestate 56 /* the function arguments */ #define deflatestate 56 /* the function arguments */
#define curmatch 60 #define curmatch 60
/* All the +zlib1222add offsets are due to the addition of fields /* All the +zlib1222add offsets are due to the addition of fields
* in zlib in the deflate_state structure since the asm code was first written * in zlib in the deflate_state structure since the asm code was first written
* (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)"). * (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)").
* (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). * (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
* if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). * if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
*/ */
#define zlib1222add (8) #define zlib1222add (8)
#define dsWSize (36+zlib1222add) #define dsWSize (36+zlib1222add)
#define dsWMask (44+zlib1222add) #define dsWMask (44+zlib1222add)
#define dsWindow (48+zlib1222add) #define dsWindow (48+zlib1222add)
#define dsPrev (56+zlib1222add) #define dsPrev (56+zlib1222add)
#define dsMatchLen (88+zlib1222add) #define dsMatchLen (88+zlib1222add)
#define dsPrevMatch (92+zlib1222add) #define dsPrevMatch (92+zlib1222add)
#define dsStrStart (100+zlib1222add) #define dsStrStart (100+zlib1222add)
#define dsMatchStart (104+zlib1222add) #define dsMatchStart (104+zlib1222add)
#define dsLookahead (108+zlib1222add) #define dsLookahead (108+zlib1222add)
#define dsPrevLen (112+zlib1222add) #define dsPrevLen (112+zlib1222add)
#define dsMaxChainLen (116+zlib1222add) #define dsMaxChainLen (116+zlib1222add)
#define dsGoodMatch (132+zlib1222add) #define dsGoodMatch (132+zlib1222add)
#define dsNiceMatch (136+zlib1222add) #define dsNiceMatch (136+zlib1222add)
.file "match.S" .file "match.S"
.globl match_init, longest_match .globl match_init, longest_match
.text .text
/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */ /* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */
longest_match: longest_match:
/* Save registers that the compiler may be using, and adjust %esp to */ /* Save registers that the compiler may be using, and adjust %esp to */
/* make room for our stack frame. */ /* make room for our stack frame. */
pushl %ebp pushl %ebp
pushl %edi pushl %edi
pushl %esi pushl %esi
pushl %ebx pushl %ebx
subl $LocalVarsSize, %esp subl $LocalVarsSize, %esp
/* Retrieve the function arguments. %ecx will hold cur_match */ /* Retrieve the function arguments. %ecx will hold cur_match */
/* throughout the entire function. %edx will hold the pointer to the */ /* throughout the entire function. %edx will hold the pointer to the */
/* deflate_state structure during the function's setup (before */ /* deflate_state structure during the function's setup (before */
/* entering the main loop). */ /* entering the main loop). */
movl deflatestate(%esp), %edx movl deflatestate(%esp), %edx
movl curmatch(%esp), %ecx movl curmatch(%esp), %ecx
/* uInt wmask = s->w_mask; */ /* uInt wmask = s->w_mask; */
/* unsigned chain_length = s->max_chain_length; */ /* unsigned chain_length = s->max_chain_length; */
/* if (s->prev_length >= s->good_match) { */ /* if (s->prev_length >= s->good_match) { */
/* chain_length >>= 2; */ /* chain_length >>= 2; */
/* } */ /* } */
movl dsPrevLen(%edx), %eax movl dsPrevLen(%edx), %eax
movl dsGoodMatch(%edx), %ebx movl dsGoodMatch(%edx), %ebx
cmpl %ebx, %eax cmpl %ebx, %eax
movl dsWMask(%edx), %eax movl dsWMask(%edx), %eax
movl dsMaxChainLen(%edx), %ebx movl dsMaxChainLen(%edx), %ebx
jl LastMatchGood jl LastMatchGood
shrl $2, %ebx shrl $2, %ebx
LastMatchGood: LastMatchGood:
/* chainlen is decremented once beforehand so that the function can */ /* chainlen is decremented once beforehand so that the function can */
/* use the sign flag instead of the zero flag for the exit test. */ /* use the sign flag instead of the zero flag for the exit test. */
/* It is then shifted into the high word, to make room for the wmask */ /* It is then shifted into the high word, to make room for the wmask */
/* value, which it will always accompany. */ /* value, which it will always accompany. */
decl %ebx decl %ebx
shll $16, %ebx shll $16, %ebx
orl %eax, %ebx orl %eax, %ebx
movl %ebx, chainlenwmask(%esp) movl %ebx, chainlenwmask(%esp)
/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */ /* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */
movl dsNiceMatch(%edx), %eax movl dsNiceMatch(%edx), %eax
movl dsLookahead(%edx), %ebx movl dsLookahead(%edx), %ebx
cmpl %eax, %ebx cmpl %eax, %ebx
jl LookaheadLess jl LookaheadLess
movl %eax, %ebx movl %eax, %ebx
LookaheadLess: movl %ebx, nicematch(%esp) LookaheadLess: movl %ebx, nicematch(%esp)
/* register Bytef *scan = s->window + s->strstart; */ /* register Bytef *scan = s->window + s->strstart; */
movl dsWindow(%edx), %esi movl dsWindow(%edx), %esi
movl %esi, window(%esp) movl %esi, window(%esp)
movl dsStrStart(%edx), %ebp movl dsStrStart(%edx), %ebp
lea (%esi,%ebp), %edi lea (%esi,%ebp), %edi
movl %edi, scan(%esp) movl %edi, scan(%esp)
/* Determine how many bytes the scan ptr is off from being */ /* Determine how many bytes the scan ptr is off from being */
/* dword-aligned. */ /* dword-aligned. */
movl %edi, %eax movl %edi, %eax
negl %eax negl %eax
andl $3, %eax andl $3, %eax
movl %eax, scanalign(%esp) movl %eax, scanalign(%esp)
/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */ /* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */
/* s->strstart - (IPos)MAX_DIST(s) : NIL; */ /* s->strstart - (IPos)MAX_DIST(s) : NIL; */
movl dsWSize(%edx), %eax movl dsWSize(%edx), %eax
subl $MIN_LOOKAHEAD, %eax subl $MIN_LOOKAHEAD, %eax
subl %eax, %ebp subl %eax, %ebp
jg LimitPositive jg LimitPositive
xorl %ebp, %ebp xorl %ebp, %ebp
LimitPositive: LimitPositive:
/* int best_len = s->prev_length; */ /* int best_len = s->prev_length; */
movl dsPrevLen(%edx), %eax movl dsPrevLen(%edx), %eax
movl %eax, bestlen(%esp) movl %eax, bestlen(%esp)
/* Store the sum of s->window + best_len in %esi locally, and in %esi. */ /* Store the sum of s->window + best_len in %esi locally, and in %esi. */
addl %eax, %esi addl %eax, %esi
movl %esi, windowbestlen(%esp) movl %esi, windowbestlen(%esp)
/* register ush scan_start = *(ushf*)scan; */ /* register ush scan_start = *(ushf*)scan; */
/* register ush scan_end = *(ushf*)(scan+best_len-1); */ /* register ush scan_end = *(ushf*)(scan+best_len-1); */
/* Posf *prev = s->prev; */ /* Posf *prev = s->prev; */
movzwl (%edi), %ebx movzwl (%edi), %ebx
movl %ebx, scanstart(%esp) movl %ebx, scanstart(%esp)
movzwl -1(%edi,%eax), %ebx movzwl -1(%edi,%eax), %ebx
movl %ebx, scanend(%esp) movl %ebx, scanend(%esp)
movl dsPrev(%edx), %edi movl dsPrev(%edx), %edi
/* Jump into the main loop. */ /* Jump into the main loop. */
movl chainlenwmask(%esp), %edx movl chainlenwmask(%esp), %edx
jmp LoopEntry jmp LoopEntry
.balign 16 .balign 16
/* do { /* do {
* match = s->window + cur_match; * match = s->window + cur_match;
* if (*(ushf*)(match+best_len-1) != scan_end || * if (*(ushf*)(match+best_len-1) != scan_end ||
* *(ushf*)match != scan_start) continue; * *(ushf*)match != scan_start) continue;
* [...] * [...]
* } while ((cur_match = prev[cur_match & wmask]) > limit * } while ((cur_match = prev[cur_match & wmask]) > limit
* && --chain_length != 0); * && --chain_length != 0);
* *
* Here is the inner loop of the function. The function will spend the * Here is the inner loop of the function. The function will spend the
* majority of its time in this loop, and majority of that time will * majority of its time in this loop, and majority of that time will
* be spent in the first ten instructions. * be spent in the first ten instructions.
* *
* Within this loop: * Within this loop:
* %ebx = scanend * %ebx = scanend
* %ecx = curmatch * %ecx = curmatch
* %edx = chainlenwmask - i.e., ((chainlen << 16) | wmask) * %edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
* %esi = windowbestlen - i.e., (window + bestlen) * %esi = windowbestlen - i.e., (window + bestlen)
* %edi = prev * %edi = prev
* %ebp = limit * %ebp = limit
*/ */
LookupLoop: LookupLoop:
andl %edx, %ecx andl %edx, %ecx
movzwl (%edi,%ecx,2), %ecx movzwl (%edi,%ecx,2), %ecx
cmpl %ebp, %ecx cmpl %ebp, %ecx
jbe LeaveNow jbe LeaveNow
subl $0x00010000, %edx subl $0x00010000, %edx
js LeaveNow js LeaveNow
LoopEntry: movzwl -1(%esi,%ecx), %eax LoopEntry: movzwl -1(%esi,%ecx), %eax
cmpl %ebx, %eax cmpl %ebx, %eax
jnz LookupLoop jnz LookupLoop
movl window(%esp), %eax movl window(%esp), %eax
movzwl (%eax,%ecx), %eax movzwl (%eax,%ecx), %eax
cmpl scanstart(%esp), %eax cmpl scanstart(%esp), %eax
jnz LookupLoop jnz LookupLoop
/* Store the current value of chainlen. */ /* Store the current value of chainlen. */
movl %edx, chainlenwmask(%esp) movl %edx, chainlenwmask(%esp)
/* Point %edi to the string under scrutiny, and %esi to the string we */ /* Point %edi to the string under scrutiny, and %esi to the string we */
/* are hoping to match it up with. In actuality, %esi and %edi are */ /* are hoping to match it up with. In actuality, %esi and %edi are */
/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */ /* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */
/* initialized to -(MAX_MATCH_8 - scanalign). */ /* initialized to -(MAX_MATCH_8 - scanalign). */
movl window(%esp), %esi movl window(%esp), %esi
movl scan(%esp), %edi movl scan(%esp), %edi
addl %ecx, %esi addl %ecx, %esi
movl scanalign(%esp), %eax movl scanalign(%esp), %eax
movl $(-MAX_MATCH_8), %edx movl $(-MAX_MATCH_8), %edx
lea MAX_MATCH_8(%edi,%eax), %edi lea MAX_MATCH_8(%edi,%eax), %edi
lea MAX_MATCH_8(%esi,%eax), %esi lea MAX_MATCH_8(%esi,%eax), %esi
/* Test the strings for equality, 8 bytes at a time. At the end, /* Test the strings for equality, 8 bytes at a time. At the end,
* adjust %edx so that it is offset to the exact byte that mismatched. * adjust %edx so that it is offset to the exact byte that mismatched.
* *
* We already know at this point that the first three bytes of the * We already know at this point that the first three bytes of the
* strings match each other, and they can be safely passed over before * strings match each other, and they can be safely passed over before
* starting the compare loop. So what this code does is skip over 0-3 * starting the compare loop. So what this code does is skip over 0-3
* bytes, as much as necessary in order to dword-align the %edi * bytes, as much as necessary in order to dword-align the %edi
* pointer. (%esi will still be misaligned three times out of four.) * pointer. (%esi will still be misaligned three times out of four.)
* *
* It should be confessed that this loop usually does not represent * It should be confessed that this loop usually does not represent
* much of the total running time. Replacing it with a more * much of the total running time. Replacing it with a more
* straightforward "rep cmpsb" would not drastically degrade * straightforward "rep cmpsb" would not drastically degrade
* performance. * performance.
*/ */
LoopCmps: LoopCmps:
movl (%esi,%edx), %eax movl (%esi,%edx), %eax
xorl (%edi,%edx), %eax xorl (%edi,%edx), %eax
jnz LeaveLoopCmps jnz LeaveLoopCmps
movl 4(%esi,%edx), %eax movl 4(%esi,%edx), %eax
xorl 4(%edi,%edx), %eax xorl 4(%edi,%edx), %eax
jnz LeaveLoopCmps4 jnz LeaveLoopCmps4
addl $8, %edx addl $8, %edx
jnz LoopCmps jnz LoopCmps
jmp LenMaximum jmp LenMaximum
LeaveLoopCmps4: addl $4, %edx LeaveLoopCmps4: addl $4, %edx
LeaveLoopCmps: testl $0x0000FFFF, %eax LeaveLoopCmps: testl $0x0000FFFF, %eax
jnz LenLower jnz LenLower
addl $2, %edx addl $2, %edx
shrl $16, %eax shrl $16, %eax
LenLower: subb $1, %al LenLower: subb $1, %al
adcl $0, %edx adcl $0, %edx
/* Calculate the length of the match. If it is longer than MAX_MATCH, */ /* Calculate the length of the match. If it is longer than MAX_MATCH, */
/* then automatically accept it as the best possible match and leave. */ /* then automatically accept it as the best possible match and leave. */
lea (%edi,%edx), %eax lea (%edi,%edx), %eax
movl scan(%esp), %edi movl scan(%esp), %edi
subl %edi, %eax subl %edi, %eax
cmpl $MAX_MATCH, %eax cmpl $MAX_MATCH, %eax
jge LenMaximum jge LenMaximum
/* If the length of the match is not longer than the best match we */ /* If the length of the match is not longer than the best match we */
/* have so far, then forget it and return to the lookup loop. */ /* have so far, then forget it and return to the lookup loop. */
movl deflatestate(%esp), %edx movl deflatestate(%esp), %edx
movl bestlen(%esp), %ebx movl bestlen(%esp), %ebx
cmpl %ebx, %eax cmpl %ebx, %eax
jg LongerMatch jg LongerMatch
movl windowbestlen(%esp), %esi movl windowbestlen(%esp), %esi
movl dsPrev(%edx), %edi movl dsPrev(%edx), %edi
movl scanend(%esp), %ebx movl scanend(%esp), %ebx
movl chainlenwmask(%esp), %edx movl chainlenwmask(%esp), %edx
jmp LookupLoop jmp LookupLoop
/* s->match_start = cur_match; */ /* s->match_start = cur_match; */
/* best_len = len; */ /* best_len = len; */
/* if (len >= nice_match) break; */ /* if (len >= nice_match) break; */
/* scan_end = *(ushf*)(scan+best_len-1); */ /* scan_end = *(ushf*)(scan+best_len-1); */
LongerMatch: movl nicematch(%esp), %ebx LongerMatch: movl nicematch(%esp), %ebx
movl %eax, bestlen(%esp) movl %eax, bestlen(%esp)
movl %ecx, dsMatchStart(%edx) movl %ecx, dsMatchStart(%edx)
cmpl %ebx, %eax cmpl %ebx, %eax
jge LeaveNow jge LeaveNow
movl window(%esp), %esi movl window(%esp), %esi
addl %eax, %esi addl %eax, %esi
movl %esi, windowbestlen(%esp) movl %esi, windowbestlen(%esp)
movzwl -1(%edi,%eax), %ebx movzwl -1(%edi,%eax), %ebx
movl dsPrev(%edx), %edi movl dsPrev(%edx), %edi
movl %ebx, scanend(%esp) movl %ebx, scanend(%esp)
movl chainlenwmask(%esp), %edx movl chainlenwmask(%esp), %edx
jmp LookupLoop jmp LookupLoop
/* Accept the current string, with the maximum possible length. */ /* Accept the current string, with the maximum possible length. */
LenMaximum: movl deflatestate(%esp), %edx LenMaximum: movl deflatestate(%esp), %edx
movl $MAX_MATCH, bestlen(%esp) movl $MAX_MATCH, bestlen(%esp)
movl %ecx, dsMatchStart(%edx) movl %ecx, dsMatchStart(%edx)
/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */ /* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */
/* return s->lookahead; */ /* return s->lookahead; */
LeaveNow: LeaveNow:
movl deflatestate(%esp), %edx movl deflatestate(%esp), %edx
movl bestlen(%esp), %ebx movl bestlen(%esp), %ebx
movl dsLookahead(%edx), %eax movl dsLookahead(%edx), %eax
cmpl %eax, %ebx cmpl %eax, %ebx
jg LookaheadRet jg LookaheadRet
movl %ebx, %eax movl %ebx, %eax
LookaheadRet: LookaheadRet:
/* Restore the stack and return from whence we came. */ /* Restore the stack and return from whence we came. */
addl $LocalVarsSize, %esp addl $LocalVarsSize, %esp
popl %ebx popl %ebx
popl %esi popl %esi
popl %edi popl %edi
popl %ebp popl %ebp
match_init: ret match_init: ret

View File

@@ -0,0 +1,196 @@
/* ioapi.h -- IO base function header for compress/uncompress .zip
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
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
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
#include "zlib.h"
#ifndef _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>
#ifdef _MSC_VER
#define fopen64 fopen
#if _MSC_VER >= 1400
#define ftello64 _ftelli64
#define fseeko64 _fseeki64
#else // old MSC
#define ftello64 ftell
#define fseeko64 fseek
#endif
#endif
/*
#ifndef ZPOS64_T
#ifdef _WIN32
#define ZPOS64_T fpos_t
#else
#include <stdint.h>
#define ZPOS64_T uint64_t
#endif
#endif
*/
#ifdef HAVE_MINIZIP64_CONF_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_END (2)
#define ZLIB_FILEFUNC_SEEK_SET (0)
#define ZLIB_FILEFUNC_MODE_READ (1)
#define ZLIB_FILEFUNC_MODE_WRITE (2)
#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
#define ZLIB_FILEFUNC_MODE_EXISTING (4)
#define ZLIB_FILEFUNC_MODE_CREATE (8)
#ifndef ZCALLBACK
#if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
#define ZCALLBACK CALLBACK
#else
#define ZCALLBACK
#endif
#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 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
{
open_file_func zopen_file;
read_file_func zread_file;
write_file_func zwrite_file;
tell_file_func ztell_file;
seek_file_func zseek_file;
close_file_func zclose_file;
testerror_file_func zerror_file;
voidpf opaque;
} 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));
/* now internal definition, only for zip.c and unzip.h */
typedef struct zlib_filefunc64_32_def_s
{
zlib_filefunc64_def zfile_func64;
open_file_func zopen32_file;
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
}
#endif
#endif

View File

@@ -0,0 +1,389 @@
/* iowin32.c -- IO base function header for compress/uncompress .zip
Version 1.1, January 7th, 2010
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
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
*/
#include <stdlib.h>
#include "zlib.h"
#include "ioapi.h"
#include "iowin32.h"
#ifndef INVALID_HANDLE_VALUE
#define INVALID_HANDLE_VALUE (0xFFFFFFFF)
#endif
#ifndef INVALID_SET_FILE_POINTER
#define INVALID_SET_FILE_POINTER ((DWORD)-1)
#endif
voidpf ZCALLBACK win32_open_file_func OF((voidpf opaque, const char* filename, int mode));
uLong ZCALLBACK win32_read_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
uLong ZCALLBACK win32_write_file_func OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
ZPOS64_T ZCALLBACK win32_tell64_file_func OF((voidpf opaque, voidpf stream));
long ZCALLBACK win32_seek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
int ZCALLBACK win32_close_file_func OF((voidpf opaque, voidpf stream));
int ZCALLBACK win32_error_file_func OF((voidpf opaque, voidpf stream));
typedef struct
{
HANDLE hf;
int error;
} WIN32FILE_IOWIN;
static void win32_translate_open_mode(int mode,
DWORD* lpdwDesiredAccess,
DWORD* lpdwCreationDisposition,
DWORD* lpdwShareMode,
DWORD* lpdwFlagsAndAttributes)
{
*lpdwDesiredAccess = *lpdwShareMode = *lpdwFlagsAndAttributes = *lpdwCreationDisposition = 0;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
{
*lpdwDesiredAccess = GENERIC_READ;
*lpdwCreationDisposition = OPEN_EXISTING;
*lpdwShareMode = FILE_SHARE_READ;
}
else if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
{
*lpdwDesiredAccess = GENERIC_WRITE | GENERIC_READ;
*lpdwCreationDisposition = OPEN_EXISTING;
}
else if (mode & ZLIB_FILEFUNC_MODE_CREATE)
{
*lpdwDesiredAccess = GENERIC_WRITE | GENERIC_READ;
*lpdwCreationDisposition = CREATE_ALWAYS;
}
}
static voidpf win32_build_iowin(HANDLE hFile)
{
voidpf ret=NULL;
if ((hFile != NULL) && (hFile != INVALID_HANDLE_VALUE))
{
WIN32FILE_IOWIN w32fiow;
w32fiow.hf = hFile;
w32fiow.error = 0;
ret = malloc(sizeof(WIN32FILE_IOWIN));
if (ret==NULL)
CloseHandle(hFile);
else
*((WIN32FILE_IOWIN*)ret) = w32fiow;
}
return ret;
}
voidpf ZCALLBACK win32_open64_file_func (voidpf opaque,const void* filename,int mode)
{
const char* mode_fopen = NULL;
DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
HANDLE hFile = NULL;
win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
if ((filename!=NULL) && (dwDesiredAccess != 0))
hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
return win32_build_iowin(hFile);
}
voidpf ZCALLBACK win32_open64_file_funcA (voidpf opaque,const void* filename,int mode)
{
const char* mode_fopen = NULL;
DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
HANDLE hFile = NULL;
win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
if ((filename!=NULL) && (dwDesiredAccess != 0))
hFile = CreateFileA((LPCSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
return win32_build_iowin(hFile);
}
voidpf ZCALLBACK win32_open64_file_funcW (voidpf opaque,const void* filename,int mode)
{
const char* mode_fopen = NULL;
DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
HANDLE hFile = NULL;
win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
if ((filename!=NULL) && (dwDesiredAccess != 0))
hFile = CreateFileW((LPCWSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
return win32_build_iowin(hFile);
}
voidpf ZCALLBACK win32_open_file_func (voidpf opaque,const char* filename,int mode)
{
const char* mode_fopen = NULL;
DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
HANDLE hFile = NULL;
win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
if ((filename!=NULL) && (dwDesiredAccess != 0))
hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
return win32_build_iowin(hFile);
}
uLong ZCALLBACK win32_read_file_func (voidpf opaque, voidpf stream, void* buf,uLong size)
{
uLong ret=0;
HANDLE hFile = NULL;
if (stream!=NULL)
hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
if (hFile != NULL)
{
if (!ReadFile(hFile, buf, size, &ret, NULL))
{
DWORD dwErr = GetLastError();
if (dwErr == ERROR_HANDLE_EOF)
dwErr = 0;
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
}
}
return ret;
}
uLong ZCALLBACK win32_write_file_func (voidpf opaque,voidpf stream,const void* buf,uLong size)
{
uLong ret=0;
HANDLE hFile = NULL;
if (stream!=NULL)
hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
if (hFile != NULL)
{
if (!WriteFile(hFile, buf, size, &ret, NULL))
{
DWORD dwErr = GetLastError();
if (dwErr == ERROR_HANDLE_EOF)
dwErr = 0;
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
}
}
return ret;
}
long ZCALLBACK win32_tell_file_func (voidpf opaque,voidpf stream)
{
long ret=-1;
HANDLE hFile = NULL;
if (stream!=NULL)
hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
if (hFile != NULL)
{
DWORD dwSet = SetFilePointer(hFile, 0, NULL, FILE_CURRENT);
if (dwSet == INVALID_SET_FILE_POINTER)
{
DWORD dwErr = GetLastError();
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
ret = -1;
}
else
ret=(long)dwSet;
}
return ret;
}
ZPOS64_T ZCALLBACK win32_tell64_file_func (voidpf opaque, voidpf stream)
{
ZPOS64_T ret= (ZPOS64_T)-1;
HANDLE hFile = NULL;
if (stream!=NULL)
hFile = ((WIN32FILE_IOWIN*)stream)->hf;
if (hFile)
{
LARGE_INTEGER li;
li.QuadPart = 0;
li.u.LowPart = SetFilePointer(hFile, li.u.LowPart, &li.u.HighPart, FILE_CURRENT);
if ( (li.LowPart == 0xFFFFFFFF) && (GetLastError() != NO_ERROR))
{
DWORD dwErr = GetLastError();
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
ret = (ZPOS64_T)-1;
}
else
ret=li.QuadPart;
}
return ret;
}
long ZCALLBACK win32_seek_file_func (voidpf opaque,voidpf stream,uLong offset,int origin)
{
DWORD dwMoveMethod=0xFFFFFFFF;
HANDLE hFile = NULL;
long ret=-1;
if (stream!=NULL)
hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
switch (origin)
{
case ZLIB_FILEFUNC_SEEK_CUR :
dwMoveMethod = FILE_CURRENT;
break;
case ZLIB_FILEFUNC_SEEK_END :
dwMoveMethod = FILE_END;
break;
case ZLIB_FILEFUNC_SEEK_SET :
dwMoveMethod = FILE_BEGIN;
break;
default: return -1;
}
if (hFile != NULL)
{
DWORD dwSet = SetFilePointer(hFile, offset, NULL, dwMoveMethod);
if (dwSet == INVALID_SET_FILE_POINTER)
{
DWORD dwErr = GetLastError();
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
ret = -1;
}
else
ret=0;
}
return ret;
}
long ZCALLBACK win32_seek64_file_func (voidpf opaque, voidpf stream,ZPOS64_T offset,int origin)
{
DWORD dwMoveMethod=0xFFFFFFFF;
HANDLE hFile = NULL;
long ret=-1;
if (stream!=NULL)
hFile = ((WIN32FILE_IOWIN*)stream)->hf;
switch (origin)
{
case ZLIB_FILEFUNC_SEEK_CUR :
dwMoveMethod = FILE_CURRENT;
break;
case ZLIB_FILEFUNC_SEEK_END :
dwMoveMethod = FILE_END;
break;
case ZLIB_FILEFUNC_SEEK_SET :
dwMoveMethod = FILE_BEGIN;
break;
default: return -1;
}
if (hFile)
{
LARGE_INTEGER* li = (LARGE_INTEGER*)&offset;
DWORD dwSet = SetFilePointer(hFile, li->u.LowPart, &li->u.HighPart, dwMoveMethod);
if (dwSet == INVALID_SET_FILE_POINTER)
{
DWORD dwErr = GetLastError();
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
ret = -1;
}
else
ret=0;
}
return ret;
}
int ZCALLBACK win32_close_file_func (voidpf opaque, voidpf stream)
{
int ret=-1;
if (stream!=NULL)
{
HANDLE hFile;
hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
if (hFile != NULL)
{
CloseHandle(hFile);
ret=0;
}
free(stream);
}
return ret;
}
int ZCALLBACK win32_error_file_func (voidpf opaque,voidpf stream)
{
int ret=-1;
if (stream!=NULL)
{
ret = ((WIN32FILE_IOWIN*)stream) -> error;
}
return ret;
}
extern void ZEXPORT fill_win32_filefunc (zlib_filefunc_def* pzlib_filefunc_def)
{
pzlib_filefunc_def->zopen_file = win32_open_file_func;
pzlib_filefunc_def->zread_file = win32_read_file_func;
pzlib_filefunc_def->zwrite_file = win32_write_file_func;
pzlib_filefunc_def->ztell_file = win32_tell_file_func;
pzlib_filefunc_def->zseek_file = win32_seek_file_func;
pzlib_filefunc_def->zclose_file = win32_close_file_func;
pzlib_filefunc_def->zerror_file = win32_error_file_func;
pzlib_filefunc_def->opaque = NULL;
}
extern void ZEXPORT fill_win32_filefunc64(zlib_filefunc64_def* pzlib_filefunc_def)
{
pzlib_filefunc_def->zopen64_file = win32_open64_file_func;
pzlib_filefunc_def->zread_file = win32_read_file_func;
pzlib_filefunc_def->zwrite_file = win32_write_file_func;
pzlib_filefunc_def->ztell64_file = win32_tell64_file_func;
pzlib_filefunc_def->zseek64_file = win32_seek64_file_func;
pzlib_filefunc_def->zclose_file = win32_close_file_func;
pzlib_filefunc_def->zerror_file = win32_error_file_func;
pzlib_filefunc_def->opaque = NULL;
}
extern void ZEXPORT fill_win32_filefunc64A(zlib_filefunc64_def* pzlib_filefunc_def)
{
pzlib_filefunc_def->zopen64_file = win32_open64_file_funcA;
pzlib_filefunc_def->zread_file = win32_read_file_func;
pzlib_filefunc_def->zwrite_file = win32_write_file_func;
pzlib_filefunc_def->ztell64_file = win32_tell64_file_func;
pzlib_filefunc_def->zseek64_file = win32_seek64_file_func;
pzlib_filefunc_def->zclose_file = win32_close_file_func;
pzlib_filefunc_def->zerror_file = win32_error_file_func;
pzlib_filefunc_def->opaque = NULL;
}
extern void ZEXPORT fill_win32_filefunc64W(zlib_filefunc64_def* pzlib_filefunc_def)
{
pzlib_filefunc_def->zopen64_file = win32_open64_file_funcW;
pzlib_filefunc_def->zread_file = win32_read_file_func;
pzlib_filefunc_def->zwrite_file = win32_write_file_func;
pzlib_filefunc_def->ztell64_file = win32_tell64_file_func;
pzlib_filefunc_def->zseek64_file = win32_seek64_file_func;
pzlib_filefunc_def->zclose_file = win32_close_file_func;
pzlib_filefunc_def->zerror_file = win32_error_file_func;
pzlib_filefunc_def->opaque = NULL;
}

View File

@@ -0,0 +1,28 @@
/* iowin32.h -- IO base function header for compress/uncompress .zip
Version 1.1, January 7th, 2010
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
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
*/
#include <windows.h>
#ifdef __cplusplus
extern "C" {
#endif
extern void ZEXPORT fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
extern void ZEXPORT fill_win32_filefunc64 OF((zlib_filefunc64_def* pzlib_filefunc_def));
extern void ZEXPORT fill_win32_filefunc64A OF((zlib_filefunc64_def* pzlib_filefunc_def));
extern void ZEXPORT fill_win32_filefunc64W OF((zlib_filefunc64_def* pzlib_filefunc_def));
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,649 @@
/*
miniunz.c
Version 1.1, January 7th, 2010
sample part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
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 )
*/
#include "unzip.h"
#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 <stdlib.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <fcntl.h>
#ifdef unix
# include <unistd.h>
# include <utime.h>
#else
# include <direct.h>
# include <io.h>
#endif
#define CASESENSITIVITY (0)
#define WRITEBUFFERSIZE (8192)
#define MAXFILENAME (256)
#ifdef _WIN32
#define USEWIN32IOAPI
#include "iowin32.h"
#endif
/*
mini unzip, demo of unzip package
usage :
Usage : miniunz [-exvlo] file.zip [file_to_extract] [-d extractdir]
list the file in the zipfile, and print the content of FILE_ID.ZIP or README.TXT
if it exists
*/
/* change_file_date : change the date/time of a file
filename : the filename of the file where date/time must be modified
dosdate : the new date at the MSDos format (4 bytes)
tmu_date : the SAME new date at the tm_unz format */
void change_file_date(filename,dosdate,tmu_date)
const char *filename;
uLong dosdate;
tm_unz tmu_date;
{
#ifdef _WIN32
HANDLE hFile;
FILETIME ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite;
hFile = CreateFileA(filename,GENERIC_READ | GENERIC_WRITE,
0,NULL,OPEN_EXISTING,0,NULL);
GetFileTime(hFile,&ftCreate,&ftLastAcc,&ftLastWrite);
DosDateTimeToFileTime((WORD)(dosdate>>16),(WORD)dosdate,&ftLocal);
LocalFileTimeToFileTime(&ftLocal,&ftm);
SetFileTime(hFile,&ftm,&ftLastAcc,&ftm);
CloseHandle(hFile);
#else
#ifdef unix
struct utimbuf ut;
struct tm newdate;
newdate.tm_sec = tmu_date.tm_sec;
newdate.tm_min=tmu_date.tm_min;
newdate.tm_hour=tmu_date.tm_hour;
newdate.tm_mday=tmu_date.tm_mday;
newdate.tm_mon=tmu_date.tm_mon;
if (tmu_date.tm_year > 1900)
newdate.tm_year=tmu_date.tm_year - 1900;
else
newdate.tm_year=tmu_date.tm_year ;
newdate.tm_isdst=-1;
ut.actime=ut.modtime=mktime(&newdate);
utime(filename,&ut);
#endif
#endif
}
/* mymkdir and change_file_date are not 100 % portable
As I don't know well Unix, I wait feedback for the unix portion */
int mymkdir(dirname)
const char* dirname;
{
int ret=0;
#ifdef _WIN32
ret = _mkdir(dirname);
#else
#ifdef unix
ret = mkdir (dirname,0775);
#endif
#endif
return ret;
}
int makedir (newdir)
char *newdir;
{
char *buffer ;
char *p;
int len = (int)strlen(newdir);
if (len <= 0)
return 0;
buffer = (char*)malloc(len+1);
if (buffer==NULL)
{
printf("Error allocating memory\n");
return UNZ_INTERNALERROR;
}
strcpy(buffer,newdir);
if (buffer[len-1] == '/') {
buffer[len-1] = '\0';
}
if (mymkdir(buffer) == 0)
{
free(buffer);
return 1;
}
p = buffer+1;
while (1)
{
char hold;
while(*p && *p != '\\' && *p != '/')
p++;
hold = *p;
*p = 0;
if ((mymkdir(buffer) == -1) && (errno == ENOENT))
{
printf("couldn't create directory %s\n",buffer);
free(buffer);
return 0;
}
if (hold == 0)
break;
*p++ = hold;
}
free(buffer);
return 1;
}
void do_banner()
{
printf("MiniUnz 1.01b, demo of zLib + Unz package written by Gilles Vollant\n");
printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n");
}
void do_help()
{
printf("Usage : miniunz [-e] [-x] [-v] [-l] [-o] [-p password] file.zip [file_to_extr.] [-d extractdir]\n\n" \
" -e Extract without pathname (junk paths)\n" \
" -x Extract with pathname\n" \
" -v list files\n" \
" -l list files\n" \
" -d directory to extract into\n" \
" -o overwrite files without prompting\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)
unzFile uf;
{
uLong i;
unz_global_info64 gi;
int err;
err = unzGetGlobalInfo64(uf,&gi);
if (err!=UNZ_OK)
printf("error %d with zipfile in unzGetGlobalInfo \n",err);
printf(" Length Method Size Ratio Date Time CRC-32 Name\n");
printf(" ------ ------ ---- ----- ---- ---- ------ ----\n");
for (i=0;i<gi.number_entry;i++)
{
char filename_inzip[256];
unz_file_info64 file_info;
uLong ratio=0;
const char *string_method;
char charCrypt=' ';
err = unzGetCurrentFileInfo64(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
if (err!=UNZ_OK)
{
printf("error %d with zipfile in unzGetCurrentFileInfo\n",err);
break;
}
if (file_info.uncompressed_size>0)
ratio = (uLong)((file_info.compressed_size*100)/file_info.uncompressed_size);
/* display a '*' if the file is crypted */
if ((file_info.flag & 1) != 0)
charCrypt='*';
if (file_info.compression_method==0)
string_method="Stored";
else
if (file_info.compression_method==Z_DEFLATED)
{
uInt iLevel=(uInt)((file_info.flag & 0x6)/2);
if (iLevel==0)
string_method="Defl:N";
else if (iLevel==1)
string_method="Defl:X";
else if ((iLevel==2) || (iLevel==3))
string_method="Defl:F"; /* 2:fast , 3 : extra fast*/
}
else
if (file_info.compression_method==Z_BZIP2ED)
{
string_method="BZip2 ";
}
else
string_method="Unkn. ";
Display64BitsSize(file_info.uncompressed_size,7);
printf(" %6s%c",string_method,charCrypt);
Display64BitsSize(file_info.compressed_size,7);
printf(" %3lu%% %2.2lu-%2.2lu-%2.2lu %2.2lu:%2.2lu %8.8lx %s\n",
ratio,
(uLong)file_info.tmu_date.tm_mon + 1,
(uLong)file_info.tmu_date.tm_mday,
(uLong)file_info.tmu_date.tm_year % 100,
(uLong)file_info.tmu_date.tm_hour,(uLong)file_info.tmu_date.tm_min,
(uLong)file_info.crc,filename_inzip);
if ((i+1)<gi.number_entry)
{
err = unzGoToNextFile(uf);
if (err!=UNZ_OK)
{
printf("error %d with zipfile in unzGoToNextFile\n",err);
break;
}
}
}
return 0;
}
int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password)
unzFile uf;
const int* popt_extract_without_path;
int* popt_overwrite;
const char* password;
{
char filename_inzip[256];
char* filename_withoutpath;
char* p;
int err=UNZ_OK;
FILE *fout=NULL;
void* buf;
uInt size_buf;
unz_file_info64 file_info;
uLong ratio=0;
err = unzGetCurrentFileInfo64(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
if (err!=UNZ_OK)
{
printf("error %d with zipfile in unzGetCurrentFileInfo\n",err);
return err;
}
size_buf = WRITEBUFFERSIZE;
buf = (void*)malloc(size_buf);
if (buf==NULL)
{
printf("Error allocating memory\n");
return UNZ_INTERNALERROR;
}
p = filename_withoutpath = filename_inzip;
while ((*p) != '\0')
{
if (((*p)=='/') || ((*p)=='\\'))
filename_withoutpath = p+1;
p++;
}
if ((*filename_withoutpath)=='\0')
{
if ((*popt_extract_without_path)==0)
{
printf("creating directory: %s\n",filename_inzip);
mymkdir(filename_inzip);
}
}
else
{
const char* write_filename;
int skip=0;
if ((*popt_extract_without_path)==0)
write_filename = filename_inzip;
else
write_filename = filename_withoutpath;
err = unzOpenCurrentFilePassword(uf,password);
if (err!=UNZ_OK)
{
printf("error %d with zipfile in unzOpenCurrentFilePassword\n",err);
}
if (((*popt_overwrite)==0) && (err==UNZ_OK))
{
char rep=0;
FILE* ftestexist;
ftestexist = fopen64(write_filename,"rb");
if (ftestexist!=NULL)
{
fclose(ftestexist);
do
{
char answer[128];
int ret;
printf("The file %s exists. Overwrite ? [y]es, [n]o, [A]ll: ",write_filename);
ret = scanf("%1s",answer);
if (ret != 1)
{
exit(EXIT_FAILURE);
}
rep = answer[0] ;
if ((rep>='a') && (rep<='z'))
rep -= 0x20;
}
while ((rep!='Y') && (rep!='N') && (rep!='A'));
}
if (rep == 'N')
skip = 1;
if (rep == 'A')
*popt_overwrite=1;
}
if ((skip==0) && (err==UNZ_OK))
{
fout=fopen64(write_filename,"wb");
/* some zipfile don't contain directory alone before file */
if ((fout==NULL) && ((*popt_extract_without_path)==0) &&
(filename_withoutpath!=(char*)filename_inzip))
{
char c=*(filename_withoutpath-1);
*(filename_withoutpath-1)='\0';
makedir(write_filename);
*(filename_withoutpath-1)=c;
fout=fopen64(write_filename,"wb");
}
if (fout==NULL)
{
printf("error opening %s\n",write_filename);
}
}
if (fout!=NULL)
{
printf(" extracting: %s\n",write_filename);
do
{
err = unzReadCurrentFile(uf,buf,size_buf);
if (err<0)
{
printf("error %d with zipfile in unzReadCurrentFile\n",err);
break;
}
if (err>0)
if (fwrite(buf,err,1,fout)!=1)
{
printf("error in writing extracted file\n");
err=UNZ_ERRNO;
break;
}
}
while (err>0);
if (fout)
fclose(fout);
if (err==0)
change_file_date(write_filename,file_info.dosDate,
file_info.tmu_date);
}
if (err==UNZ_OK)
{
err = unzCloseCurrentFile (uf);
if (err!=UNZ_OK)
{
printf("error %d with zipfile in unzCloseCurrentFile\n",err);
}
}
else
unzCloseCurrentFile(uf); /* don't lose the error */
}
free(buf);
return err;
}
int do_extract(uf,opt_extract_without_path,opt_overwrite,password)
unzFile uf;
int opt_extract_without_path;
int opt_overwrite;
const char* password;
{
uLong i;
unz_global_info64 gi;
int err;
FILE* fout=NULL;
err = unzGetGlobalInfo64(uf,&gi);
if (err!=UNZ_OK)
printf("error %d with zipfile in unzGetGlobalInfo \n",err);
for (i=0;i<gi.number_entry;i++)
{
if (do_extract_currentfile(uf,&opt_extract_without_path,
&opt_overwrite,
password) != UNZ_OK)
break;
if ((i+1)<gi.number_entry)
{
err = unzGoToNextFile(uf);
if (err!=UNZ_OK)
{
printf("error %d with zipfile in unzGoToNextFile\n",err);
break;
}
}
}
return 0;
}
int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite,password)
unzFile uf;
const char* filename;
int opt_extract_without_path;
int opt_overwrite;
const char* password;
{
int err = UNZ_OK;
if (unzLocateFile(uf,filename,CASESENSITIVITY)!=UNZ_OK)
{
printf("file %s not found in the zipfile\n",filename);
return 2;
}
if (do_extract_currentfile(uf,&opt_extract_without_path,
&opt_overwrite,
password) == UNZ_OK)
return 0;
else
return 1;
}
int main(argc,argv)
int argc;
char *argv[];
{
const char *zipfilename=NULL;
const char *filename_to_extract=NULL;
const char *password=NULL;
char filename_try[MAXFILENAME+16] = "";
int i;
int ret_value=0;
int opt_do_list=0;
int opt_do_extract=1;
int opt_do_extract_withoutpath=0;
int opt_overwrite=0;
int opt_extractdir=0;
const char *dirname=NULL;
unzFile uf=NULL;
do_banner();
if (argc==1)
{
do_help();
return 0;
}
else
{
for (i=1;i<argc;i++)
{
if ((*argv[i])=='-')
{
const char *p=argv[i]+1;
while ((*p)!='\0')
{
char c=*(p++);;
if ((c=='l') || (c=='L'))
opt_do_list = 1;
if ((c=='v') || (c=='V'))
opt_do_list = 1;
if ((c=='x') || (c=='X'))
opt_do_extract = 1;
if ((c=='e') || (c=='E'))
opt_do_extract = opt_do_extract_withoutpath = 1;
if ((c=='o') || (c=='O'))
opt_overwrite=1;
if ((c=='d') || (c=='D'))
{
opt_extractdir=1;
dirname=argv[i+1];
}
if (((c=='p') || (c=='P')) && (i+1<argc))
{
password=argv[i+1];
i++;
}
}
}
else
{
if (zipfilename == NULL)
zipfilename = argv[i];
else if ((filename_to_extract==NULL) && (!opt_extractdir))
filename_to_extract = argv[i] ;
}
}
}
if (zipfilename!=NULL)
{
# ifdef USEWIN32IOAPI
zlib_filefunc64_def ffunc;
# endif
strncpy(filename_try, zipfilename,MAXFILENAME-1);
/* strncpy doesnt append the trailing NULL, of the string is too long. */
filename_try[ MAXFILENAME ] = '\0';
# ifdef USEWIN32IOAPI
fill_win32_filefunc64A(&ffunc);
uf = unzOpen2_64(zipfilename,&ffunc);
# else
uf = unzOpen64(zipfilename);
# endif
if (uf==NULL)
{
strcat(filename_try,".zip");
# ifdef USEWIN32IOAPI
uf = unzOpen2_64(filename_try,&ffunc);
# else
uf = unzOpen64(filename_try);
# endif
}
}
if (uf==NULL)
{
printf("Cannot open %s or %s.zip\n",zipfilename,zipfilename);
return 1;
}
printf("%s opened\n",filename_try);
if (opt_do_list==1)
ret_value = do_list(uf);
else if (opt_do_extract==1)
{
#ifdef _WIN32
if (opt_extractdir && _chdir(dirname))
#else
if (opt_extractdir && chdir(dirname))
#endif
{
printf("Error changing into %s, aborting\n", dirname);
exit(-1);
}
if (filename_to_extract == NULL)
ret_value = do_extract(uf, opt_do_extract_withoutpath, opt_overwrite, password);
else
ret_value = do_extract_onefile(uf, filename_to_extract, opt_do_extract_withoutpath, opt_overwrite, password);
}
unzClose(uf);
return ret_value;
}

View File

@@ -0,0 +1,508 @@
/*
minizip.c
Version 1.1, January 7th, 2010
sample part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
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 )
*/
#include "zip.h"
#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 <stdlib.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <fcntl.h>
#ifdef unix
# include <unistd.h>
# include <utime.h>
# include <sys/types.h>
# include <sys/stat.h>
#else
# include <direct.h>
# include <io.h>
#endif
#ifdef _WIN32
#define USEWIN32IOAPI
#include "iowin32.h"
#endif
#define WRITEBUFFERSIZE (16384)
#define MAXFILENAME (256)
#ifdef _WIN32
uLong filetime(f, tmzip, dt)
char *f; /* name of file to get info on */
tm_zip *tmzip; /* return value: access, modific. and creation times */
uLong *dt; /* dostime */
{
int ret = 0;
{
FILETIME ftLocal;
HANDLE hFind;
WIN32_FIND_DATAA ff32;
hFind = FindFirstFileA(f,&ff32);
if (hFind != INVALID_HANDLE_VALUE)
{
FileTimeToLocalFileTime(&(ff32.ftLastWriteTime),&ftLocal);
FileTimeToDosDateTime(&ftLocal,((LPWORD)dt)+1,((LPWORD)dt)+0);
FindClose(hFind);
ret = 1;
}
}
return ret;
}
#else
#ifdef unix
uLong filetime(f, tmzip, dt)
char *f; /* name of file to get info on */
tm_zip *tmzip; /* return value: access, modific. and creation times */
uLong *dt; /* dostime */
{
int ret=0;
struct stat s; /* results of stat() */
struct tm* filedate;
time_t tm_t=0;
if (strcmp(f,"-")!=0)
{
char name[MAXFILENAME+1];
int len = strlen(f);
if (len > MAXFILENAME)
len = MAXFILENAME;
strncpy(name, f,MAXFILENAME-1);
/* strncpy doesnt append the trailing NULL, of the string is too long. */
name[ MAXFILENAME ] = '\0';
if (name[len - 1] == '/')
name[len - 1] = '\0';
/* not all systems allow stat'ing a file with / appended */
if (stat(name,&s)==0)
{
tm_t = s.st_mtime;
ret = 1;
}
}
filedate = localtime(&tm_t);
tmzip->tm_sec = filedate->tm_sec;
tmzip->tm_min = filedate->tm_min;
tmzip->tm_hour = filedate->tm_hour;
tmzip->tm_mday = filedate->tm_mday;
tmzip->tm_mon = filedate->tm_mon ;
tmzip->tm_year = filedate->tm_year;
return ret;
}
#else
uLong filetime(f, tmzip, dt)
char *f; /* name of file to get info on */
tm_zip *tmzip; /* return value: access, modific. and creation times */
uLong *dt; /* dostime */
{
return 0;
}
#endif
#endif
int check_exist_file(filename)
const char* filename;
{
FILE* ftestexist;
int ret = 1;
ftestexist = fopen64(filename,"rb");
if (ftestexist==NULL)
ret = 0;
else
fclose(ftestexist);
return ret;
}
void do_banner()
{
printf("MiniZip64 1.0, demo of zLib + MiniZip64 package, written by Gilles Vollant\n");
printf("more info on MiniZip at http://www.winimage.com/zLibDll/minizip.html\n\n");
printf("more info on MiniZip64 at http://result42.com/projects/MiniZip64\n\n");
}
void do_help()
{
printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] [-j] file.zip [files_to_add]\n\n" \
" -o Overwrite existing file.zip\n" \
" -a Append to existing file.zip\n" \
" -0 Store only\n" \
" -1 Compress faster\n" \
" -9 Compress better\n\n" \
" -j exclude path. store only the file name.\n\n");
}
/* calculate the CRC32 of a file,
because to encrypt a file, we need known the CRC32 of the file before */
int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigned long* result_crc)
{
unsigned long calculate_crc=0;
int err=ZIP_OK;
FILE * fin = fopen64(filenameinzip,"rb");
unsigned long size_read = 0;
unsigned long total_read = 0;
if (fin==NULL)
{
err = ZIP_ERRNO;
}
if (err == ZIP_OK)
do
{
err = ZIP_OK;
size_read = (int)fread(buf,1,size_buf,fin);
if (size_read < size_buf)
if (feof(fin)==0)
{
printf("error in reading %s\n",filenameinzip);
err = ZIP_ERRNO;
}
if (size_read>0)
calculate_crc = crc32(calculate_crc,buf,size_read);
total_read += size_read;
} while ((err == ZIP_OK) && (size_read>0));
if (fin)
fclose(fin);
*result_crc=calculate_crc;
printf("file %s crc %lx\n", filenameinzip, calculate_crc);
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 argc;
char *argv[];
{
int i;
int opt_overwrite=0;
int opt_compress_level=Z_DEFAULT_COMPRESSION;
int opt_exclude_path=0;
int zipfilenamearg = 0;
char filename_try[MAXFILENAME+16];
int zipok;
int err=0;
int size_buf=0;
void* buf=NULL;
const char* password=NULL;
do_banner();
if (argc==1)
{
do_help();
return 0;
}
else
{
for (i=1;i<argc;i++)
{
if ((*argv[i])=='-')
{
const char *p=argv[i]+1;
while ((*p)!='\0')
{
char c=*(p++);;
if ((c=='o') || (c=='O'))
opt_overwrite = 1;
if ((c=='a') || (c=='A'))
opt_overwrite = 2;
if ((c>='0') && (c<='9'))
opt_compress_level = c-'0';
if ((c=='j') || (c=='J'))
opt_exclude_path = 1;
if (((c=='p') || (c=='P')) && (i+1<argc))
{
password=argv[i+1];
i++;
}
}
}
else
{
if (zipfilenamearg == 0)
{
zipfilenamearg = i ;
}
}
}
}
size_buf = WRITEBUFFERSIZE;
buf = (void*)malloc(size_buf);
if (buf==NULL)
{
printf("Error allocating memory\n");
return ZIP_INTERNALERROR;
}
if (zipfilenamearg==0)
{
zipok=0;
}
else
{
int i,len;
int dot_found=0;
zipok = 1 ;
strncpy(filename_try, argv[zipfilenamearg],MAXFILENAME-1);
/* strncpy doesnt append the trailing NULL, of the string is too long. */
filename_try[ MAXFILENAME ] = '\0';
len=(int)strlen(filename_try);
for (i=0;i<len;i++)
if (filename_try[i]=='.')
dot_found=1;
if (dot_found==0)
strcat(filename_try,".zip");
if (opt_overwrite==2)
{
/* if the file don't exist, we not append file */
if (check_exist_file(filename_try)==0)
opt_overwrite=1;
}
else
if (opt_overwrite==0)
if (check_exist_file(filename_try)!=0)
{
char rep=0;
do
{
char answer[128];
int ret;
printf("The file %s exists. Overwrite ? [y]es, [n]o, [a]ppend : ",filename_try);
ret = scanf("%1s",answer);
if (ret != 1)
{
exit(EXIT_FAILURE);
}
rep = answer[0] ;
if ((rep>='a') && (rep<='z'))
rep -= 0x20;
}
while ((rep!='Y') && (rep!='N') && (rep!='A'));
if (rep=='N')
zipok = 0;
if (rep=='A')
opt_overwrite = 2;
}
}
if (zipok==1)
{
zipFile zf;
int errclose;
# ifdef USEWIN32IOAPI
zlib_filefunc64_def ffunc;
fill_win32_filefunc64A(&ffunc);
zf = zipOpen2_64(filename_try,(opt_overwrite==2) ? 2 : 0,NULL,&ffunc);
# else
zf = zipOpen64(filename_try,(opt_overwrite==2) ? 2 : 0);
# endif
if (zf == NULL)
{
printf("error opening %s\n",filename_try);
err= ZIP_ERRNO;
}
else
printf("creating %s\n",filename_try);
for (i=zipfilenamearg+1;(i<argc) && (err==ZIP_OK);i++)
{
if (!((((*(argv[i]))=='-') || ((*(argv[i]))=='/')) &&
((argv[i][1]=='o') || (argv[i][1]=='O') ||
(argv[i][1]=='a') || (argv[i][1]=='A') ||
(argv[i][1]=='p') || (argv[i][1]=='P') ||
((argv[i][1]>='0') || (argv[i][1]<='9'))) &&
(strlen(argv[i]) == 2)))
{
FILE * fin;
int size_read;
const char* filenameinzip = argv[i];
const char *savefilenameinzip;
zip_fileinfo zi;
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_mday = zi.tmz_date.tm_mon = zi.tmz_date.tm_year = 0;
zi.dosDate = 0;
zi.internal_fa = 0;
zi.external_fa = 0;
filetime(filenameinzip,&zi.tmz_date,&zi.dosDate);
/*
err = zipOpenNewFileInZip(zf,filenameinzip,&zi,
NULL,0,NULL,0,NULL / * comment * /,
(opt_compress_level != 0) ? Z_DEFLATED : 0,
opt_compress_level);
*/
if ((password != NULL) && (err==ZIP_OK))
err = getFileCrc(filenameinzip,buf,size_buf,&crcFile);
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*/,
(opt_compress_level != 0) ? Z_DEFLATED : 0,
opt_compress_level,0,
/* -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, */
-MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
password,crcFile, zip64);
if (err != ZIP_OK)
printf("error in opening %s in zipfile\n",filenameinzip);
else
{
fin = fopen64(filenameinzip,"rb");
if (fin==NULL)
{
err=ZIP_ERRNO;
printf("error in opening %s for reading\n",filenameinzip);
}
}
if (err == ZIP_OK)
do
{
err = ZIP_OK;
size_read = (int)fread(buf,1,size_buf,fin);
if (size_read < size_buf)
if (feof(fin)==0)
{
printf("error in reading %s\n",filenameinzip);
err = ZIP_ERRNO;
}
if (size_read>0)
{
err = zipWriteInFileInZip (zf,buf,size_read);
if (err<0)
{
printf("error in writing %s in the zipfile\n",
filenameinzip);
}
}
} while ((err == ZIP_OK) && (size_read>0));
if (fin)
fclose(fin);
if (err<0)
err=ZIP_ERRNO;
else
{
err = zipCloseFileInZip(zf);
if (err!=ZIP_OK)
printf("error in closing %s in the zipfile\n",
filenameinzip);
}
}
}
errclose = zipClose(zf,NULL);
if (errclose != ZIP_OK)
printf("error in closing %s\n",filename_try);
}
else
{
do_help();
}
free(buf);
return 0;
}

View File

@@ -0,0 +1,95 @@
VERSION 1.23
HEAPSIZE 1048576,8192
EXPORTS
adler32 @1
compress @2
crc32 @3
deflate @4
deflateCopy @5
deflateEnd @6
deflateInit2_ @7
deflateInit_ @8
deflateParams @9
deflateReset @10
deflateSetDictionary @11
gzclose @12
gzdopen @13
gzerror @14
gzflush @15
gzopen @16
gzread @17
gzwrite @18
inflate @19
inflateEnd @20
inflateInit2_ @21
inflateInit_ @22
inflateReset @23
inflateSetDictionary @24
inflateSync @25
uncompress @26
zlibVersion @27
gzprintf @28
gzputc @29
gzgetc @30
gzseek @31
gzrewind @32
gztell @33
gzeof @34
gzsetparams @35
zError @36
inflateSyncPoint @37
get_crc_table @38
compress2 @39
gzputs @40
gzgets @41
inflateCopy @42
inflateBackInit_ @43
inflateBack @44
inflateBackEnd @45
compressBound @46
deflateBound @47
gzclearerr @48
gzungetc @49
zlibCompileFlags @50
deflatePrime @51
unzOpen @61
unzClose @62
unzGetGlobalInfo @63
unzGetCurrentFileInfo @64
unzGoToFirstFile @65
unzGoToNextFile @66
unzOpenCurrentFile @67
unzReadCurrentFile @68
unzOpenCurrentFile3 @69
unztell @70
unzeof @71
unzCloseCurrentFile @72
unzGetGlobalComment @73
unzStringFileNameCompare @74
unzLocateFile @75
unzGetLocalExtrafield @76
unzOpen2 @77
unzOpenCurrentFile2 @78
unzOpenCurrentFilePassword @79
zipOpen @80
zipOpenNewFileInZip @81
zipWriteInFileInZip @82
zipCloseFileInZip @83
zipClose @84
zipOpenNewFileInZip2 @86
zipCloseFileInZipRaw @87
zipOpen2 @88
zipOpenNewFileInZip3 @89
unzGetFilePos @100
unzGoToFilePos @101
fill_win32_filefunc @110
fill_win32_filefunc64 @111
fill_win32_filefunc64A @112
fill_win32_filefunc64W @113

View File

@@ -0,0 +1,881 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="zlibstat"
ProjectGUID="{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
<Platform
Name="Itanium"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="x86\ZlibStat$(ConfigurationName)"
IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NO_snprintf;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE"
ExceptionHandling="0"
RuntimeLibrary="1"
BufferSecurityCheck="false"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB"
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="x64\ZlibStat$(ConfigurationName)"
IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="ZLIB_WINAPI;NO_snprintf;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;WIN64"
ExceptionHandling="0"
RuntimeLibrary="3"
BufferSecurityCheck="false"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB"
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Itanium"
OutputDirectory="ia64\ZlibStat$(ConfigurationName)"
IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="2"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="ZLIB_WINAPI;NO_snprintf;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;WIN64"
ExceptionHandling="0"
RuntimeLibrary="3"
BufferSecurityCheck="false"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB"
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="x86\ZlibStat$(ConfigurationName)"
IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NO_snprintf;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ASMV;ASMINF"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB"
AdditionalDependencies="..\..\masmx86\gvmat32.obj ..\..\masmx86\inffas32.obj "
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="x64\ZlibStat$(ConfigurationName)"
IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="ZLIB_WINAPI;NO_snprintf;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ASMV;ASMINF;WIN64"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB"
AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj "
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Itanium"
OutputDirectory="ia64\ZlibStat$(ConfigurationName)"
IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="2"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="ZLIB_WINAPI;NO_snprintf;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;WIN64"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB"
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="ReleaseWithoutAsm|Win32"
OutputDirectory="x86\ZlibStat$(ConfigurationName)"
IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NO_snprintf;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB"
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="ReleaseWithoutAsm|x64"
OutputDirectory="x64\ZlibStat$(ConfigurationName)"
IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="ZLIB_WINAPI;NO_snprintf;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;WIN64"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB"
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="ReleaseWithoutAsm|Itanium"
OutputDirectory="ia64\ZlibStat$(ConfigurationName)"
IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="2"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="ZLIB_WINAPI;NO_snprintf;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;WIN64"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB"
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
>
<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"
>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseWithoutAsm|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseWithoutAsm|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\gzclose.c">
</File>
<File
RelativePath="..\..\..\gzio.c">
</File>
<File
RelativePath="..\..\..\gzlib.c">
</File>
<File
RelativePath="..\..\..\gzread.c">
</File>
<File
RelativePath="..\..\..\gzwrite.c">
</File>
<File
RelativePath="..\..\..\infback.c"
>
</File>
<File
RelativePath="..\..\masmx64\inffas8664.c"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseWithoutAsm|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseWithoutAsm|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</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>

View File

@@ -0,0 +1,95 @@
VERSION 1.23
HEAPSIZE 1048576,8192
EXPORTS
adler32 @1
compress @2
crc32 @3
deflate @4
deflateCopy @5
deflateEnd @6
deflateInit2_ @7
deflateInit_ @8
deflateParams @9
deflateReset @10
deflateSetDictionary @11
gzclose @12
gzdopen @13
gzerror @14
gzflush @15
gzopen @16
gzread @17
gzwrite @18
inflate @19
inflateEnd @20
inflateInit2_ @21
inflateInit_ @22
inflateReset @23
inflateSetDictionary @24
inflateSync @25
uncompress @26
zlibVersion @27
gzprintf @28
gzputc @29
gzgetc @30
gzseek @31
gzrewind @32
gztell @33
gzeof @34
gzsetparams @35
zError @36
inflateSyncPoint @37
get_crc_table @38
compress2 @39
gzputs @40
gzgets @41
inflateCopy @42
inflateBackInit_ @43
inflateBack @44
inflateBackEnd @45
compressBound @46
deflateBound @47
gzclearerr @48
gzungetc @49
zlibCompileFlags @50
deflatePrime @51
unzOpen @61
unzClose @62
unzGetGlobalInfo @63
unzGetCurrentFileInfo @64
unzGoToFirstFile @65
unzGoToNextFile @66
unzOpenCurrentFile @67
unzReadCurrentFile @68
unzOpenCurrentFile3 @69
unztell @70
unzeof @71
unzCloseCurrentFile @72
unzGetGlobalComment @73
unzStringFileNameCompare @74
unzLocateFile @75
unzGetLocalExtrafield @76
unzOpen2 @77
unzOpenCurrentFile2 @78
unzOpenCurrentFilePassword @79
zipOpen @80
zipOpenNewFileInZip @81
zipWriteInFileInZip @82
zipCloseFileInZip @83
zipClose @84
zipOpenNewFileInZip2 @86
zipCloseFileInZipRaw @87
zipOpen2 @88
zipOpenNewFileInZip3 @89
unzGetFilePos @100
unzGoToFilePos @101
fill_win32_filefunc @110
fill_win32_filefunc64 @111
fill_win32_filefunc64A @112
fill_win32_filefunc64W @113

File diff suppressed because it is too large Load Diff

View File

@@ -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.2'; zlib_version = '1.2.3';
type type
EZlibError = class(Exception); EZlibError = class(Exception);

View File

@@ -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 gzio.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+gzio.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,8 +38,16 @@ 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
gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
gzio.obj: gzio.c zutil.h zlib.h zconf.h gzio.obj: gzio.c zutil.h zlib.h zconf.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

View File

@@ -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 @@
</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}">

Binary file not shown.

View File

@@ -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;
[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.

View File

@@ -1,7 +1,7 @@
// //
// <20> Copyright Henrik Ravn 2004 // <20> 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
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
/// <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
/// <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
/// <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

View File

@@ -1,7 +1,7 @@
// //
// <20> Copyright Henrik Ravn 2004 // <20> 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
#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;

View File

@@ -1,7 +1,7 @@
// //
// <20> Copyright Henrik Ravn 2004 // <20> 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
#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
#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
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();
} }
} }

View File

@@ -1,7 +1,7 @@
// //
// <20> Copyright Henrik Ravn 2004 // <20> 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
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
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();

View File

@@ -1,7 +1,7 @@
// //
// <20> Copyright Henrik Ravn 2004 // <20> 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
/// <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
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
} }
#endregion #endregion
#endregion #endregion
#region Public enums #region Public enums
@@ -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
/// <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
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
} }
/// <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
#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
/// <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);

View File

@@ -1,7 +1,7 @@
// //
// <20> Copyright Henrik Ravn 2004 // <20> 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
return !_isWriting; return !_isWriting;
} }
} }
/// <summary> /// <summary>
/// Returns false. /// Returns false.
@@ -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
} }
} }
#endregion #endregion
#region Destructor & IDispose stuff #region Destructor & IDispose stuff
/// <summary> /// <summary>
@@ -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
{ {
throw new NotSupportedException(); throw new NotSupportedException();
} }
/// <summary> /// <summary>
/// Not suppported. /// Not suppported.
/// </summary> /// </summary>
@@ -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
{ {
// 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
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>

View File

@@ -1,7 +1,7 @@
// //
// <20> Copyright Henrik Ravn 2004 // <20> 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;
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
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();

View File

@@ -1,7 +1,7 @@
// //
// <20> Copyright Henrik Ravn 2004 // <20> 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
public void Info_Version() public void Info_Version()
{ {
Info info = new Info(); Info info = new Info();
Assert.AreEqual("1.2.2", Info.Version); Assert.AreEqual("1.2.3", 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
[Test] [Test]
public void Inflate_Expand() public void Inflate_Expand()
{ {
uncompressedData.Clear(); uncompressedData.Clear();
using (Inflater inf = new Inflater()) using (Inflater inf = new Inflater())

View File

@@ -1,6 +1,6 @@
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:
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:
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:
--------------------------------- ---------------------------------
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)

View File

@@ -1,5 +1,5 @@
/* 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;
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;
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;
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;
/* 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;
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;
} }
/* 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;
/* 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);

View File

@@ -1,5 +1,5 @@
/* 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 @@
#define MAXBITS 15 #define MAXBITS 15
const char inflate9_copyright[] = const char inflate9_copyright[] =
" inflate9 1.2.2.4 Copyright 1995-2005 Mark Adler "; " inflate9 1.2.3.8 Copyright 1995-2010 Mark Adler ";
/* /*
If you use the zlib library in a product, an acknowledgment is welcome If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot in the documentation of your product. If for some reason you cannot
@@ -64,7 +64,7 @@ unsigned short FAR *work;
static const unsigned short lext[31] = { /* Length codes 257..285 extra */ static const unsigned short lext[31] = { /* Length codes 257..285 extra */
128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132, 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
133, 133, 133, 133, 144, 206, 69}; 133, 133, 133, 133, 144, 78, 75};
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,
@@ -128,7 +128,7 @@ unsigned short FAR *work;
left -= count[len]; left -= count[len];
if (left < 0) return -1; /* over-subscribed */ if (left < 0) return -1; /* over-subscribed */
} }
if (left > 0 && (type == CODES || (codes - count[0] != 1))) if (left > 0 && (type == CODES || max != 1))
return -1; /* incomplete set */ return -1; /* incomplete set */
/* generate offsets into symbol table for each length for sorting */ /* generate offsets into symbol table for each length for sorting */
@@ -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;
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;
/* 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 */

View File

@@ -1,5 +1,5 @@
/* 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 {
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 1004 code structures (850 for length/literals 1446, which is the sum of 852 for literal/length codes and 594 for distance
and 154 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 1440 maximum bit length of a code. "enough 286 9 15" for literal/length codes
#define MAXD 154 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,

View File

@@ -4,24 +4,33 @@
; 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
; Copyright (C) 1995-2005 Jean-loup Gailly, Brian Raiter and Gilles Vollant. ; Copyright (C) 1995-2005 Jean-loup Gailly, Brian Raiter and Gilles Vollant.
; File written by Gilles Vollant, by modifiying the longest_match ;
; from Jean-loup Gailly in deflate.c ; File written by Gilles Vollant, by converting to assembly the longest_match
; and modifying asm686 with masm, optimised assembly code from Brian Raiter, ; from Jean-loup Gailly in deflate.c of zLib and infoZip zip.
; written 1998 ;
; and by taking inspiration on asm686 with masm, optimised assembly code
; from Brian Raiter, written 1998
;
; 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
; ;
; to compile this file, I use option ; to compile this file for infozip Zip, I use option:
; ml64.exe /Flgvmat64 /c /Zi gvmat64.asm ; ml64.exe /Flgvmat64 /c /Zi /DINFOZIP gvmat64.asm
; with Microsoft Macro Assembler (x64) for AMD64
; ;
; ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK ; to compile this file for zLib, I use option:
; ml64.exe /Flgvmat64 /c /Zi gvmat64.asm
; Be carrefull to adapt zlib1222add below to your version of zLib
; (if you use a version of zLib before 1.0.4 or after 1.2.2.2, change
; value of zlib1222add later)
;
; This file compile with Microsoft Macro Assembler (x64) for AMD64
;
; ml64.exe is given with Visual Studio 2005 and 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)
; ;
; Be carrefull to adapt zlib1222add below to your version of zLib
;uInt longest_match(s, cur_match) ;uInt longest_match(s, cur_match)
@@ -47,7 +56,10 @@ longest_match PROC
;scanalign equ rsp + xx - LocalVarsSize ; dword-misalignment of string r13 ;scanalign equ rsp + xx - LocalVarsSize ; dword-misalignment of string r13
;bestlen equ rsp + xx - LocalVarsSize ; size of best match so far -> r11d ;bestlen equ rsp + xx - LocalVarsSize ; size of best match so far -> r11d
;scan equ rsp + xx - LocalVarsSize ; ptr to string wanting match -> r9 ;scan equ rsp + xx - LocalVarsSize ; ptr to string wanting match -> r9
nicematch equ rsp + 16 - LocalVarsSize ; a good enough match size -> r14 IFDEF INFOZIP
ELSE
nicematch equ (rsp + 16 - LocalVarsSize) ; a good enough match size
ENDIF
save_rdi equ rsp + 24 - LocalVarsSize save_rdi equ rsp + 24 - LocalVarsSize
save_rsi equ rsp + 32 - LocalVarsSize save_rsi equ rsp + 32 - LocalVarsSize
@@ -84,8 +96,34 @@ save_r13 equ rsp + 64 - LocalVarsSize
; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0"). ; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8"). ; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
zlib1222add equ 8
IFDEF INFOZIP
_DATA SEGMENT
COMM window_size:DWORD
; WMask ; 7fff
COMM window:BYTE:010040H
COMM prev:WORD:08000H
; MatchLen : unused
; PrevMatch : unused
COMM strstart:DWORD
COMM match_start:DWORD
; Lookahead : ignore
COMM prev_length:DWORD ; PrevLen
COMM max_chain_length:DWORD
COMM good_match:DWORD
COMM nice_match:DWORD
prev_ad equ OFFSET prev
window_ad equ OFFSET window
nicematch equ nice_match
_DATA ENDS
WMask equ 07fffh
ELSE
IFNDEF zlib1222add
zlib1222add equ 8
ENDIF
dsWSize equ 56+zlib1222add+(zlib1222add/2) dsWSize equ 56+zlib1222add+(zlib1222add/2)
dsWMask equ 64+zlib1222add+(zlib1222add/2) dsWMask equ 64+zlib1222add+(zlib1222add/2)
dsWindow equ 72+zlib1222add dsWindow equ 72+zlib1222add
@@ -100,6 +138,18 @@ dsMaxChainLen equ 156+zlib1222add
dsGoodMatch equ 172+zlib1222add dsGoodMatch equ 172+zlib1222add
dsNiceMatch equ 176+zlib1222add dsNiceMatch equ 176+zlib1222add
window_size equ [ rcx + dsWSize]
WMask equ [ rcx + dsWMask]
window_ad equ [ rcx + dsWindow]
prev_ad equ [ rcx + dsPrev]
strstart equ [ rcx + dsStrStart]
match_start equ [ rcx + dsMatchStart]
Lookahead equ [ rcx + dsLookahead] ; 0ffffffffh on infozip
prev_length equ [ rcx + dsPrevLen]
max_chain_length equ [ rcx + dsMaxChainLen]
good_match equ [ rcx + dsGoodMatch]
nice_match equ [ rcx + dsNiceMatch]
ENDIF
; parameter 1 in r8(deflate state s), param 2 in rdx (cur match) ; parameter 1 in r8(deflate state s), param 2 in rdx (cur match)
@@ -107,7 +157,7 @@ dsNiceMatch equ 176+zlib1222add
; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp ; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp
; ;
; All registers must be preserved across the call, except for ; All registers must be preserved across the call, except for
; rax, rcx, rdx, r8, r-9, r10, and r11, which are scratch. ; rax, rcx, rdx, r8, r9, r10, and r11, which are scratch.
@@ -124,12 +174,15 @@ dsNiceMatch equ 176+zlib1222add
; this clear high 32 bits of r8, which can be garbage in both r8 and rdx ; this clear high 32 bits of r8, which can be garbage in both r8 and rdx
mov [save_rdi],rdi mov [save_rdi],rdi
mov [save_rsi],rsi mov [save_rsi],rsi
mov [save_rbx],rbx mov [save_rbx],rbx
mov [save_rbp],rbp mov [save_rbp],rbp
IFDEF INFOZIP
mov r8d,ecx
ELSE
mov r8d,edx mov r8d,edx
ENDIF
mov [save_r12],r12 mov [save_r12],r12
mov [save_r13],r13 mov [save_r13],r13
; mov [save_r14],r14 ; mov [save_r14],r14
@@ -142,10 +195,10 @@ dsNiceMatch equ 176+zlib1222add
;;; chain_length >>= 2; ;;; chain_length >>= 2;
;;; } ;;; }
mov edi, [rcx + dsPrevLen] mov edi, prev_length
mov esi, [rcx + dsGoodMatch] mov esi, good_match
mov eax, [rcx + dsWMask] mov eax, WMask
mov ebx, [rcx + dsMaxChainLen] mov ebx, max_chain_length
cmp edi, esi cmp edi, esi
jl LastMatchGood jl LastMatchGood
shr ebx, 2 shr ebx, 2
@@ -159,21 +212,25 @@ LastMatchGood:
dec ebx dec ebx
shl ebx, 16 shl ebx, 16
or ebx, eax or ebx, eax
mov [chainlenwmask], ebx
;;; on zlib only
;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; ;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
mov eax, [rcx + dsNiceMatch] IFDEF INFOZIP
mov r10d, [rcx + dsLookahead] mov [chainlenwmask], ebx
; on infozip nice_match = [nice_match]
ELSE
mov eax, nice_match
mov [chainlenwmask], ebx
mov r10d, Lookahead
cmp r10d, eax cmp r10d, eax
cmovnl r10d, eax cmovnl r10d, eax
mov [nicematch],r10d mov [nicematch],r10d
LookaheadLess: ENDIF
;;; register Bytef *scan = s->window + s->strstart; ;;; register Bytef *scan = s->window + s->strstart;
mov r10, window_ad
mov r10, [rcx + dsWindow] mov ebp, strstart
mov ebp, [rcx + dsStrStart]
lea r13, [r10 + rbp] lea r13, [r10 + rbp]
;;; Determine how many bytes the scan ptr is off from being ;;; Determine how many bytes the scan ptr is off from being
@@ -185,13 +242,16 @@ LookaheadLess:
;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ? ;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
;;; s->strstart - (IPos)MAX_DIST(s) : NIL; ;;; s->strstart - (IPos)MAX_DIST(s) : NIL;
IFDEF INFOZIP
mov eax, [rcx + dsWSize] mov eax,07efah ; MAX_DIST = (WSIZE-MIN_LOOKAHEAD) (0x8000-(3+8+1))
ELSE
mov eax, window_size
sub eax, MIN_LOOKAHEAD sub eax, MIN_LOOKAHEAD
ENDIF
xor edi,edi xor edi,edi
sub ebp, eax sub ebp, eax
mov r11d, [rcx + dsPrevLen] mov r11d, prev_length
cmovng ebp,edi cmovng ebp,edi
@@ -207,8 +267,9 @@ LookaheadLess:
;;; Posf *prev = s->prev; ;;; Posf *prev = s->prev;
movzx r12d,word ptr [r9] movzx r12d,word ptr [r9]
movzx ebx, word ptr [r9 + r11 - 1] movzx ebx, word ptr [r9 + r11 - 1]
mov rdi, [rcx + dsPrev]
mov rdi, prev_ad
;;; Jump into the main loop. ;;; Jump into the main loop.
@@ -312,38 +373,22 @@ LookupLoopIsZero:
prefetcht1 [rsi+rdx] prefetcht1 [rsi+rdx]
prefetcht1 [rdi+rdx] prefetcht1 [rdi+rdx]
;;; Test the strings for equality, 8 bytes at a time. At the end, ;;; Test the strings for equality, 8 bytes at a time. At the end,
;;; adjust edx so that it is offset to the exact byte that mismatched. ;;; adjust rdx so that it is offset to the exact byte that mismatched.
;;; ;;;
;;; We already know at this point that the first three bytes of the ;;; We already know at this point that the first three bytes of the
;;; strings match each other, and they can be safely passed over before ;;; strings match each other, and they can be safely passed over before
;;; starting the compare loop. So what this code does is skip over 0-3 ;;; starting the compare loop. So what this code does is skip over 0-3
;;; bytes, as much as necessary in order to dword-align the edi ;;; bytes, as much as necessary in order to dword-align the edi
;;; pointer. (esi will still be misaligned three times out of four.) ;;; pointer. (rsi will still be misaligned three times out of four.)
;;; ;;;
;;; It should be confessed that this loop usually does not represent ;;; It should be confessed that this loop usually does not represent
;;; much of the total running time. Replacing it with a more ;;; much of the total running time. Replacing it with a more
;;; straightforward "rep cmpsb" would not drastically degrade ;;; straightforward "rep cmpsb" would not drastically degrade
;;; performance. ;;; performance.
;LoopCmps:
; mov eax, [rsi + rdx]
; xor eax, [rdi + rdx]
; jnz LeaveLoopCmps
; mov eax, [rsi + rdx + 4]
; xor eax, [rdi + rdx + 4]
; jnz LeaveLoopCmps4
; add rdx, 8
; jnz LoopCmps
; jmp LenMaximum
;LeaveLoopCmps4: add rdx, 4
;LeaveLoopCmps: test eax, 0000FFFFh
; jnz LenLower
; add rdx, 2
; shr eax, 16
;LenLower: sub al, 1
; adc rdx, 0
LoopCmps: LoopCmps:
mov rax, [rsi + rdx] mov rax, [rsi + rdx]
@@ -361,7 +406,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:
@@ -400,7 +446,7 @@ LenLower: sub al, 1
lea rsi,[r10+r11] lea rsi,[r10+r11]
mov rdi, [rcx + dsPrev] mov rdi, prev_ad
mov edx, [chainlenwmask] mov edx, [chainlenwmask]
jmp LookupLoop jmp LookupLoop
@@ -411,14 +457,14 @@ LenLower: sub al, 1
LongerMatch: LongerMatch:
mov r11d, eax mov r11d, eax
mov [rcx + dsMatchStart], r8d mov match_start, r8d
cmp eax, [nicematch] cmp eax, [nicematch]
jge LeaveNow jge LeaveNow
lea rsi,[r10+rax] lea rsi,[r10+rax]
movzx ebx, word ptr [r9 + rax - 1] movzx ebx, word ptr [r9 + rax - 1]
mov rdi, [rcx + dsPrev] mov rdi, prev_ad
mov edx, [chainlenwmask] mov edx, [chainlenwmask]
jmp LookupLoop jmp LookupLoop
@@ -426,16 +472,19 @@ LongerMatch:
LenMaximum: LenMaximum:
mov r11d,MAX_MATCH mov r11d,MAX_MATCH
mov [rcx + dsMatchStart], r8d mov match_start, r8d
;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len; ;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
;;; return s->lookahead; ;;; return s->lookahead;
LeaveNow: LeaveNow:
mov eax, [rcx + dsLookahead] IFDEF INFOZIP
mov eax,r11d
ELSE
mov eax, Lookahead
cmp r11d, eax cmp r11d, eax
cmovng eax, r11d cmovng eax, r11d
ENDIF
;;; Restore the stack and return from whence we came. ;;; Restore the stack and return from whence we came.
@@ -452,7 +501,8 @@ LeaveNow:
ret 0 ret 0
; please don't remove this string ! ; please don't remove this string !
; Your can freely use gvmat32 in any free or commercial app if you don't remove the string in the binary! ; Your can freely use gvmat64 in any free or commercial app
; but it is far better don't remove the string in the binary!
db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998, converted to amd 64 by Gilles Vollant 2005",0dh,0ah,0 db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998, converted to amd 64 by Gilles Vollant 2005",0dh,0ah,0
longest_match ENDP longest_match ENDP

Binary file not shown.

View File

@@ -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

View File

@@ -11,7 +11,7 @@
; ;
; 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.exe for AMD64 from ; (you can get Windows 2003 server DDK with ml64 and cl.exe 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)
; ;
@@ -379,7 +379,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)

Binary file not shown.

View File

@@ -24,5 +24,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)

View File

@@ -1,2 +1,2 @@
ml /coff /Zi /c /Flgvmat32.lst gvmat32.asm ml /coff /Zi /c /Flgvmat32.lst gvmat32.asm
ml /coff /Zi /c /Flinffas32.lst inffas32.asm ml /coff /Zi /c /Flinffas32.lst inffas32.asm

View File

@@ -14,7 +14,7 @@
; ;
; this file contain two implementation of longest_match ; this file contain two implementation of longest_match
; ;
; longest_match_7fff : written 1996 by Gilles Vollant optimized for ; longest_match_7fff : written 1996 by Gilles Vollant optimized for
; first Pentium. Assume s->w_mask == 0x7fff ; first Pentium. Assume s->w_mask == 0x7fff
; longest_match_686 : written by Brian raiter (1998), optimized for Pentium Pro ; longest_match_686 : written by Brian raiter (1998), optimized for Pentium Pro
; ;
@@ -39,7 +39,7 @@
; ;
; compile the asm file running ; compile the asm file running
; ml /coff /Zi /c /Flgvmat32.lst /DNOOLDPENTIUMCODE gvmat32.asm ; ml /coff /Zi /c /Flgvmat32.lst /DNOOLDPENTIUMCODE gvmat32.asm
; and do not include gvmat32c.c in your project (ou define also ; and do not include gvmat32c.c in your project (ou define also
; NOOLDPENTIUMCODE) ; NOOLDPENTIUMCODE)
; ;
; note : as I known, longest_match_686 is very faster than longest_match_7fff ; note : as I known, longest_match_686 is very faster than longest_match_7fff
@@ -113,7 +113,7 @@ IFDEF NOUNDERLINE
IFDEF NOOLDPENTIUMCODE IFDEF NOOLDPENTIUMCODE
public longest_match public longest_match
public match_init public match_init
ELSE ELSE
public longest_match_7fff public longest_match_7fff
public cpudetect32 public cpudetect32
public longest_match_686 public longest_match_686
@@ -959,7 +959,7 @@ IFDEF NOOLDPENTIUMCODE
_match_init proc near _match_init proc near
ret ret
_match_init endp _match_init endp
ENDIF ENDIF
ELSE ELSE
IFDEF NOUNDERLINE IFDEF NOUNDERLINE
longest_match_686 endp longest_match_686 endp

View File

@@ -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 @@
; 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:
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:
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:
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

View File

@@ -1,67 +0,0 @@
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)

View File

@@ -1,25 +1,25 @@
CC=cc CC=cc
CFLAGS=-O -I../.. CFLAGS=-O -I../..
UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a
ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a
.c.o: .c.o:
$(CC) -c $(CFLAGS) $*.c $(CC) -c $(CFLAGS) $*.c
all: miniunz minizip all: miniunz minizip
miniunz: $(UNZ_OBJS) miniunz: $(UNZ_OBJS)
$(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS)
minizip: $(ZIP_OBJS) minizip: $(ZIP_OBJS)
$(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS)
test: miniunz minizip test: miniunz minizip
./minizip test readme.txt ./minizip test readme.txt
./miniunz -l test.zip ./miniunz -l test.zip
mv readme.txt readme.old mv readme.txt readme.old
./miniunz test.zip ./miniunz test.zip
clean: clean:
/bin/rm -f *.o *~ minizip miniunz /bin/rm -f *.o *~ minizip miniunz

View File

@@ -0,0 +1,6 @@
MiniZip64 was derrived from MiniZip at version 1.01f
Change in 1.0 (Okt 2009)
- **TODO - Add history**

View File

@@ -0,0 +1,79 @@
MiniZip64 - Copyright (c) 2009-2010 - Mathias Svensson - Built from MiniZip by Gilles Vollant
Introduction
---------------------
MiniZip64 is built from MiniZip by Gilles Vollant ( http://www.winimage.com/zLibDll/minizip.html )
When adding ZIP64 support into minizip it would result into breaking compatibility with current minizip.
And since breaking compatibility in minizip is not wanted. I decided to create a fork of minizip
and create minizip64.
Even though MiniZip64 is build from MiniZip, all functions and struct's have changed name so that it
would not collide with each other.
Background
---------------------
When adding ZIP64 support I 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 to MiniZip64
-------------------------------------
* Filenames has got a '64' at the end of them . eg unzip.c is now called unzip64.c
* 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.
----------------------------------------------------------

View File

@@ -1,132 +1,131 @@
/* crypt.h -- base code for crypt/uncrypt ZIPfile /* crypt.h -- base code for crypt/uncrypt ZIPfile
Version 1.01e, February 12th, 2005 Version 1.01e, February 12th, 2005
Copyright (C) 1998-2005 Gilles Vollant Copyright (C) 1998-2005 Gilles Vollant
This code is a modified version of crypting code in Infozip distribution This code is a modified version of crypting code in Infozip distribution
The encryption/decryption parts of this source code (as opposed to the The encryption/decryption parts of this source code (as opposed to the
non-echoing password parts) were originally written in Europe. The non-echoing password parts) were originally written in Europe. The
whole source package can be freely distributed, including from the USA. whole source package can be freely distributed, including from the USA.
(Prior to January 2000, re-export from the US was a violation of US law.) (Prior to January 2000, re-export from the US was a violation of US law.)
This encryption code is a direct transcription of the algorithm from This encryption code is a direct transcription of the algorithm from
Roger Schlafly, described by Phil Katz in the file appnote.txt. This Roger Schlafly, described by Phil Katz in the file appnote.txt. This
file (appnote.txt) is distributed with the PKZIP program (even in the file (appnote.txt) is distributed with the PKZIP program (even in the
version without encryption capabilities). version without encryption capabilities).
If you don't need crypting in your application, just define symbols If you don't need crypting in your application, just define symbols
NOCRYPT and NOUNCRYPT. NOCRYPT and NOUNCRYPT.
This code support the "Traditional PKWARE Encryption". This code support the "Traditional PKWARE Encryption".
The new AES encryption added on Zip format by Winzip (see the page The new AES encryption added on Zip format by Winzip (see the page
http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
Encryption is not supported. Encryption is not supported.
*/ */
#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) #define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
/*********************************************************************** /***********************************************************************
* Return the next byte in the pseudo-random sequence * Return the next byte in the pseudo-random sequence
*/ */
static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
{ {
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
* unpredictable manner on 16-bit systems; not a problem * unpredictable manner on 16-bit systems; not a problem
* with any known compiler so far, though */ * with any known compiler so far, though */
temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
} }
/*********************************************************************** /***********************************************************************
* Update the encryption keys with the next byte of plain text * Update the encryption keys with the next byte of plain text
*/ */
static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
{ {
(*(pkeys+0)) = CRC32((*(pkeys+0)), c); (*(pkeys+0)) = CRC32((*(pkeys+0)), c);
(*(pkeys+1)) += (*(pkeys+0)) & 0xff; (*(pkeys+1)) += (*(pkeys+0)) & 0xff;
(*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
{ {
register int keyshift = (int)((*(pkeys+1)) >> 24); register int keyshift = (int)((*(pkeys+1)) >> 24);
(*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
} }
return c; return c;
} }
/*********************************************************************** /***********************************************************************
* Initialize the encryption keys and the random header according to * Initialize the encryption keys and the random header according to
* the given password. * the given password.
*/ */
static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
{ {
*(pkeys+0) = 305419896L; *(pkeys+0) = 305419896L;
*(pkeys+1) = 591751049L; *(pkeys+1) = 591751049L;
*(pkeys+2) = 878082192L; *(pkeys+2) = 878082192L;
while (*passwd != '\0') { while (*passwd != '\0') {
update_keys(pkeys,pcrc_32_tab,(int)*passwd); update_keys(pkeys,pcrc_32_tab,(int)*passwd);
passwd++; passwd++;
} }
} }
#define zdecode(pkeys,pcrc_32_tab,c) \ #define zdecode(pkeys,pcrc_32_tab,c) \
(update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
#define zencode(pkeys,pcrc_32_tab,c,t) \ #define zencode(pkeys,pcrc_32_tab,c,t) \
(t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED #ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
#define RAND_HEAD_LEN 12 #define RAND_HEAD_LEN 12
/* "last resort" source for second part of crypt seed pattern */ /* "last resort" source for second part of crypt seed pattern */
# ifndef ZCR_SEED2 # ifndef ZCR_SEED2
# 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 */ int c; /* random byte */
int c; /* random byte */ unsigned char header[RAND_HEAD_LEN-2]; /* random header */
unsigned char header[RAND_HEAD_LEN-2]; /* random header */ static unsigned calls = 0; /* ensure different random header each time */
static unsigned calls = 0; /* ensure different random header each time */
if (bufSize<RAND_HEAD_LEN)
if (bufSize<RAND_HEAD_LEN) return 0;
return 0;
/* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
/* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the * output of rand() to get less predictability, since rand() is
* output of rand() to get less predictability, since rand() is * often poorly implemented.
* often poorly implemented. */
*/ if (++calls == 1)
if (++calls == 1) {
{ srand((unsigned)(time(NULL) ^ ZCR_SEED2));
srand((unsigned)(time(NULL) ^ ZCR_SEED2)); }
} init_keys(passwd, pkeys, pcrc_32_tab);
init_keys(passwd, pkeys, pcrc_32_tab); for (n = 0; n < RAND_HEAD_LEN-2; n++)
for (n = 0; n < RAND_HEAD_LEN-2; n++) {
{ c = (rand() >> 7) & 0xff;
c = (rand() >> 7) & 0xff; header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); }
} /* Encrypt random header (last two bytes is high word of crc) */
/* Encrypt random header (last two bytes is high word of crc) */ init_keys(passwd, pkeys, pcrc_32_tab);
init_keys(passwd, pkeys, pcrc_32_tab); for (n = 0; n < RAND_HEAD_LEN-2; n++)
for (n = 0; n < RAND_HEAD_LEN-2; n++) {
{ 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++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); return n;
return n; }
}
#endif
#endif

View File

@@ -1,177 +1,235 @@
/* 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 Modifications for Zip64 support
*/ Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
#include <stdio.h> For more info read MiniZip_info.txt
#include <stdlib.h>
#include <string.h> */
#include "zlib.h" #if (defined(_WIN32))
#include "ioapi.h" #define _CRT_SECURE_NO_WARNINGS
#endif
#include "ioapi.h"
/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)
#ifndef SEEK_CUR {
#define SEEK_CUR 1 if (pfilefunc->zfile_func64.zopen64_file != NULL)
#endif return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode);
else
#ifndef SEEK_END {
#define SEEK_END 2 return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode);
#endif }
}
#ifndef SEEK_SET
#define SEEK_SET 0 long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)
#endif {
if (pfilefunc->zfile_func64.zseek64_file != NULL)
voidpf ZCALLBACK fopen_file_func OF(( return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin);
voidpf opaque, else
const char* filename, {
int mode)); uLong offsetTruncated = (uLong)offset;
if (offsetTruncated != offset)
uLong ZCALLBACK fread_file_func OF(( return -1;
voidpf opaque, else
voidpf stream, return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin);
void* buf, }
uLong size)); }
uLong ZCALLBACK fwrite_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)
const void* buf, return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream);
uLong size)); else
{
long ZCALLBACK ftell_file_func OF(( uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream);
voidpf opaque, if ((tell_uLong) == ((uLong)-1))
voidpf stream)); return (ZPOS64_T)-1;
else
long ZCALLBACK fseek_file_func OF(( return tell_uLong;
voidpf opaque, }
voidpf stream, }
uLong offset,
int origin)); void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32)
{
int ZCALLBACK fclose_file_func OF(( p_filefunc64_32->zfile_func64.zopen64_file = NULL;
voidpf opaque, p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file;
voidpf stream)); p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file;
p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file;
int ZCALLBACK ferror_file_func OF(( p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file;
voidpf opaque, p_filefunc64_32->zfile_func64.ztell64_file = NULL;
voidpf stream)); 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;
voidpf ZCALLBACK fopen_file_func (opaque, filename, mode) p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque;
voidpf opaque; p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file;
const char* filename; p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file;
int mode; }
{
FILE* file = NULL;
const char* mode_fopen = NULL;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode));
mode_fopen = "rb"; static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
else static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size));
if (mode & ZLIB_FILEFUNC_MODE_EXISTING) static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream));
mode_fopen = "r+b"; static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
else static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream));
if (mode & ZLIB_FILEFUNC_MODE_CREATE) static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));
mode_fopen = "wb";
static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode)
if ((filename!=NULL) && (mode_fopen != NULL)) {
file = fopen(filename, mode_fopen); FILE* file = NULL;
return file; const char* mode_fopen = NULL;
} if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
mode_fopen = "rb";
else
uLong ZCALLBACK fread_file_func (opaque, stream, buf, size) if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
voidpf opaque; mode_fopen = "r+b";
voidpf stream; else
void* buf; if (mode & ZLIB_FILEFUNC_MODE_CREATE)
uLong size; mode_fopen = "wb";
{
uLong ret; if ((filename!=NULL) && (mode_fopen != NULL))
ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); file = fopen(filename, mode_fopen);
return ret; return file;
} }
static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode)
uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size) {
voidpf opaque; FILE* file = NULL;
voidpf stream; const char* mode_fopen = NULL;
const void* buf; if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
uLong size; mode_fopen = "rb";
{ else
uLong ret; if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); mode_fopen = "r+b";
return ret; else
} if (mode & ZLIB_FILEFUNC_MODE_CREATE)
mode_fopen = "wb";
long ZCALLBACK ftell_file_func (opaque, stream)
voidpf opaque; if ((filename!=NULL) && (mode_fopen != NULL))
voidpf stream; file = fopen64((const char*)filename, mode_fopen);
{ return file;
long ret; }
ret = ftell((FILE *)stream);
return ret;
} static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)
{
long ZCALLBACK fseek_file_func (opaque, stream, offset, origin) uLong ret;
voidpf opaque; ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
voidpf stream; return ret;
uLong offset; }
int origin;
{ static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size)
int fseek_origin=0; {
long ret; uLong ret;
switch (origin) ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
{ return ret;
case ZLIB_FILEFUNC_SEEK_CUR : }
fseek_origin = SEEK_CUR;
break; static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
case ZLIB_FILEFUNC_SEEK_END : {
fseek_origin = SEEK_END; long ret;
break; ret = ftell((FILE *)stream);
case ZLIB_FILEFUNC_SEEK_SET : return ret;
fseek_origin = SEEK_SET; }
break;
default: return -1;
} static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
ret = 0; {
fseek((FILE *)stream, offset, fseek_origin); ZPOS64_T ret;
return ret; ret = ftello64((FILE *)stream);
} return ret;
}
int ZCALLBACK fclose_file_func (opaque, stream)
voidpf opaque; static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin)
voidpf stream; {
{ int fseek_origin=0;
int ret; long ret;
ret = fclose((FILE *)stream); switch (origin)
return ret; {
} case ZLIB_FILEFUNC_SEEK_CUR :
fseek_origin = SEEK_CUR;
int ZCALLBACK ferror_file_func (opaque, stream) break;
voidpf opaque; case ZLIB_FILEFUNC_SEEK_END :
voidpf stream; fseek_origin = SEEK_END;
{ break;
int ret; case ZLIB_FILEFUNC_SEEK_SET :
ret = ferror((FILE *)stream); fseek_origin = SEEK_SET;
return ret; break;
} default: return -1;
}
void fill_fopen_filefunc (pzlib_filefunc_def) ret = 0;
zlib_filefunc_def* pzlib_filefunc_def; if (fseek((FILE *)stream, offset, fseek_origin) != 0)
{ ret = -1;
pzlib_filefunc_def->zopen_file = fopen_file_func; return ret;
pzlib_filefunc_def->zread_file = fread_file_func; }
pzlib_filefunc_def->zwrite_file = fwrite_file_func;
pzlib_filefunc_def->ztell_file = ftell_file_func; static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)
pzlib_filefunc_def->zseek_file = fseek_file_func; {
pzlib_filefunc_def->zclose_file = fclose_file_func; int fseek_origin=0;
pzlib_filefunc_def->zerror_file = ferror_file_func; long ret;
pzlib_filefunc_def->opaque = NULL; 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;
ret = fclose((FILE *)stream);
return ret;
}
static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream)
{
int ret;
ret = ferror((FILE *)stream);
return ret;
}
void fill_fopen_filefunc (pzlib_filefunc_def)
zlib_filefunc_def* pzlib_filefunc_def;
{
pzlib_filefunc_def->zopen_file = fopen_file_func;
pzlib_filefunc_def->zread_file = fread_file_func;
pzlib_filefunc_def->zwrite_file = fwrite_file_func;
pzlib_filefunc_def->ztell_file = ftell_file_func;
pzlib_filefunc_def->zseek_file = fseek_file_func;
pzlib_filefunc_def->zclose_file = fclose_file_func;
pzlib_filefunc_def->zerror_file = ferror_file_func;
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;
}

View File

@@ -1,75 +1,194 @@
/* 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 )
#ifndef _ZLIBIOAPI_H For more info read MiniZip_info.txt
#define _ZLIBIOAPI_H
Changes
#define ZLIB_FILEFUNC_SEEK_CUR (1) 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)
#define ZLIB_FILEFUNC_SEEK_END (2) Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux.
#define ZLIB_FILEFUNC_SEEK_SET (0) 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.
#define ZLIB_FILEFUNC_MODE_READ (1) (but you should use iowin32.c for windows instead)
#define ZLIB_FILEFUNC_MODE_WRITE (2)
#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) */
#define ZLIB_FILEFUNC_MODE_EXISTING (4) #ifndef _ZLIBIOAPI64_H
#define ZLIB_FILEFUNC_MODE_CREATE (8) #define _ZLIBIOAPI64_H
#ifndef _WIN32
#ifndef ZCALLBACK
// Linux needs this to support file operation on files larger then 4+GB
#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) // But might need better if/def to select just the platforms that needs them.
#define ZCALLBACK CALLBACK
#else #ifndef __USE_FILE_OFFSET64
#define ZCALLBACK #define __USE_FILE_OFFSET64
#endif #endif
#endif #ifndef __USE_LARGEFILE64
#define __USE_LARGEFILE64
#ifdef __cplusplus #endif
extern "C" { #ifndef _LARGEFILE64_SOURCE
#endif #define _LARGEFILE64_SOURCE
#endif
typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); #ifndef _FILE_OFFSET_BIT
typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); #define _FILE_OFFSET_BIT 64
typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); #endif
typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); #endif
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)); #include <stdio.h>
typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); #include <stdlib.h>
#include "zlib.h"
typedef struct zlib_filefunc_def_s
{ #ifdef _MSC_VER
open_file_func zopen_file; #define fopen64 fopen
read_file_func zread_file; #if _MSC_VER >= 1400
write_file_func zwrite_file; #define ftello64 _ftelli64
tell_file_func ztell_file; #define fseeko64 _fseeki64
seek_file_func zseek_file; #else // old MSC
close_file_func zclose_file; #define ftello64 ftell
testerror_file_func zerror_file; #define fseeko64 fseek
voidpf opaque; #endif
} zlib_filefunc_def; #endif
/*
#ifndef ZPOS64_T
void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); #ifdef _WIN32
#define ZPOS64_T fpos_t
#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) #else
#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) #include <stdint.h>
#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) #define ZPOS64_T uint64_t
#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) #endif
#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) #endif
#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) */
#ifdef HAVE_MINIZIP64_CONF_H
#ifdef __cplusplus #include "mz64conf.h"
} #endif
#endif
/* a type choosen by DEFINE */
#endif #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_END (2)
#define ZLIB_FILEFUNC_SEEK_SET (0)
#define ZLIB_FILEFUNC_MODE_READ (1)
#define ZLIB_FILEFUNC_MODE_WRITE (2)
#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
#define ZLIB_FILEFUNC_MODE_EXISTING (4)
#define ZLIB_FILEFUNC_MODE_CREATE (8)
#ifndef ZCALLBACK
#if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
#define ZCALLBACK CALLBACK
#else
#define ZCALLBACK
#endif
#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 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
{
open_file_func zopen_file;
read_file_func zread_file;
write_file_func zwrite_file;
tell_file_func ztell_file;
seek_file_func zseek_file;
close_file_func zclose_file;
testerror_file_func zerror_file;
voidpf opaque;
} 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));
/* now internal definition, only for zip.c and unzip.h */
typedef struct zlib_filefunc64_32_def_s
{
zlib_filefunc64_def zfile_func64;
open_file_func zopen32_file;
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
}
#endif
#endif

View File

@@ -1,270 +1,389 @@
/* iowin32.c -- IO base function header for compress/uncompress .zip /* iowin32.c -- IO base function header for compress/uncompress .zip
files using zlib + zip or unzip API Version 1.1, January 7th, 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 )
Copyright (C) 1998-2005 Gilles Vollant Modifications for Zip64 support
*/ Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
#include <stdlib.h> For more info read MiniZip_info.txt
#include "zlib.h" */
#include "ioapi.h"
#include "iowin32.h" #include <stdlib.h>
#ifndef INVALID_HANDLE_VALUE #include "zlib.h"
#define INVALID_HANDLE_VALUE (0xFFFFFFFF) #include "ioapi.h"
#endif #include "iowin32.h"
#ifndef INVALID_SET_FILE_POINTER #ifndef INVALID_HANDLE_VALUE
#define INVALID_SET_FILE_POINTER ((DWORD)-1) #define INVALID_HANDLE_VALUE (0xFFFFFFFF)
#endif #endif
voidpf ZCALLBACK win32_open_file_func OF(( #ifndef INVALID_SET_FILE_POINTER
voidpf opaque, #define INVALID_SET_FILE_POINTER ((DWORD)-1)
const char* filename, #endif
int mode));
voidpf ZCALLBACK win32_open_file_func OF((voidpf opaque, const char* filename, int mode));
uLong ZCALLBACK win32_read_file_func OF(( uLong ZCALLBACK win32_read_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
voidpf opaque, uLong ZCALLBACK win32_write_file_func OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
voidpf stream, ZPOS64_T ZCALLBACK win32_tell64_file_func OF((voidpf opaque, voidpf stream));
void* buf, long ZCALLBACK win32_seek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
uLong size)); int ZCALLBACK win32_close_file_func OF((voidpf opaque, voidpf stream));
int ZCALLBACK win32_error_file_func OF((voidpf opaque, voidpf stream));
uLong ZCALLBACK win32_write_file_func OF((
voidpf opaque, typedef struct
voidpf stream, {
const void* buf, HANDLE hf;
uLong size)); int error;
} WIN32FILE_IOWIN;
long ZCALLBACK win32_tell_file_func OF((
voidpf opaque,
voidpf stream)); static void win32_translate_open_mode(int mode,
DWORD* lpdwDesiredAccess,
long ZCALLBACK win32_seek_file_func OF(( DWORD* lpdwCreationDisposition,
voidpf opaque, DWORD* lpdwShareMode,
voidpf stream, DWORD* lpdwFlagsAndAttributes)
uLong offset, {
int origin)); *lpdwDesiredAccess = *lpdwShareMode = *lpdwFlagsAndAttributes = *lpdwCreationDisposition = 0;
int ZCALLBACK win32_close_file_func OF(( if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
voidpf opaque, {
voidpf stream)); *lpdwDesiredAccess = GENERIC_READ;
*lpdwCreationDisposition = OPEN_EXISTING;
int ZCALLBACK win32_error_file_func OF(( *lpdwShareMode = FILE_SHARE_READ;
voidpf opaque, }
voidpf stream)); else if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
{
typedef struct *lpdwDesiredAccess = GENERIC_WRITE | GENERIC_READ;
{ *lpdwCreationDisposition = OPEN_EXISTING;
HANDLE hf; }
int error; else if (mode & ZLIB_FILEFUNC_MODE_CREATE)
} WIN32FILE_IOWIN; {
*lpdwDesiredAccess = GENERIC_WRITE | GENERIC_READ;
voidpf ZCALLBACK win32_open_file_func (opaque, filename, mode) *lpdwCreationDisposition = CREATE_ALWAYS;
voidpf opaque; }
const char* filename; }
int mode;
{ static voidpf win32_build_iowin(HANDLE hFile)
const char* mode_fopen = NULL; {
DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ; voidpf ret=NULL;
HANDLE hFile = 0;
voidpf ret=NULL; if ((hFile != NULL) && (hFile != INVALID_HANDLE_VALUE))
{
dwDesiredAccess = dwShareMode = dwFlagsAndAttributes = 0; WIN32FILE_IOWIN w32fiow;
w32fiow.hf = hFile;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) w32fiow.error = 0;
{ ret = malloc(sizeof(WIN32FILE_IOWIN));
dwDesiredAccess = GENERIC_READ;
dwCreationDisposition = OPEN_EXISTING; if (ret==NULL)
dwShareMode = FILE_SHARE_READ; CloseHandle(hFile);
} else
else *((WIN32FILE_IOWIN*)ret) = w32fiow;
if (mode & ZLIB_FILEFUNC_MODE_EXISTING) }
{ return ret;
dwDesiredAccess = GENERIC_WRITE | GENERIC_READ; }
dwCreationDisposition = OPEN_EXISTING;
} voidpf ZCALLBACK win32_open64_file_func (voidpf opaque,const void* filename,int mode)
else {
if (mode & ZLIB_FILEFUNC_MODE_CREATE) const char* mode_fopen = NULL;
{ DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
dwDesiredAccess = GENERIC_WRITE | GENERIC_READ; HANDLE hFile = NULL;
dwCreationDisposition = CREATE_ALWAYS;
} win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
if ((filename!=NULL) && (dwDesiredAccess != 0)) if ((filename!=NULL) && (dwDesiredAccess != 0))
hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
dwCreationDisposition, dwFlagsAndAttributes, NULL);
return win32_build_iowin(hFile);
if (hFile == INVALID_HANDLE_VALUE) }
hFile = NULL;
if (hFile != NULL) voidpf ZCALLBACK win32_open64_file_funcA (voidpf opaque,const void* filename,int mode)
{ {
WIN32FILE_IOWIN w32fiow; const char* mode_fopen = NULL;
w32fiow.hf = hFile; DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
w32fiow.error = 0; HANDLE hFile = NULL;
ret = malloc(sizeof(WIN32FILE_IOWIN));
if (ret==NULL) win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
CloseHandle(hFile);
else *((WIN32FILE_IOWIN*)ret) = w32fiow; if ((filename!=NULL) && (dwDesiredAccess != 0))
} hFile = CreateFileA((LPCSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
return ret;
} return win32_build_iowin(hFile);
}
uLong ZCALLBACK win32_read_file_func (opaque, stream, buf, size)
voidpf opaque; voidpf ZCALLBACK win32_open64_file_funcW (voidpf opaque,const void* filename,int mode)
voidpf stream; {
void* buf; const char* mode_fopen = NULL;
uLong size; DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
{ HANDLE hFile = NULL;
uLong ret=0;
HANDLE hFile = NULL; win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
if (stream!=NULL)
hFile = ((WIN32FILE_IOWIN*)stream) -> hf; if ((filename!=NULL) && (dwDesiredAccess != 0))
if (hFile != NULL) hFile = CreateFileW((LPCWSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
if (!ReadFile(hFile, buf, size, &ret, NULL))
{ return win32_build_iowin(hFile);
DWORD dwErr = GetLastError(); }
if (dwErr == ERROR_HANDLE_EOF)
dwErr = 0;
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; voidpf ZCALLBACK win32_open_file_func (voidpf opaque,const char* filename,int mode)
} {
const char* mode_fopen = NULL;
return ret; DWORD dwDesiredAccess,dwCreationDisposition,dwShareMode,dwFlagsAndAttributes ;
} HANDLE hFile = NULL;
win32_translate_open_mode(mode,&dwDesiredAccess,&dwCreationDisposition,&dwShareMode,&dwFlagsAndAttributes);
uLong ZCALLBACK win32_write_file_func (opaque, stream, buf, size)
voidpf opaque; if ((filename!=NULL) && (dwDesiredAccess != 0))
voidpf stream; hFile = CreateFile((LPCTSTR)filename, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL);
const void* buf;
uLong size; return win32_build_iowin(hFile);
{ }
uLong ret=0;
HANDLE hFile = NULL;
if (stream!=NULL) uLong ZCALLBACK win32_read_file_func (voidpf opaque, voidpf stream, void* buf,uLong size)
hFile = ((WIN32FILE_IOWIN*)stream) -> hf; {
uLong ret=0;
if (hFile !=NULL) HANDLE hFile = NULL;
if (!WriteFile(hFile, buf, size, &ret, NULL)) if (stream!=NULL)
{ hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
DWORD dwErr = GetLastError();
if (dwErr == ERROR_HANDLE_EOF) if (hFile != NULL)
dwErr = 0; {
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; if (!ReadFile(hFile, buf, size, &ret, NULL))
} {
DWORD dwErr = GetLastError();
return ret; if (dwErr == ERROR_HANDLE_EOF)
} dwErr = 0;
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
long ZCALLBACK win32_tell_file_func (opaque, stream) }
voidpf opaque; }
voidpf stream;
{ return ret;
long ret=-1; }
HANDLE hFile = NULL;
if (stream!=NULL)
hFile = ((WIN32FILE_IOWIN*)stream) -> hf; uLong ZCALLBACK win32_write_file_func (voidpf opaque,voidpf stream,const void* buf,uLong size)
if (hFile != NULL) {
{ uLong ret=0;
DWORD dwSet = SetFilePointer(hFile, 0, NULL, FILE_CURRENT); HANDLE hFile = NULL;
if (dwSet == INVALID_SET_FILE_POINTER) if (stream!=NULL)
{ hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
DWORD dwErr = GetLastError();
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr; if (hFile != NULL)
ret = -1; {
} if (!WriteFile(hFile, buf, size, &ret, NULL))
else {
ret=(long)dwSet; DWORD dwErr = GetLastError();
} if (dwErr == ERROR_HANDLE_EOF)
return ret; dwErr = 0;
} ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
}
long ZCALLBACK win32_seek_file_func (opaque, stream, offset, origin) }
voidpf opaque;
voidpf stream; return ret;
uLong offset; }
int origin;
{ long ZCALLBACK win32_tell_file_func (voidpf opaque,voidpf stream)
DWORD dwMoveMethod=0xFFFFFFFF; {
HANDLE hFile = NULL; long ret=-1;
HANDLE hFile = NULL;
long ret=-1; if (stream!=NULL)
if (stream!=NULL) hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
hFile = ((WIN32FILE_IOWIN*)stream) -> hf; if (hFile != NULL)
switch (origin) {
{ DWORD dwSet = SetFilePointer(hFile, 0, NULL, FILE_CURRENT);
case ZLIB_FILEFUNC_SEEK_CUR : if (dwSet == INVALID_SET_FILE_POINTER)
dwMoveMethod = FILE_CURRENT; {
break; DWORD dwErr = GetLastError();
case ZLIB_FILEFUNC_SEEK_END : ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
dwMoveMethod = FILE_END; ret = -1;
break; }
case ZLIB_FILEFUNC_SEEK_SET : else
dwMoveMethod = FILE_BEGIN; ret=(long)dwSet;
break; }
default: return -1; return ret;
} }
if (hFile != NULL) ZPOS64_T ZCALLBACK win32_tell64_file_func (voidpf opaque, voidpf stream)
{ {
DWORD dwSet = SetFilePointer(hFile, offset, NULL, dwMoveMethod); ZPOS64_T ret= (ZPOS64_T)-1;
if (dwSet == INVALID_SET_FILE_POINTER) HANDLE hFile = NULL;
{ if (stream!=NULL)
DWORD dwErr = GetLastError(); hFile = ((WIN32FILE_IOWIN*)stream)->hf;
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
ret = -1; if (hFile)
} {
else LARGE_INTEGER li;
ret=0; li.QuadPart = 0;
} li.u.LowPart = SetFilePointer(hFile, li.u.LowPart, &li.u.HighPart, FILE_CURRENT);
return ret; if ( (li.LowPart == 0xFFFFFFFF) && (GetLastError() != NO_ERROR))
} {
DWORD dwErr = GetLastError();
int ZCALLBACK win32_close_file_func (opaque, stream) ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
voidpf opaque; ret = (ZPOS64_T)-1;
voidpf stream; }
{ else
int ret=-1; ret=li.QuadPart;
}
if (stream!=NULL) return ret;
{ }
HANDLE hFile;
hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
if (hFile != NULL) long ZCALLBACK win32_seek_file_func (voidpf opaque,voidpf stream,uLong offset,int origin)
{ {
CloseHandle(hFile); DWORD dwMoveMethod=0xFFFFFFFF;
ret=0; HANDLE hFile = NULL;
}
free(stream); long ret=-1;
} if (stream!=NULL)
return ret; hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
} switch (origin)
{
int ZCALLBACK win32_error_file_func (opaque, stream) case ZLIB_FILEFUNC_SEEK_CUR :
voidpf opaque; dwMoveMethod = FILE_CURRENT;
voidpf stream; break;
{ case ZLIB_FILEFUNC_SEEK_END :
int ret=-1; dwMoveMethod = FILE_END;
if (stream!=NULL) break;
{ case ZLIB_FILEFUNC_SEEK_SET :
ret = ((WIN32FILE_IOWIN*)stream) -> error; dwMoveMethod = FILE_BEGIN;
} break;
return ret; default: return -1;
} }
void fill_win32_filefunc (pzlib_filefunc_def) if (hFile != NULL)
zlib_filefunc_def* pzlib_filefunc_def; {
{ DWORD dwSet = SetFilePointer(hFile, offset, NULL, dwMoveMethod);
pzlib_filefunc_def->zopen_file = win32_open_file_func; if (dwSet == INVALID_SET_FILE_POINTER)
pzlib_filefunc_def->zread_file = win32_read_file_func; {
pzlib_filefunc_def->zwrite_file = win32_write_file_func; DWORD dwErr = GetLastError();
pzlib_filefunc_def->ztell_file = win32_tell_file_func; ((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
pzlib_filefunc_def->zseek_file = win32_seek_file_func; ret = -1;
pzlib_filefunc_def->zclose_file = win32_close_file_func; }
pzlib_filefunc_def->zerror_file = win32_error_file_func; else
pzlib_filefunc_def->opaque=NULL; ret=0;
} }
return ret;
}
long ZCALLBACK win32_seek64_file_func (voidpf opaque, voidpf stream,ZPOS64_T offset,int origin)
{
DWORD dwMoveMethod=0xFFFFFFFF;
HANDLE hFile = NULL;
long ret=-1;
if (stream!=NULL)
hFile = ((WIN32FILE_IOWIN*)stream)->hf;
switch (origin)
{
case ZLIB_FILEFUNC_SEEK_CUR :
dwMoveMethod = FILE_CURRENT;
break;
case ZLIB_FILEFUNC_SEEK_END :
dwMoveMethod = FILE_END;
break;
case ZLIB_FILEFUNC_SEEK_SET :
dwMoveMethod = FILE_BEGIN;
break;
default: return -1;
}
if (hFile)
{
LARGE_INTEGER* li = (LARGE_INTEGER*)&offset;
DWORD dwSet = SetFilePointer(hFile, li->u.LowPart, &li->u.HighPart, dwMoveMethod);
if (dwSet == INVALID_SET_FILE_POINTER)
{
DWORD dwErr = GetLastError();
((WIN32FILE_IOWIN*)stream) -> error=(int)dwErr;
ret = -1;
}
else
ret=0;
}
return ret;
}
int ZCALLBACK win32_close_file_func (voidpf opaque, voidpf stream)
{
int ret=-1;
if (stream!=NULL)
{
HANDLE hFile;
hFile = ((WIN32FILE_IOWIN*)stream) -> hf;
if (hFile != NULL)
{
CloseHandle(hFile);
ret=0;
}
free(stream);
}
return ret;
}
int ZCALLBACK win32_error_file_func (voidpf opaque,voidpf stream)
{
int ret=-1;
if (stream!=NULL)
{
ret = ((WIN32FILE_IOWIN*)stream) -> error;
}
return ret;
}
void fill_win32_filefunc (zlib_filefunc_def* pzlib_filefunc_def)
{
pzlib_filefunc_def->zopen_file = win32_open_file_func;
pzlib_filefunc_def->zread_file = win32_read_file_func;
pzlib_filefunc_def->zwrite_file = win32_write_file_func;
pzlib_filefunc_def->ztell_file = win32_tell_file_func;
pzlib_filefunc_def->zseek_file = win32_seek_file_func;
pzlib_filefunc_def->zclose_file = win32_close_file_func;
pzlib_filefunc_def->zerror_file = win32_error_file_func;
pzlib_filefunc_def->opaque = NULL;
}
void fill_win32_filefunc64(zlib_filefunc64_def* pzlib_filefunc_def)
{
pzlib_filefunc_def->zopen64_file = win32_open64_file_func;
pzlib_filefunc_def->zread_file = win32_read_file_func;
pzlib_filefunc_def->zwrite_file = win32_write_file_func;
pzlib_filefunc_def->ztell64_file = win32_tell64_file_func;
pzlib_filefunc_def->zseek64_file = win32_seek64_file_func;
pzlib_filefunc_def->zclose_file = win32_close_file_func;
pzlib_filefunc_def->zerror_file = win32_error_file_func;
pzlib_filefunc_def->opaque = NULL;
}
void fill_win32_filefunc64A(zlib_filefunc64_def* pzlib_filefunc_def)
{
pzlib_filefunc_def->zopen64_file = win32_open64_file_funcA;
pzlib_filefunc_def->zread_file = win32_read_file_func;
pzlib_filefunc_def->zwrite_file = win32_write_file_func;
pzlib_filefunc_def->ztell64_file = win32_tell64_file_func;
pzlib_filefunc_def->zseek64_file = win32_seek64_file_func;
pzlib_filefunc_def->zclose_file = win32_close_file_func;
pzlib_filefunc_def->zerror_file = win32_error_file_func;
pzlib_filefunc_def->opaque = NULL;
}
void fill_win32_filefunc64W(zlib_filefunc64_def* pzlib_filefunc_def)
{
pzlib_filefunc_def->zopen64_file = win32_open64_file_funcW;
pzlib_filefunc_def->zread_file = win32_read_file_func;
pzlib_filefunc_def->zwrite_file = win32_write_file_func;
pzlib_filefunc_def->ztell64_file = win32_tell64_file_func;
pzlib_filefunc_def->zseek64_file = win32_seek64_file_func;
pzlib_filefunc_def->zclose_file = win32_close_file_func;
pzlib_filefunc_def->zerror_file = win32_error_file_func;
pzlib_filefunc_def->opaque = NULL;
}

View File

@@ -1,21 +1,28 @@
/* 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, January 7th, 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 )
Copyright (C) 1998-2005 Gilles Vollant Modifications for Zip64 support
*/ Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
#include <windows.h> For more info read MiniZip_info.txt
*/
#ifdef __cplusplus
extern "C" { #include <windows.h>
#endif
void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); #ifdef __cplusplus
extern "C" {
#ifdef __cplusplus #endif
}
#endif 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
}
#endif

View File

@@ -0,0 +1,25 @@
$ 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 minizip64_info.txt
$ mcr []miniunz -l test.zip
$ rename minizip64_info.txt; minizip64_info.txt_old
$ mcr []miniunz test.zip
$ delete test.zip;*
$exit

File diff suppressed because it is too large Load Diff

View File

@@ -1,420 +1,508 @@
/* /*
minizip.c minizip.c
Version 1.01e, February 12th, 2005 Version 1.1, January 7th, 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 )
#include <stdio.h> Modifications of Unzip for Zip64
#include <stdlib.h> Copyright (C) 2007-2008 Even Rouault
#include <string.h>
#include <time.h> Modifications for Zip64 support on both zip and unzip
#include <errno.h> Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
#include <fcntl.h> */
#ifdef unix
# include <unistd.h> #ifndef _WIN32
# include <utime.h> #ifndef __USE_FILE_OFFSET64
# include <sys/types.h> #define __USE_FILE_OFFSET64
# include <sys/stat.h> #endif
#else #ifndef __USE_LARGEFILE64
# include <direct.h> #define __USE_LARGEFILE64
# include <io.h> #endif
#endif #ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#include "zip.h" #endif
#ifndef _FILE_OFFSET_BIT
#ifdef WIN32 #define _FILE_OFFSET_BIT 64
#define USEWIN32IOAPI #endif
#include "iowin32.h" #endif
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define WRITEBUFFERSIZE (16384) #include <time.h>
#define MAXFILENAME (256) #include <errno.h>
#include <fcntl.h>
#ifdef WIN32
uLong filetime(f, tmzip, dt) #ifdef unix
char *f; /* name of file to get info on */ # include <unistd.h>
tm_zip *tmzip; /* return value: access, modific. and creation times */ # include <utime.h>
uLong *dt; /* dostime */ # include <sys/types.h>
{ # include <sys/stat.h>
int ret = 0; #else
{ # include <direct.h>
FILETIME ftLocal; # include <io.h>
HANDLE hFind; #endif
WIN32_FIND_DATA ff32;
#include "zip.h"
hFind = FindFirstFile(f,&ff32);
if (hFind != INVALID_HANDLE_VALUE) #ifdef _WIN32
{ #define USEWIN32IOAPI
FileTimeToLocalFileTime(&(ff32.ftLastWriteTime),&ftLocal); #include "iowin32.h"
FileTimeToDosDateTime(&ftLocal,((LPWORD)dt)+1,((LPWORD)dt)+0); #endif
FindClose(hFind);
ret = 1;
}
} #define WRITEBUFFERSIZE (16384)
return ret; #define MAXFILENAME (256)
}
#else #ifdef _WIN32
#ifdef unix 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 */ uLong *dt; /* dostime */
uLong *dt; /* dostime */ {
{ int ret = 0;
int ret=0; {
struct stat s; /* results of stat() */ FILETIME ftLocal;
struct tm* filedate; HANDLE hFind;
time_t tm_t=0; WIN32_FIND_DATAA ff32;
if (strcmp(f,"-")!=0) hFind = FindFirstFileA(f,&ff32);
{ if (hFind != INVALID_HANDLE_VALUE)
char name[MAXFILENAME+1]; {
int len = strlen(f); FileTimeToLocalFileTime(&(ff32.ftLastWriteTime),&ftLocal);
if (len > MAXFILENAME) FileTimeToDosDateTime(&ftLocal,((LPWORD)dt)+1,((LPWORD)dt)+0);
len = MAXFILENAME; FindClose(hFind);
ret = 1;
strncpy(name, f,MAXFILENAME-1); }
/* strncpy doesnt append the trailing NULL, of the string is too long. */ }
name[ MAXFILENAME ] = '\0'; return ret;
}
if (name[len - 1] == '/') #else
name[len - 1] = '\0'; #ifdef unix
/* not all systems allow stat'ing a file with / appended */ uLong filetime(f, tmzip, dt)
if (stat(name,&s)==0) char *f; /* name of file to get info on */
{ tm_zip *tmzip; /* return value: access, modific. and creation times */
tm_t = s.st_mtime; uLong *dt; /* dostime */
ret = 1; {
} int ret=0;
} struct stat s; /* results of stat() */
filedate = localtime(&tm_t); struct tm* filedate;
time_t tm_t=0;
tmzip->tm_sec = filedate->tm_sec;
tmzip->tm_min = filedate->tm_min; if (strcmp(f,"-")!=0)
tmzip->tm_hour = filedate->tm_hour; {
tmzip->tm_mday = filedate->tm_mday; char name[MAXFILENAME+1];
tmzip->tm_mon = filedate->tm_mon ; int len = strlen(f);
tmzip->tm_year = filedate->tm_year; if (len > MAXFILENAME)
len = MAXFILENAME;
return ret;
} strncpy(name, f,MAXFILENAME-1);
#else /* strncpy doesnt append the trailing NULL, of the string is too long. */
uLong filetime(f, tmzip, dt) name[ MAXFILENAME ] = '\0';
char *f; /* name of file to get info on */
tm_zip *tmzip; /* return value: access, modific. and creation times */ if (name[len - 1] == '/')
uLong *dt; /* dostime */ name[len - 1] = '\0';
{ /* not all systems allow stat'ing a file with / appended */
return 0; if (stat(name,&s)==0)
} {
#endif tm_t = s.st_mtime;
#endif ret = 1;
}
}
filedate = localtime(&tm_t);
int check_exist_file(filename) tmzip->tm_sec = filedate->tm_sec;
const char* filename; tmzip->tm_min = filedate->tm_min;
{ tmzip->tm_hour = filedate->tm_hour;
FILE* ftestexist; tmzip->tm_mday = filedate->tm_mday;
int ret = 1; tmzip->tm_mon = filedate->tm_mon ;
ftestexist = fopen(filename,"rb"); tmzip->tm_year = filedate->tm_year;
if (ftestexist==NULL)
ret = 0; return ret;
else }
fclose(ftestexist); #else
return ret; uLong filetime(f, tmzip, dt)
} char *f; /* name of file to get info on */
tm_zip *tmzip; /* return value: access, modific. and creation times */
void do_banner() uLong *dt; /* dostime */
{ {
printf("MiniZip 1.01b, demo of zLib + Zip package written by Gilles Vollant\n"); return 0;
printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n"); }
} #endif
#endif
void do_help()
{
printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] file.zip [files_to_add]\n\n" \
" -o Overwrite existing file.zip\n" \
" -a Append to existing file.zip\n" \ int check_exist_file(filename)
" -0 Store only\n" \ const char* filename;
" -1 Compress faster\n" \ {
" -9 Compress better\n\n"); FILE* ftestexist;
} int ret = 1;
ftestexist = fopen64(filename,"rb");
/* calculate the CRC32 of a file, if (ftestexist==NULL)
because to encrypt a file, we need known the CRC32 of the file before */ ret = 0;
int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigned long* result_crc) else
{ fclose(ftestexist);
unsigned long calculate_crc=0; return ret;
int err=ZIP_OK; }
FILE * fin = fopen(filenameinzip,"rb");
unsigned long size_read = 0; void do_banner()
unsigned long total_read = 0; {
if (fin==NULL) printf("MiniZip64 1.0, demo of zLib + MiniZip64 package, written by Gilles Vollant\n");
{ printf("more info on MiniZip at http://www.winimage.com/zLibDll/minizip.html\n\n");
err = ZIP_ERRNO; printf("more info on MiniZip64 at http://result42.com/projects/MiniZip64\n\n");
} }
if (err == ZIP_OK) void do_help()
do {
{ printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] [-j] file.zip [files_to_add]\n\n" \
err = ZIP_OK; " -o Overwrite existing file.zip\n" \
size_read = (int)fread(buf,1,size_buf,fin); " -a Append to existing file.zip\n" \
if (size_read < size_buf) " -0 Store only\n" \
if (feof(fin)==0) " -1 Compress faster\n" \
{ " -9 Compress better\n\n" \
printf("error in reading %s\n",filenameinzip); " -j exclude path. store only the file name.\n\n");
err = ZIP_ERRNO; }
}
/* calculate the CRC32 of a file,
if (size_read>0) because to encrypt a file, we need known the CRC32 of the file before */
calculate_crc = crc32(calculate_crc,buf,size_read); int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigned long* result_crc)
total_read += size_read; {
unsigned long calculate_crc=0;
} while ((err == ZIP_OK) && (size_read>0)); int err=ZIP_OK;
FILE * fin = fopen64(filenameinzip,"rb");
if (fin) unsigned long size_read = 0;
fclose(fin); unsigned long total_read = 0;
if (fin==NULL)
*result_crc=calculate_crc; {
printf("file %s crc %x\n",filenameinzip,calculate_crc); err = ZIP_ERRNO;
return err; }
}
if (err == ZIP_OK)
int main(argc,argv) do
int argc; {
char *argv[]; err = ZIP_OK;
{ size_read = (int)fread(buf,1,size_buf,fin);
int i; if (size_read < size_buf)
int opt_overwrite=0; if (feof(fin)==0)
int opt_compress_level=Z_DEFAULT_COMPRESSION; {
int zipfilenamearg = 0; printf("error in reading %s\n",filenameinzip);
char filename_try[MAXFILENAME+16]; err = ZIP_ERRNO;
int zipok; }
int err=0;
int size_buf=0; if (size_read>0)
void* buf=NULL; calculate_crc = crc32(calculate_crc,buf,size_read);
const char* password=NULL; total_read += size_read;
} while ((err == ZIP_OK) && (size_read>0));
do_banner();
if (argc==1) if (fin)
{ fclose(fin);
do_help();
return 0; *result_crc=calculate_crc;
} printf("file %s crc %lx\n", filenameinzip, calculate_crc);
else return err;
{ }
for (i=1;i<argc;i++)
{ int isLargeFile(const char* filename)
if ((*argv[i])=='-') {
{ int largeFile = 0;
const char *p=argv[i]+1; ZPOS64_T pos = 0;
FILE* pFile = fopen64(filename, "rb");
while ((*p)!='\0')
{ if(pFile != NULL)
char c=*(p++);; {
if ((c=='o') || (c=='O')) int n = fseeko64(pFile, 0, SEEK_END);
opt_overwrite = 1;
if ((c=='a') || (c=='A')) pos = ftello64(pFile);
opt_overwrite = 2;
if ((c>='0') && (c<='9')) printf("File : %s is %lld bytes\n", filename, pos);
opt_compress_level = c-'0';
if(pos >= 0xffffffff)
if (((c=='p') || (c=='P')) && (i+1<argc)) largeFile = 1;
{
password=argv[i+1]; fclose(pFile);
i++; }
}
} return largeFile;
} }
else
if (zipfilenamearg == 0) int main(argc,argv)
zipfilenamearg = i ; int argc;
} char *argv[];
} {
int i;
size_buf = WRITEBUFFERSIZE; int opt_overwrite=0;
buf = (void*)malloc(size_buf); int opt_compress_level=Z_DEFAULT_COMPRESSION;
if (buf==NULL) int opt_exclude_path=0;
{ int zipfilenamearg = 0;
printf("Error allocating memory\n"); char filename_try[MAXFILENAME+16];
return ZIP_INTERNALERROR; int zipok;
} int err=0;
int size_buf=0;
if (zipfilenamearg==0) void* buf=NULL;
zipok=0; const char* password=NULL;
else
{
int i,len; do_banner();
int dot_found=0; if (argc==1)
{
zipok = 1 ; do_help();
strncpy(filename_try, argv[zipfilenamearg],MAXFILENAME-1); return 0;
/* strncpy doesnt append the trailing NULL, of the string is too long. */ }
filename_try[ MAXFILENAME ] = '\0'; else
{
len=(int)strlen(filename_try); for (i=1;i<argc;i++)
for (i=0;i<len;i++) {
if (filename_try[i]=='.') if ((*argv[i])=='-')
dot_found=1; {
const char *p=argv[i]+1;
if (dot_found==0)
strcat(filename_try,".zip"); while ((*p)!='\0')
{
if (opt_overwrite==2) char c=*(p++);;
{ if ((c=='o') || (c=='O'))
/* if the file don't exist, we not append file */ opt_overwrite = 1;
if (check_exist_file(filename_try)==0) if ((c=='a') || (c=='A'))
opt_overwrite=1; opt_overwrite = 2;
} if ((c>='0') && (c<='9'))
else opt_compress_level = c-'0';
if (opt_overwrite==0) if ((c=='j') || (c=='J'))
if (check_exist_file(filename_try)!=0) opt_exclude_path = 1;
{
char rep=0; if (((c=='p') || (c=='P')) && (i+1<argc))
do {
{ password=argv[i+1];
char answer[128]; i++;
int ret; }
printf("The file %s exists. Overwrite ? [y]es, [n]o, [a]ppend : ",filename_try); }
ret = scanf("%1s",answer); }
if (ret != 1) else
{ {
exit(EXIT_FAILURE); if (zipfilenamearg == 0)
} {
rep = answer[0] ; zipfilenamearg = i ;
if ((rep>='a') && (rep<='z')) }
rep -= 0x20; }
} }
while ((rep!='Y') && (rep!='N') && (rep!='A')); }
if (rep=='N')
zipok = 0; size_buf = WRITEBUFFERSIZE;
if (rep=='A') buf = (void*)malloc(size_buf);
opt_overwrite = 2; if (buf==NULL)
} {
} printf("Error allocating memory\n");
return ZIP_INTERNALERROR;
if (zipok==1) }
{
zipFile zf; if (zipfilenamearg==0)
int errclose; {
# ifdef USEWIN32IOAPI zipok=0;
zlib_filefunc_def ffunc; }
fill_win32_filefunc(&ffunc); else
zf = zipOpen2(filename_try,(opt_overwrite==2) ? 2 : 0,NULL,&ffunc); {
# else int i,len;
zf = zipOpen(filename_try,(opt_overwrite==2) ? 2 : 0); int dot_found=0;
# endif
zipok = 1 ;
if (zf == NULL) strncpy(filename_try, argv[zipfilenamearg],MAXFILENAME-1);
{ /* strncpy doesnt append the trailing NULL, of the string is too long. */
printf("error opening %s\n",filename_try); filename_try[ MAXFILENAME ] = '\0';
err= ZIP_ERRNO;
} len=(int)strlen(filename_try);
else for (i=0;i<len;i++)
printf("creating %s\n",filename_try); if (filename_try[i]=='.')
dot_found=1;
for (i=zipfilenamearg+1;(i<argc) && (err==ZIP_OK);i++)
{ if (dot_found==0)
if (!((((*(argv[i]))=='-') || ((*(argv[i]))=='/')) && strcat(filename_try,".zip");
((argv[i][1]=='o') || (argv[i][1]=='O') ||
(argv[i][1]=='a') || (argv[i][1]=='A') || if (opt_overwrite==2)
(argv[i][1]=='p') || (argv[i][1]=='P') || {
((argv[i][1]>='0') || (argv[i][1]<='9'))) && /* if the file don't exist, we not append file */
(strlen(argv[i]) == 2))) if (check_exist_file(filename_try)==0)
{ opt_overwrite=1;
FILE * fin; }
int size_read; else
const char* filenameinzip = argv[i]; if (opt_overwrite==0)
zip_fileinfo zi; if (check_exist_file(filename_try)!=0)
unsigned long crcFile=0; {
char rep=0;
zi.tmz_date.tm_sec = zi.tmz_date.tm_min = zi.tmz_date.tm_hour = do
zi.tmz_date.tm_mday = zi.tmz_date.tm_mon = zi.tmz_date.tm_year = 0; {
zi.dosDate = 0; char answer[128];
zi.internal_fa = 0; int ret;
zi.external_fa = 0; printf("The file %s exists. Overwrite ? [y]es, [n]o, [a]ppend : ",filename_try);
filetime(filenameinzip,&zi.tmz_date,&zi.dosDate); ret = scanf("%1s",answer);
if (ret != 1)
/* {
err = zipOpenNewFileInZip(zf,filenameinzip,&zi, exit(EXIT_FAILURE);
NULL,0,NULL,0,NULL / * comment * /, }
(opt_compress_level != 0) ? Z_DEFLATED : 0, rep = answer[0] ;
opt_compress_level); if ((rep>='a') && (rep<='z'))
*/ rep -= 0x20;
if ((password != NULL) && (err==ZIP_OK)) }
err = getFileCrc(filenameinzip,buf,size_buf,&crcFile); while ((rep!='Y') && (rep!='N') && (rep!='A'));
if (rep=='N')
err = zipOpenNewFileInZip3(zf,filenameinzip,&zi, zipok = 0;
NULL,0,NULL,0,NULL /* comment*/, if (rep=='A')
(opt_compress_level != 0) ? Z_DEFLATED : 0, opt_overwrite = 2;
opt_compress_level,0, }
/* -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, */ }
-MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
password,crcFile); if (zipok==1)
{
if (err != ZIP_OK) zipFile zf;
printf("error in opening %s in zipfile\n",filenameinzip); int errclose;
else # ifdef USEWIN32IOAPI
{ zlib_filefunc64_def ffunc;
fin = fopen(filenameinzip,"rb"); fill_win32_filefunc64A(&ffunc);
if (fin==NULL) zf = zipOpen2_64(filename_try,(opt_overwrite==2) ? 2 : 0,NULL,&ffunc);
{ # else
err=ZIP_ERRNO; zf = zipOpen64(filename_try,(opt_overwrite==2) ? 2 : 0);
printf("error in opening %s for reading\n",filenameinzip); # endif
}
} if (zf == NULL)
{
if (err == ZIP_OK) printf("error opening %s\n",filename_try);
do err= ZIP_ERRNO;
{ }
err = ZIP_OK; else
size_read = (int)fread(buf,1,size_buf,fin); printf("creating %s\n",filename_try);
if (size_read < size_buf)
if (feof(fin)==0) for (i=zipfilenamearg+1;(i<argc) && (err==ZIP_OK);i++)
{ {
printf("error in reading %s\n",filenameinzip); if (!((((*(argv[i]))=='-') || ((*(argv[i]))=='/')) &&
err = ZIP_ERRNO; ((argv[i][1]=='o') || (argv[i][1]=='O') ||
} (argv[i][1]=='a') || (argv[i][1]=='A') ||
(argv[i][1]=='p') || (argv[i][1]=='P') ||
if (size_read>0) ((argv[i][1]>='0') || (argv[i][1]<='9'))) &&
{ (strlen(argv[i]) == 2)))
err = zipWriteInFileInZip (zf,buf,size_read); {
if (err<0) FILE * fin;
{ int size_read;
printf("error in writing %s in the zipfile\n", const char* filenameinzip = argv[i];
filenameinzip); const char *savefilenameinzip;
} zip_fileinfo zi;
unsigned long crcFile=0;
} int zip64 = 0;
} while ((err == ZIP_OK) && (size_read>0));
zi.tmz_date.tm_sec = zi.tmz_date.tm_min = zi.tmz_date.tm_hour =
if (fin) zi.tmz_date.tm_mday = zi.tmz_date.tm_mon = zi.tmz_date.tm_year = 0;
fclose(fin); zi.dosDate = 0;
zi.internal_fa = 0;
if (err<0) zi.external_fa = 0;
err=ZIP_ERRNO; filetime(filenameinzip,&zi.tmz_date,&zi.dosDate);
else
{ /*
err = zipCloseFileInZip(zf); err = zipOpenNewFileInZip(zf,filenameinzip,&zi,
if (err!=ZIP_OK) NULL,0,NULL,0,NULL / * comment * /,
printf("error in closing %s in the zipfile\n", (opt_compress_level != 0) ? Z_DEFLATED : 0,
filenameinzip); opt_compress_level);
} */
} if ((password != NULL) && (err==ZIP_OK))
} err = getFileCrc(filenameinzip,buf,size_buf,&crcFile);
errclose = zipClose(zf,NULL);
if (errclose != ZIP_OK) zip64 = isLargeFile(filenameinzip);
printf("error in closing %s\n",filename_try);
} /* The path name saved, should not include a leading slash. */
else /*if it did, windows/xp and dynazip couldn't read the zip file. */
{ savefilenameinzip = filenameinzip;
do_help(); while( savefilenameinzip[0] == '\\' || savefilenameinzip[0] == '/' )
} {
savefilenameinzip++;
free(buf); }
return 0;
} /*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*/,
(opt_compress_level != 0) ? Z_DEFLATED : 0,
opt_compress_level,0,
/* -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, */
-MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY,
password,crcFile, zip64);
if (err != ZIP_OK)
printf("error in opening %s in zipfile\n",filenameinzip);
else
{
fin = fopen64(filenameinzip,"rb");
if (fin==NULL)
{
err=ZIP_ERRNO;
printf("error in opening %s for reading\n",filenameinzip);
}
}
if (err == ZIP_OK)
do
{
err = ZIP_OK;
size_read = (int)fread(buf,1,size_buf,fin);
if (size_read < size_buf)
if (feof(fin)==0)
{
printf("error in reading %s\n",filenameinzip);
err = ZIP_ERRNO;
}
if (size_read>0)
{
err = zipWriteInFileInZip (zf,buf,size_read);
if (err<0)
{
printf("error in writing %s in the zipfile\n",
filenameinzip);
}
}
} while ((err == ZIP_OK) && (size_read>0));
if (fin)
fclose(fin);
if (err<0)
err=ZIP_ERRNO;
else
{
err = zipCloseFileInZip(zf);
if (err!=ZIP_OK)
printf("error in closing %s in the zipfile\n",
filenameinzip);
}
}
}
errclose = zipClose(zf,NULL);
if (errclose != ZIP_OK)
printf("error in closing %s\n",filename_try);
}
else
{
do_help();
}
free(buf);
return 0;
}

View File

@@ -1,281 +1,281 @@
/* /*
Additional tools for Minizip Additional tools for Minizip
Code: Xavier Roche '2004 Code: Xavier Roche '2004
License: Same as ZLIB (www.gzip.org) License: Same as ZLIB (www.gzip.org)
*/ */
/* Code */ /* Code */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "zlib.h" #include "zlib.h"
#include "unzip.h" #include "unzip.h"
#define READ_8(adr) ((unsigned char)*(adr)) #define READ_8(adr) ((unsigned char)*(adr))
#define READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) ) #define READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) )
#define READ_32(adr) ( READ_16(adr) | (READ_16((adr)+2) << 16) ) #define READ_32(adr) ( READ_16(adr) | (READ_16((adr)+2) << 16) )
#define WRITE_8(buff, n) do { \ #define WRITE_8(buff, n) do { \
*((unsigned char*)(buff)) = (unsigned char) ((n) & 0xff); \ *((unsigned char*)(buff)) = (unsigned char) ((n) & 0xff); \
} while(0) } while(0)
#define WRITE_16(buff, n) do { \ #define WRITE_16(buff, n) do { \
WRITE_8((unsigned char*)(buff), n); \ WRITE_8((unsigned char*)(buff), n); \
WRITE_8(((unsigned char*)(buff)) + 1, (n) >> 8); \ WRITE_8(((unsigned char*)(buff)) + 1, (n) >> 8); \
} while(0) } while(0)
#define WRITE_32(buff, n) do { \ #define WRITE_32(buff, n) do { \
WRITE_16((unsigned char*)(buff), (n) & 0xffff); \ WRITE_16((unsigned char*)(buff), (n) & 0xffff); \
WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \ WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \
} while(0) } while(0)
extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered) extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered)
const char* file; const char* file;
const char* fileOut; const char* fileOut;
const char* fileOutTmp; const char* fileOutTmp;
uLong* nRecovered; uLong* nRecovered;
uLong* bytesRecovered; uLong* bytesRecovered;
{ {
int err = Z_OK; int err = Z_OK;
FILE* fpZip = fopen(file, "rb"); FILE* fpZip = fopen(file, "rb");
FILE* fpOut = fopen(fileOut, "wb"); FILE* fpOut = fopen(fileOut, "wb");
FILE* fpOutCD = fopen(fileOutTmp, "wb"); FILE* fpOutCD = fopen(fileOutTmp, "wb");
if (fpZip != NULL && fpOut != NULL) { if (fpZip != NULL && fpOut != NULL) {
int entries = 0; int entries = 0;
uLong totalBytes = 0; uLong totalBytes = 0;
char header[30]; char header[30];
char filename[256]; char filename[256];
char extra[1024]; char extra[1024];
int offset = 0; int offset = 0;
int offsetCD = 0; int offsetCD = 0;
while ( fread(header, 1, 30, fpZip) == 30 ) { while ( fread(header, 1, 30, fpZip) == 30 ) {
int currentOffset = offset; int currentOffset = offset;
/* File entry */ /* File entry */
if (READ_32(header) == 0x04034b50) { if (READ_32(header) == 0x04034b50) {
unsigned int version = READ_16(header + 4); unsigned int version = READ_16(header + 4);
unsigned int gpflag = READ_16(header + 6); unsigned int gpflag = READ_16(header + 6);
unsigned int method = READ_16(header + 8); unsigned int method = READ_16(header + 8);
unsigned int filetime = READ_16(header + 10); unsigned int filetime = READ_16(header + 10);
unsigned int filedate = READ_16(header + 12); unsigned int filedate = READ_16(header + 12);
unsigned int crc = READ_32(header + 14); /* crc */ unsigned int crc = READ_32(header + 14); /* crc */
unsigned int cpsize = READ_32(header + 18); /* compressed size */ unsigned int cpsize = READ_32(header + 18); /* compressed size */
unsigned int uncpsize = READ_32(header + 22); /* uncompressed sz */ unsigned int uncpsize = READ_32(header + 22); /* uncompressed sz */
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;
} else { } else {
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) {
if (fwrite(filename, 1, fnsize, fpOut) == fnsize) { if (fwrite(filename, 1, fnsize, fpOut) == fnsize) {
offset += fnsize; offset += fnsize;
} else { } else {
err = Z_ERRNO; err = Z_ERRNO;
break; break;
} }
} else { } else {
err = Z_ERRNO; err = Z_ERRNO;
break; break;
} }
} else { } else {
err = Z_STREAM_ERROR; err = Z_STREAM_ERROR;
break; break;
} }
/* Extra field */ /* Extra field */
if (extsize > 0) { if (extsize > 0) {
if (fread(extra, 1, extsize, fpZip) == extsize) { if (fread(extra, 1, extsize, fpZip) == extsize) {
if (fwrite(extra, 1, extsize, fpOut) == extsize) { if (fwrite(extra, 1, extsize, fpOut) == extsize) {
offset += extsize; offset += extsize;
} else { } else {
err = Z_ERRNO; err = Z_ERRNO;
break; break;
} }
} else { } else {
err = Z_ERRNO; err = Z_ERRNO;
break; break;
} }
} }
/* Data */ /* Data */
{ {
int dataSize = cpsize; int dataSize = cpsize;
if (dataSize == 0) { if (dataSize == 0) {
dataSize = uncpsize; dataSize = uncpsize;
} }
if (dataSize > 0) { if (dataSize > 0) {
char* data = malloc(dataSize); char* data = malloc(dataSize);
if (data != NULL) { if (data != NULL) {
if ((int)fread(data, 1, dataSize, fpZip) == dataSize) { if ((int)fread(data, 1, dataSize, fpZip) == dataSize) {
if ((int)fwrite(data, 1, dataSize, fpOut) == dataSize) { if ((int)fwrite(data, 1, dataSize, fpOut) == dataSize) {
offset += dataSize; offset += dataSize;
totalBytes += dataSize; totalBytes += dataSize;
} else { } else {
err = Z_ERRNO; err = Z_ERRNO;
} }
} else { } else {
err = Z_ERRNO; err = Z_ERRNO;
} }
free(data); free(data);
if (err != Z_OK) { if (err != Z_OK) {
break; break;
} }
} else { } else {
err = Z_MEM_ERROR; err = Z_MEM_ERROR;
break; break;
} }
} }
} }
/* Central directory entry */ /* Central directory entry */
{ {
char header[46]; char header[46];
char* comment = ""; char* comment = "";
int comsize = (int) strlen(comment); int comsize = (int) strlen(comment);
WRITE_32(header, 0x02014b50); WRITE_32(header, 0x02014b50);
WRITE_16(header + 4, version); WRITE_16(header + 4, version);
WRITE_16(header + 6, version); WRITE_16(header + 6, version);
WRITE_16(header + 8, gpflag); WRITE_16(header + 8, gpflag);
WRITE_16(header + 10, method); WRITE_16(header + 10, method);
WRITE_16(header + 12, filetime); WRITE_16(header + 12, filetime);
WRITE_16(header + 14, filedate); WRITE_16(header + 14, filedate);
WRITE_32(header + 16, crc); WRITE_32(header + 16, crc);
WRITE_32(header + 20, cpsize); WRITE_32(header + 20, cpsize);
WRITE_32(header + 24, uncpsize); WRITE_32(header + 24, uncpsize);
WRITE_16(header + 28, fnsize); WRITE_16(header + 28, fnsize);
WRITE_16(header + 30, extsize); WRITE_16(header + 30, extsize);
WRITE_16(header + 32, comsize); WRITE_16(header + 32, comsize);
WRITE_16(header + 34, 0); /* disk # */ WRITE_16(header + 34, 0); /* disk # */
WRITE_16(header + 36, 0); /* int attrb */ WRITE_16(header + 36, 0); /* int attrb */
WRITE_32(header + 38, 0); /* ext attrb */ WRITE_32(header + 38, 0); /* ext attrb */
WRITE_32(header + 42, currentOffset); WRITE_32(header + 42, currentOffset);
/* 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) {
offsetCD += fnsize; offsetCD += fnsize;
} else { } else {
err = Z_ERRNO; err = Z_ERRNO;
break; break;
} }
} else { } else {
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) {
offsetCD += extsize; offsetCD += extsize;
} else { } else {
err = Z_ERRNO; err = Z_ERRNO;
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) {
offsetCD += comsize; offsetCD += comsize;
} else { } else {
err = Z_ERRNO; err = Z_ERRNO;
break; break;
} }
} }
} else { } else {
err = Z_ERRNO; err = Z_ERRNO;
break; break;
} }
} }
/* Success */ /* Success */
entries++; entries++;
} else { } else {
break; break;
} }
} }
/* Final central directory */ /* Final central directory */
{ {
int entriesZip = entries; int entriesZip = entries;
char header[22]; char header[22];
char* comment = ""; // "ZIP File recovered by zlib/minizip/mztools"; char* comment = ""; // "ZIP File recovered by zlib/minizip/mztools";
int comsize = (int) strlen(comment); int comsize = (int) strlen(comment);
if (entriesZip > 0xffff) { if (entriesZip > 0xffff) {
entriesZip = 0xffff; entriesZip = 0xffff;
} }
WRITE_32(header, 0x06054b50); WRITE_32(header, 0x06054b50);
WRITE_16(header + 4, 0); /* disk # */ WRITE_16(header + 4, 0); /* disk # */
WRITE_16(header + 6, 0); /* disk # */ WRITE_16(header + 6, 0); /* disk # */
WRITE_16(header + 8, entriesZip); /* hack */ WRITE_16(header + 8, entriesZip); /* hack */
WRITE_16(header + 10, entriesZip); /* hack */ WRITE_16(header + 10, entriesZip); /* hack */
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;
} }
} }
/* Final merge (file + central directory) */ /* Final merge (file + central directory) */
fclose(fpOutCD); fclose(fpOutCD);
if (err == Z_OK) { if (err == Z_OK) {
fpOutCD = fopen(fileOutTmp, "rb"); fpOutCD = fopen(fileOutTmp, "rb");
if (fpOutCD != NULL) { if (fpOutCD != NULL) {
int nRead; int nRead;
char buffer[8192]; char buffer[8192];
while ( (nRead = (int)fread(buffer, 1, sizeof(buffer), fpOutCD)) > 0) { while ( (nRead = (int)fread(buffer, 1, sizeof(buffer), fpOutCD)) > 0) {
if ((int)fwrite(buffer, 1, nRead, fpOut) != nRead) { if ((int)fwrite(buffer, 1, nRead, fpOut) != nRead) {
err = Z_ERRNO; err = Z_ERRNO;
break; break;
} }
} }
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) {
*nRecovered = entries; *nRecovered = entries;
} }
if (bytesRecovered != NULL) { if (bytesRecovered != NULL) {
*bytesRecovered = totalBytes; *bytesRecovered = totalBytes;
} }
} }
} else { } else {
err = Z_STREAM_ERROR; err = Z_STREAM_ERROR;
} }
return err; return err;
} }

View File

@@ -1,31 +1,31 @@
/* /*
Additional tools for Minizip Additional tools for Minizip
Code: Xavier Roche '2004 Code: Xavier Roche '2004
License: Same as ZLIB (www.gzip.org) License: Same as ZLIB (www.gzip.org)
*/ */
#ifndef _zip_tools_H #ifndef _zip_tools_H
#define _zip_tools_H #define _zip_tools_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef _ZLIB_H #ifndef _ZLIB_H
#include "zlib.h" #include "zlib.h"
#endif #endif
#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);
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,354 +1,437 @@
/* 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, January 7th, 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
WinZip, InfoZip tools and compatible. Modifications of Unzip for Zip64
Copyright (C) 2007-2008 Even Rouault
Multi volume ZipFile (span) are not supported.
Encryption compatible with pkzip 2.04g only supported Modifications for Zip64 support on both zip and unzip
Old compressions used by old PKZip 1.x are not supported Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
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
arising from the use of this software. arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions: freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not 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 claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be in a product, an acknowledgment in the product documentation would be
appreciated but is not required. appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be 2. Altered source versions must be plainly marked as such, and must not be
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
/* for more info about .ZIP format, see
http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip See header of unzip64.c
http://www.info-zip.org/pub/infozip/doc/
PkWare has also a specification at : */
ftp://ftp.pkware.com/probdesc.zip
*/ #ifndef _unz64_H
#define _unz64_H
#ifndef _unz_H
#define _unz_H #ifdef __cplusplus
extern "C" {
#ifdef __cplusplus #endif
extern "C" {
#endif #ifndef _ZLIB_H
#include "zlib.h"
#ifndef _ZLIB_H #endif
#include "zlib.h"
#endif #ifndef _ZLIBIOAPI_H
#include "ioapi.h"
#ifndef _ZLIBIOAPI_H #endif
#include "ioapi.h"
#endif #ifdef HAVE_BZIP2
#include "bzlib.h"
#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) #endif
/* like the STRICT of WIN32, we define a pointer that cannot be converted
from (void*) without cast */ #define Z_BZIP2ED 12
typedef struct TagunzFile__ { int unused; } unzFile__;
typedef unzFile__ *unzFile; #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
#else /* like the STRICT of WIN32, we define a pointer that cannot be converted
typedef voidp unzFile; from (void*) without cast */
#endif typedef struct TagunzFile__ { int unused; } unzFile__;
typedef unzFile__ *unzFile;
#else
#define UNZ_OK (0) typedef voidp unzFile;
#define UNZ_END_OF_LIST_OF_FILE (-100) #endif
#define UNZ_ERRNO (Z_ERRNO)
#define UNZ_EOF (0)
#define UNZ_PARAMERROR (-102) #define UNZ_OK (0)
#define UNZ_BADZIPFILE (-103) #define UNZ_END_OF_LIST_OF_FILE (-100)
#define UNZ_INTERNALERROR (-104) #define UNZ_ERRNO (Z_ERRNO)
#define UNZ_CRCERROR (-105) #define UNZ_EOF (0)
#define UNZ_PARAMERROR (-102)
/* tm_unz contain date/time info */ #define UNZ_BADZIPFILE (-103)
typedef struct tm_unz_s #define UNZ_INTERNALERROR (-104)
{ #define UNZ_CRCERROR (-105)
uInt tm_sec; /* seconds after the minute - [0,59] */
uInt tm_min; /* minutes after the hour - [0,59] */ /* tm_unz contain date/time info */
uInt tm_hour; /* hours since midnight - [0,23] */ typedef struct tm_unz_s
uInt tm_mday; /* day of the month - [1,31] */ {
uInt tm_mon; /* months since January - [0,11] */ uInt tm_sec; /* seconds after the minute - [0,59] */
uInt tm_year; /* years - [1980..2044] */ uInt tm_min; /* minutes after the hour - [0,59] */
} tm_unz; uInt tm_hour; /* hours since midnight - [0,23] */
uInt tm_mday; /* day of the month - [1,31] */
/* unz_global_info structure contain global data about the ZIPfile uInt tm_mon; /* months since January - [0,11] */
These data comes from the end of central dir */ uInt tm_year; /* years - [1980..2044] */
typedef struct unz_global_info_s } tm_unz;
{
uLong number_entry; /* total number of entries in /* unz_global_info structure contain global data about the ZIPfile
the central dir on this disk */ These data comes from the end of central dir */
uLong size_comment; /* size of the global comment of the zipfile */ typedef struct unz_global_info64_s
} unz_global_info; {
ZPOS64_T number_entry; /* total number of entries in
the central dir on this disk */
/* unz_file_info contain information about a file in the zipfile */ uLong size_comment; /* size of the global comment of the zipfile */
typedef struct unz_file_info_s } unz_global_info64;
{
uLong version; /* version made by 2 bytes */ typedef struct unz_global_info_s
uLong version_needed; /* version needed to extract 2 bytes */ {
uLong flag; /* general purpose bit flag 2 bytes */ uLong number_entry; /* total number of entries in
uLong compression_method; /* compression method 2 bytes */ the central dir on this disk */
uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ uLong size_comment; /* size of the global comment of the zipfile */
uLong crc; /* crc-32 4 bytes */ } unz_global_info;
uLong compressed_size; /* compressed size 4 bytes */
uLong uncompressed_size; /* uncompressed size 4 bytes */ /* unz_file_info contain information about a file in the zipfile */
uLong size_filename; /* filename length 2 bytes */ typedef struct unz_file_info64_s
uLong size_file_extra; /* extra field length 2 bytes */ {
uLong size_file_comment; /* file comment length 2 bytes */ uLong version; /* version made by 2 bytes */
uLong version_needed; /* version needed to extract 2 bytes */
uLong disk_num_start; /* disk number start 2 bytes */ uLong flag; /* general purpose bit flag 2 bytes */
uLong internal_fa; /* internal file attributes 2 bytes */ uLong compression_method; /* compression method 2 bytes */
uLong external_fa; /* external file attributes 4 bytes */ uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
uLong crc; /* crc-32 4 bytes */
tm_unz tmu_date; ZPOS64_T compressed_size; /* compressed size 8 bytes */
} unz_file_info; ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */
uLong size_filename; /* filename length 2 bytes */
extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, uLong size_file_extra; /* extra field length 2 bytes */
const char* fileName2, uLong size_file_comment; /* file comment length 2 bytes */
int iCaseSensitivity));
/* uLong disk_num_start; /* disk number start 2 bytes */
Compare two filename (fileName1,fileName2). uLong internal_fa; /* internal file attributes 2 bytes */
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) uLong external_fa; /* external file attributes 4 bytes */
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
or strcasecmp) tm_unz tmu_date;
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system } unz_file_info64;
(like 1 on Unix, 2 on Windows)
*/ typedef struct unz_file_info_s
{
uLong version; /* version made by 2 bytes */
extern unzFile ZEXPORT unzOpen OF((const char *path)); uLong version_needed; /* version needed to extract 2 bytes */
/* uLong flag; /* general purpose bit flag 2 bytes */
Open a Zip file. path contain the full pathname (by example, uLong compression_method; /* compression method 2 bytes */
on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
"zlib/zlib113.zip". uLong crc; /* crc-32 4 bytes */
If the zipfile cannot be opened (file don't exist or in not valid), the uLong compressed_size; /* compressed size 4 bytes */
return value is NULL. uLong uncompressed_size; /* uncompressed size 4 bytes */
Else, the return value is a unzFile Handle, usable with other function uLong size_filename; /* filename length 2 bytes */
of this unzip package. uLong size_file_extra; /* extra field length 2 bytes */
*/ uLong size_file_comment; /* file comment length 2 bytes */
extern unzFile ZEXPORT unzOpen2 OF((const char *path, uLong disk_num_start; /* disk number start 2 bytes */
zlib_filefunc_def* pzlib_filefunc_def)); uLong internal_fa; /* internal file attributes 2 bytes */
/* uLong external_fa; /* external file attributes 4 bytes */
Open a Zip file, like unzOpen, but provide a set of file low level API
for read/write the zip file (see ioapi.h) tm_unz tmu_date;
*/ } unz_file_info;
extern int ZEXPORT unzClose OF((unzFile file)); extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
/* const char* fileName2,
Close a ZipFile opened with unzipOpen. int iCaseSensitivity));
If there is files inside the .Zip opened with unzOpenCurrentFile (see later), /*
these files MUST be closed with unzipCloseCurrentFile before call unzipClose. Compare two filename (fileName1,fileName2).
return UNZ_OK if there is no problem. */ If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, or strcasecmp)
unz_global_info *pglobal_info)); If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
/* (like 1 on Unix, 2 on Windows)
Write info about the ZipFile in the *pglobal_info structure. */
No preparation of the structure is needed
return UNZ_OK if there is no problem. */
extern unzFile ZEXPORT unzOpen OF((const char *path));
extern unzFile ZEXPORT unzOpen64 OF((const void *path));
extern int ZEXPORT unzGetGlobalComment OF((unzFile file, /*
char *szComment, Open a Zip file. path contain the full pathname (by example,
uLong uSizeBuf)); on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer
/* "zlib/zlib113.zip".
Get the global comment string of the ZipFile, in the szComment buffer. If the zipfile cannot be opened (file don't exist or in not valid), the
uSizeBuf is the size of the szComment buffer. return value is NULL.
return the number of byte copied or an error code <0 Else, the return value is a unzFile Handle, usable with other function
*/ 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
/* Unzip package allow you browse the directory of the zipfile */ is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char*
does not describe the reality
extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); */
/*
Set the current file of the zipfile to the first file.
return UNZ_OK if there is no problem extern unzFile ZEXPORT unzOpen2 OF((const char *path,
*/ zlib_filefunc_def* pzlib_filefunc_def));
/*
extern int ZEXPORT unzGoToNextFile OF((unzFile file)); Open a Zip file, like unzOpen, but provide a set of file low level API
/* for read/write the zip file (see ioapi.h)
Set the current file of the zipfile to the next file. */
return UNZ_OK if there is no problem
return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. extern unzFile ZEXPORT unzOpen2_64 OF((const void *path,
*/ zlib_filefunc64_def* pzlib_filefunc_def));
/*
extern int ZEXPORT unzLocateFile OF((unzFile file, Open a Zip file, like unz64Open, but provide a set of file low level API
const char *szFileName, for read/write the zip file (see ioapi.h)
int iCaseSensitivity)); */
/*
Try locate the file szFileName in the zipfile. extern int ZEXPORT unzClose OF((unzFile file));
For the iCaseSensitivity signification, see unzStringFileNameCompare /*
Close a ZipFile opened with unzipOpen.
return value : If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
UNZ_OK if the file is found. It becomes the current file. these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
UNZ_END_OF_LIST_OF_FILE if the file is not found return UNZ_OK if there is no problem. */
*/
extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
unz_global_info *pglobal_info));
/* ****************************************** */
/* Ryan supplied functions */ extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file,
/* unz_file_info contain information about a file in the zipfile */ unz_global_info64 *pglobal_info));
typedef struct unz_file_pos_s /*
{ Write info about the ZipFile in the *pglobal_info structure.
uLong pos_in_zip_directory; /* offset in zip file directory */ No preparation of the structure is needed
uLong num_of_file; /* # of file */ return UNZ_OK if there is no problem. */
} unz_file_pos;
extern int ZEXPORT unzGetFilePos( extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
unzFile file, char *szComment,
unz_file_pos* file_pos); uLong uSizeBuf));
/*
extern int ZEXPORT unzGoToFilePos( Get the global comment string of the ZipFile, in the szComment buffer.
unzFile file, uSizeBuf is the size of the szComment buffer.
unz_file_pos* file_pos); return the number of byte copied or an error code <0
*/
/* ****************************************** */
extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, /***************************************************************************/
unz_file_info *pfile_info, /* Unzip package allow you browse the directory of the zipfile */
char *szFileName,
uLong fileNameBufferSize, extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
void *extraField, /*
uLong extraFieldBufferSize, Set the current file of the zipfile to the first file.
char *szComment, return UNZ_OK if there is no problem
uLong commentBufferSize)); */
/*
Get Info about the current file extern int ZEXPORT unzGoToNextFile OF((unzFile file));
if pfile_info!=NULL, the *pfile_info structure will contain somes info about /*
the current file Set the current file of the zipfile to the next file.
if szFileName!=NULL, the filemane string will be copied in szFileName return UNZ_OK if there is no problem
(fileNameBufferSize is the size of the buffer) return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
if extraField!=NULL, the extra field information will be copied in extraField */
(extraFieldBufferSize is the size of the buffer).
This is the Central-header version of the extra field extern int ZEXPORT unzLocateFile OF((unzFile file,
if szComment!=NULL, the comment string of the file will be copied in szComment const char *szFileName,
(commentBufferSize is the size of the buffer) int iCaseSensitivity));
*/ /*
Try locate the file szFileName in the zipfile.
/***************************************************************************/ For the iCaseSensitivity signification, see unzStringFileNameCompare
/* 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) return value :
*/ UNZ_OK if the file is found. It becomes the current file.
UNZ_END_OF_LIST_OF_FILE if the file is not found
extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); */
/*
Open for reading data the current file in the zipfile.
If there is no error, the return value is UNZ_OK. /* ****************************************** */
*/ /* Ryan supplied functions */
/* unz_file_info contain information about a file in the zipfile */
extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, typedef struct unz_file_pos_s
const char* password)); {
/* uLong pos_in_zip_directory; /* offset in zip file directory */
Open for reading data the current file in the zipfile. uLong num_of_file; /* # of file */
password is a crypting password } unz_file_pos;
If there is no error, the return value is UNZ_OK.
*/ extern int ZEXPORT unzGetFilePos(
unzFile file,
extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, unz_file_pos* file_pos);
int* method,
int* level, extern int ZEXPORT unzGoToFilePos(
int raw)); unzFile file,
/* unz_file_pos* file_pos);
Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
if raw==1 typedef struct unz64_file_pos_s
*method will receive method of compression, *level will receive level of {
compression ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */
note : you can set level parameter as NULL (if you did not want known level, ZPOS64_T num_of_file; /* # of file */
but you CANNOT set method parameter as NULL } unz64_file_pos;
*/
extern int ZEXPORT unzGetFilePos64(
extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, unzFile file,
int* method, unz64_file_pos* file_pos);
int* level,
int raw, extern int ZEXPORT unzGoToFilePos64(
const char* password)); unzFile file,
/* const unz64_file_pos* file_pos);
Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
if raw==1 /* ****************************************** */
*method will receive method of compression, *level will receive level of
compression extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file,
note : you can set level parameter as NULL (if you did not want known level, unz_file_info64 *pfile_info,
but you CANNOT set method parameter as NULL char *szFileName,
*/ uLong fileNameBufferSize,
void *extraField,
uLong extraFieldBufferSize,
extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); char *szComment,
/* uLong commentBufferSize));
Close the file in zip opened with unzOpenCurrentFile
Return UNZ_CRCERROR if all the file was read but the CRC is not good extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
*/ unz_file_info *pfile_info,
char *szFileName,
extern int ZEXPORT unzReadCurrentFile OF((unzFile file, uLong fileNameBufferSize,
voidp buf, void *extraField,
unsigned len)); uLong extraFieldBufferSize,
/* char *szComment,
Read bytes from the current file (opened by unzOpenCurrentFile) uLong commentBufferSize));
buf contain buffer where data must be copied /*
len the size of buf. Get Info about the current file
if pfile_info!=NULL, the *pfile_info structure will contain somes info about
return the number of byte copied if somes bytes are copied the current file
return 0 if the end of file was reached if szFileName!=NULL, the filemane string will be copied in szFileName
return <0 with error code if there is an error (fileNameBufferSize is the size of the buffer)
(UNZ_ERRNO for IO error, or zLib error for uncompress error) if extraField!=NULL, the extra field information will be copied in extraField
*/ (extraFieldBufferSize is the size of the buffer).
This is the Central-header version of the extra field
extern z_off_t ZEXPORT unztell OF((unzFile file)); if szComment!=NULL, the comment string of the file will be copied in szComment
/* (commentBufferSize is the size of the buffer)
Give the current position in uncompressed data */
*/
extern int ZEXPORT unzeof OF((unzFile file)); /** Addition for GDAL : START */
/*
return 1 if the end of file was reached, 0 elsewhere extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file));
*/
/** Addition for GDAL : END */
extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
voidp buf,
unsigned len)); /***************************************************************************/
/* /* for reading the content of the current zipfile, you can open it, read data
Read extra field from the current file (opened by unzOpenCurrentFile) from it, and close it (you can close it before reading all the file)
This is the local-header version of the extra field (sometimes, there is */
more info in the local-header version than in the central-header)
extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
if buf==NULL, it return the size of the local extra field /*
Open for reading data the current file in the zipfile.
if buf!=NULL, len is the size of the buffer, the extra header is copied in If there is no error, the return value is UNZ_OK.
buf. */
the return value is the number of bytes copied in buf, or (if <0)
the error code extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file,
*/ const char* password));
/*
/***************************************************************************/ Open for reading data the current file in the zipfile.
password is a crypting password
/* Get the current file offset */ If there is no error, the return value is UNZ_OK.
extern uLong ZEXPORT unzGetOffset (unzFile file); */
/* Set the current file offset */ extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file,
extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); int* method,
int* level,
int raw));
/*
#ifdef __cplusplus Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
} if raw==1
#endif *method will receive method of compression, *level will receive level of
compression
#endif /* _unz_H */ note : you can set level parameter as NULL (if you did not want known level,
but you CANNOT set method parameter as NULL
*/
extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file,
int* method,
int* level,
int raw,
const char* password));
/*
Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
if raw==1
*method will receive method of compression, *level will receive level of
compression
note : you can set level parameter as NULL (if you did not want known level,
but you CANNOT set method parameter as NULL
*/
extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
/*
Close the file in zip opened with unzOpenCurrentFile
Return UNZ_CRCERROR if all the file was read but the CRC is not good
*/
extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
voidp buf,
unsigned len));
/*
Read bytes from the current file (opened by unzOpenCurrentFile)
buf contain buffer where data must be copied
len the size of buf.
return the number of byte copied if somes bytes are copied
return 0 if the end of file was reached
return <0 with error code if there is an error
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
*/
extern z_off_t ZEXPORT unztell OF((unzFile file));
extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file));
/*
Give the current position in uncompressed data
*/
extern int ZEXPORT unzeof OF((unzFile file));
/*
return 1 if the end of file was reached, 0 elsewhere
*/
extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
voidp buf,
unsigned len));
/*
Read extra field from the current file (opened by unzOpenCurrentFile)
This is the local-header version of the extra field (sometimes, there is
more info in the local-header version than in the central-header)
if buf==NULL, it return the size of the local extra field
if buf!=NULL, len is the size of the buffer, the extra header is copied in
buf.
the return value is the number of bytes copied in buf, or (if <0)
the error code
*/
/***************************************************************************/
/* Get the current file offset */
extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file);
extern uLong ZEXPORT unzGetOffset (unzFile file);
/* Set the current file offset */
extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos);
extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
#ifdef __cplusplus
}
#endif
#endif /* _unz64_H */

File diff suppressed because it is too large Load Diff

View File

@@ -1,235 +1,362 @@
/* zip.h -- IO for compress .zip files using zlib /* zip.h -- IO on .zip files using zlib
Version 1.01e, February 12th, 2005 Version 1.1, January 7th, 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 creates .ZIP file, compatible with PKZip 2.04g
WinZip, InfoZip tools and compatible. Modifications for Zip64 support
Multi volume ZipFile (span) are not supported. Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
Encryption compatible with pkzip 2.04g only supported
Old compressions used by old PKZip 1.x are not supported For more info read MiniZip_info.txt
For uncompress .zip file, look at unzip.h ---------------------------------------------------------------------------
Condition of use and distribution are the same than zlib :
I WAIT FEEDBACK at mail info@winimage.com
Visit also http://www.winimage.com/zLibDll/unzip.html for evolution This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
Condition of use and distribution are the same than zlib : arising from the use of this software.
This software is provided 'as-is', without any express or implied Permission is granted to anyone to use this software for any purpose,
warranty. In no event will the authors be held liable for any damages including commercial applications, and to alter it and redistribute it
arising from the use of this software. freely, subject to the following restrictions:
Permission is granted to anyone to use this software for any purpose, 1. The origin of this software must not be misrepresented; you must not
including commercial applications, and to alter it and redistribute it claim that you wrote the original software. If you use this software
freely, subject to the following restrictions: in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
1. The origin of this software must not be misrepresented; you must not 2. Altered source versions must be plainly marked as such, and must not be
claim that you wrote the original software. If you use this software misrepresented as being the original software.
in a product, an acknowledgment in the product documentation would be 3. This notice may not be removed or altered from any source distribution.
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. Changes
See header of zip.h
*/
*/
/* for more info about .ZIP format, see
http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip #ifndef _zip12_H
http://www.info-zip.org/pub/infozip/doc/ #define _zip12_H
PkWare has also a specification at :
ftp://ftp.pkware.com/probdesc.zip #ifdef __cplusplus
*/ extern "C" {
#endif
#ifndef _zip_H
#define _zip_H //#define HAVE_BZIP2
#ifdef __cplusplus #ifndef _ZLIB_H
extern "C" { #include "zlib.h"
#endif #endif
#ifndef _ZLIB_H #ifndef _ZLIBIOAPI_H
#include "zlib.h" #include "ioapi.h"
#endif #endif
#ifndef _ZLIBIOAPI_H #ifdef HAVE_BZIP2
#include "ioapi.h" #include "bzlib.h"
#endif #endif
#if defined(STRICTZIP) || defined(STRICTZIPUNZIP) #define Z_BZIP2ED 12
/* like the STRICT of WIN32, we define a pointer that cannot be converted
from (void*) without cast */ #if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
typedef struct TagzipFile__ { int unused; } zipFile__; /* like the STRICT of WIN32, we define a pointer that cannot be converted
typedef zipFile__ *zipFile; from (void*) without cast */
#else typedef struct TagzipFile__ { int unused; } zipFile__;
typedef voidp zipFile; typedef zipFile__ *zipFile;
#endif #else
typedef voidp zipFile;
#define ZIP_OK (0) #endif
#define ZIP_EOF (0)
#define ZIP_ERRNO (Z_ERRNO) #define ZIP_OK (0)
#define ZIP_PARAMERROR (-102) #define ZIP_EOF (0)
#define ZIP_BADZIPFILE (-103) #define ZIP_ERRNO (Z_ERRNO)
#define ZIP_INTERNALERROR (-104) #define ZIP_PARAMERROR (-102)
#define ZIP_BADZIPFILE (-103)
#ifndef DEF_MEM_LEVEL #define ZIP_INTERNALERROR (-104)
# if MAX_MEM_LEVEL >= 8
# define DEF_MEM_LEVEL 8 #ifndef DEF_MEM_LEVEL
# else # if MAX_MEM_LEVEL >= 8
# define DEF_MEM_LEVEL MAX_MEM_LEVEL # define DEF_MEM_LEVEL 8
# endif # else
#endif # define DEF_MEM_LEVEL MAX_MEM_LEVEL
/* default memLevel */ # endif
#endif
/* tm_zip contain date/time info */ /* default memLevel */
typedef struct tm_zip_s
{ /* tm_zip contain date/time info */
uInt tm_sec; /* seconds after the minute - [0,59] */ typedef struct tm_zip_s
uInt tm_min; /* minutes after the hour - [0,59] */ {
uInt tm_hour; /* hours since midnight - [0,23] */ uInt tm_sec; /* seconds after the minute - [0,59] */
uInt tm_mday; /* day of the month - [1,31] */ uInt tm_min; /* minutes after the hour - [0,59] */
uInt tm_mon; /* months since January - [0,11] */ uInt tm_hour; /* hours since midnight - [0,23] */
uInt tm_year; /* years - [1980..2044] */ uInt tm_mday; /* day of the month - [1,31] */
} tm_zip; uInt tm_mon; /* months since January - [0,11] */
uInt tm_year; /* years - [1980..2044] */
typedef struct } tm_zip;
{
tm_zip tmz_date; /* date in understandable format */ typedef struct
uLong dosDate; /* if dos_date == 0, tmu_date is used */ {
/* uLong flag; */ /* general purpose bit flag 2 bytes */ tm_zip tmz_date; /* date in understandable format */
uLong dosDate; /* if dos_date == 0, tmu_date is used */
uLong internal_fa; /* internal file attributes 2 bytes */ /* uLong flag; */ /* general purpose bit flag 2 bytes */
uLong external_fa; /* external file attributes 4 bytes */
} zip_fileinfo; uLong internal_fa; /* internal file attributes 2 bytes */
uLong external_fa; /* external file attributes 4 bytes */
typedef const char* zipcharpc; } zip_fileinfo;
typedef const char* zipcharpc;
#define APPEND_STATUS_CREATE (0)
#define APPEND_STATUS_CREATEAFTER (1)
#define APPEND_STATUS_ADDINZIP (2) #define APPEND_STATUS_CREATE (0)
#define APPEND_STATUS_CREATEAFTER (1)
extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); #define APPEND_STATUS_ADDINZIP (2)
/*
Create a zipfile. extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append));
an Unix computer "zlib/zlib113.zip". /*
if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip Create a zipfile.
will be created at the end of the file. pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on
(useful if the file contain a self extractor code) an Unix computer "zlib/zlib113.zip".
if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip
add files in existing zip (be sure you don't add file that doesn't exist) will be created at the end of the file.
If the zipfile cannot be opened, the return value is NULL. (useful if the file contain a self extractor code)
Else, the return value is a zipFile Handle, usable with other function if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will
of this zip package. add files in existing zip (be sure you don't add file that doesn't exist)
*/ If the zipfile cannot be opened, the return value is NULL.
Else, the return value is a zipFile Handle, usable with other function
/* Note : there is no delete function into a zipfile. of this zip package.
If you want delete file into a zipfile, you must open a zipfile, and create another */
Of couse, you can use RAW reading and writing to copy the file you did not want delte
*/ /* Note : there is no delete function into a zipfile.
If you want delete file into a zipfile, you must open a zipfile, and create another
extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, Of couse, you can use RAW reading and writing to copy the file you did not want delte
int append, */
zipcharpc* globalcomment,
zlib_filefunc_def* pzlib_filefunc_def)); extern zipFile ZEXPORT zipOpen2 OF((const char *pathname,
int append,
extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, zipcharpc* globalcomment,
const char* filename, zlib_filefunc_def* pzlib_filefunc_def));
const zip_fileinfo* zipfi,
const void* extrafield_local, extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname,
uInt size_extrafield_local, int append,
const void* extrafield_global, zipcharpc* globalcomment,
uInt size_extrafield_global, zlib_filefunc64_def* pzlib_filefunc_def));
const char* comment,
int method, extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
int level)); const char* filename,
/* const zip_fileinfo* zipfi,
Open a file in the ZIP for writing. const void* extrafield_local,
filename : the filename in zip (if NULL, '-' without quote will be used uInt size_extrafield_local,
*zipfi contain supplemental information const void* extrafield_global,
if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local uInt size_extrafield_global,
contains the extrafield data the the local header const char* comment,
if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global int method,
contains the extrafield data the the local header int level));
if comment != NULL, comment contain the comment string
method contain the compression method (0 for store, Z_DEFLATED for deflate) extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file,
level contain the level of compression (can be Z_DEFAULT_COMPRESSION) const char* filename,
*/ const zip_fileinfo* zipfi,
const void* extrafield_local,
uInt size_extrafield_local,
extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, const void* extrafield_global,
const char* filename, uInt size_extrafield_global,
const zip_fileinfo* zipfi, const char* comment,
const void* extrafield_local, int method,
uInt size_extrafield_local, int level,
const void* extrafield_global, int zip64));
uInt size_extrafield_global,
const char* comment, /*
int method, Open a file in the ZIP for writing.
int level, filename : the filename in zip (if NULL, '-' without quote will be used
int raw)); *zipfi contain supplemental information
if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local
/* contains the extrafield data the the local header
Same than zipOpenNewFileInZip, except if raw=1, we write raw file if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global
*/ contains the extrafield data the the local header
if comment != NULL, comment contain the comment string
extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, method contain the compression method (0 for store, Z_DEFLATED for deflate)
const char* filename, level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
const zip_fileinfo* zipfi, zip64 is set to 1 if a zip64 extended information block should be added to the local file header.
const void* extrafield_local, this MUST be '1' if the uncompressed size is >= 0xffffffff.
uInt size_extrafield_local,
const void* extrafield_global, */
uInt size_extrafield_global,
const char* comment,
int method, extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file,
int level, const char* filename,
int raw, const zip_fileinfo* zipfi,
int windowBits, const void* extrafield_local,
int memLevel, uInt size_extrafield_local,
int strategy, const void* extrafield_global,
const char* password, uInt size_extrafield_global,
uLong crcForCtypting)); const char* comment,
int method,
/* int level,
Same than zipOpenNewFileInZip2, except int raw));
windowBits,memLevel,,strategy : see parameter strategy in deflateInit2
password : crypting password (NULL for no crypting)
crcForCtypting : crc of file to compress (needed for crypting) extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file,
*/ const char* filename,
const zip_fileinfo* zipfi,
const void* extrafield_local,
extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, uInt size_extrafield_local,
const void* buf, const void* extrafield_global,
unsigned len)); uInt size_extrafield_global,
/* const char* comment,
Write data in the zipfile int method,
*/ int level,
int raw,
extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); int zip64));
/* /*
Close the current file in the zipfile Same than zipOpenNewFileInZip, except if raw=1, we write raw file
*/ */
extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file,
uLong uncompressed_size, const char* filename,
uLong crc32)); const zip_fileinfo* zipfi,
/* const void* extrafield_local,
Close the current file in the zipfile, for fiel opened with uInt size_extrafield_local,
parameter raw=1 in zipOpenNewFileInZip2 const void* extrafield_global,
uncompressed_size and crc32 are value for the uncompressed size uInt size_extrafield_global,
*/ const char* comment,
int method,
extern int ZEXPORT zipClose OF((zipFile file, int level,
const char* global_comment)); int raw,
/* int windowBits,
Close the zipfile int memLevel,
*/ int strategy,
const char* password,
#ifdef __cplusplus uLong crcForCrypting));
}
#endif extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file,
const char* filename,
#endif /* _zip_H */ const zip_fileinfo* zipfi,
const void* extrafield_local,
uInt size_extrafield_local,
const void* extrafield_global,
uInt size_extrafield_global,
const char* comment,
int method,
int level,
int raw,
int windowBits,
int memLevel,
int strategy,
const char* password,
uLong crcForCrypting,
int zip64
));
/*
Same than zipOpenNewFileInZip2, except
windowBits,memLevel,,strategy : see parameter strategy in deflateInit2
password : crypting password (NULL for no crypting)
crcForCrypting : crc of file to compress (needed for crypting)
*/
extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file,
const char* filename,
const zip_fileinfo* zipfi,
const void* extrafield_local,
uInt size_extrafield_local,
const void* extrafield_global,
uInt size_extrafield_global,
const char* comment,
int method,
int level,
int raw,
int windowBits,
int memLevel,
int strategy,
const char* password,
uLong crcForCrypting,
uLong versionMadeBy,
uLong flagBase
));
extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file,
const char* filename,
const zip_fileinfo* zipfi,
const void* extrafield_local,
uInt size_extrafield_local,
const void* extrafield_global,
uInt size_extrafield_global,
const char* comment,
int method,
int level,
int raw,
int windowBits,
int memLevel,
int strategy,
const char* password,
uLong crcForCrypting,
uLong versionMadeBy,
uLong flagBase,
int zip64
));
/*
Same than zipOpenNewFileInZip4, except
versionMadeBy : value for Version made by field
flag : value for flag field (compression level info will be added)
*/
extern int ZEXPORT zipWriteInFileInZip OF((zipFile file,
const void* buf,
unsigned len));
/*
Write data in the zipfile
*/
extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
/*
Close the current file in the zipfile
*/
extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file,
uLong uncompressed_size,
uLong crc32));
extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file,
ZPOS64_T uncompressed_size,
uLong crc32));
/*
Close the current file in the zipfile, for file opened with
parameter raw=1 in zipOpenNewFileInZip2
uncompressed_size and crc32 are value for the uncompressed size
*/
extern int ZEXPORT zipClose OF((zipFile file,
const char* global_comment));
/*
Close the zipfile
*/
extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader));
/*
zipRemoveExtraInfoBlock - Added by Mathias Svensson
Remove extra information block from a extra information data for the local file header or central directory header
It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode.
0x0001 is the signature header for the ZIP64 extra information blocks
usage.
Remove ZIP64 Extra information from a central director extra field data
zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001);
Remove ZIP64 Extra information from a Local File Header extra field data
zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001);
*/
#ifdef __cplusplus
}
#endif
#endif /* _zip64_H */

View File

@@ -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 gzio.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+gzio.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,8 +38,16 @@ 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
gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
gzio.obj: gzio.c zutil.h zlib.h zconf.h gzio.obj: gzio.c zutil.h zlib.h zconf.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

View File

@@ -10,7 +10,7 @@ unit zlibpas;
interface interface
const const
ZLIB_VERSION = '1.2.2'; ZLIB_VERSION = '1.2.3';
type type
alloc_func = function(opaque: Pointer; items, size: Integer): Pointer; alloc_func = function(opaque: Pointer; items, size: Integer): Pointer;

View File

@@ -1,8 +1,8 @@
/* /*
* puff.c * puff.c
* Copyright (C) 2002-2004 Mark Adler * Copyright (C) 2002-2008 Mark Adler
* For conditions of distribution and use, see copyright notice in puff.h * For conditions of distribution and use, see copyright notice in puff.h
* version 1.8, 9 Jan 2004 * version 2.0, 25 Jul 2008
* *
* puff.c is a simple inflate written to be an unambiguous way to specify the * puff.c is a simple inflate written to be an unambiguous way to specify the
* deflate format. It is not written for speed but rather simplicity. As a * deflate format. It is not written for speed but rather simplicity. As a
@@ -61,6 +61,12 @@
* 1.7 3 Mar 2003 - Added test code for distribution * 1.7 3 Mar 2003 - Added test code for distribution
* - Added zlib-like license * - Added zlib-like license
* 1.8 9 Jan 2004 - Added some comments on no distance codes case * 1.8 9 Jan 2004 - Added some comments on no distance codes case
* 1.9 21 Feb 2008 - Fix bug on 16-bit integer architectures [Pohland]
* - Catch missing end-of-block symbol error
* 2.0 25 Jul 2008 - Add #define to permit distance too far back
* - Add option in TEST code for puff to write the data
* - Add option in TEST code to skip input bytes
* - Allow TEST code to read from piped stdin
*/ */
#include <setjmp.h> /* for setjmp(), longjmp(), and jmp_buf */ #include <setjmp.h> /* for setjmp(), longjmp(), and jmp_buf */
@@ -194,7 +200,7 @@ struct huffman {
* Decode a code from the stream s using huffman table h. Return the symbol or * Decode a code from the stream s using huffman table h. Return the symbol or
* a negative value if there is an error. If all of the lengths are zero, i.e. * a negative value if there is an error. If all of the lengths are zero, i.e.
* an empty code, or if the code is incomplete and an invalid code is received, * an empty code, or if the code is incomplete and an invalid code is received,
* then -9 is returned after reading MAXBITS bits. * then -10 is returned after reading MAXBITS bits.
* *
* Format notes: * Format notes:
* *
@@ -226,14 +232,14 @@ local int decode(struct state *s, struct huffman *h)
for (len = 1; len <= MAXBITS; len++) { for (len = 1; len <= MAXBITS; len++) {
code |= bits(s, 1); /* get next bit */ code |= bits(s, 1); /* get next bit */
count = h->count[len]; count = h->count[len];
if (code < first + count) /* if length len, return symbol */ if (code - count < first) /* if length len, return symbol */
return h->symbol[index + (code - first)]; return h->symbol[index + (code - first)];
index += count; /* else update for next length */ index += count; /* else update for next length */
first += count; first += count;
first <<= 1; first <<= 1;
code <<= 1; code <<= 1;
} }
return -9; /* ran out of codes */ return -10; /* ran out of codes */
} }
/* /*
@@ -263,7 +269,7 @@ local int decode(struct state *s, struct huffman *h)
code |= bitbuf & 1; code |= bitbuf & 1;
bitbuf >>= 1; bitbuf >>= 1;
count = *next++; count = *next++;
if (code < first + count) { /* if length len, return symbol */ if (code - count < first) { /* if length len, return symbol */
s->bitbuf = bitbuf; s->bitbuf = bitbuf;
s->bitcnt = (s->bitcnt - len) & 7; s->bitcnt = (s->bitcnt - len) & 7;
return h->symbol[index + (code - first)]; return h->symbol[index + (code - first)];
@@ -280,7 +286,7 @@ local int decode(struct state *s, struct huffman *h)
bitbuf = s->in[s->incnt++]; bitbuf = s->in[s->incnt++];
if (left > 8) left = 8; if (left > 8) left = 8;
} }
return -9; /* ran out of codes */ return -10; /* ran out of codes */
} }
#endif /* SLOW */ #endif /* SLOW */
@@ -448,21 +454,27 @@ local int codes(struct state *s,
else if (symbol > 256) { /* length */ else if (symbol > 256) { /* length */
/* get and compute length */ /* get and compute length */
symbol -= 257; symbol -= 257;
if (symbol >= 29) return -9; /* invalid fixed code */ if (symbol >= 29) return -10; /* invalid fixed code */
len = lens[symbol] + bits(s, lext[symbol]); len = lens[symbol] + bits(s, lext[symbol]);
/* get and check distance */ /* get and check distance */
symbol = decode(s, distcode); symbol = decode(s, distcode);
if (symbol < 0) return symbol; /* invalid symbol */ if (symbol < 0) return symbol; /* invalid symbol */
dist = dists[symbol] + bits(s, dext[symbol]); dist = dists[symbol] + bits(s, dext[symbol]);
#ifndef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
if (dist > s->outcnt) if (dist > s->outcnt)
return -10; /* distance too far back */ return -11; /* distance too far back */
#endif
/* copy length bytes from distance bytes back */ /* copy length bytes from distance bytes back */
if (s->out != NIL) { if (s->out != NIL) {
if (s->outcnt + len > s->outlen) return 1; if (s->outcnt + len > s->outlen) return 1;
while (len--) { while (len--) {
s->out[s->outcnt] = s->out[s->outcnt - dist]; s->out[s->outcnt] =
#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
dist > s->outcnt ? 0 :
#endif
s->out[s->outcnt - dist];
s->outcnt++; s->outcnt++;
} }
} }
@@ -680,6 +692,10 @@ local int dynamic(struct state *s)
} }
} }
/* check for end-of-block code -- there better be one! */
if (lengths[256] == 0)
return -9;
/* build huffman table for literal/length codes */ /* build huffman table for literal/length codes */
err = construct(&lencode, lengths, nlen); err = construct(&lencode, lengths, nlen);
if (err < 0 || (err > 0 && nlen - lencode.count[0] != 1)) if (err < 0 || (err > 0 && nlen - lencode.count[0] != 1))
@@ -724,8 +740,9 @@ local int dynamic(struct state *s)
* -6: dynamic block code description: repeat more than specified lengths * -6: dynamic block code description: repeat more than specified lengths
* -7: dynamic block code description: invalid literal/length code lengths * -7: dynamic block code description: invalid literal/length code lengths
* -8: dynamic block code description: invalid distance code lengths * -8: dynamic block code description: invalid distance code lengths
* -9: invalid literal/length or distance code in fixed or dynamic block * -9: dynamic block code description: missing end-of-block code
* -10: distance is too far back in fixed or dynamic block * -10: invalid literal/length or distance code in fixed or dynamic block
* -11: distance is too far back in fixed or dynamic block
* *
* Format notes: * Format notes:
* *
@@ -783,54 +800,142 @@ int puff(unsigned char *dest, /* pointer to destination pointer */
} }
#ifdef TEST #ifdef TEST
/* Example of how to use puff() */ /* Examples of how to use puff().
Usage: puff [-w] [-nnn] file
... | puff [-w] [-nnn]
where file is the input file with deflate data, nnn is the number of bytes
of input to skip before inflating (e.g. to skip a zlib or gzip header), and
-w is used to write the decompressed data to stdout */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
local unsigned char *yank(char *name, unsigned long *len) /* Return size times approximately the cube root of 2, keeping the result as 1,
3, or 5 times a power of 2 -- the result is always > size, until the result
is the maximum value of an unsigned long, where it remains. This is useful
to keep reallocations less than ~33% over the actual data. */
local size_t bythirds(size_t size)
{ {
unsigned long size; int n;
unsigned char *buf; size_t m;
m = size;
for (n = 0; m; n++)
m >>= 1;
if (n < 3)
return size + 1;
n -= 3;
m = size >> n;
m += m == 6 ? 2 : 1;
m <<= n;
return m > size ? m : (size_t)(-1);
}
/* Read the input file *name, or stdin if name is NULL, into allocated memory.
Reallocate to larger buffers until the entire file is read in. Return a
pointer to the allocated data, or NULL if there was a memory allocation
failure. *len is the number of bytes of data read from the input file (even
if load() returns NULL). If the input file was empty or could not be opened
or read, *len is zero. */
local void *load(char *name, size_t *len)
{
size_t size;
void *buf, *swap;
FILE *in; FILE *in;
struct stat s;
*len = 0; *len = 0;
if (stat(name, &s)) return NULL; buf = malloc(size = 4096);
if ((s.st_mode & S_IFMT) != S_IFREG) return NULL; if (buf == NULL)
size = (unsigned long)(s.st_size); return NULL;
if (size == 0 || (off_t)size != s.st_size) return NULL; in = name == NULL ? stdin : fopen(name, "rb");
in = fopen(name, "r"); if (in != NULL) {
if (in == NULL) return NULL; for (;;) {
buf = malloc(size); *len += fread((char *)buf + *len, 1, size - *len, in);
if (buf != NULL && fread(buf, 1, size, in) != size) { if (*len < size) break;
free(buf); size = bythirds(size);
buf = NULL; if (size == *len || (swap = realloc(buf, size)) == NULL) {
free(buf);
buf = NULL;
break;
}
buf = swap;
}
fclose(in);
} }
fclose(in);
*len = size;
return buf; return buf;
} }
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int ret; int ret, skip = 0, put = 0;
unsigned char *source; char *arg, *name = NULL;
unsigned long len, sourcelen, destlen; unsigned char *source = NULL, *dest;
size_t len = 0;
unsigned long sourcelen, destlen;
if (argc < 2) return 2; /* process arguments */
source = yank(argv[1], &len); while (arg = *++argv, --argc)
if (source == NULL) return 2; if (arg[0] == '-') {
sourcelen = len; if (arg[1] == 'w' && arg[2] == 0)
ret = puff(NIL, &destlen, source, &sourcelen); put = 1;
if (ret) else if (arg[1] >= '0' && arg[1] <= '9')
printf("puff() failed with return code %d\n", ret); skip = atoi(arg + 1);
else { else {
printf("puff() succeeded uncompressing %lu bytes\n", destlen); fprintf(stderr, "invalid option %s\n", arg);
if (sourcelen < len) printf("%lu compressed bytes unused\n", return 3;
len - sourcelen); }
}
else if (name != NULL) {
fprintf(stderr, "only one file name allowed\n");
return 3;
}
else
name = arg;
source = load(name, &len);
if (source == NULL) {
fprintf(stderr, "memory allocation failure\n");
return 4;
} }
if (len == 0) {
fprintf(stderr, "could not read %s, or it was empty\n",
name == NULL ? "<stdin>" : name);
free(source);
return 3;
}
if (skip >= len) {
fprintf(stderr, "skip request of %d leaves no input\n", skip);
free(source);
return 3;
}
/* test inflate data with offset skip */
len -= skip;
sourcelen = (unsigned long)len;
ret = puff(NIL, &destlen, source + skip, &sourcelen);
if (ret)
fprintf(stderr, "puff() failed with return code %d\n", ret);
else {
fprintf(stderr, "puff() succeeded uncompressing %lu bytes\n", destlen);
if (sourcelen < len) fprintf(stderr, "%lu compressed bytes unused\n",
len - sourcelen);
}
/* if requested, inflate again and write decompressd data to stdout */
if (put) {
dest = malloc(destlen);
if (dest == NULL) {
fprintf(stderr, "memory allocation failure\n");
free(source);
return 4;
}
puff(dest, &destlen, source + skip, &sourcelen);
fwrite(dest, 1, destlen, stdout);
free(dest);
}
/* clean up */
free(source); free(source);
return ret; return ret;
} }

View File

@@ -1,6 +1,6 @@
/* puff.h /* puff.h
Copyright (C) 2002, 2003 Mark Adler, all rights reserved Copyright (C) 2002-2008 Mark Adler, all rights reserved
version 1.7, 3 Mar 2002 version 1.9, 10 Jan 2008
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

View File

@@ -1,18 +0,0 @@
; rdtsc64.asm
;
; unsigned _int64 myrdtsc();
;
; return the performance rdtsc value, on AMD64/Intel EM64T
;
; compile with :
; ml64.exe" /Flrdtsc64 /c /Zi rdtsc64.asm
;
.code
myrdtsc PROC
rdtsc
shl rdx,32
or rax,rdx
ret
myrdtsc ENDP
END

Binary file not shown.

View File

@@ -1,7 +1,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <windows.h> #include <windows.h>
#include "zlib.h" #include "zlib.h"
@@ -17,23 +17,25 @@ void MyDoMinus64(LARGE_INTEGER *R,LARGE_INTEGER A,LARGE_INTEGER B)
} }
} }
#ifdef _AMD64_ #ifdef _M_X64
unsigned _int64 myrdtsc(); // see http://msdn2.microsoft.com/library/twchhe95(en-us,vs.80).aspx for __rdtsc
unsigned __int64 __rdtsc(void);
void BeginCountRdtsc(LARGE_INTEGER * pbeginTime64) void BeginCountRdtsc(LARGE_INTEGER * pbeginTime64)
{ {
// printf("rdtsc = %I64x\n",myrdtsc()); // printf("rdtsc = %I64x\n",__rdtsc());
pbeginTime64->QuadPart=myrdtsc(); pbeginTime64->QuadPart=__rdtsc();
} }
LARGE_INTEGER GetResRdtsc(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf) LARGE_INTEGER GetResRdtsc(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf)
{ {
LARGE_INTEGER LIres; LARGE_INTEGER LIres;
unsigned _int64 res=myrdtsc()-((unsigned _int64)(beginTime64.QuadPart)); unsigned _int64 res=__rdtsc()-((unsigned _int64)(beginTime64.QuadPart));
LIres.QuadPart=res; LIres.QuadPart=res;
// printf("rdtsc = %I64x\n",myrdtsc()); // printf("rdtsc = %I64x\n",__rdtsc());
return LIres; return LIres;
} }
#else #else
#ifdef _M_IX86
void myGetRDTSC32(LARGE_INTEGER * pbeginTime64) void myGetRDTSC32(LARGE_INTEGER * pbeginTime64)
{ {
DWORD dwEdx,dwEax; DWORD dwEdx,dwEax;
@@ -61,8 +63,23 @@ LARGE_INTEGER GetResRdtsc(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf)
MyDoMinus64(&LIres,endTime64,beginTime64); MyDoMinus64(&LIres,endTime64,beginTime64);
return LIres; return LIres;
} }
#endif #else
void myGetRDTSC32(LARGE_INTEGER * pbeginTime64)
{
}
void BeginCountRdtsc(LARGE_INTEGER * pbeginTime64)
{
}
LARGE_INTEGER GetResRdtsc(LARGE_INTEGER beginTime64,BOOL fComputeTimeQueryPerf)
{
LARGE_INTEGER lr;
lr.QuadPart=0;
return lr;
}
#endif
#endif
void BeginCountPerfCounter(LARGE_INTEGER * pbeginTime64,BOOL fComputeTimeQueryPerf) void BeginCountPerfCounter(LARGE_INTEGER * pbeginTime64,BOOL fComputeTimeQueryPerf)
{ {
@@ -86,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;

View File

@@ -1,21 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 7.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlib", "testzlib.vcproj", "{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}"
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
ConfigName.0 = Debug
ConfigName.1 = Release
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug.ActiveCfg = Debug|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug.Build.0 = Debug|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release.ActiveCfg = Release|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

View File

@@ -1,32 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlib8", "testzlib8.vcproj", "{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|Win64 (AMD64) = Debug|Win64 (AMD64)
Release|Win32 = Release|Win32
Release|Win64 (AMD64) = Release|Win64 (AMD64)
ReleaseAsm|Win32 = ReleaseAsm|Win32
ReleaseAsm|Win64 (AMD64) = ReleaseAsm|Win64 (AMD64)
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win64 (AMD64).ActiveCfg = Debug|Win64 (AMD64)
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win64 (AMD64).Build.0 = Debug|Win64 (AMD64)
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win64 (AMD64).ActiveCfg = Release|Win64 (AMD64)
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win64 (AMD64).Build.0 = Release|Win64 (AMD64)
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseAsm|Win32.ActiveCfg = ReleaseAsm|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseAsm|Win32.Build.0 = ReleaseAsm|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseAsm|Win64 (AMD64).ActiveCfg = ReleaseAsm|Win64 (AMD64)
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseAsm|Win64 (AMD64).Build.0 = ReleaseAsm|Win64 (AMD64)
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -1,8 +1,8 @@
Building instructions for the DLL versions of Zlib 1.2.x Building instructions for the DLL versions of Zlib 1.2.3
======================================================= ========================================================
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. Microsoft Visual C++ 7.0/7.1, 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:
@@ -11,18 +11,36 @@ binaries from:
More information can be found at this site. More information can be found at this site.
Build instructions Build instructions for Visual Studio 7.x (32 bits)
------------------ --------------------------------------------------
- Unzip zlib*.zip and copy the files from contrib\vstudio\vc7, - Uncompress current zlib, including all contrib/* files
from contrib\vstudio\masmx86 and from contrib\minizip into the same
directory.
- Download the crtdll library from - Download the crtdll library from
http://www.winimage.com/zLibDll/crtdll.zip http://www.winimage.com/zLibDll/crtdll.zip
Unzip crtdll.zip to extract crtdll.lib. Unzip crtdll.zip to extract crtdll.lib on contrib\vstudio\vc7.
- If you are using x86, use the Release target. - Open contrib\vstudio\vc7\zlibvc.sln with Microsoft Visual C++ 7.x
- Open zlibvc.sln with Microsoft Visual C++ 7.0 or 7.1
(Visual Studio .Net 2002 or 2003). (Visual Studio .Net 2002 or 2003).
Build instructions for Visual Studio 2005 (32 bits or 64 bits)
--------------------------------------------------------------
- Uncompress current zlib, including all contrib/* files
- For 32 bits only: download the crtdll library from
http://www.winimage.com/zLibDll/crtdll.zip
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
- Uncompress current zlib, including all contrib/* files
- start Visual Studio 2005 from a platform SDK command prompt, using
the /useenv switch
- Open contrib\vstudio\vc8\zlibvc.sln with Microsoft Visual C++ 8.0
Important Important
--------- ---------

Binary file not shown.

Binary file not shown.

View File

@@ -19,6 +19,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE" PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE" MinimalRebuild="TRUE"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
@@ -63,6 +64,7 @@
Optimization="2" Optimization="2"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
OmitFramePointers="TRUE" OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE" PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="4" RuntimeLibrary="4"
@@ -104,7 +106,7 @@
Name="Source Files" Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
<File <File
RelativePath="miniunz.c"> RelativePath="..\..\minizip\miniunz.c">
</File> </File>
</Filter> </Filter>
<Filter <Filter
@@ -116,7 +118,7 @@
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter> </Filter>
<File <File
RelativePath="zlibwapi.lib"> RelativePath="ReleaseDll\zlibwapi.lib">
</File> </File>
</Files> </Files>
<Globals> <Globals>

View File

@@ -19,6 +19,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE" PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE" MinimalRebuild="TRUE"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
@@ -63,6 +64,7 @@
Optimization="2" Optimization="2"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
OmitFramePointers="TRUE" OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE" PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="4" RuntimeLibrary="4"
@@ -104,7 +106,7 @@
Name="Source Files" Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
<File <File
RelativePath="minizip.c"> RelativePath="..\..\minizip\minizip.c">
</File> </File>
</Filter> </Filter>
<Filter <Filter
@@ -116,7 +118,7 @@
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter> </Filter>
<File <File
RelativePath="zlibwapi.lib"> RelativePath="ReleaseDll\zlibwapi.lib">
</File> </File>
</Files> </Files>
<Globals> <Globals>

View File

@@ -2,8 +2,8 @@
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="7.00" Version="7.00"
Name="testzlib" Name="testZlibDll"
ProjectGUID="{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}" ProjectGUID="{AA6666AA-E09F-4135-9C0C-4FE50C3C654C}"
Keyword="Win32Proj"> Keyword="Win32Proj">
<Platforms> <Platforms>
<Platform <Platform
@@ -19,6 +19,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\.."
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE" PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE" MinimalRebuild="TRUE"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
@@ -63,6 +64,7 @@
Optimization="2" Optimization="2"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
OmitFramePointers="TRUE" OmitFramePointers="TRUE"
AdditionalIncludeDirectories="..\..\.."
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE" PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE"
StringPooling="TRUE" StringPooling="TRUE"
RuntimeLibrary="4" RuntimeLibrary="4"
@@ -104,7 +106,7 @@
Name="Source Files" Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
<File <File
RelativePath="testzlib.c"> RelativePath="..\..\testzlib\testzlib.c">
</File> </File>
</Filter> </Filter>
<Filter <Filter
@@ -116,7 +118,7 @@
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter> </Filter>
<File <File
RelativePath="zlibwapi.lib"> RelativePath="ReleaseDll\zlibwapi.lib">
</File> </File>
</Files> </Files>
<Globals> <Globals>

View File

@@ -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,2,4 FILEVERSION 1,2,3,8
PRODUCTVERSION 1,2,2,4 PRODUCTVERSION 1,2,3,8
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0 FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32 FILEOS VOS_DOS_WINDOWS32
@@ -17,12 +17,12 @@ BEGIN
BEGIN BEGIN
VALUE "FileDescription", "zlib data compression library\0" VALUE "FileDescription", "zlib data compression library\0"
VALUE "FileVersion", "1.2.2.4\0" VALUE "FileVersion", "1.2.3.8\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"

View File

@@ -20,6 +20,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI" PreprocessorDefinitions="WIN32;ZLIB_WINAPI"
ExceptionHandling="FALSE" ExceptionHandling="FALSE"
RuntimeLibrary="5" RuntimeLibrary="5"
@@ -61,6 +62,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI" PreprocessorDefinitions="WIN32;ZLIB_WINAPI"
StringPooling="TRUE" StringPooling="TRUE"
ExceptionHandling="FALSE" ExceptionHandling="FALSE"
@@ -102,6 +104,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;ASMV;ASMINF" PreprocessorDefinitions="WIN32;ZLIB_WINAPI;ASMV;ASMINF"
StringPooling="TRUE" StringPooling="TRUE"
ExceptionHandling="FALSE" ExceptionHandling="FALSE"
@@ -117,7 +120,7 @@
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLibrarianTool" Name="VCLibrarianTool"
AdditionalOptions="gvmat32.obj inffas32.obj /NODEFAULTLIB " AdditionalOptions="..\..\masmx86\gvmat32.obj ..\..\masmx86\inffas32.obj /NODEFAULTLIB "
OutputFile=".\zlibstat\zlibstat.lib" OutputFile=".\zlibstat\zlibstat.lib"
SuppressStartupBanner="TRUE"/> SuppressStartupBanner="TRUE"/>
<Tool <Tool
@@ -144,6 +147,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI" PreprocessorDefinitions="WIN32;ZLIB_WINAPI"
StringPooling="TRUE" StringPooling="TRUE"
ExceptionHandling="FALSE" ExceptionHandling="FALSE"
@@ -182,49 +186,61 @@
Name="Source Files" Name="Source Files"
Filter=""> Filter="">
<File <File
RelativePath=".\adler32.c"> RelativePath="..\..\..\adler32.c">
</File> </File>
<File <File
RelativePath=".\compress.c"> RelativePath="..\..\..\compress.c">
</File> </File>
<File <File
RelativePath=".\crc32.c"> RelativePath="..\..\..\crc32.c">
</File> </File>
<File <File
RelativePath=".\deflate.c"> RelativePath="..\..\..\deflate.c">
</File> </File>
<File <File
RelativePath=".\gvmat32c.c"> RelativePath="..\..\masmx86\gvmat32c.c">
</File> </File>
<File <File
RelativePath=".\gzio.c"> RelativePath="..\..\..\gzclose.c">
</File> </File>
<File <File
RelativePath=".\infback.c"> RelativePath="..\..\..\gzio.c">
</File> </File>
<File <File
RelativePath=".\inffast.c"> RelativePath="..\..\..\gzlib.c">
</File> </File>
<File <File
RelativePath=".\inflate.c"> RelativePath="..\..\..\gzread.c">
</File> </File>
<File <File
RelativePath=".\inftrees.c"> RelativePath="..\..\..\gzwrite.c">
</File> </File>
<File <File
RelativePath=".\ioapi.c"> RelativePath="..\..\..\infback.c">
</File> </File>
<File <File
RelativePath=".\trees.c"> RelativePath="..\..\..\inffast.c">
</File> </File>
<File <File
RelativePath=".\uncompr.c"> RelativePath="..\..\..\inflate.c">
</File> </File>
<File <File
RelativePath=".\unzip.c"> RelativePath="..\..\..\inftrees.c">
</File> </File>
<File <File
RelativePath=".\zip.c"> 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>
<File <File
RelativePath=".\zlib.rc"> RelativePath=".\zlib.rc">
@@ -233,7 +249,7 @@
RelativePath=".\zlibvc.def"> RelativePath=".\zlibvc.def">
</File> </File>
<File <File
RelativePath=".\zutil.c"> RelativePath="..\..\..\zutil.c">
</File> </File>
</Filter> </Filter>
</Files> </Files>

View File

@@ -1,5 +1,5 @@
VERSION 1.21 VERSION 1.23
HEAPSIZE 1048576,8192 HEAPSIZE 1048576,8192
@@ -53,7 +53,7 @@ EXPORTS
deflateBound @47 deflateBound @47
gzclearerr @48 gzclearerr @48
gzungetc @49 gzungetc @49
zlibCompileFlags @50 zlibCompileFlags @50
deflatePrime @51 deflatePrime @51
unzOpen @61 unzOpen @61

View File

@@ -7,6 +7,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "minizip.vcproj",
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniunz", "miniunz.vcproj", "{C52F9E7B-498A-42BE-8DB4-85A15694382A}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniunz", "miniunz.vcproj", "{C52F9E7B-498A-42BE-8DB4-85A15694382A}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testZlibDll", "testzlib.vcproj", "{AA6666AA-E09F-4135-9C0C-4FE50C3C654C}"
EndProject
Global Global
GlobalSection(SolutionConfiguration) = preSolution GlobalSection(SolutionConfiguration) = preSolution
ConfigName.0 = Debug ConfigName.0 = Debug
@@ -58,6 +60,16 @@ Global
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm.Build.0 = Release|Win32 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm.Build.0 = Release|Win32
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutCrtdll.ActiveCfg = Release|Win32 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutCrtdll.ActiveCfg = Release|Win32
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutCrtdll.Build.0 = Release|Win32 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutCrtdll.Build.0 = Release|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654C}.Debug.ActiveCfg = Debug|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654C}.Debug.Build.0 = Debug|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654C}.Release.ActiveCfg = Release|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654C}.Release.Build.0 = Release|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654C}.ReleaseAxp.ActiveCfg = Release|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654C}.ReleaseAxp.Build.0 = Release|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654C}.ReleaseWithoutAsm.ActiveCfg = Release|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654C}.ReleaseWithoutAsm.Build.0 = Release|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654C}.ReleaseWithoutCrtdll.ActiveCfg = Release|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654C}.ReleaseWithoutCrtdll.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection EndGlobalSection

View File

@@ -20,6 +20,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32,ZLIB_WINAPI,ASMV,ASMINF" PreprocessorDefinitions="WIN32,ZLIB_WINAPI,ASMV,ASMINF"
ExceptionHandling="FALSE" ExceptionHandling="FALSE"
RuntimeLibrary="1" RuntimeLibrary="1"
@@ -35,7 +36,7 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386" AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="gvmat32.obj inffas32.obj" AdditionalDependencies="..\..\masmx86\gvmat32.obj ..\..\masmx86\inffas32.obj"
OutputFile=".\DebugDll\zlibwapi.dll" OutputFile=".\DebugDll\zlibwapi.dll"
LinkIncremental="2" LinkIncremental="2"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
@@ -72,10 +73,12 @@
IntermediateDirectory=".\zlibDllWithoutAsm" IntermediateDirectory=".\zlibDllWithoutAsm"
ConfigurationType="2" ConfigurationType="2"
UseOfMFC="0" UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"> ATLMinimizesCRunTimeLibraryUsage="FALSE"
WholeProgramOptimization="TRUE">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32,ZLIB_WINAPI" PreprocessorDefinitions="WIN32,ZLIB_WINAPI"
StringPooling="TRUE" StringPooling="TRUE"
ExceptionHandling="FALSE" ExceptionHandling="FALSE"
@@ -134,10 +137,12 @@
IntermediateDirectory=".\zlibDllWithoutCrtDll" IntermediateDirectory=".\zlibDllWithoutCrtDll"
ConfigurationType="2" ConfigurationType="2"
UseOfMFC="0" UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"> ATLMinimizesCRunTimeLibraryUsage="FALSE"
WholeProgramOptimization="TRUE">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32,ZLIB_WINAPI,ASMV,ASMINF" PreprocessorDefinitions="WIN32,ZLIB_WINAPI,ASMV,ASMINF"
StringPooling="TRUE" StringPooling="TRUE"
ExceptionHandling="FALSE" ExceptionHandling="FALSE"
@@ -156,7 +161,7 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386" AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="gvmat32.obj inffas32.obj " AdditionalDependencies="..\..\masmx86\gvmat32.obj ..\..\masmx86\inffas32.obj "
OutputFile=".\zlibDllWithoutCrtDll\zlibwapi.dll" OutputFile=".\zlibDllWithoutCrtDll\zlibwapi.dll"
LinkIncremental="1" LinkIncremental="1"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
@@ -196,10 +201,12 @@
IntermediateDirectory=".\zlibvc__" IntermediateDirectory=".\zlibvc__"
ConfigurationType="2" ConfigurationType="2"
UseOfMFC="0" UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"> ATLMinimizesCRunTimeLibraryUsage="FALSE"
WholeProgramOptimization="TRUE">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32,ZLIB_WINAPI" PreprocessorDefinitions="WIN32,ZLIB_WINAPI"
StringPooling="TRUE" StringPooling="TRUE"
ExceptionHandling="FALSE" ExceptionHandling="FALSE"
@@ -256,10 +263,12 @@
IntermediateDirectory=".\ReleaseDll" IntermediateDirectory=".\ReleaseDll"
ConfigurationType="2" ConfigurationType="2"
UseOfMFC="0" UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"> ATLMinimizesCRunTimeLibraryUsage="FALSE"
WholeProgramOptimization="TRUE">
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32,ZLIB_WINAPI,ASMV,ASMINF" PreprocessorDefinitions="WIN32,ZLIB_WINAPI,ASMV,ASMINF"
StringPooling="TRUE" StringPooling="TRUE"
ExceptionHandling="FALSE" ExceptionHandling="FALSE"
@@ -278,7 +287,7 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386" AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="gvmat32.obj inffas32.obj crtdll.lib" AdditionalDependencies="..\..\masmx86\gvmat32.obj ..\..\masmx86\inffas32.obj crtdll.lib"
OutputFile=".\ReleaseDll\zlibwapi.dll" OutputFile=".\ReleaseDll\zlibwapi.dll"
LinkIncremental="1" LinkIncremental="1"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
@@ -318,19 +327,19 @@
Name="Source Files" Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"> Filter="cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90">
<File <File
RelativePath=".\adler32.c"> RelativePath="..\..\..\adler32.c">
</File> </File>
<File <File
RelativePath=".\compress.c"> RelativePath="..\..\..\compress.c">
</File> </File>
<File <File
RelativePath=".\crc32.c"> RelativePath="..\..\..\crc32.c">
</File> </File>
<File <File
RelativePath=".\deflate.c"> RelativePath="..\..\..\deflate.c">
</File> </File>
<File <File
RelativePath=".\gvmat32c.c"> RelativePath="..\..\masmx86\gvmat32c.c">
<FileConfiguration <FileConfiguration
Name="ReleaseWithoutAsm|Win32" Name="ReleaseWithoutAsm|Win32"
ExcludedFromBuild="TRUE"> ExcludedFromBuild="TRUE">
@@ -339,34 +348,46 @@
</FileConfiguration> </FileConfiguration>
</File> </File>
<File <File
RelativePath=".\gzio.c"> RelativePath="..\..\..\gzclose.c">
</File> </File>
<File <File
RelativePath=".\infback.c"> RelativePath="..\..\..\gzio.c">
</File> </File>
<File <File
RelativePath=".\inffast.c"> RelativePath="..\..\..\gzlib.c">
</File> </File>
<File <File
RelativePath=".\inflate.c"> RelativePath="..\..\..\gzread.c">
</File> </File>
<File <File
RelativePath=".\inftrees.c"> RelativePath="..\..\..\gzwrite.c">
</File> </File>
<File <File
RelativePath=".\ioapi.c"> RelativePath="..\..\..\infback.c">
</File> </File>
<File <File
RelativePath=".\iowin32.c"> RelativePath="..\..\..\inffast.c">
</File> </File>
<File <File
RelativePath=".\trees.c"> RelativePath="..\..\..\inflate.c">
</File> </File>
<File <File
RelativePath=".\uncompr.c"> RelativePath="..\..\..\inftrees.c">
</File> </File>
<File <File
RelativePath=".\unzip.c"> RelativePath="..\..\minizip\ioapi.c">
</File>
<File
RelativePath="..\..\minizip\iowin32.c">
</File>
<File
RelativePath="..\..\..\trees.c">
</File>
<File
RelativePath="..\..\..\uncompr.c">
</File>
<File
RelativePath="..\..\minizip\unzip.c">
<FileConfiguration <FileConfiguration
Name="Release|Win32"> Name="Release|Win32">
<Tool <Tool
@@ -376,7 +397,7 @@
</FileConfiguration> </FileConfiguration>
</File> </File>
<File <File
RelativePath=".\zip.c"> RelativePath="..\..\minizip\zip.c">
<FileConfiguration <FileConfiguration
Name="Release|Win32"> Name="Release|Win32">
<Tool <Tool
@@ -392,38 +413,38 @@
RelativePath=".\zlibvc.def"> RelativePath=".\zlibvc.def">
</File> </File>
<File <File
RelativePath=".\zutil.c"> RelativePath="..\..\..\zutil.c">
</File> </File>
</Filter> </Filter>
<Filter <Filter
Name="Header Files" Name="Header Files"
Filter="h;hpp;hxx;hm;inl;fi;fd"> Filter="h;hpp;hxx;hm;inl;fi;fd">
<File <File
RelativePath=".\deflate.h"> RelativePath="..\..\..\deflate.h">
</File> </File>
<File <File
RelativePath=".\infblock.h"> RelativePath="..\..\..\infblock.h">
</File> </File>
<File <File
RelativePath=".\infcodes.h"> RelativePath="..\..\..\infcodes.h">
</File> </File>
<File <File
RelativePath=".\inffast.h"> RelativePath="..\..\..\inffast.h">
</File> </File>
<File <File
RelativePath=".\inftrees.h"> RelativePath="..\..\..\inftrees.h">
</File> </File>
<File <File
RelativePath=".\infutil.h"> RelativePath="..\..\..\infutil.h">
</File> </File>
<File <File
RelativePath=".\zconf.h"> RelativePath="..\..\..\zconf.h">
</File> </File>
<File <File
RelativePath=".\zlib.h"> RelativePath="..\..\..\zlib.h">
</File> </File>
<File <File
RelativePath=".\zutil.h"> RelativePath="..\..\..\zutil.h">
</File> </File>
</Filter> </Filter>
<Filter <Filter

View File

@@ -0,0 +1,566 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="miniunz"
ProjectGUID="{C52F9E7B-498A-42BE-8DB4-85A15694382A}"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
<Platform
Name="Itanium"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="x86\MiniUnzip$(ConfigurationName)"
IntermediateDirectory="x86\MiniUnzip$(ConfigurationName)\Tmp"
ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="0"
RuntimeLibrary="1"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="x86\ZlibDllDebug\zlibwapi.lib"
OutputFile="$(OutDir)/miniunz.exe"
LinkIncremental="2"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/miniunz.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="x64\MiniUnzip$(ConfigurationName)"
IntermediateDirectory="x64\MiniUnzip$(ConfigurationName)\Tmp"
ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64"
MinimalRebuild="true"
BasicRuntimeChecks="0"
RuntimeLibrary="3"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="x64\ZlibDllDebug\zlibwapi.lib"
OutputFile="$(OutDir)/miniunz.exe"
LinkIncremental="2"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/miniunz.pdb"
SubSystem="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Itanium"
OutputDirectory="ia64\MiniUnzip$(ConfigurationName)"
IntermediateDirectory="ia64\MiniUnzip$(ConfigurationName)\Tmp"
ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="2"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64"
MinimalRebuild="true"
BasicRuntimeChecks="0"
RuntimeLibrary="3"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ia64\ZlibDllDebug\zlibwapi.lib"
OutputFile="$(OutDir)/miniunz.exe"
LinkIncremental="2"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/miniunz.pdb"
SubSystem="1"
TargetMachine="5"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="x86\MiniUnzip$(ConfigurationName)"
IntermediateDirectory="x86\MiniUnzip$(ConfigurationName)\Tmp"
ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE"
StringPooling="true"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="x86\ZlibDllRelease\zlibwapi.lib"
OutputFile="$(OutDir)/miniunz.exe"
LinkIncremental="1"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="x64\MiniUnzip$(ConfigurationName)"
IntermediateDirectory="x64\MiniUnzip$(ConfigurationName)\Tmp"
ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64"
StringPooling="true"
BasicRuntimeChecks="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="x64\ZlibDllRelease\zlibwapi.lib"
OutputFile="$(OutDir)/miniunz.exe"
LinkIncremental="1"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Itanium"
OutputDirectory="ia64\MiniUnzip$(ConfigurationName)"
IntermediateDirectory="ia64\MiniUnzip$(ConfigurationName)\Tmp"
ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="2"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64"
StringPooling="true"
BasicRuntimeChecks="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ia64\ZlibDllRelease\zlibwapi.lib"
OutputFile="$(OutDir)/miniunz.exe"
LinkIncremental="1"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="5"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<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>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,563 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="minizip"
ProjectGUID="{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
<Platform
Name="Itanium"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="x86\MiniZip$(ConfigurationName)"
IntermediateDirectory="x86\MiniZip$(ConfigurationName)\Tmp"
ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="0"
RuntimeLibrary="1"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="x86\ZlibDllDebug\zlibwapi.lib"
OutputFile="$(OutDir)/minizip.exe"
LinkIncremental="2"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/minizip.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="x64\$(ConfigurationName)"
IntermediateDirectory="x64\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64"
MinimalRebuild="true"
BasicRuntimeChecks="0"
RuntimeLibrary="3"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="x64\ZlibDllDebug\zlibwapi.lib"
OutputFile="$(OutDir)/minizip.exe"
LinkIncremental="2"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/minizip.pdb"
SubSystem="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Itanium"
OutputDirectory="ia64\$(ConfigurationName)"
IntermediateDirectory="ia64\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="2"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64"
MinimalRebuild="true"
BasicRuntimeChecks="0"
RuntimeLibrary="3"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ia64\ZlibDllDebug\zlibwapi.lib"
OutputFile="$(OutDir)/minizip.exe"
LinkIncremental="2"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/minizip.pdb"
SubSystem="1"
TargetMachine="5"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="x86\MiniZip$(ConfigurationName)"
IntermediateDirectory="x86\MiniZip$(ConfigurationName)\Tmp"
ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE"
StringPooling="true"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="x86\ZlibDllRelease\zlibwapi.lib"
OutputFile="$(OutDir)/minizip.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="x64\$(ConfigurationName)"
IntermediateDirectory="x64\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64"
StringPooling="true"
BasicRuntimeChecks="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="x64\ZlibDllRelease\zlibwapi.lib"
OutputFile="$(OutDir)/minizip.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Itanium"
OutputDirectory="ia64\$(ConfigurationName)"
IntermediateDirectory="ia64\$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="2"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64"
StringPooling="true"
BasicRuntimeChecks="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ia64\ZlibDllRelease\zlibwapi.lib"
OutputFile="$(OutDir)/minizip.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="5"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<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>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,948 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="testzlib"
ProjectGUID="{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}"
RootNamespace="testzlib"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
<Platform
Name="Itanium"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="x86\TestZlib$(ConfigurationName)"
IntermediateDirectory="x86\TestZlib$(ConfigurationName)\Tmp"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\.."
PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="0"
RuntimeLibrary="1"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
AssemblerOutput="4"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\masmx86\gvmat32.obj ..\..\masmx86\inffas32.obj"
OutputFile="$(OutDir)/testzlib.exe"
LinkIncremental="2"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/testzlib.pdb"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="x64\TestZlib$(ConfigurationName)"
IntermediateDirectory="x64\TestZlib$(ConfigurationName)\Tmp"
ConfigurationType="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\.."
PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE"
BasicRuntimeChecks="0"
RuntimeLibrary="3"
BufferSecurityCheck="false"
AssemblerListingLocation="$(IntDir)\"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj"
GenerateManifest="false"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Itanium"
OutputDirectory="ia64\TestZlib$(ConfigurationName)"
IntermediateDirectory="ia64\TestZlib$(ConfigurationName)\Tmp"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="2"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\.."
PreprocessorDefinitions="ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;WIN64"
MinimalRebuild="true"
BasicRuntimeChecks="0"
RuntimeLibrary="3"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
AssemblerOutput="4"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/testzlib.exe"
LinkIncremental="2"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/testzlib.pdb"
SubSystem="1"
TargetMachine="5"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="ReleaseWithoutAsm|Win32"
OutputDirectory="x86\TestZlib$(ConfigurationName)"
IntermediateDirectory="x86\TestZlib$(ConfigurationName)\Tmp"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\..\.."
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/testzlib.exe"
LinkIncremental="1"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="ReleaseWithoutAsm|x64"
OutputDirectory="x64\TestZlib$(ConfigurationName)"
IntermediateDirectory="x64\TestZlib$(ConfigurationName)\Tmp"
ConfigurationType="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\.."
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE"
BasicRuntimeChecks="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
AssemblerListingLocation="$(IntDir)\"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies=""
GenerateManifest="false"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="ReleaseWithoutAsm|Itanium"
OutputDirectory="ia64\TestZlib$(ConfigurationName)"
IntermediateDirectory="ia64\TestZlib$(ConfigurationName)\Tmp"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="2"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\..\.."
PreprocessorDefinitions="ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;WIN64"
StringPooling="true"
BasicRuntimeChecks="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/testzlib.exe"
LinkIncremental="1"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="5"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="x86\TestZlib$(ConfigurationName)"
IntermediateDirectory="x86\TestZlib$(ConfigurationName)\Tmp"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\..\.."
PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
BasicRuntimeChecks="0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\masmx86\gvmat32.obj ..\..\masmx86\inffas32.obj"
OutputFile="$(OutDir)/testzlib.exe"
LinkIncremental="1"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="x64\TestZlib$(ConfigurationName)"
IntermediateDirectory="x64\TestZlib$(ConfigurationName)\Tmp"
ConfigurationType="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\.."
PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE"
BasicRuntimeChecks="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
AssemblerListingLocation="$(IntDir)\"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj"
GenerateManifest="false"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Itanium"
OutputDirectory="ia64\TestZlib$(ConfigurationName)"
IntermediateDirectory="ia64\TestZlib$(ConfigurationName)\Tmp"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="2"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="..\..\.."
PreprocessorDefinitions="ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;WIN64"
StringPooling="true"
BasicRuntimeChecks="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/testzlib.exe"
LinkIncremental="1"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="5"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
>
<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"
>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseWithoutAsm|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseWithoutAsm|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win64 (AMD64)"
ExcludedFromBuild="TRUE"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win64 (AMD64)"
ExcludedFromBuild="TRUE"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseAsm|Win64 (AMD64)"
ExcludedFromBuild="TRUE"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\infback.c"
>
</File>
<File
RelativePath="..\..\masmx64\inffas8664.c"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseWithoutAsm|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseWithoutAsm|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\inffast.c"
>
</File>
<File
RelativePath="..\..\..\inflate.c"
>
</File>
<File
RelativePath="..\..\..\inftrees.c"
>
</File>
<File
RelativePath="..\..\testzlib\testzlib.c"
>
</File>
<File
RelativePath="..\..\..\trees.c"
>
</File>
<File
RelativePath="..\..\..\uncompr.c"
>
</File>
<File
RelativePath="..\..\..\zutil.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>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -2,29 +2,31 @@
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8,00" Version="8,00"
Name="testzlib8" Name="TestZlibDll"
ProjectGUID="{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}" ProjectGUID="{C52F9E7B-498A-42BE-8DB4-85A15694366A}"
Keyword="Win32Proj" Keyword="Win32Proj"
SignManifests="true"
> >
<Platforms> <Platforms>
<Platform <Platform
Name="Win32" Name="Win32"
/> />
<Platform <Platform
Name="Win64 (AMD64)" Name="x64"
/>
<Platform
Name="Itanium"
/> />
</Platforms> </Platforms>
<ToolFiles> <ToolFiles>
<DefaultToolFile
FileName="masm.tool"
/>
</ToolFiles> </ToolFiles>
<Configurations> <Configurations>
<Configuration <Configuration
Name="Debug|Win32" Name="Debug|Win32"
OutputDirectory="x86\$(ConfigurationName)" OutputDirectory="x86\TestZlibDll$(ConfigurationName)"
IntermediateDirectory="x86\$(ConfigurationName)" IntermediateDirectory="x86\TestZlibDll$(ConfigurationName)\Tmp"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2" CharacterSet="2"
> >
<Tool <Tool
@@ -33,9 +35,6 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
/> />
<Tool
Name="MASM"
/>
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
/> />
@@ -48,14 +47,16 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE" AdditionalIncludeDirectories="..\..\..;..\..\minizip"
MinimalRebuild="TRUE" PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE"
BasicRuntimeChecks="3" MinimalRebuild="true"
BasicRuntimeChecks="0"
RuntimeLibrary="1" RuntimeLibrary="1"
BufferSecurityCheck="false"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
AssemblerOutput="4" AssemblerListingLocation="$(IntDir)\"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="TRUE" Detect64BitPortabilityProblems="true"
DebugInformationFormat="4" DebugInformationFormat="4"
/> />
<Tool <Tool
@@ -69,10 +70,11 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="gvmat32.obj inffas32.obj" AdditionalDependencies="x86\ZlibDllDebug\zlibwapi.lib"
OutputFile="$(OutDir)/testzlib.exe" OutputFile="$(OutDir)/testzlib.exe"
LinkIncremental="2" LinkIncremental="2"
GenerateDebugInformation="TRUE" GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/testzlib.pdb" ProgramDatabaseFile="$(OutDir)/testzlib.pdb"
SubSystem="1" SubSystem="1"
TargetMachine="1" TargetMachine="1"
@@ -89,6 +91,9 @@
<Tool <Tool
Name="VCBscMakeTool" Name="VCBscMakeTool"
/> />
<Tool
Name="VCFxCopTool"
/>
<Tool <Tool
Name="VCAppVerifierTool" Name="VCAppVerifierTool"
/> />
@@ -100,10 +105,11 @@
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="Debug|Win64 (AMD64)" Name="Debug|x64"
OutputDirectory="amd64\$(ConfigurationName)" OutputDirectory="x64\TestZlibDll$(ConfigurationName)"
IntermediateDirectory="amd64\$(ConfigurationName)" IntermediateDirectory="x64\TestZlibDll$(ConfigurationName)\Tmp"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2" CharacterSet="2"
> >
<Tool <Tool
@@ -112,9 +118,6 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
/> />
<Tool
Name="MASM"
/>
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
/> />
@@ -128,14 +131,16 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE" AdditionalIncludeDirectories="..\..\..;..\..\minizip"
MinimalRebuild="TRUE" PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64"
BasicRuntimeChecks="3" MinimalRebuild="true"
RuntimeLibrary="1" BasicRuntimeChecks="0"
RuntimeLibrary="3"
BufferSecurityCheck="false"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
AssemblerOutput="4" AssemblerListingLocation="$(IntDir)\"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="TRUE" Detect64BitPortabilityProblems="true"
DebugInformationFormat="3" DebugInformationFormat="3"
/> />
<Tool <Tool
@@ -146,14 +151,14 @@
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
CommandLine=""
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="gvmat64.obj inffasx64.obj rdtsc64.obj" AdditionalDependencies="x64\ZlibDllDebug\zlibwapi.lib"
OutputFile="$(OutDir)/testzlib.exe" OutputFile="$(OutDir)/testzlib.exe"
LinkIncremental="2" LinkIncremental="2"
GenerateDebugInformation="TRUE" GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/testzlib.pdb" ProgramDatabaseFile="$(OutDir)/testzlib.pdb"
SubSystem="1" SubSystem="1"
TargetMachine="17" TargetMachine="17"
@@ -170,6 +175,96 @@
<Tool <Tool
Name="VCBscMakeTool" Name="VCBscMakeTool"
/> />
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Itanium"
OutputDirectory="ia64\TestZlibDll$(ConfigurationName)"
IntermediateDirectory="ia64\TestZlibDll$(ConfigurationName)\Tmp"
ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="2"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\minizip"
PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;_DEBUG;_CONSOLE;WIN64"
MinimalRebuild="true"
BasicRuntimeChecks="0"
RuntimeLibrary="3"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ia64\ZlibDllDebug\zlibwapi.lib"
OutputFile="$(OutDir)/testzlib.exe"
LinkIncremental="2"
GenerateManifest="false"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/testzlib.pdb"
SubSystem="1"
TargetMachine="5"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool <Tool
Name="VCWebDeploymentTool" Name="VCWebDeploymentTool"
/> />
@@ -179,9 +274,10 @@
</Configuration> </Configuration>
<Configuration <Configuration
Name="Release|Win32" Name="Release|Win32"
OutputDirectory="x86\$(ConfigurationName)" OutputDirectory="x86\TestZlibDll$(ConfigurationName)"
IntermediateDirectory="x86\$(ConfigurationName)" IntermediateDirectory="x86\TestZlibDll$(ConfigurationName)\Tmp"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2" CharacterSet="2"
> >
<Tool <Tool
@@ -190,9 +286,6 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
/> />
<Tool
Name="MASM"
/>
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
/> />
@@ -206,14 +299,18 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2" Optimization="2"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
OmitFramePointers="TRUE" OmitFramePointers="true"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE" AdditionalIncludeDirectories="..\..\..;..\..\minizip"
StringPooling="TRUE" PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE"
StringPooling="true"
BasicRuntimeChecks="0"
RuntimeLibrary="0" RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE" BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="TRUE" Detect64BitPortabilityProblems="true"
DebugInformationFormat="3" DebugInformationFormat="3"
/> />
<Tool <Tool
@@ -227,9 +324,11 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="x86\ZlibDllRelease\zlibwapi.lib"
OutputFile="$(OutDir)/testzlib.exe" OutputFile="$(OutDir)/testzlib.exe"
LinkIncremental="1" LinkIncremental="1"
GenerateDebugInformation="TRUE" GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="1" SubSystem="1"
OptimizeReferences="2" OptimizeReferences="2"
EnableCOMDATFolding="2" EnableCOMDATFolding="2"
@@ -248,6 +347,9 @@
<Tool <Tool
Name="VCBscMakeTool" Name="VCBscMakeTool"
/> />
<Tool
Name="VCFxCopTool"
/>
<Tool <Tool
Name="VCAppVerifierTool" Name="VCAppVerifierTool"
/> />
@@ -259,10 +361,11 @@
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="Release|Win64 (AMD64)" Name="Release|x64"
OutputDirectory="amd64\$(ConfigurationName)" OutputDirectory="x64\TestZlibDll$(ConfigurationName)"
IntermediateDirectory="amd64\$(ConfigurationName)" IntermediateDirectory="x64\TestZlibDll$(ConfigurationName)\Tmp"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2" CharacterSet="2"
> >
<Tool <Tool
@@ -271,9 +374,6 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
/> />
<Tool
Name="MASM"
/>
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
/> />
@@ -288,14 +388,18 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2" Optimization="2"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
OmitFramePointers="TRUE" OmitFramePointers="true"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE" AdditionalIncludeDirectories="..\..\..;..\..\minizip"
StringPooling="TRUE" PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64"
RuntimeLibrary="0" StringPooling="true"
EnableFunctionLevelLinking="TRUE" BasicRuntimeChecks="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
AssemblerListingLocation="$(IntDir)\"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="TRUE" Detect64BitPortabilityProblems="true"
DebugInformationFormat="3" DebugInformationFormat="3"
/> />
<Tool <Tool
@@ -309,10 +413,11 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="rdtsc64.obj" AdditionalDependencies="x64\ZlibDllRelease\zlibwapi.lib"
OutputFile="$(OutDir)/testzlib.exe" OutputFile="$(OutDir)/testzlib.exe"
LinkIncremental="1" LinkIncremental="1"
GenerateDebugInformation="TRUE" GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="1" SubSystem="1"
OptimizeReferences="2" OptimizeReferences="2"
EnableCOMDATFolding="2" EnableCOMDATFolding="2"
@@ -332,83 +437,7 @@
Name="VCBscMakeTool" Name="VCBscMakeTool"
/> />
<Tool <Tool
Name="VCWebDeploymentTool" Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="ReleaseAsm|Win32"
OutputDirectory="x86\$(ConfigurationName)"
IntermediateDirectory="x86\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="MASM"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="gvmat32.obj inffas32.obj"
OutputFile="$(OutDir)/testzlib.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
OptimizeForWindows98="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/> />
<Tool <Tool
Name="VCAppVerifierTool" Name="VCAppVerifierTool"
@@ -421,22 +450,19 @@
/> />
</Configuration> </Configuration>
<Configuration <Configuration
Name="ReleaseAsm|Win64 (AMD64)" Name="Release|Itanium"
OutputDirectory="amd64\$(ConfigurationName)" OutputDirectory="ia64\TestZlibDll$(ConfigurationName)"
IntermediateDirectory="amd64\$(ConfigurationName)" IntermediateDirectory="ia64\TestZlibDll$(ConfigurationName)\Tmp"
ConfigurationType="1" ConfigurationType="1"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
CharacterSet="2" CharacterSet="2"
> >
<Tool <Tool
Name="VCPreBuildEventTool" Name="VCPreBuildEventTool"
CommandLine=""
/> />
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
/> />
<Tool
Name="MASM"
/>
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
/> />
@@ -445,21 +471,24 @@
/> />
<Tool <Tool
Name="VCMIDLTool" Name="VCMIDLTool"
TargetEnvironment="3" TargetEnvironment="2"
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2" Optimization="2"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
OmitFramePointers="TRUE" OmitFramePointers="true"
PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE" AdditionalIncludeDirectories="..\..\..;..\..\minizip"
StringPooling="TRUE" PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ZLIB_WINAPI;NDEBUG;_CONSOLE;WIN64"
RuntimeLibrary="0" StringPooling="true"
EnableFunctionLevelLinking="TRUE" BasicRuntimeChecks="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
AssemblerOutput="4" AssemblerListingLocation="$(IntDir)\"
WarningLevel="3" WarningLevel="3"
Detect64BitPortabilityProblems="TRUE" Detect64BitPortabilityProblems="true"
DebugInformationFormat="3" DebugInformationFormat="3"
/> />
<Tool <Tool
@@ -470,19 +499,19 @@
/> />
<Tool <Tool
Name="VCPreLinkEventTool" Name="VCPreLinkEventTool"
CommandLine=""
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="gvmat64.obj inffasx64.obj rdtsc64.obj" AdditionalDependencies="ia64\ZlibDllRelease\zlibwapi.lib"
OutputFile="$(OutDir)/testzlib.exe" OutputFile="$(OutDir)/testzlib.exe"
LinkIncremental="1" LinkIncremental="1"
GenerateDebugInformation="TRUE" GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="1" SubSystem="1"
OptimizeReferences="2" OptimizeReferences="2"
EnableCOMDATFolding="2" EnableCOMDATFolding="2"
OptimizeForWindows98="1" OptimizeForWindows98="1"
TargetMachine="17" TargetMachine="5"
/> />
<Tool <Tool
Name="VCALinkTool" Name="VCALinkTool"
@@ -496,6 +525,12 @@
<Tool <Tool
Name="VCBscMakeTool" Name="VCBscMakeTool"
/> />
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool <Tool
Name="VCWebDeploymentTool" Name="VCWebDeploymentTool"
/> />
@@ -512,113 +547,7 @@
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
> >
<File <File
RelativePath=".\adler32.c" RelativePath="..\..\testzlib\testzlib.c"
>
</File>
<File
RelativePath=".\compress.c"
>
</File>
<File
RelativePath=".\crc32.c"
>
</File>
<File
RelativePath=".\deflate.c"
>
</File>
<File
RelativePath=".\gvmat32c.c"
>
<FileConfiguration
Name="Debug|Win64 (AMD64)"
ExcludedFromBuild="TRUE"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win64 (AMD64)"
ExcludedFromBuild="TRUE"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseAsm|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseAsm|Win64 (AMD64)"
ExcludedFromBuild="TRUE"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\infback.c"
>
</File>
<File
RelativePath=".\inffas8664.c"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="TRUE"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseAsm|Win32"
ExcludedFromBuild="TRUE"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\inffast.c"
>
</File>
<File
RelativePath=".\inflate.c"
>
</File>
<File
RelativePath=".\inftrees.c"
>
</File>
<File
RelativePath="testzlib.c"
>
</File>
<File
RelativePath=".\trees.c"
>
</File>
<File
RelativePath=".\uncompr.c"
>
</File>
<File
RelativePath=".\zutil.c"
> >
</File> </File>
</Filter> </Filter>

View File

@@ -0,0 +1,32 @@
#include <windows.h>
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
FILEVERSION 1,2,3,0
PRODUCTVERSION 1,2,3,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS_DOS_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0 // not used
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
//language ID = U.S. English, char set = Windows, Multilingual
BEGIN
VALUE "FileDescription", "zlib data compression library\0"
VALUE "FileVersion", "1.2.3.0\0"
VALUE "InternalName", "zlib\0"
VALUE "OriginalFilename", "zlib.dll\0"
VALUE "ProductName", "ZLib.DLL\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
VALUE "LegalCopyright", "(C) 1995-2003 Jean-loup Gailly & Mark Adler\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1252
END
END

View File

@@ -0,0 +1,881 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="zlibstat"
ProjectGUID="{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
<Platform
Name="Itanium"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="x86\ZlibStat$(ConfigurationName)"
IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE"
ExceptionHandling="0"
RuntimeLibrary="1"
BufferSecurityCheck="false"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB"
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="x64\ZlibStat$(ConfigurationName)"
IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;WIN64"
ExceptionHandling="0"
RuntimeLibrary="3"
BufferSecurityCheck="false"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB"
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Itanium"
OutputDirectory="ia64\ZlibStat$(ConfigurationName)"
IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="2"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;WIN64"
ExceptionHandling="0"
RuntimeLibrary="3"
BufferSecurityCheck="false"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB"
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="x86\ZlibStat$(ConfigurationName)"
IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ASMV;ASMINF"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB"
AdditionalDependencies="..\..\masmx86\gvmat32.obj ..\..\masmx86\inffas32.obj "
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="x64\ZlibStat$(ConfigurationName)"
IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ASMV;ASMINF;WIN64"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB"
AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj "
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Itanium"
OutputDirectory="ia64\ZlibStat$(ConfigurationName)"
IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="2"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;WIN64"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB"
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="ReleaseWithoutAsm|Win32"
OutputDirectory="x86\ZlibStat$(ConfigurationName)"
IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB"
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="ReleaseWithoutAsm|x64"
OutputDirectory="x64\ZlibStat$(ConfigurationName)"
IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;WIN64"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB"
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="ReleaseWithoutAsm|Itanium"
OutputDirectory="ia64\ZlibStat$(ConfigurationName)"
IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp"
ConfigurationType="4"
InheritedPropertySheets="UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="2"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;WIN64"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
AssemblerListingLocation="$(IntDir)\"
ObjectFile="$(IntDir)\"
ProgramDataBaseFileName="$(OutDir)\"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
Culture="1036"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB"
OutputFile="$(OutDir)\zlibstat.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
>
<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"
>
<FileConfiguration
Name="Debug|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseWithoutAsm|x64"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseWithoutAsm|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\gzclose.c">
</File>
<File
RelativePath="..\..\..\gzio.c">
</File>
<File
RelativePath="..\..\..\gzlib.c">
</File>
<File
RelativePath="..\..\..\gzread.c">
</File>
<File
RelativePath="..\..\..\gzwrite.c">
</File>
<File
RelativePath="..\..\..\infback.c"
>
</File>
<File
RelativePath="..\..\masmx64\inffas8664.c"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseWithoutAsm|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="ReleaseWithoutAsm|Itanium"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</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>

View File

@@ -0,0 +1,92 @@
VERSION 1.23
HEAPSIZE 1048576,8192
EXPORTS
adler32 @1
compress @2
crc32 @3
deflate @4
deflateCopy @5
deflateEnd @6
deflateInit2_ @7
deflateInit_ @8
deflateParams @9
deflateReset @10
deflateSetDictionary @11
gzclose @12
gzdopen @13
gzerror @14
gzflush @15
gzopen @16
gzread @17
gzwrite @18
inflate @19
inflateEnd @20
inflateInit2_ @21
inflateInit_ @22
inflateReset @23
inflateSetDictionary @24
inflateSync @25
uncompress @26
zlibVersion @27
gzprintf @28
gzputc @29
gzgetc @30
gzseek @31
gzrewind @32
gztell @33
gzeof @34
gzsetparams @35
zError @36
inflateSyncPoint @37
get_crc_table @38
compress2 @39
gzputs @40
gzgets @41
inflateCopy @42
inflateBackInit_ @43
inflateBack @44
inflateBackEnd @45
compressBound @46
deflateBound @47
gzclearerr @48
gzungetc @49
zlibCompileFlags @50
deflatePrime @51
unzOpen @61
unzClose @62
unzGetGlobalInfo @63
unzGetCurrentFileInfo @64
unzGoToFirstFile @65
unzGoToNextFile @66
unzOpenCurrentFile @67
unzReadCurrentFile @68
unzOpenCurrentFile3 @69
unztell @70
unzeof @71
unzCloseCurrentFile @72
unzGetGlobalComment @73
unzStringFileNameCompare @74
unzLocateFile @75
unzGetLocalExtrafield @76
unzOpen2 @77
unzOpenCurrentFile2 @78
unzOpenCurrentFilePassword @79
zipOpen @80
zipOpenNewFileInZip @81
zipWriteInFileInZip @82
zipCloseFileInZip @83
zipClose @84
zipOpenNewFileInZip2 @86
zipCloseFileInZipRaw @87
zipOpen2 @88
zipOpenNewFileInZip3 @89
unzGetFilePos @100
unzGoToFilePos @101
fill_win32_filefunc @110

View File

@@ -0,0 +1,144 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibvc", "zlibvc.vcproj", "{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "zlibstat.vcproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testzlib", "testzlib.vcproj", "{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestZlibDll", "testzlibdll.vcproj", "{C52F9E7B-498A-42BE-8DB4-85A15694366A}"
ProjectSection(ProjectDependencies) = postProject
{8FD826F8-3739-44E6-8CC8-997122E53B8D} = {8FD826F8-3739-44E6-8CC8-997122E53B8D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minizip", "minizip.vcproj", "{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}"
ProjectSection(ProjectDependencies) = postProject
{8FD826F8-3739-44E6-8CC8-997122E53B8D} = {8FD826F8-3739-44E6-8CC8-997122E53B8D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniunz", "miniunz.vcproj", "{C52F9E7B-498A-42BE-8DB4-85A15694382A}"
ProjectSection(ProjectDependencies) = postProject
{8FD826F8-3739-44E6-8CC8-997122E53B8D} = {8FD826F8-3739-44E6-8CC8-997122E53B8D}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Itanium = Debug|Itanium
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Itanium = Release|Itanium
Release|Win32 = Release|Win32
Release|x64 = Release|x64
ReleaseWithoutAsm|Itanium = ReleaseWithoutAsm|Itanium
ReleaseWithoutAsm|Win32 = ReleaseWithoutAsm|Win32
ReleaseWithoutAsm|x64 = ReleaseWithoutAsm|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Itanium.ActiveCfg = Debug|Itanium
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Itanium.Build.0 = Debug|Itanium
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.ActiveCfg = Debug|Win32
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|Win32.Build.0 = Debug|Win32
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.ActiveCfg = Debug|x64
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Debug|x64.Build.0 = Debug|x64
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.ActiveCfg = Release|Itanium
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.Build.0 = Release|Itanium
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = ReleaseWithoutAsm|x64
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = ReleaseWithoutAsm|x64
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
{8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.ActiveCfg = Debug|Itanium
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.Build.0 = Debug|Itanium
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.ActiveCfg = Debug|x64
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.Build.0 = Debug|x64
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.ActiveCfg = Release|Itanium
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.Build.0 = Release|Itanium
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = Release|Win32
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.ActiveCfg = Release|x64
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.Build.0 = Release|x64
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Itanium
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.Build.0 = Debug|Itanium
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Itanium
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.Build.0 = Release|Itanium
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Itanium.ActiveCfg = Debug|Itanium
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Itanium.Build.0 = Debug|Itanium
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.ActiveCfg = Debug|Win32
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|Win32.Build.0 = Debug|Win32
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.ActiveCfg = Debug|x64
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Debug|x64.Build.0 = Debug|x64
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Itanium.ActiveCfg = Release|Itanium
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Itanium.Build.0 = Release|Itanium
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.ActiveCfg = Release|Win32
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|Win32.Build.0 = Release|Win32
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.ActiveCfg = Release|x64
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.Build.0 = Release|x64
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Itanium
{C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Itanium
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Itanium
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.Build.0 = Debug|Itanium
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.Build.0 = Debug|Win32
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.ActiveCfg = Debug|x64
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|x64.Build.0 = Debug|x64
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.ActiveCfg = Release|Itanium
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Itanium.Build.0 = Release|Itanium
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.ActiveCfg = Release|Win32
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|Win32.Build.0 = Release|Win32
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.ActiveCfg = Release|x64
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Itanium
{48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Itanium
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.ActiveCfg = Debug|Itanium
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.Build.0 = Debug|Itanium
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.ActiveCfg = Debug|Win32
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.Build.0 = Debug|Win32
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.ActiveCfg = Debug|x64
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|x64.Build.0 = Debug|x64
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Itanium.ActiveCfg = Release|Itanium
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Itanium.Build.0 = Release|Itanium
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.ActiveCfg = Release|Win32
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|Win32.Build.0 = Release|Win32
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.ActiveCfg = Release|x64
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.Build.0 = Release|x64
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Itanium
{C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Itanium
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Some files were not shown because too many files have changed in this diff Show More