summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:32:36 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:32:36 -0700
commit67cc20d0041a32bee12bd9eb20ae218f91b73f77 (patch)
treed7e1b94bd15c30efd57cf9036f5fe89306b6bba0
parent7751bd4c715ea8478113e34b49b5a794a4642e8e (diff)
downloadzlib-1.2.4-pre1.tar.gz
zlib-1.2.4-pre1.tar.bz2
zlib-1.2.4-pre1.zip
zlib 1.2.4-pre1v1.2.4-pre1
-rw-r--r--CMakeLists.txt21
-rw-r--r--ChangeLog27
-rw-r--r--FAQ259
-rw-r--r--INDEX8
-rw-r--r--Makefile3
-rw-r--r--Makefile.in19
-rw-r--r--README85
-rwxr-xr-xconfigure4
-rw-r--r--contrib/README.contrib19
-rw-r--r--contrib/amd64/amd64-match.S101
-rw-r--r--contrib/asm586/README.58643
-rw-r--r--contrib/asm586/match.S364
-rw-r--r--contrib/asm686/README.68617
-rw-r--r--contrib/asm686/match.S24
-rw-r--r--contrib/delphi/ZLib.pas2
-rw-r--r--contrib/dotzlib/DotZLib/UnitTests.cs2
-rw-r--r--contrib/gcc_gvmat64/gvmat64.S574
-rw-r--r--contrib/infback9/inftree9.c4
-rw-r--r--contrib/masm686/match.asm413
-rw-r--r--contrib/masmx64/gvmat64.asm49
-rw-r--r--contrib/masmx64/inffas8664.c2
-rw-r--r--contrib/masmx64/inffasx64.asm10
-rw-r--r--contrib/masmx86/bld_ml32.bat2
-rw-r--r--contrib/masmx86/gvmat32.asm972
-rw-r--r--contrib/masmx86/gvmat32c.c62
-rw-r--r--contrib/masmx86/match686.asm478
-rw-r--r--contrib/masmx86/match686.objbin0 -> 3507 bytes
-rwxr-xr-xcontrib/masmx86/mkasm.bat3
-rw-r--r--contrib/masmx86/readme.txt4
-rw-r--r--contrib/pascal/zlibpas.pas2
-rw-r--r--contrib/vstudio/readme.txt40
-rw-r--r--contrib/vstudio/vc10/testzlib.vcxproj12
-rw-r--r--contrib/vstudio/vc10/testzlib.vcxproj.filters3
-rw-r--r--contrib/vstudio/vc10/zlib.rc10
-rw-r--r--contrib/vstudio/vc10/zlibstat.vcxproj11
-rw-r--r--contrib/vstudio/vc10/zlibstat.vcxproj.filters6
-rw-r--r--contrib/vstudio/vc10/zlibvc.def68
-rw-r--r--contrib/vstudio/vc10/zlibvc.sln16
-rw-r--r--contrib/vstudio/vc10/zlibvc.vcxproj16
-rw-r--r--contrib/vstudio/vc10/zlibvc.vcxproj.filters6
-rw-r--r--contrib/vstudio/vc7/zlibvc.def114
-rw-r--r--contrib/vstudio/vc8/zlibvc.def114
-rw-r--r--contrib/vstudio/vc9/testzlib.vcproj274
-rw-r--r--contrib/vstudio/vc9/zlib.rc10
-rw-r--r--contrib/vstudio/vc9/zlibstat.vcproj170
-rw-r--r--contrib/vstudio/vc9/zlibvc.def68
-rw-r--r--contrib/vstudio/vc9/zlibvc.sln16
-rw-r--r--contrib/vstudio/vc9/zlibvc.vcproj247
-rw-r--r--deflate.c12
-rw-r--r--deflate.h4
-rw-r--r--gzlib.c19
-rw-r--r--gzread.c1
-rw-r--r--gzwrite.c3
-rw-r--r--inftrees.c4
-rw-r--r--make_vms.com11
-rw-r--r--minigzip.c61
-rw-r--r--qnx/package.qpg10
-rw-r--r--treebuild.xml4
-rw-r--r--trees.c20
-rw-r--r--win32/Makefile.gcc2
-rw-r--r--win32/Makefile.msc8
-rw-r--r--zconf.h416
-rw-r--r--zconf.h.cmakein418
-rw-r--r--zconf.h.in2
-rw-r--r--zlib.363
-rw-r--r--zlib.3.pdfbin0 -> 8687 bytes
-rw-r--r--zlib.h9
67 files changed, 2822 insertions, 3019 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b129ef2..7eefa49 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,17 +66,19 @@ if(MSVC)
66endif() 66endif()
67 67
68if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) 68if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
69 # If we're doing an out of source build and the user has a zconf.h 69 # If we're doing an out of source build and the user has a zconf.h
70 # in their source tree... 70 # in their source tree...
71 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h) 71 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h)
72 message(FATAL_ERROR "You must remove zconf.h from the source tree. This f 72 message(FATAL_ERROR
73ile is generated by the ./configure script shipped with zlib. CMake generates t 73 "You must remove ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h "
74his file for you automatically in the build directory") 74 "from the source tree. This file is included with zlib "
75 "but CMake generates this file for you automatically "
76 "in the build directory.")
75 endif() 77 endif()
76endif() 78endif()
77 79
78configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.in 80configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein
79 ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h @ONLY) 81 ${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY)
80include_directories(${CMAKE_CURRENT_BINARY_DIR}) 82include_directories(${CMAKE_CURRENT_BINARY_DIR})
81 83
82 84
@@ -85,7 +87,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
85#============================================================================ 87#============================================================================
86 88
87set(ZLIB_PUBLIC_HDRS 89set(ZLIB_PUBLIC_HDRS
88 zconf.h 90 ${CMAKE_CURRENT_BINARY_DIR}/zconf.h
89 zlib.h 91 zlib.h
90) 92)
91set(ZLIB_PRIVATE_HDRS 93set(ZLIB_PRIVATE_HDRS
@@ -129,6 +131,7 @@ if(MINGW)
129 COMMAND windres.exe 131 COMMAND windres.exe
130 -D GCC_WINDRES 132 -D GCC_WINDRES
131 -I ${CMAKE_CURRENT_SOURCE_DIR} 133 -I ${CMAKE_CURRENT_SOURCE_DIR}
134 -I ${CMAKE_CURRENT_BINARY_DIR}
132 -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj 135 -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj
133 -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) 136 -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc)
134 set(ZLIB_SRCS ${ZLIB_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) 137 set(ZLIB_SRCS ${ZLIB_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
diff --git a/ChangeLog b/ChangeLog
index 736b59e..8b7afd1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,31 @@
1 1
2 ChangeLog file for zlib 2 ChangeLog file for zlib
3 3
4Changes in 1.2.4 (11 Mar 2010)
5- Fix VER3 extraction in configure for no fourth subversion
6- Update zlib.3, add docs to Makefile.in to make .pdf out of it
7- Add zlib.3.pdf to distribution
8- Don't set error code in gzerror() if passed pointer is NULL
9- Apply destination directory fixes to CMakeLists.txt [Lowman]
10- Move #cmakedefine's to a new zconf.in.cmakein
11- Restore zconf.h for builds that don't use configure or cmake
12- Add distclean to dummy Makefile for convenience
13- Update and improve INDEX, README, and FAQ
14- Update CMakeLists.txt for the return of zconf.h [Lowman]
15- Update contrib/vstudio/vc9 and vc10 [Vollant]
16- Change libz.dll.a back to libzdll.a in win32/Makefile.gcc
17- Apply license and readme changes to contrib/asm686 [Raiter]
18- Check file name lengths and add -c option in minigzip.c [Li]
19- Update contrib/amd64 and contrib/masmx86/ [Vollant]
20- Avoid use of "eof" parameter in trees.c to not shadow library variable
21- Update make_vms.com for removal of zlibdefs.h [Zinser]
22- Update assembler code and vstudio projects in contrib [Vollant]
23- Remove outdated assembler code contrib/masm686 and contrib/asm586
24- Remove old vc7 and vc8 from contrib/vstudio
25- Update win32/Makefile.msc, add ZLIB_VER_SUBREVISION [Rowe]
26- Fix memory leaks in gzclose_r() and gzclose_w(), file leak in gz_open()
27- Add contrib/gcc_gvmat64 for longest_match and inflate_fast [Vollant]
28
4Changes in 1.2.3.9 (21 Feb 2010) 29Changes in 1.2.3.9 (21 Feb 2010)
5- Expunge gzio.c 30- Expunge gzio.c
6- Move as400 build information to old 31- Move as400 build information to old
@@ -256,7 +281,7 @@ Changes in 1.2.2.4 (11 July 2005)
256 compile 281 compile
257- Fix some spelling errors in comments [Betts] 282- Fix some spelling errors in comments [Betts]
258- Correct inflateInit2() error return documentation in zlib.h 283- Correct inflateInit2() error return documentation in zlib.h
259- Added zran.c example of compressed data random access to examples 284- Add zran.c example of compressed data random access to examples
260 directory, shows use of inflatePrime() 285 directory, shows use of inflatePrime()
261- Fix cast for assignments to strm->state in inflate.c and infback.c 286- Fix cast for assignments to strm->state in inflate.c and infback.c
262- Fix zlibCompileFlags() in zutil.c to use 1L for long shifts [Oberhumer] 287- Fix zlibCompileFlags() in zutil.c to use 1L for long shifts [Oberhumer]
diff --git a/FAQ b/FAQ
index 61e8e8a..5603207 100644
--- a/FAQ
+++ b/FAQ
@@ -3,8 +3,8 @@
3 3
4 4
5If your question is not there, please check the zlib home page 5If your question is not there, please check the zlib home page
6http://www.zlib.org which may have more recent information. 6http://zlib.net/ which may have more recent information.
7The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html 7The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
8 8
9 9
10 1. Is zlib Y2K-compliant? 10 1. Is zlib Y2K-compliant?
@@ -13,54 +13,51 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
13 13
14 2. Where can I get a Windows DLL version? 14 2. Where can I get a Windows DLL version?
15 15
16 The zlib sources can be compiled without change to produce a DLL. 16 The zlib sources can be compiled without change to produce a DLL. See the
17 See the file win32/DLL_FAQ.txt in the zlib distribution. 17 file win32/DLL_FAQ.txt in the zlib distribution. Pointers to the
18 Pointers to the precompiled DLL are found in the zlib web site at 18 precompiled DLL are found in the zlib web site at http://zlib.net/ .
19 http://www.zlib.org.
20 19
21 3. Where can I get a Visual Basic interface to zlib? 20 3. Where can I get a Visual Basic interface to zlib?
22 21
23 See 22 See
24 * http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm 23 * http://marknelson.us/1997/01/01/zlib-engine/
25 * contrib/visual-basic.txt in the zlib distribution
26 * win32/DLL_FAQ.txt in the zlib distribution 24 * win32/DLL_FAQ.txt in the zlib distribution
27 25
28 4. compress() returns Z_BUF_ERROR. 26 4. compress() returns Z_BUF_ERROR.
29 27
30 Make sure that before the call of compress, the length of the compressed 28 Make sure that before the call of compress, the length of the compressed
31 buffer is equal to the total size of the compressed buffer and not 29 buffer is equal to the available size of the compressed buffer and not
32 zero. For Visual Basic, check that this parameter is passed by reference 30 zero. For Visual Basic, check that this parameter is passed by reference
33 ("as any"), not by value ("as long"). 31 ("as any"), not by value ("as long").
34 32
35 5. deflate() or inflate() returns Z_BUF_ERROR. 33 5. deflate() or inflate() returns Z_BUF_ERROR.
36 34
37 Before making the call, make sure that avail_in and avail_out are not 35 Before making the call, make sure that avail_in and avail_out are not zero.
38 zero. When setting the parameter flush equal to Z_FINISH, also make sure 36 When setting the parameter flush equal to Z_FINISH, also make sure that
39 that avail_out is big enough to allow processing all pending input. 37 avail_out is big enough to allow processing all pending input. Note that a
40 Note that a Z_BUF_ERROR is not fatal--another call to deflate() or 38 Z_BUF_ERROR is not fatal--another call to deflate() or inflate() can be
41 inflate() can be made with more input or output space. A Z_BUF_ERROR 39 made with more input or output space. A Z_BUF_ERROR may in fact be
42 may in fact be unavoidable depending on how the functions are used, since 40 unavoidable depending on how the functions are used, since it is not
43 it is not possible to tell whether or not there is more output pending 41 possible to tell whether or not there is more output pending when
44 when strm.avail_out returns with zero. 42 strm.avail_out returns with zero. See http://zlib.net/zlib_how.html for a
43 heavily annotated example.
45 44
46 6. Where's the zlib documentation (man pages, etc.)? 45 6. Where's the zlib documentation (man pages, etc.)?
47 46
48 It's in zlib.h for the moment, and Francis S. Lin has converted it to a 47 It's in zlib.h . Examples of zlib usage are in the files example.c and
49 web page zlib.html. Volunteers to transform this to Unix-style man pages, 48 minigzip.c, with more in examples/ .
50 please contact us (zlib@gzip.org). Examples of zlib usage are in the files
51 example.c and minigzip.c.
52 49
53 7. Why don't you use GNU autoconf or libtool or ...? 50 7. Why don't you use GNU autoconf or libtool or ...?
54 51
55 Because we would like to keep zlib as a very small and simple 52 Because we would like to keep zlib as a very small and simple package.
56 package. zlib is rather portable and doesn't need much configuration. 53 zlib is rather portable and doesn't need much configuration.
57 54
58 8. I found a bug in zlib. 55 8. I found a bug in zlib.
59 56
60 Most of the time, such problems are due to an incorrect usage of 57 Most of the time, such problems are due to an incorrect usage of zlib.
61 zlib. Please try to reproduce the problem with a small program and send 58 Please try to reproduce the problem with a small program and send the
62 the corresponding source to us at zlib@gzip.org . Do not send 59 corresponding source to us at zlib@gzip.org . Do not send multi-megabyte
63 multi-megabyte data files without prior agreement. 60 data files without prior agreement.
64 61
65 9. Why do I get "undefined reference to gzputc"? 62 9. Why do I get "undefined reference to gzputc"?
66 63
@@ -77,12 +74,12 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
77 74
7811. Can zlib handle .zip archives? 7511. Can zlib handle .zip archives?
79 76
80 Not by itself, no. See the directory contrib/minizip in the zlib 77 Not by itself, no. See the directory contrib/minizip in the zlib
81 distribution. 78 distribution.
82 79
8312. Can zlib handle .Z files? 8012. Can zlib handle .Z files?
84 81
85 No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt 82 No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt
86 the code of uncompress on your own. 83 the code of uncompress on your own.
87 84
8813. How can I make a Unix shared library? 8513. How can I make a Unix shared library?
@@ -99,8 +96,10 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
99 96
100 However, many flavors of Unix come with a shared zlib already installed. 97 However, many flavors of Unix come with a shared zlib already installed.
101 Before going to the trouble of compiling a shared version of zlib and 98 Before going to the trouble of compiling a shared version of zlib and
102 trying to install it, you may want to check if it's already there! If you 99 trying to install it, you may want to check if it's already there! If you
103 can #include <zlib.h>, it's there. The -lz option will probably link to it. 100 can #include <zlib.h>, it's there. The -lz option will probably link to
101 it. You can check the version at the top of zlib.h or with the
102 ZLIB_VERSION symbol defined in zlib.h .
104 103
10515. I have a question about OttoPDF. 10415. I have a question about OttoPDF.
106 105
@@ -121,39 +120,39 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
121 symbol __register_frame_info: referenced symbol not found 120 symbol __register_frame_info: referenced symbol not found
122 121
123 The symbol __register_frame_info is not part of zlib, it is generated by 122 The symbol __register_frame_info is not part of zlib, it is generated by
124 the C compiler (cc or gcc). You must recompile applications using zlib 123 the C compiler (cc or gcc). You must recompile applications using zlib
125 which have this problem. This problem is specific to Solaris. See 124 which have this problem. This problem is specific to Solaris. See
126 http://www.sunfreeware.com for Solaris versions of zlib and applications 125 http://www.sunfreeware.com for Solaris versions of zlib and applications
127 using zlib. 126 using zlib.
128 127
12918. Why does gzip give an error on a file I make with compress/deflate? 12818. Why does gzip give an error on a file I make with compress/deflate?
130 129
131 The compress and deflate functions produce data in the zlib format, which 130 The compress and deflate functions produce data in the zlib format, which
132 is different and incompatible with the gzip format. The gz* functions in 131 is different and incompatible with the gzip format. The gz* functions in
133 zlib on the other hand use the gzip format. Both the zlib and gzip 132 zlib on the other hand use the gzip format. Both the zlib and gzip formats
134 formats use the same compressed data format internally, but have different 133 use the same compressed data format internally, but have different headers
135 headers and trailers around the compressed data. 134 and trailers around the compressed data.
136 135
13719. Ok, so why are there two different formats? 13619. Ok, so why are there two different formats?
138 137
139 The gzip format was designed to retain the directory information about 138 The gzip format was designed to retain the directory information about a
140 a single file, such as the name and last modification date. The zlib 139 single file, such as the name and last modification date. The zlib format
141 format on the other hand was designed for in-memory and communication 140 on the other hand was designed for in-memory and communication channel
142 channel applications, and has a much more compact header and trailer and 141 applications, and has a much more compact header and trailer and uses a
143 uses a faster integrity check than gzip. 142 faster integrity check than gzip.
144 143
14520. Well that's nice, but how do I make a gzip file in memory? 14420. Well that's nice, but how do I make a gzip file in memory?
146 145
147 You can request that deflate write the gzip format instead of the zlib 146 You can request that deflate write the gzip format instead of the zlib
148 format using deflateInit2(). You can also request that inflate decode 147 format using deflateInit2(). You can also request that inflate decode the
149 the gzip format using inflateInit2(). Read zlib.h for more details. 148 gzip format using inflateInit2(). Read zlib.h for more details.
150 149
15121. Is zlib thread-safe? 15021. Is zlib thread-safe?
152 151
153 Yes. However any library routines that zlib uses and any application- 152 Yes. However any library routines that zlib uses and any application-
154 provided memory allocation routines must also be thread-safe. zlib's gz* 153 provided memory allocation routines must also be thread-safe. zlib's gz*
155 functions use stdio library routines, and most of zlib's functions use the 154 functions use stdio library routines, and most of zlib's functions use the
156 library memory allocation routines by default. zlib's Init functions allow 155 library memory allocation routines by default. zlib's Init functions allow
157 for the application to provide custom memory allocation routines. 156 for the application to provide custom memory allocation routines.
158 157
159 Of course, you should only operate on any given zlib or gzip stream from a 158 Of course, you should only operate on any given zlib or gzip stream from a
@@ -161,27 +160,27 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
161 160
16222. Can I use zlib in my commercial application? 16122. Can I use zlib in my commercial application?
163 162
164 Yes. Please read the license in zlib.h. 163 Yes. Please read the license in zlib.h.
165 164
16623. Is zlib under the GNU license? 16523. Is zlib under the GNU license?
167 166
168 No. Please read the license in zlib.h. 167 No. Please read the license in zlib.h.
169 168
17024. The license says that altered source versions must be "plainly marked". So 16924. The license says that altered source versions must be "plainly marked". So
171 what exactly do I need to do to meet that requirement? 170 what exactly do I need to do to meet that requirement?
172 171
173 You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In 172 You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In
174 particular, the final version number needs to be changed to "f", and an 173 particular, the final version number needs to be changed to "f", and an
175 identification string should be appended to ZLIB_VERSION. Version numbers 174 identification string should be appended to ZLIB_VERSION. Version numbers
176 x.x.x.f are reserved for modifications to zlib by others than the zlib 175 x.x.x.f are reserved for modifications to zlib by others than the zlib
177 maintainers. For example, if the version of the base zlib you are altering 176 maintainers. For example, if the version of the base zlib you are altering
178 is "1.2.3.4", then in zlib.h you should change ZLIB_VERNUM to 0x123f, and 177 is "1.2.3.4", then in zlib.h you should change ZLIB_VERNUM to 0x123f, and
179 ZLIB_VERSION to something like "1.2.3.f-zachary-mods-v3". You can also 178 ZLIB_VERSION to something like "1.2.3.f-zachary-mods-v3". You can also
180 update the version strings in deflate.c and inftrees.c. 179 update the version strings in deflate.c and inftrees.c.
181 180
182 For altered source distributions, you should also note the origin and 181 For altered source distributions, you should also note the origin and
183 nature of the changes in zlib.h, as well as in ChangeLog and README, along 182 nature of the changes in zlib.h, as well as in ChangeLog and README, along
184 with the dates of the alterations. The origin should include at least your 183 with the dates of the alterations. The origin should include at least your
185 name (or your company's name), and an email address to contact for help or 184 name (or your company's name), and an email address to contact for help or
186 issues with the library. 185 issues with the library.
187 186
@@ -197,111 +196,112 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
197 196
19826. Will zlib work on a 64-bit machine? 19726. Will zlib work on a 64-bit machine?
199 198
200 It should. It has been tested on 64-bit machines, and has no dependence 199 Yes. It has been tested on 64-bit machines, and has no dependence on any
201 on any data types being limited to 32-bits in length. If you have any 200 data types being limited to 32-bits in length. If you have any
202 difficulties, please provide a complete problem report to zlib@gzip.org 201 difficulties, please provide a complete problem report to zlib@gzip.org
203 202
20427. Will zlib decompress data from the PKWare Data Compression Library? 20327. Will zlib decompress data from the PKWare Data Compression Library?
205 204
206 No. The PKWare DCL uses a completely different compressed data format 205 No. The PKWare DCL uses a completely different compressed data format than
207 than does PKZIP and zlib. However, you can look in zlib's contrib/blast 206 does PKZIP and zlib. However, you can look in zlib's contrib/blast
208 directory for a possible solution to your problem. 207 directory for a possible solution to your problem.
209 208
21028. Can I access data randomly in a compressed stream? 20928. Can I access data randomly in a compressed stream?
211 210
212 No, not without some preparation. If when compressing you periodically 211 No, not without some preparation. If when compressing you periodically use
213 use Z_FULL_FLUSH, carefully write all the pending data at those points, 212 Z_FULL_FLUSH, carefully write all the pending data at those points, and
214 and keep an index of those locations, then you can start decompression 213 keep an index of those locations, then you can start decompression at those
215 at those points. You have to be careful to not use Z_FULL_FLUSH too 214 points. You have to be careful to not use Z_FULL_FLUSH too often, since it
216 often, since it can significantly degrade compression. 215 can significantly degrade compression. Alternatively, you can scan a
216 deflate stream once to generate an index, and then use that index for
217 random access. See examples/zran.c .
217 218
21829. Does zlib work on MVS, OS/390, CICS, etc.? 21929. Does zlib work on MVS, OS/390, CICS, etc.?
219 220
220 Yes, there are working ports of zlib 1.1.4 to MVS which you can find 221 It has in the past, but we have not heard of any recent evidence. There
221 here: 222 were working ports of zlib 1.1.4 to MVS, but those links no longer work.
223 If you know of recent, successful applications of zlib on these operating
224 systems, please let us know. Thanks.
222 225
223 http://www.homerow.net/asm/zlib390.htm 22630. Is there some simpler, easier to read version of inflate I can look at to
224 http://www.homerow.net/asm/zlibLE.htm 227 understand the deflate format?
225 228
226 If these are updated to more recent versions of zlib, please let us 229 First off, you should read RFC 1951. Second, yes. Look in zlib's
227 know. Thanks.
228
22930. Is there some simpler, easier to read version of inflate I can look at
230 to understand the deflate format?
231
232 First off, you should read RFC 1951. Second, yes. Look in zlib's
233 contrib/puff directory. 230 contrib/puff directory.
234 231
23531. Does zlib infringe on any patents? 23231. Does zlib infringe on any patents?
236 233
237 As far as we know, no. In fact, that was originally the whole point behind 234 As far as we know, no. In fact, that was originally the whole point behind
238 zlib. Look here for some more information: 235 zlib. Look here for some more information:
239 236
240 http://www.gzip.org/#faq11 237 http://www.gzip.org/#faq11
241 238
24232. Can zlib work with greater than 4 GB of data? 23932. Can zlib work with greater than 4 GB of data?
243 240
244 Yes. inflate() and deflate() will process any amount of data correctly. 241 Yes. inflate() and deflate() will process any amount of data correctly.
245 Each call of inflate() or deflate() is limited to input and output chunks 242 Each call of inflate() or deflate() is limited to input and output chunks
246 of the maximum value that can be stored in the compiler's "unsigned int" 243 of the maximum value that can be stored in the compiler's "unsigned int"
247 type, but there is no limit to the number of chunks. Note however that the 244 type, but there is no limit to the number of chunks. Note however that the
248 strm.total_in and strm_total_out counters may be limited to 4 GB. These 245 strm.total_in and strm_total_out counters may be limited to 4 GB. These
249 counters are provided as a convenience and are not used internally by 246 counters are provided as a convenience and are not used internally by
250 inflate() or deflate(). The application can easily set up its own counters 247 inflate() or deflate(). The application can easily set up its own counters
251 updated after each call of inflate() or deflate() to count beyond 4 GB. 248 updated after each call of inflate() or deflate() to count beyond 4 GB.
252 compress() and uncompress() may be limited to 4 GB, since they operate in a 249 compress() and uncompress() may be limited to 4 GB, since they operate in a
253 single call. gzseek() and gztell() may be limited to 4 GB depending on how 250 single call. gzseek() and gztell() may be limited to 4 GB depending on how
254 zlib is compiled. See the zlibCompileFlags() function in zlib.h. 251 zlib is compiled. See the zlibCompileFlags() function in zlib.h.
255 252
256 The word "may" appears several times above since there is a 4 GB limit 253 The word "may" appears several times above since there is a 4 GB limit only
257 only if the compiler's "long" type is 32 bits. If the compiler's "long" 254 if the compiler's "long" type is 32 bits. If the compiler's "long" type is
258 type is 64 bits, then the limit is 16 exabytes. 255 64 bits, then the limit is 16 exabytes.
259 256
26033. Does zlib have any security vulnerabilities? 25733. Does zlib have any security vulnerabilities?
261 258
262 The only one that we are aware of is potentially in gzprintf(). If zlib 259 The only one that we are aware of is potentially in gzprintf(). If zlib is
263 is compiled to use sprintf() or vsprintf(), then there is no protection 260 compiled to use sprintf() or vsprintf(), then there is no protection
264 against a buffer overflow of a 4K string space, other than the caller of 261 against a buffer overflow of an 8K string space (or other value as set by
265 gzprintf() assuring that the output will not exceed 4K. On the other 262 gzbuffer()), other than the caller of gzprintf() assuring that the output
266 hand, if zlib is compiled to use snprintf() or vsnprintf(), which should 263 will not exceed 8K. On the other hand, if zlib is compiled to use
267 normally be the case, then there is no vulnerability. The ./configure 264 snprintf() or vsnprintf(), which should normally be the case, then there is
268 script will display warnings if an insecure variation of sprintf() will 265 no vulnerability. The ./configure script will display warnings if an
269 be used by gzprintf(). Also the zlibCompileFlags() function will return 266 insecure variation of sprintf() will be used by gzprintf(). Also the
270 information on what variant of sprintf() is used by gzprintf(). 267 zlibCompileFlags() function will return information on what variant of
268 sprintf() is used by gzprintf().
271 269
272 If you don't have snprintf() or vsnprintf() and would like one, you can 270 If you don't have snprintf() or vsnprintf() and would like one, you can
273 find a portable implementation here: 271 find a portable implementation here:
274 272
275 http://www.ijs.si/software/snprintf/ 273 http://www.ijs.si/software/snprintf/
276 274
277 Note that you should be using the most recent version of zlib. Versions 275 Note that you should be using the most recent version of zlib. Versions
278 1.1.3 and before were subject to a double-free vulnerability, and version 276 1.1.3 and before were subject to a double-free vulnerability, and versions
279 1.2.1 was subject to an access exception when decompressing invalid 277 1.2.1 and 1.2.2 were subject to an access exception when decompressing
280 compressed data. 278 invalid compressed data.
281 279
28234. Is there a Java version of zlib? 28034. Is there a Java version of zlib?
283 281
284 Probably what you want is to use zlib in Java. zlib is already included 282 Probably what you want is to use zlib in Java. zlib is already included
285 as part of the Java SDK in the java.util.zip package. If you really want 283 as part of the Java SDK in the java.util.zip package. If you really want
286 a version of zlib written in the Java language, look on the zlib home 284 a version of zlib written in the Java language, look on the zlib home
287 page for links: http://www.zlib.org/ 285 page for links: http://zlib.net/ .
288 286
28935. I get this or that compiler or source-code scanner warning when I crank it 28735. I get this or that compiler or source-code scanner warning when I crank it
290 up to maximally-pedantic. Can't you guys write proper code? 288 up to maximally-pedantic. Can't you guys write proper code?
291 289
292 Many years ago, we gave up attempting to avoid warnings on every compiler 290 Many years ago, we gave up attempting to avoid warnings on every compiler
293 in the universe. It just got to be a waste of time, and some compilers 291 in the universe. It just got to be a waste of time, and some compilers
294 were downright silly. So now, we simply make sure that the code always 292 were downright silly as well as contradicted each other. So now, we simply
295 works. 293 make sure that the code always works.
296 294
29736. Valgrind (or some similar memory access checker) says that deflate is 29536. Valgrind (or some similar memory access checker) says that deflate is
298 performing a conditional jump that depends on an uninitialized value. 296 performing a conditional jump that depends on an uninitialized value.
299 Isn't that a bug? 297 Isn't that a bug?
300 298
301 No. That is intentional for performance reasons, and the output of 299 No. That is intentional for performance reasons, and the output of deflate
302 deflate is not affected. This only started showing up recently since 300 is not affected. This only started showing up recently since zlib 1.2.x
303 zlib 1.2.x uses malloc() by default for allocations, whereas earlier 301 uses malloc() by default for allocations, whereas earlier versions used
304 versions used calloc(), which zeros out the allocated memory. 302 calloc(), which zeros out the allocated memory. Even though the code was
303 correct, versions 1.2.4 and later was changed to not stimulate these
304 checkers.
305 305
30637. Will zlib read the (insert any ancient or arcane format here) compressed 30637. Will zlib read the (insert any ancient or arcane format here) compressed
307 data format? 307 data format?
@@ -311,20 +311,21 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
311 311
31238. How can I encrypt/decrypt zip files with zlib? 31238. How can I encrypt/decrypt zip files with zlib?
313 313
314 zlib doesn't support encryption. The original PKZIP encryption is very weak 314 zlib doesn't support encryption. The original PKZIP encryption is very
315 and can be broken with freely available programs. To get strong encryption, 315 weak and can be broken with freely available programs. To get strong
316 use GnuPG, http://www.gnupg.org/ , which already includes zlib compression. 316 encryption, use GnuPG, http://www.gnupg.org/ , which already includes zlib
317 For PKZIP compatible "encryption", look at http://www.info-zip.org/ 317 compression. For PKZIP compatible "encryption", look at
318 http://www.info-zip.org/
318 319
31939. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? 32039. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings?
320 321
321 "gzip" is the gzip format, and "deflate" is the zlib format. They should 322 "gzip" is the gzip format, and "deflate" is the zlib format. They should
322 probably have called the second one "zlib" instead to avoid confusion 323 probably have called the second one "zlib" instead to avoid confusion with
323 with the raw deflate compressed data format. While the HTTP 1.1 RFC 2616 324 the raw deflate compressed data format. While the HTTP 1.1 RFC 2616
324 correctly points to the zlib specification in RFC 1950 for the "deflate" 325 correctly points to the zlib specification in RFC 1950 for the "deflate"
325 transfer encoding, there have been reports of servers and browsers that 326 transfer encoding, there have been reports of servers and browsers that
326 incorrectly produce or expect raw deflate data per the deflate 327 incorrectly produce or expect raw deflate data per the deflate
327 specficiation in RFC 1951, most notably Microsoft. So even though the 328 specficiation in RFC 1951, most notably Microsoft. So even though the
328 "deflate" transfer encoding using the zlib format would be the more 329 "deflate" transfer encoding using the zlib format would be the more
329 efficient approach (and in fact exactly what the zlib format was designed 330 efficient approach (and in fact exactly what the zlib format was designed
330 for), using the "gzip" transfer encoding is probably more reliable due to 331 for), using the "gzip" transfer encoding is probably more reliable due to
@@ -334,28 +335,32 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
334 335
33540. Does zlib support the new "Deflate64" format introduced by PKWare? 33640. Does zlib support the new "Deflate64" format introduced by PKWare?
336 337
337 No. PKWare has apparently decided to keep that format proprietary, since 338 No. PKWare has apparently decided to keep that format proprietary, since
338 they have not documented it as they have previous compression formats. 339 they have not documented it as they have previous compression formats. In
339 In any case, the compression improvements are so modest compared to other 340 any case, the compression improvements are so modest compared to other more
340 more modern approaches, that it's not worth the effort to implement. 341 modern approaches, that it's not worth the effort to implement.
341 342
34241. I'm having a problem with the zip functions in zlib, can you help? 34341. I'm having a problem with the zip functions in zlib, can you help?
343 344
344 There are no zip functions in zlib. You are probably using minizip by 345 There are no zip functions in zlib. You are probably using minizip by
345 Giles Vollant, which is found in the contrib directory of zlib. It is not 346 Giles Vollant, which is found in the contrib directory of zlib. It is not
346 part of zlib. In fact none of the stuff in contrib is part of zlib. The 347 part of zlib. In fact none of the stuff in contrib is part of zlib. The
347 files in there are not supported by the zlib authors. You need to contact 348 files in there are not supported by the zlib authors. You need to contact
348 the authors of the contribution for help. 349 the authors of the respective contribution for help.
349 350
35042. The match.asm code in contrib is under the GNU General Public License. 35142. The match.asm code in contrib is under the GNU General Public License.
351 Since it's part of zlib, doesn't that mean that all of zlib falls under the 352 Since it's part of zlib, doesn't that mean that all of zlib falls under the
352 GNU GPL? 353 GNU GPL?
353 354
354 No. The files in contrib are not part of zlib. They were contributed by 355 No. The files in contrib are not part of zlib. They were contributed by
355 other authors and are provided as a convenience to the user within the zlib 356 other authors and are provided as a convenience to the user within the zlib
356 distribution. Each of the items in contrib have their own license. 357 distribution. Each of the items in contrib have their own license.
358
35943. Is zlib subject to export controls? What is its ECCN?
360
361 zlib is not subject to export controls, and so is classified as EAR99.
357 362
35843. Can you please sign these lengthy legal documents and fax them back to us 36344. Can you please sign these lengthy legal documents and fax them back to us
359 so that we can use your software in our product? 364 so that we can use your software in our product?
360 365
361 No. Go away. Shoo. 366 No. Go away. Shoo.
diff --git a/INDEX b/INDEX
index 01b0070..f66bf9b 100644
--- a/INDEX
+++ b/INDEX
@@ -2,33 +2,33 @@ CMakeLists.txt cmake build file
2ChangeLog history of changes 2ChangeLog history of changes
3FAQ Frequently Asked Questions about zlib 3FAQ Frequently Asked Questions about zlib
4INDEX this file 4INDEX this file
5Makefile dummy Makefile that tells you to ./configure
5Makefile.in template for Unix Makefile 6Makefile.in template for Unix Makefile
6README guess what 7README guess what
7configure configure script for Unix 8configure configure script for Unix
8make_vms.com makefile for VMS 9make_vms.com makefile for VMS
9treebuild.xml XML description of source file dependencies 10treebuild.xml XML description of source file dependencies
11zconf.h.cmakein zconf.h template for cmake
10zconf.h.in zconf.h template for configure 12zconf.h.in zconf.h template for configure
11zlib.3 Man page for zlib 13zlib.3 Man page for zlib
14zlib.3.pdf Man page in PDF format
12zlib.map Linux symbol information 15zlib.map Linux symbol information
13zlib.pc.in Template for pkg-config descriptor 16zlib.pc.in Template for pkg-config descriptor
14zlib2ansi perl script to convert source files for C++ compilation 17zlib2ansi perl script to convert source files for C++ compilation
15 18
16amiga/ makefiles for Amiga SAS C 19amiga/ makefiles for Amiga SAS C
17as400/ makefiles for IBM AS/400
18doc/ documentation for formats and algorithms 20doc/ documentation for formats and algorithms
19msdos/ makefiles for MSDOS 21msdos/ makefiles for MSDOS
20nintendods/ makefile for Nintendo DS 22nintendods/ makefile for Nintendo DS
21objs/ destination for object files
22old/ makefiles for various architectures and zlib documentation 23old/ makefiles for various architectures and zlib documentation
23 files that have not yet been updated for zlib 1.2.x 24 files that have not yet been updated for zlib 1.2.x
24pics/ destination for position-independent-code object files
25projects/ projects for various Integrated Development Environments 25projects/ projects for various Integrated Development Environments
26qnx/ makefiles for QNX 26qnx/ makefiles for QNX
27watcom/ makefiles for OpenWatcom 27watcom/ makefiles for OpenWatcom
28win32/ makefiles for Windows 28win32/ makefiles for Windows
29 29
30 zlib public header files (required for library use): 30 zlib public header files (required for library use):
31zconf.h (made by configure) 31zconf.h
32zlib.h 32zlib.h
33 33
34 private source files used to build the zlib library: 34 private source files used to build the zlib library:
diff --git a/Makefile b/Makefile
index 744c494..3839b42 100644
--- a/Makefile
+++ b/Makefile
@@ -1,2 +1,5 @@
1all: 1all:
2 -@echo "Use ./configure first. Thank you." 2 -@echo "Use ./configure first. Thank you."
3
4distclean:
5 make -f Makefile.in distclean
diff --git a/Makefile.in b/Makefile.in
index c1cbeb5..efaec6f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -32,7 +32,7 @@ CPP=$(CC) -E
32 32
33STATICLIB=libz.a 33STATICLIB=libz.a
34SHAREDLIB=libz.so 34SHAREDLIB=libz.so
35SHAREDLIBV=libz.so.1.2.3.9 35SHAREDLIBV=libz.so.1.2.4
36SHAREDLIBM=libz.so.1 36SHAREDLIBM=libz.so.1
37LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV) 37LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV)
38 38
@@ -193,6 +193,18 @@ uninstall:
193 cd $(DESTDIR)$(man3dir); rm -f zlib.3 193 cd $(DESTDIR)$(man3dir); rm -f zlib.3
194 cd $(DESTDIR)$(pkgconfigdir); rm -f zlib.pc 194 cd $(DESTDIR)$(pkgconfigdir); rm -f zlib.pc
195 195
196docs: zlib.3.pdf
197
198zlib.3.pdf: zlib.3
199 groff -mandoc -f H -T ps zlib.3 | ps2pdf - zlib.3.pdf
200
201zconf.h.in: zconf.h.cmakein
202 sed "/^#cmakedefine/D" < zconf.h.cmakein > zconf.h.in
203 touch -r zconf.h.cmakein zconf.h.in
204
205zconf: zconf.h.in
206 cp -p zconf.h.in zconf.h
207
196mostlyclean: clean 208mostlyclean: clean
197clean: 209clean:
198 rm -f *.o *.lo *~ \ 210 rm -f *.o *.lo *~ \
@@ -203,10 +215,11 @@ clean:
203 rm -rf objs 215 rm -rf objs
204 216
205maintainer-clean: distclean 217maintainer-clean: distclean
206distclean: clean 218distclean: clean zconf docs
207 rm -f Makefile zconf.h zlib.pc 219 rm -f Makefile zlib.pc
208 -@rm -f .DS_Store 220 -@rm -f .DS_Store
209 -@printf 'all:\n\t-@echo "Use ./configure first. Thank you."\n' > Makefile 221 -@printf 'all:\n\t-@echo "Use ./configure first. Thank you."\n' > Makefile
222 -@printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile
210 -@touch -r Makefile.in Makefile 223 -@touch -r Makefile.in Makefile
211 224
212tags: 225tags:
diff --git a/README b/README
index e6bea09..f24aeee 100644
--- a/README
+++ b/README
@@ -1,56 +1,51 @@
1ZLIB DATA COMPRESSION LIBRARY 1ZLIB DATA COMPRESSION LIBRARY
2 2
3zlib 1.2.3.9 is a general purpose data compression library. All the code is 3zlib 1.2.4 is a general purpose data compression library. All the code is
4thread safe. The data format used by the zlib library is described by RFCs 4thread safe. The data format used by the zlib library is described by RFCs
5(Request for Comments) 1950 to 1952 in the files 5(Request for Comments) 1950 to 1952 in the files
6http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) 6http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
7and rfc1952.txt (gzip format). These documents are also available in other 7and rfc1952.txt (gzip format).
8formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
9 8
10All functions of the compression library are documented in the file zlib.h 9All functions of the compression library are documented in the file zlib.h
11(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example 10(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
12of the library is given in the file example.c which also tests that the library 11of the library is given in the file example.c which also tests that the library
13is working correctly. Another example is given in the file minigzip.c. The 12is working correctly. Another example is given in the file minigzip.c. The
14compression library itself is composed of all source files except example.c and 13compression library itself is composed of all source files except example.c and
15minigzip.c. 14minigzip.c.
16 15
17To compile all files and run the test program, follow the instructions given at 16To compile all files and run the test program, follow the instructions given at
18the top of Makefile. In short "make test; make install" should work for most 17the top of Makefile.in. In short "./configure; make test", and if that goes
19machines. For Unix: "./configure; make test; make install". For MSDOS, use one 18well, "make install" should work for most flavors of Unix. For Windows, use one
20of the special makefiles such as Makefile.msc. For VMS, use make_vms.com. 19of the special makefiles in win32/ or projects/ . For VMS, use make_vms.com.
21 20
22Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant 21Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
23<info@winimage.com> for the Windows DLL version. The zlib home page is 22<info@winimage.com> for the Windows DLL version. The zlib home page is
24http://www.zlib.org or http://www.gzip.org/zlib/ Before reporting a problem, 23http://zlib.net/ . Before reporting a problem, please check this site to
25please check this site to verify that you have the latest version of zlib; 24verify that you have the latest version of zlib; otherwise get the latest
26otherwise get the latest version and check whether the problem still exists or 25version and check whether the problem still exists or not.
27not.
28 26
29PLEASE read the zlib FAQ http://www.gzip.org/zlib/zlib_faq.html before asking 27PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.
30for help.
31 28
32Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997 29Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
33issue of Dr. Dobb's Journal; a copy of the article is available in 30issue of Dr. Dobb's Journal; a copy of the article is available at
34http://dogma.net/markn/articles/zlibtool/zlibtool.htm 31http://marknelson.us/1997/01/01/zlib-engine/ .
35 32
36The changes made in version 1.2.3.9 are documented in the file ChangeLog. 33The changes made in version 1.2.4 are documented in the file ChangeLog.
37 34
38Unsupported third party contributions are provided in directory "contrib". 35Unsupported third party contributions are provided in directory contrib/ .
39 36
40A Java implementation of zlib is available in the Java Development Kit 37zlib is available in Java using the java.util.zip package, documented at
41http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/package-summary.html 38http://java.sun.com/developer/technicalArticles/Programming/compression/ .
42See the zlib home page http://www.zlib.org for details.
43 39
44A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is in the 40A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is available
45CPAN (Comprehensive Perl Archive Network) sites 41at CPAN (Comprehensive Perl Archive Network) sites, including
46http://www.cpan.org/modules/by-module/Compress/ 42http://search.cpan.org/~pmqs/IO-Compress-Zlib/ .
47 43
48A Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is 44A Python interface to zlib written by A.M. Kuchling <amk@amk.ca> is
49available in Python 1.5 and later versions, see 45available in Python 1.5 and later versions, see
50http://www.python.org/doc/lib/module-zlib.html 46http://www.python.org/doc/lib/module-zlib.html .
51 47
52A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com> is 48zlib is built into tcl: http://wiki.tcl.tk/4610 .
53availlable at http://www.oche.de/~akupries/soft/trf/trf_zip.html
54 49
55An experimental package to read and write files in .zip format, written on top 50An experimental package to read and write files in .zip format, written on top
56of zlib by Gilles Vollant <info@winimage.com>, is available in the 51of zlib by Gilles Vollant <info@winimage.com>, is available in the
@@ -74,25 +69,21 @@ Notes for some targets:
74- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with 69- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
75 other compilers. Use "make test" to check your compiler. 70 other compilers. Use "make test" to check your compiler.
76 71
77- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers. 72- gzdopen is not supported on RISCOS or BEOS.
78 73
79- For PalmOs, see http://palmzlib.sourceforge.net/ 74- For PalmOs, see http://palmzlib.sourceforge.net/
80 75
81- When building a shared, i.e. dynamic library on Mac OS X, the library must be
82 installed before testing (do "make install" before "make test"), since the
83 library location is specified in the library.
84
85 76
86Acknowledgments: 77Acknowledgments:
87 78
88 The deflate format used by zlib was defined by Phil Katz. The deflate 79 The deflate format used by zlib was defined by Phil Katz. The deflate and
89 and zlib specifications were written by L. Peter Deutsch. Thanks to all the 80 zlib specifications were written by L. Peter Deutsch. Thanks to all the
90 people who reported problems and suggested various improvements in zlib; 81 people who reported problems and suggested various improvements in zlib; they
91 they are too numerous to cite here. 82 are too numerous to cite here.
92 83
93Copyright notice: 84Copyright notice:
94 85
95 (C) 1995-2004 Jean-loup Gailly and Mark Adler 86 (C) 1995-2010 Jean-loup Gailly and Mark Adler
96 87
97 This software is provided 'as-is', without any express or implied 88 This software is provided 'as-is', without any express or implied
98 warranty. In no event will the authors be held liable for any damages 89 warranty. In no event will the authors be held liable for any damages
@@ -113,13 +104,11 @@ Copyright notice:
113 Jean-loup Gailly Mark Adler 104 Jean-loup Gailly Mark Adler
114 jloup@gzip.org madler@alumni.caltech.edu 105 jloup@gzip.org madler@alumni.caltech.edu
115 106
116If you use the zlib library in a product, we would appreciate *not* 107If you use the zlib library in a product, we would appreciate *not* receiving
117receiving lengthy legal documents to sign. The sources are provided 108lengthy legal documents to sign. The sources are provided for free but without
118for free but without warranty of any kind. The library has been 109warranty of any kind. The library has been entirely written by Jean-loup
119entirely written by Jean-loup Gailly and Mark Adler; it does not 110Gailly and Mark Adler; it does not include third-party code.
120include third-party code.
121 111
122If you redistribute modified sources, we would appreciate that you include 112If you redistribute modified sources, we would appreciate that you include in
123in the file ChangeLog history information documenting your changes. Please 113the file ChangeLog history information documenting your changes. Please read
124read the FAQ for more information on the distribution of modified source 114the FAQ for more information on the distribution of modified source versions.
125versions.
diff --git a/configure b/configure
index 2ec1d5c..d3ee355 100755
--- a/configure
+++ b/configure
@@ -16,7 +16,7 @@
16STATICLIB=libz.a 16STATICLIB=libz.a
17LDFLAGS="${LDFLAGS} -L. ${STATICLIB}" 17LDFLAGS="${LDFLAGS} -L. ${STATICLIB}"
18VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h` 18VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
19VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h` 19VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < zlib.h`
20VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h` 20VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h`
21VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h` 21VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h`
22AR=${AR-"ar"} 22AR=${AR-"ar"}
@@ -250,7 +250,7 @@ EOF
250 fi 250 fi
251fi 251fi
252 252
253sed "/^#cmakedefine/D" < zconf.h.in > zconf.h 253cp -p zconf.h.in zconf.h
254 254
255cat > $test.c <<EOF 255cat > $test.c <<EOF
256#include <unistd.h> 256#include <unistd.h>
diff --git a/contrib/README.contrib b/contrib/README.contrib
index 17fc8f6..dd2285d 100644
--- a/contrib/README.contrib
+++ b/contrib/README.contrib
@@ -12,7 +12,6 @@ amd64/ by Mikhail Teterin <mi@ALDAN.algebra.com>
12 asm code for AMD64 12 asm code for AMD64
13 See patch at http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/96393 13 See patch at http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/96393
14 14
15asm586/
16asm686/ by Brian Raiter <breadbox@muppetlabs.com> 15asm686/ by Brian Raiter <breadbox@muppetlabs.com>
17 asm code for Pentium and PPro/PII, using the AT&T (GNU as) syntax 16 asm code for Pentium and PPro/PII, using the AT&T (GNU as) syntax
18 See http://www.muppetlabs.com/~breadbox/software/assembly.html 17 See http://www.muppetlabs.com/~breadbox/software/assembly.html
@@ -26,6 +25,10 @@ delphi/ by Cosmin Truta <cosmint@cs.ubbcluj.ro>
26dotzlib/ by Henrik Ravn <henrik@ravn.com> 25dotzlib/ by Henrik Ravn <henrik@ravn.com>
27 Support for Microsoft .Net and Visual C++ .Net 26 Support for Microsoft .Net and Visual C++ .Net
28 27
28gcc_gvmat64/by Gilles Vollant <info@winimage.com>
29 GCC Version of x86 64-bit (AMD64 and Intel EM64t) code for x64
30 assembler to replace longest_match() and inflate_fast()
31
29infback9/ by Mark Adler <madler@alumni.caltech.edu> 32infback9/ by Mark Adler <madler@alumni.caltech.edu>
30 Unsupported diffs to infback to decode the deflate64 format 33 Unsupported diffs to infback to decode the deflate64 format
31 34
@@ -42,21 +45,19 @@ iostream3/ by Ludwig Schwardt <schwardt@sun.ac.za>
42 and Kevin Ruland <kevin@rodin.wustl.edu> 45 and Kevin Ruland <kevin@rodin.wustl.edu>
43 Yet another C++ I/O streams interface 46 Yet another C++ I/O streams interface
44 47
45masm686/ by Dan Higdon <hdan@kinesoft.com>
46 and Chuck Walbourn <chuckw@kinesoft.com>
47 asm code for Pentium Pro/PII, using the MASM syntax
48
49masmx64/ by Gilles Vollant <info@winimage.com> 48masmx64/ by Gilles Vollant <info@winimage.com>
50 x86 64-bit (AMD64 and Intel EM64t) code for x64 assembler to 49 x86 64-bit (AMD64 and Intel EM64t) code for x64 assembler to
51 replace longest_match() and inflate_fast() 50 replace longest_match() and inflate_fast(), also masm x86
51 64-bits translation of Chris Anderson inflate_fast()
52 52
53masmx86/ by Gilles Vollant <info@winimage.com> 53masmx86/ by Gilles Vollant <info@winimage.com>
54 x86 asm code to replace longest_match() and inflate_fast(), 54 x86 asm code to replace longest_match() and inflate_fast(),
55 for Visual C++ and MASM 55 for Visual C++ and MASM (32 bits).
56 Based on Brian Raiter (asm686) and Chris Anderson (inflate86)
56 57
57minizip/ by Gilles Vollant <info@winimage.com> 58minizip/ by Gilles Vollant <info@winimage.com>
58 Mini zip and unzip based on zlib 59 Mini zip and unzip based on zlib
59 Includes Zip64 support by Mathias Svensson <mathias@result42.com> 60 Includes Zip64 support by Mathias Svensson <mathias@result42.com>
60 See http://www.winimage.com/zLibDll/unzip.html 61 See http://www.winimage.com/zLibDll/unzip.html
61 62
62pascal/ by Bob Dellaca <bobdl@xtra.co.nz> et al. 63pascal/ by Bob Dellaca <bobdl@xtra.co.nz> et al.
diff --git a/contrib/amd64/amd64-match.S b/contrib/amd64/amd64-match.S
index b3bf1ac..81d4a1c 100644
--- a/contrib/amd64/amd64-match.S
+++ b/contrib/amd64/amd64-match.S
@@ -52,14 +52,73 @@
52#define save_r13 (64-LocalVarsSize)(%rsp) 52#define save_r13 (64-LocalVarsSize)(%rsp)
53#define save_r15 (80-LocalVarsSize)(%rsp) 53#define save_r15 (80-LocalVarsSize)(%rsp)
54 54
55
56.globl match_init, longest_match
57
55/* 58/*
56 * On AMD64 the first argument of a function (in our case -- the pointer to 59 * On AMD64 the first argument of a function (in our case -- the pointer to
57 * deflate_state structure) is passed in %rdi, hence our offsets below are 60 * deflate_state structure) is passed in %rdi, hence our offsets below are
58 * all off of that. 61 * all off of that.
59 */ 62 */
63
64/* you can check the structure offset by running
65
66#include <stdlib.h>
67#include <stdio.h>
68#include "deflate.h"
69
70void print_depl()
71{
72deflate_state ds;
73deflate_state *s=&ds;
74printf("size pointer=%u\n",(int)sizeof(void*));
75
76printf("#define dsWSize (%3u)(%%rdi)\n",(int)(((char*)&(s->w_size))-((char*)s)));
77printf("#define dsWMask (%3u)(%%rdi)\n",(int)(((char*)&(s->w_mask))-((char*)s)));
78printf("#define dsWindow (%3u)(%%rdi)\n",(int)(((char*)&(s->window))-((char*)s)));
79printf("#define dsPrev (%3u)(%%rdi)\n",(int)(((char*)&(s->prev))-((char*)s)));
80printf("#define dsMatchLen (%3u)(%%rdi)\n",(int)(((char*)&(s->match_length))-((char*)s)));
81printf("#define dsPrevMatch (%3u)(%%rdi)\n",(int)(((char*)&(s->prev_match))-((char*)s)));
82printf("#define dsStrStart (%3u)(%%rdi)\n",(int)(((char*)&(s->strstart))-((char*)s)));
83printf("#define dsMatchStart (%3u)(%%rdi)\n",(int)(((char*)&(s->match_start))-((char*)s)));
84printf("#define dsLookahead (%3u)(%%rdi)\n",(int)(((char*)&(s->lookahead))-((char*)s)));
85printf("#define dsPrevLen (%3u)(%%rdi)\n",(int)(((char*)&(s->prev_length))-((char*)s)));
86printf("#define dsMaxChainLen (%3u)(%%rdi)\n",(int)(((char*)&(s->max_chain_length))-((char*)s)));
87printf("#define dsGoodMatch (%3u)(%%rdi)\n",(int)(((char*)&(s->good_match))-((char*)s)));
88printf("#define dsNiceMatch (%3u)(%%rdi)\n",(int)(((char*)&(s->nice_match))-((char*)s)));
89}
90
91*/
92
93
94/*
95 to compile for XCode 3.2 on MacOSX x86_64
96 - run "gcc -g -c -DXCODE_MAC_X64_STRUCTURE amd64-match.S"
97 */
98
99
100#ifndef CURRENT_LINX_XCODE_MAC_X64_STRUCTURE
101#define dsWSize ( 68)(%rdi)
102#define dsWMask ( 76)(%rdi)
103#define dsWindow ( 80)(%rdi)
104#define dsPrev ( 96)(%rdi)
105#define dsMatchLen (144)(%rdi)
106#define dsPrevMatch (148)(%rdi)
107#define dsStrStart (156)(%rdi)
108#define dsMatchStart (160)(%rdi)
109#define dsLookahead (164)(%rdi)
110#define dsPrevLen (168)(%rdi)
111#define dsMaxChainLen (172)(%rdi)
112#define dsGoodMatch (188)(%rdi)
113#define dsNiceMatch (192)(%rdi)
114
115#else
116
60#ifndef STRUCT_OFFSET 117#ifndef STRUCT_OFFSET
61# define STRUCT_OFFSET (0) 118# define STRUCT_OFFSET (0)
62#endif 119#endif
120
121
63#define dsWSize ( 56 + STRUCT_OFFSET)(%rdi) 122#define dsWSize ( 56 + STRUCT_OFFSET)(%rdi)
64#define dsWMask ( 64 + STRUCT_OFFSET)(%rdi) 123#define dsWMask ( 64 + STRUCT_OFFSET)(%rdi)
65#define dsWindow ( 72 + STRUCT_OFFSET)(%rdi) 124#define dsWindow ( 72 + STRUCT_OFFSET)(%rdi)
@@ -74,7 +133,10 @@
74#define dsGoodMatch (180 + STRUCT_OFFSET)(%rdi) 133#define dsGoodMatch (180 + STRUCT_OFFSET)(%rdi)
75#define dsNiceMatch (184 + STRUCT_OFFSET)(%rdi) 134#define dsNiceMatch (184 + STRUCT_OFFSET)(%rdi)
76 135
77.globl match_init, longest_match 136#endif
137
138
139
78 140
79.text 141.text
80 142
@@ -222,7 +284,9 @@ LoopEntry: cmpw -1(%windowbestlen, %curmatch), %scanendw
222 * straightforward "rep cmpsb" would not drastically degrade 284 * straightforward "rep cmpsb" would not drastically degrade
223 * performance -- unrolling it, for example, makes no difference. 285 * performance -- unrolling it, for example, makes no difference.
224 */ 286 */
287
225#undef USE_SSE /* works, but is 6-7% slower, than non-SSE... */ 288#undef USE_SSE /* works, but is 6-7% slower, than non-SSE... */
289
226LoopCmps: 290LoopCmps:
227#ifdef USE_SSE 291#ifdef USE_SSE
228 /* Preload the SSE registers */ 292 /* Preload the SSE registers */
@@ -244,29 +308,55 @@ LoopCmps:
244 notw %ax 308 notw %ax
245 bsfw %ax, %ax 309 bsfw %ax, %ax
246 jnz LeaveLoopCmps 310 jnz LeaveLoopCmps
247 add $16, %rdx 311
312 /* this is the only iteration of the loop with a possibility of having
313 incremented rdx by 0x108 (each loop iteration add 16*4 = 0x40
314 and (0x40*4)+8=0x108 */
315 add $8, %rdx
316 jz LenMaximum
317 add $8, %rdx
318
319
248 pmovmskb %xmm3, %rax 320 pmovmskb %xmm3, %rax
249 notw %ax 321 notw %ax
250 bsfw %ax, %ax 322 bsfw %ax, %ax
251 jnz LeaveLoopCmps 323 jnz LeaveLoopCmps
324
325
252 add $16, %rdx 326 add $16, %rdx
327
328
253 pmovmskb %xmm5, %rax 329 pmovmskb %xmm5, %rax
254 notw %ax 330 notw %ax
255 bsfw %ax, %ax 331 bsfw %ax, %ax
256 jnz LeaveLoopCmps 332 jnz LeaveLoopCmps
333
257 add $16, %rdx 334 add $16, %rdx
335
336
258 pmovmskb %xmm7, %rax 337 pmovmskb %xmm7, %rax
259 notw %ax 338 notw %ax
260 bsfw %ax, %ax 339 bsfw %ax, %ax
261 jnz LeaveLoopCmps 340 jnz LeaveLoopCmps
341
262 add $16, %rdx 342 add $16, %rdx
343
263 jmp LoopCmps 344 jmp LoopCmps
264LeaveLoopCmps: add %rax, %rdx 345LeaveLoopCmps: add %rax, %rdx
265#else 346#else
266 mov (%windowbestlen, %rdx), %rax 347 mov (%windowbestlen, %rdx), %rax
267 xor (%prev, %rdx), %rax 348 xor (%prev, %rdx), %rax
268 jnz LeaveLoopCmps 349 jnz LeaveLoopCmps
269 add $8, %rdx 350
351 mov 8(%windowbestlen, %rdx), %rax
352 xor 8(%prev, %rdx), %rax
353 jnz LeaveLoopCmps8
354
355 mov 16(%windowbestlen, %rdx), %rax
356 xor 16(%prev, %rdx), %rax
357 jnz LeaveLoopCmps16
358
359 add $24, %rdx
270 jnz LoopCmps 360 jnz LoopCmps
271 jmp LenMaximum 361 jmp LenMaximum
272# if 0 362# if 0
@@ -274,10 +364,15 @@ LeaveLoopCmps: add %rax, %rdx
274 * This three-liner is tantalizingly simple, but bsf is a slow instruction, 364 * This three-liner is tantalizingly simple, but bsf is a slow instruction,
275 * and the complicated alternative down below is quite a bit faster. Sad... 365 * and the complicated alternative down below is quite a bit faster. Sad...
276 */ 366 */
367
277LeaveLoopCmps: bsf %rax, %rax /* find the first non-zero bit */ 368LeaveLoopCmps: bsf %rax, %rax /* find the first non-zero bit */
278 shrl $3, %eax /* divide by 8 to get the byte */ 369 shrl $3, %eax /* divide by 8 to get the byte */
279 add %rax, %rdx 370 add %rax, %rdx
280# else 371# else
372LeaveLoopCmps16:
373 add $8, %rdx
374LeaveLoopCmps8:
375 add $8, %rdx
281LeaveLoopCmps: testl $0xFFFFFFFF, %eax /* Check the first 4 bytes */ 376LeaveLoopCmps: testl $0xFFFFFFFF, %eax /* Check the first 4 bytes */
282 jnz Check16 377 jnz Check16
283 add $4, %rdx 378 add $4, %rdx
diff --git a/contrib/asm586/README.586 b/contrib/asm586/README.586
deleted file mode 100644
index 6bb78f3..0000000
--- a/contrib/asm586/README.586
+++ /dev/null
@@ -1,43 +0,0 @@
1This is a patched version of zlib modified to use
2Pentium-optimized assembly code in the deflation algorithm. The files
3changed/added by this patch are:
4
5README.586
6match.S
7
8The effectiveness of these modifications is a bit marginal, as the the
9program's bottleneck seems to be mostly L1-cache contention, for which
10there is no real way to work around without rewriting the basic
11algorithm. The speedup on average is around 5-10% (which is generally
12less than the amount of variance between subsequent executions).
13However, when used at level 9 compression, the cache contention can
14drop enough for the assembly version to achieve 10-20% speedup (and
15sometimes more, depending on the amount of overall redundancy in the
16files). Even here, though, cache contention can still be the limiting
17factor, depending on the nature of the program using the zlib library.
18This may also mean that better improvements will be seen on a Pentium
19with MMX, which suffers much less from L1-cache contention, but I have
20not yet verified this.
21
22Note that this code has been tailored for the Pentium in particular,
23and will not perform well on the Pentium Pro (due to the use of a
24partial register in the inner loop).
25
26If you are using an assembler other than GNU as, you will have to
27translate match.S to use your assembler's syntax. (Have fun.)
28
29Brian Raiter
30breadbox@muppetlabs.com
31April, 1998
32
33
34Added for zlib 1.1.3:
35
36The patches come from
37http://www.muppetlabs.com/~breadbox/software/assembly.html
38
39To compile zlib with this asm file, copy match.S to the zlib directory
40then do:
41
42CFLAGS="-O3 -DASMV" ./configure
43make OBJA=match.o
diff --git a/contrib/asm586/match.S b/contrib/asm586/match.S
deleted file mode 100644
index 0368b35..0000000
--- a/contrib/asm586/match.S
+++ /dev/null
@@ -1,364 +0,0 @@
1/* match.s -- Pentium-optimized version of longest_match()
2 * Written for zlib 1.1.2
3 * Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
4 *
5 * This is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License.
7 */
8
9#ifndef NO_UNDERLINE
10#define match_init _match_init
11#define longest_match _longest_match
12#endif
13
14#define MAX_MATCH (258)
15#define MIN_MATCH (3)
16#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1)
17#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7)
18
19/* stack frame offsets */
20
21#define wmask 0 /* local copy of s->wmask */
22#define window 4 /* local copy of s->window */
23#define windowbestlen 8 /* s->window + bestlen */
24#define chainlenscanend 12 /* high word: current chain len */
25 /* low word: last bytes sought */
26#define scanstart 16 /* first two bytes of string */
27#define scanalign 20 /* dword-misalignment of string */
28#define nicematch 24 /* a good enough match size */
29#define bestlen 28 /* size of best match so far */
30#define scan 32 /* ptr to string wanting match */
31
32#define LocalVarsSize (36)
33/* saved ebx 36 */
34/* saved edi 40 */
35/* saved esi 44 */
36/* saved ebp 48 */
37/* return address 52 */
38#define deflatestate 56 /* the function arguments */
39#define curmatch 60
40
41/* Offsets for fields in the deflate_state structure. These numbers
42 * are calculated from the definition of deflate_state, with the
43 * assumption that the compiler will dword-align the fields. (Thus,
44 * changing the definition of deflate_state could easily cause this
45 * program to crash horribly, without so much as a warning at
46 * compile time. Sigh.)
47 */
48
49/* All the +zlib1222add offsets are due to the addition of fields
50 * in zlib in the deflate_state structure since the asm code was first written
51 * (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)").
52 * (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
53 * if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
54 */
55
56#define zlib1222add (8)
57
58#define dsWSize (36+zlib1222add)
59#define dsWMask (44+zlib1222add)
60#define dsWindow (48+zlib1222add)
61#define dsPrev (56+zlib1222add)
62#define dsMatchLen (88+zlib1222add)
63#define dsPrevMatch (92+zlib1222add)
64#define dsStrStart (100+zlib1222add)
65#define dsMatchStart (104+zlib1222add)
66#define dsLookahead (108+zlib1222add)
67#define dsPrevLen (112+zlib1222add)
68#define dsMaxChainLen (116+zlib1222add)
69#define dsGoodMatch (132+zlib1222add)
70#define dsNiceMatch (136+zlib1222add)
71
72
73.file "match.S"
74
75.globl match_init, longest_match
76
77.text
78
79/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */
80
81longest_match:
82
83/* Save registers that the compiler may be using, and adjust %esp to */
84/* make room for our stack frame. */
85
86 pushl %ebp
87 pushl %edi
88 pushl %esi
89 pushl %ebx
90 subl $LocalVarsSize, %esp
91
92/* Retrieve the function arguments. %ecx will hold cur_match */
93/* throughout the entire function. %edx will hold the pointer to the */
94/* deflate_state structure during the function's setup (before */
95/* entering the main loop). */
96
97 movl deflatestate(%esp), %edx
98 movl curmatch(%esp), %ecx
99
100/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */
101
102 movl dsNiceMatch(%edx), %eax
103 movl dsLookahead(%edx), %ebx
104 cmpl %eax, %ebx
105 jl LookaheadLess
106 movl %eax, %ebx
107LookaheadLess: movl %ebx, nicematch(%esp)
108
109/* register Bytef *scan = s->window + s->strstart; */
110
111 movl dsWindow(%edx), %esi
112 movl %esi, window(%esp)
113 movl dsStrStart(%edx), %ebp
114 lea (%esi,%ebp), %edi
115 movl %edi, scan(%esp)
116
117/* Determine how many bytes the scan ptr is off from being */
118/* dword-aligned. */
119
120 movl %edi, %eax
121 negl %eax
122 andl $3, %eax
123 movl %eax, scanalign(%esp)
124
125/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */
126/* s->strstart - (IPos)MAX_DIST(s) : NIL; */
127
128 movl dsWSize(%edx), %eax
129 subl $MIN_LOOKAHEAD, %eax
130 subl %eax, %ebp
131 jg LimitPositive
132 xorl %ebp, %ebp
133LimitPositive:
134
135/* unsigned chain_length = s->max_chain_length; */
136/* if (s->prev_length >= s->good_match) { */
137/* chain_length >>= 2; */
138/* } */
139
140 movl dsPrevLen(%edx), %eax
141 movl dsGoodMatch(%edx), %ebx
142 cmpl %ebx, %eax
143 movl dsMaxChainLen(%edx), %ebx
144 jl LastMatchGood
145 shrl $2, %ebx
146LastMatchGood:
147
148/* chainlen is decremented once beforehand so that the function can */
149/* use the sign flag instead of the zero flag for the exit test. */
150/* It is then shifted into the high word, to make room for the scanend */
151/* scanend value, which it will always accompany. */
152
153 decl %ebx
154 shll $16, %ebx
155
156/* int best_len = s->prev_length; */
157
158 movl dsPrevLen(%edx), %eax
159 movl %eax, bestlen(%esp)
160
161/* Store the sum of s->window + best_len in %esi locally, and in %esi. */
162
163 addl %eax, %esi
164 movl %esi, windowbestlen(%esp)
165
166/* register ush scan_start = *(ushf*)scan; */
167/* register ush scan_end = *(ushf*)(scan+best_len-1); */
168
169 movw (%edi), %bx
170 movw %bx, scanstart(%esp)
171 movw -1(%edi,%eax), %bx
172 movl %ebx, chainlenscanend(%esp)
173
174/* Posf *prev = s->prev; */
175/* uInt wmask = s->w_mask; */
176
177 movl dsPrev(%edx), %edi
178 movl dsWMask(%edx), %edx
179 mov %edx, wmask(%esp)
180
181/* Jump into the main loop. */
182
183 jmp LoopEntry
184
185.balign 16
186
187/* do {
188 * match = s->window + cur_match;
189 * if (*(ushf*)(match+best_len-1) != scan_end ||
190 * *(ushf*)match != scan_start) continue;
191 * [...]
192 * } while ((cur_match = prev[cur_match & wmask]) > limit
193 * && --chain_length != 0);
194 *
195 * Here is the inner loop of the function. The function will spend the
196 * majority of its time in this loop, and majority of that time will
197 * be spent in the first ten instructions.
198 *
199 * Within this loop:
200 * %ebx = chainlenscanend - i.e., ((chainlen << 16) | scanend)
201 * %ecx = curmatch
202 * %edx = curmatch & wmask
203 * %esi = windowbestlen - i.e., (window + bestlen)
204 * %edi = prev
205 * %ebp = limit
206 *
207 * Two optimization notes on the choice of instructions:
208 *
209 * The first instruction uses a 16-bit address, which costs an extra,
210 * unpairable cycle. This is cheaper than doing a 32-bit access and
211 * zeroing the high word, due to the 3-cycle misalignment penalty which
212 * would occur half the time. This also turns out to be cheaper than
213 * doing two separate 8-bit accesses, as the memory is so rarely in the
214 * L1 cache.
215 *
216 * The window buffer, however, apparently spends a lot of time in the
217 * cache, and so it is faster to retrieve the word at the end of the
218 * match string with two 8-bit loads. The instructions that test the
219 * word at the beginning of the match string, however, are executed
220 * much less frequently, and there it was cheaper to use 16-bit
221 * instructions, which avoided the necessity of saving off and
222 * subsequently reloading one of the other registers.
223 */
224LookupLoop:
225 /* 1 U & V */
226 movw (%edi,%edx,2), %cx /* 2 U pipe */
227 movl wmask(%esp), %edx /* 2 V pipe */
228 cmpl %ebp, %ecx /* 3 U pipe */
229 jbe LeaveNow /* 3 V pipe */
230 subl $0x00010000, %ebx /* 4 U pipe */
231 js LeaveNow /* 4 V pipe */
232LoopEntry: movb -1(%esi,%ecx), %al /* 5 U pipe */
233 andl %ecx, %edx /* 5 V pipe */
234 cmpb %bl, %al /* 6 U pipe */
235 jnz LookupLoop /* 6 V pipe */
236 movb (%esi,%ecx), %ah
237 cmpb %bh, %ah
238 jnz LookupLoop
239 movl window(%esp), %eax
240 movw (%eax,%ecx), %ax
241 cmpw scanstart(%esp), %ax
242 jnz LookupLoop
243
244/* Store the current value of chainlen. */
245
246 movl %ebx, chainlenscanend(%esp)
247
248/* Point %edi to the string under scrutiny, and %esi to the string we */
249/* are hoping to match it up with. In actuality, %esi and %edi are */
250/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */
251/* initialized to -(MAX_MATCH_8 - scanalign). */
252
253 movl window(%esp), %esi
254 movl scan(%esp), %edi
255 addl %ecx, %esi
256 movl scanalign(%esp), %eax
257 movl $(-MAX_MATCH_8), %edx
258 lea MAX_MATCH_8(%edi,%eax), %edi
259 lea MAX_MATCH_8(%esi,%eax), %esi
260
261/* Test the strings for equality, 8 bytes at a time. At the end,
262 * adjust %edx so that it is offset to the exact byte that mismatched.
263 *
264 * We already know at this point that the first three bytes of the
265 * strings match each other, and they can be safely passed over before
266 * starting the compare loop. So what this code does is skip over 0-3
267 * bytes, as much as necessary in order to dword-align the %edi
268 * pointer. (%esi will still be misaligned three times out of four.)
269 *
270 * It should be confessed that this loop usually does not represent
271 * much of the total running time. Replacing it with a more
272 * straightforward "rep cmpsb" would not drastically degrade
273 * performance.
274 */
275LoopCmps:
276 movl (%esi,%edx), %eax
277 movl (%edi,%edx), %ebx
278 xorl %ebx, %eax
279 jnz LeaveLoopCmps
280 movl 4(%esi,%edx), %eax
281 movl 4(%edi,%edx), %ebx
282 xorl %ebx, %eax
283 jnz LeaveLoopCmps4
284 addl $8, %edx
285 jnz LoopCmps
286 jmp LenMaximum
287LeaveLoopCmps4: addl $4, %edx
288LeaveLoopCmps: testl $0x0000FFFF, %eax
289 jnz LenLower
290 addl $2, %edx
291 shrl $16, %eax
292LenLower: subb $1, %al
293 adcl $0, %edx
294
295/* Calculate the length of the match. If it is longer than MAX_MATCH, */
296/* then automatically accept it as the best possible match and leave. */
297
298 lea (%edi,%edx), %eax
299 movl scan(%esp), %edi
300 subl %edi, %eax
301 cmpl $MAX_MATCH, %eax
302 jge LenMaximum
303
304/* If the length of the match is not longer than the best match we */
305/* have so far, then forget it and return to the lookup loop. */
306
307 movl deflatestate(%esp), %edx
308 movl bestlen(%esp), %ebx
309 cmpl %ebx, %eax
310 jg LongerMatch
311 movl chainlenscanend(%esp), %ebx
312 movl windowbestlen(%esp), %esi
313 movl dsPrev(%edx), %edi
314 movl wmask(%esp), %edx
315 andl %ecx, %edx
316 jmp LookupLoop
317
318/* s->match_start = cur_match; */
319/* best_len = len; */
320/* if (len >= nice_match) break; */
321/* scan_end = *(ushf*)(scan+best_len-1); */
322
323LongerMatch: movl nicematch(%esp), %ebx
324 movl %eax, bestlen(%esp)
325 movl %ecx, dsMatchStart(%edx)
326 cmpl %ebx, %eax
327 jge LeaveNow
328 movl window(%esp), %esi
329 addl %eax, %esi
330 movl %esi, windowbestlen(%esp)
331 movl chainlenscanend(%esp), %ebx
332 movw -1(%edi,%eax), %bx
333 movl dsPrev(%edx), %edi
334 movl %ebx, chainlenscanend(%esp)
335 movl wmask(%esp), %edx
336 andl %ecx, %edx
337 jmp LookupLoop
338
339/* Accept the current string, with the maximum possible length. */
340
341LenMaximum: movl deflatestate(%esp), %edx
342 movl $MAX_MATCH, bestlen(%esp)
343 movl %ecx, dsMatchStart(%edx)
344
345/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */
346/* return s->lookahead; */
347
348LeaveNow:
349 movl deflatestate(%esp), %edx
350 movl bestlen(%esp), %ebx
351 movl dsLookahead(%edx), %eax
352 cmpl %eax, %ebx
353 jg LookaheadRet
354 movl %ebx, %eax
355LookaheadRet:
356
357/* Restore the stack and return from whence we came. */
358
359 addl $LocalVarsSize, %esp
360 popl %ebx
361 popl %esi
362 popl %edi
363 popl %ebp
364match_init: ret
diff --git a/contrib/asm686/README.686 b/contrib/asm686/README.686
index a593f23..a0bf3be 100644
--- a/contrib/asm686/README.686
+++ b/contrib/asm686/README.686
@@ -32,3 +32,20 @@ then do:
32 32
33CFLAGS="-O3 -DASMV" ./configure 33CFLAGS="-O3 -DASMV" ./configure
34make OBJA=match.o 34make OBJA=match.o
35
36
37Update:
38
39I've been ignoring these assembly routines for years, believing that
40gcc's generated code had caught up with it sometime around gcc 2.95
41and the major rearchitecting of the Pentium 4. However, I recently
42learned that, despite what I believed, this code still has some life
43in it. On the Pentium 4 and AMD64 chips, it continues to run about 8%
44faster than the code produced by gcc 4.1.
45
46In acknowledgement of its continuing usefulness, I've altered the
47license to match that of the rest of zlib. Share and Enjoy!
48
49Brian Raiter
50breadbox@muppetlabs.com
51April, 2007
diff --git a/contrib/asm686/match.S b/contrib/asm686/match.S
index 5c3e9ee..06817e1 100644
--- a/contrib/asm686/match.S
+++ b/contrib/asm686/match.S
@@ -1,9 +1,23 @@
1/* match.s -- Pentium-Pro-optimized version of longest_match() 1/* match.S -- x86 assembly version of the zlib longest_match() function.
2 * Written for zlib 1.1.2 2 * Optimized for the Intel 686 chips (PPro and later).
3 * Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
4 * 3 *
5 * This is free software; you can redistribute it and/or modify it 4 * Copyright (C) 1998, 2007 Brian Raiter <breadbox@muppetlabs.com>
6 * under the terms of the GNU General Public License. 5 *
6 * This software is provided 'as-is', without any express or implied
7 * warranty. In no event will the author be held liable for any damages
8 * arising from the use of this software.
9 *
10 * Permission is granted to anyone to use this software for any purpose,
11 * including commercial applications, and to alter it and redistribute it
12 * freely, subject to the following restrictions:
13 *
14 * 1. The origin of this software must not be misrepresented; you must not
15 * claim that you wrote the original software. If you use this software
16 * in a product, an acknowledgment in the product documentation would be
17 * appreciated but is not required.
18 * 2. Altered source versions must be plainly marked as such, and must not be
19 * misrepresented as being the original software.
20 * 3. This notice may not be removed or altered from any source distribution.
7 */ 21 */
8 22
9#ifndef NO_UNDERLINE 23#ifndef NO_UNDERLINE
diff --git a/contrib/delphi/ZLib.pas b/contrib/delphi/ZLib.pas
index 3f2b8b4..179f9a9 100644
--- a/contrib/delphi/ZLib.pas
+++ b/contrib/delphi/ZLib.pas
@@ -152,7 +152,7 @@ procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer;
152 const OutBuf: Pointer; BufSize: Integer); 152 const OutBuf: Pointer; BufSize: Integer);
153 153
154const 154const
155 zlib_version = '1.2.3'; 155 zlib_version = '1.2.4';
156 156
157type 157type
158 EZlibError = class(Exception); 158 EZlibError = class(Exception);
diff --git a/contrib/dotzlib/DotZLib/UnitTests.cs b/contrib/dotzlib/DotZLib/UnitTests.cs
index eb751bb..42c4588 100644
--- a/contrib/dotzlib/DotZLib/UnitTests.cs
+++ b/contrib/dotzlib/DotZLib/UnitTests.cs
@@ -156,7 +156,7 @@ namespace DotZLibTests
156 public void Info_Version() 156 public void Info_Version()
157 { 157 {
158 Info info = new Info(); 158 Info info = new Info();
159 Assert.AreEqual("1.2.3", Info.Version); 159 Assert.AreEqual("1.2.4", Info.Version);
160 Assert.AreEqual(32, info.SizeOfUInt); 160 Assert.AreEqual(32, info.SizeOfUInt);
161 Assert.AreEqual(32, info.SizeOfULong); 161 Assert.AreEqual(32, info.SizeOfULong);
162 Assert.AreEqual(32, info.SizeOfPointer); 162 Assert.AreEqual(32, info.SizeOfPointer);
diff --git a/contrib/gcc_gvmat64/gvmat64.S b/contrib/gcc_gvmat64/gvmat64.S
new file mode 100644
index 0000000..dd858dd
--- /dev/null
+++ b/contrib/gcc_gvmat64/gvmat64.S
@@ -0,0 +1,574 @@
1/*
2;uInt longest_match_x64(
3; deflate_state *s,
4; IPos cur_match); // current match
5
6; gvmat64.S -- Asm portion of the optimized longest_match for 32 bits x86_64
7; (AMD64 on Athlon 64, Opteron, Phenom
8; and Intel EM64T on Pentium 4 with EM64T, Pentium D, Core 2 Duo, Core I5/I7)
9; this file is translation from gvmat64.asm to GCC 4.x (for Linux, Mac XCode)
10; Copyright (C) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant.
11;
12; File written by Gilles Vollant, by converting to assembly the longest_match
13; from Jean-loup Gailly in deflate.c of zLib and infoZip zip.
14; and by taking inspiration on asm686 with masm, optimised assembly code
15; from Brian Raiter, written 1998
16;
17; This software is provided 'as-is', without any express or implied
18; warranty. In no event will the authors be held liable for any damages
19; arising from the use of this software.
20;
21; Permission is granted to anyone to use this software for any purpose,
22; including commercial applications, and to alter it and redistribute it
23; freely, subject to the following restrictions:
24;
25; 1. The origin of this software must not be misrepresented; you must not
26; claim that you wrote the original software. If you use this software
27; in a product, an acknowledgment in the product documentation would be
28; appreciated but is not required.
29; 2. Altered source versions must be plainly marked as such, and must not be
30; misrepresented as being the original software
31; 3. This notice may not be removed or altered from any source distribution.
32;
33; http://www.zlib.net
34; http://www.winimage.com/zLibDll
35; http://www.muppetlabs.com/~breadbox/software/assembly.html
36;
37; to compile this file for zLib, I use option:
38; gcc -c -arch x86_64 gvmat64.S
39
40
41;uInt longest_match(s, cur_match)
42; deflate_state *s;
43; IPos cur_match; // current match /
44;
45; with XCode for Mac, I had strange error with some jump on intel syntax
46; this is why BEFORE_JMP and AFTER_JMP are used
47 */
48
49
50#define BEFORE_JMP .att_syntax
51#define AFTER_JMP .intel_syntax noprefix
52
53#ifndef NO_UNDERLINE
54# define match_init _match_init
55# define longest_match _longest_match
56#endif
57
58.intel_syntax noprefix
59
60.globl match_init, longest_match
61.text
62longest_match:
63
64
65
66#define LocalVarsSize 96
67/*
68; register used : rax,rbx,rcx,rdx,rsi,rdi,r8,r9,r10,r11,r12
69; free register : r14,r15
70; register can be saved : rsp
71*/
72
73#define chainlenwmask (rsp + 8 - LocalVarsSize)
74#define nicematch (rsp + 16 - LocalVarsSize)
75
76#define save_rdi (rsp + 24 - LocalVarsSize)
77#define save_rsi (rsp + 32 - LocalVarsSize)
78#define save_rbx (rsp + 40 - LocalVarsSize)
79#define save_rbp (rsp + 48 - LocalVarsSize)
80#define save_r12 (rsp + 56 - LocalVarsSize)
81#define save_r13 (rsp + 64 - LocalVarsSize)
82#define save_r14 (rsp + 72 - LocalVarsSize)
83#define save_r15 (rsp + 80 - LocalVarsSize)
84
85
86/*
87; all the +4 offsets are due to the addition of pending_buf_size (in zlib
88; in the deflate_state structure since the asm code was first written
89; (if you compile with zlib 1.0.4 or older, remove the +4).
90; Note : these value are good with a 8 bytes boundary pack structure
91*/
92
93#define MAX_MATCH 258
94#define MIN_MATCH 3
95#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
96
97/*
98;;; Offsets for fields in the deflate_state structure. These numbers
99;;; are calculated from the definition of deflate_state, with the
100;;; assumption that the compiler will dword-align the fields. (Thus,
101;;; changing the definition of deflate_state could easily cause this
102;;; program to crash horribly, without so much as a warning at
103;;; compile time. Sigh.)
104
105; all the +zlib1222add offsets are due to the addition of fields
106; in zlib in the deflate_state structure since the asm code was first written
107; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)").
108; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
109; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
110*/
111
112
113
114/* you can check the structure offset by running
115
116#include <stdlib.h>
117#include <stdio.h>
118#include "deflate.h"
119
120void print_depl()
121{
122deflate_state ds;
123deflate_state *s=&ds;
124printf("size pointer=%u\n",(int)sizeof(void*));
125
126printf("#define dsWSize %u\n",(int)(((char*)&(s->w_size))-((char*)s)));
127printf("#define dsWMask %u\n",(int)(((char*)&(s->w_mask))-((char*)s)));
128printf("#define dsWindow %u\n",(int)(((char*)&(s->window))-((char*)s)));
129printf("#define dsPrev %u\n",(int)(((char*)&(s->prev))-((char*)s)));
130printf("#define dsMatchLen %u\n",(int)(((char*)&(s->match_length))-((char*)s)));
131printf("#define dsPrevMatch %u\n",(int)(((char*)&(s->prev_match))-((char*)s)));
132printf("#define dsStrStart %u\n",(int)(((char*)&(s->strstart))-((char*)s)));
133printf("#define dsMatchStart %u\n",(int)(((char*)&(s->match_start))-((char*)s)));
134printf("#define dsLookahead %u\n",(int)(((char*)&(s->lookahead))-((char*)s)));
135printf("#define dsPrevLen %u\n",(int)(((char*)&(s->prev_length))-((char*)s)));
136printf("#define dsMaxChainLen %u\n",(int)(((char*)&(s->max_chain_length))-((char*)s)));
137printf("#define dsGoodMatch %u\n",(int)(((char*)&(s->good_match))-((char*)s)));
138printf("#define dsNiceMatch %u\n",(int)(((char*)&(s->nice_match))-((char*)s)));
139}
140*/
141
142#define dsWSize 68
143#define dsWMask 76
144#define dsWindow 80
145#define dsPrev 96
146#define dsMatchLen 144
147#define dsPrevMatch 148
148#define dsStrStart 156
149#define dsMatchStart 160
150#define dsLookahead 164
151#define dsPrevLen 168
152#define dsMaxChainLen 172
153#define dsGoodMatch 188
154#define dsNiceMatch 192
155
156#define window_size [ rcx + dsWSize]
157#define WMask [ rcx + dsWMask]
158#define window_ad [ rcx + dsWindow]
159#define prev_ad [ rcx + dsPrev]
160#define strstart [ rcx + dsStrStart]
161#define match_start [ rcx + dsMatchStart]
162#define Lookahead [ rcx + dsLookahead] //; 0ffffffffh on infozip
163#define prev_length [ rcx + dsPrevLen]
164#define max_chain_length [ rcx + dsMaxChainLen]
165#define good_match [ rcx + dsGoodMatch]
166#define nice_match [ rcx + dsNiceMatch]
167
168/*
169; windows:
170; parameter 1 in rcx(deflate state s), param 2 in rdx (cur match)
171
172; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and
173; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp
174;
175; All registers must be preserved across the call, except for
176; rax, rcx, rdx, r8, r9, r10, and r11, which are scratch.
177
178;
179; gcc on macosx-linux:
180; see http://www.x86-64.org/documentation/abi-0.99.pdf
181; param 1 in rdi, param 2 in rsi
182; rbx, rsp, rbp, r12 to r15 must be preserved
183
184;;; Save registers that the compiler may be using, and adjust esp to
185;;; make room for our stack frame.
186
187
188;;; Retrieve the function arguments. r8d will hold cur_match
189;;; throughout the entire function. edx will hold the pointer to the
190;;; deflate_state structure during the function's setup (before
191;;; entering the main loop.
192
193; ms: parameter 1 in rcx (deflate_state* s), param 2 in edx -> r8 (cur match)
194; mac: param 1 in rdi, param 2 rsi
195; this clear high 32 bits of r8, which can be garbage in both r8 and rdx
196*/
197 mov [save_rbx],rbx
198 mov [save_rbp],rbp
199
200
201 mov rcx,rdi
202
203 mov r8d,esi
204
205
206 mov [save_r12],r12
207 mov [save_r13],r13
208 mov [save_r14],r14
209 mov [save_r15],r15
210
211
212//;;; uInt wmask = s->w_mask;
213//;;; unsigned chain_length = s->max_chain_length;
214//;;; if (s->prev_length >= s->good_match) {
215//;;; chain_length >>= 2;
216//;;; }
217
218
219 mov edi, prev_length
220 mov esi, good_match
221 mov eax, WMask
222 mov ebx, max_chain_length
223 cmp edi, esi
224 jl LastMatchGood
225 shr ebx, 2
226LastMatchGood:
227
228//;;; chainlen is decremented once beforehand so that the function can
229//;;; use the sign flag instead of the zero flag for the exit test.
230//;;; It is then shifted into the high word, to make room for the wmask
231//;;; value, which it will always accompany.
232
233 dec ebx
234 shl ebx, 16
235 or ebx, eax
236
237//;;; on zlib only
238//;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
239
240
241
242 mov eax, nice_match
243 mov [chainlenwmask], ebx
244 mov r10d, Lookahead
245 cmp r10d, eax
246 cmovnl r10d, eax
247 mov [nicematch],r10d
248
249
250
251//;;; register Bytef *scan = s->window + s->strstart;
252 mov r10, window_ad
253 mov ebp, strstart
254 lea r13, [r10 + rbp]
255
256//;;; Determine how many bytes the scan ptr is off from being
257//;;; dword-aligned.
258
259 mov r9,r13
260 neg r13
261 and r13,3
262
263//;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
264//;;; s->strstart - (IPos)MAX_DIST(s) : NIL;
265
266
267 mov eax, window_size
268 sub eax, MIN_LOOKAHEAD
269
270
271 xor edi,edi
272 sub ebp, eax
273
274 mov r11d, prev_length
275
276 cmovng ebp,edi
277
278//;;; int best_len = s->prev_length;
279
280
281//;;; Store the sum of s->window + best_len in esi locally, and in esi.
282
283 lea rsi,[r10+r11]
284
285//;;; register ush scan_start = *(ushf*)scan;
286//;;; register ush scan_end = *(ushf*)(scan+best_len-1);
287//;;; Posf *prev = s->prev;
288
289 movzx r12d,word ptr [r9]
290 movzx ebx, word ptr [r9 + r11 - 1]
291
292 mov rdi, prev_ad
293
294//;;; Jump into the main loop.
295
296 mov edx, [chainlenwmask]
297
298 cmp bx,word ptr [rsi + r8 - 1]
299 jz LookupLoopIsZero
300
301
302
303LookupLoop1:
304 and r8d, edx
305
306 movzx r8d, word ptr [rdi + r8*2]
307 cmp r8d, ebp
308 jbe LeaveNow
309
310
311
312 sub edx, 0x00010000
313 BEFORE_JMP
314 js LeaveNow
315 AFTER_JMP
316
317LoopEntry1:
318 cmp bx,word ptr [rsi + r8 - 1]
319 BEFORE_JMP
320 jz LookupLoopIsZero
321 AFTER_JMP
322
323LookupLoop2:
324 and r8d, edx
325
326 movzx r8d, word ptr [rdi + r8*2]
327 cmp r8d, ebp
328 BEFORE_JMP
329 jbe LeaveNow
330 AFTER_JMP
331 sub edx, 0x00010000
332 BEFORE_JMP
333 js LeaveNow
334 AFTER_JMP
335
336LoopEntry2:
337 cmp bx,word ptr [rsi + r8 - 1]
338 BEFORE_JMP
339 jz LookupLoopIsZero
340 AFTER_JMP
341
342LookupLoop4:
343 and r8d, edx
344
345 movzx r8d, word ptr [rdi + r8*2]
346 cmp r8d, ebp
347 BEFORE_JMP
348 jbe LeaveNow
349 AFTER_JMP
350 sub edx, 0x00010000
351 BEFORE_JMP
352 js LeaveNow
353 AFTER_JMP
354
355LoopEntry4:
356
357 cmp bx,word ptr [rsi + r8 - 1]
358 BEFORE_JMP
359 jnz LookupLoop1
360 jmp LookupLoopIsZero
361 AFTER_JMP
362/*
363;;; do {
364;;; match = s->window + cur_match;
365;;; if (*(ushf*)(match+best_len-1) != scan_end ||
366;;; *(ushf*)match != scan_start) continue;
367;;; [...]
368;;; } while ((cur_match = prev[cur_match & wmask]) > limit
369;;; && --chain_length != 0);
370;;;
371;;; Here is the inner loop of the function. The function will spend the
372;;; majority of its time in this loop, and majority of that time will
373;;; be spent in the first ten instructions.
374;;;
375;;; Within this loop:
376;;; ebx = scanend
377;;; r8d = curmatch
378;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
379;;; esi = windowbestlen - i.e., (window + bestlen)
380;;; edi = prev
381;;; ebp = limit
382*/
383.balign 16
384LookupLoop:
385 and r8d, edx
386
387 movzx r8d, word ptr [rdi + r8*2]
388 cmp r8d, ebp
389 BEFORE_JMP
390 jbe LeaveNow
391 AFTER_JMP
392 sub edx, 0x00010000
393 BEFORE_JMP
394 js LeaveNow
395 AFTER_JMP
396
397LoopEntry:
398
399 cmp bx,word ptr [rsi + r8 - 1]
400 BEFORE_JMP
401 jnz LookupLoop1
402 AFTER_JMP
403LookupLoopIsZero:
404 cmp r12w, word ptr [r10 + r8]
405 BEFORE_JMP
406 jnz LookupLoop1
407 AFTER_JMP
408
409
410//;;; Store the current value of chainlen.
411 mov [chainlenwmask], edx
412/*
413;;; Point edi to the string under scrutiny, and esi to the string we
414;;; are hoping to match it up with. In actuality, esi and edi are
415;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is
416;;; initialized to -(MAX_MATCH_8 - scanalign).
417*/
418 lea rsi,[r8+r10]
419 mov rdx, 0xfffffffffffffef8 //; -(MAX_MATCH_8)
420 lea rsi, [rsi + r13 + 0x0108] //;MAX_MATCH_8]
421 lea rdi, [r9 + r13 + 0x0108] //;MAX_MATCH_8]
422
423 prefetcht1 [rsi+rdx]
424 prefetcht1 [rdi+rdx]
425
426/*
427;;; Test the strings for equality, 8 bytes at a time. At the end,
428;;; adjust rdx so that it is offset to the exact byte that mismatched.
429;;;
430;;; We already know at this point that the first three bytes of the
431;;; strings match each other, and they can be safely passed over before
432;;; starting the compare loop. So what this code does is skip over 0-3
433;;; bytes, as much as necessary in order to dword-align the edi
434;;; pointer. (rsi will still be misaligned three times out of four.)
435;;;
436;;; It should be confessed that this loop usually does not represent
437;;; much of the total running time. Replacing it with a more
438;;; straightforward "rep cmpsb" would not drastically degrade
439;;; performance.
440*/
441
442LoopCmps:
443 mov rax, [rsi + rdx]
444 xor rax, [rdi + rdx]
445 jnz LeaveLoopCmps
446
447 mov rax, [rsi + rdx + 8]
448 xor rax, [rdi + rdx + 8]
449 jnz LeaveLoopCmps8
450
451
452 mov rax, [rsi + rdx + 8+8]
453 xor rax, [rdi + rdx + 8+8]
454 jnz LeaveLoopCmps16
455
456 add rdx,8+8+8
457
458 BEFORE_JMP
459 jnz LoopCmps
460 jmp LenMaximum
461 AFTER_JMP
462
463LeaveLoopCmps16: add rdx,8
464LeaveLoopCmps8: add rdx,8
465LeaveLoopCmps:
466
467 test eax, 0x0000FFFF
468 jnz LenLower
469
470 test eax,0xffffffff
471
472 jnz LenLower32
473
474 add rdx,4
475 shr rax,32
476 or ax,ax
477 BEFORE_JMP
478 jnz LenLower
479 AFTER_JMP
480
481LenLower32:
482 shr eax,16
483 add rdx,2
484
485LenLower:
486 sub al, 1
487 adc rdx, 0
488//;;; Calculate the length of the match. If it is longer than MAX_MATCH,
489//;;; then automatically accept it as the best possible match and leave.
490
491 lea rax, [rdi + rdx]
492 sub rax, r9
493 cmp eax, MAX_MATCH
494 BEFORE_JMP
495 jge LenMaximum
496 AFTER_JMP
497/*
498;;; If the length of the match is not longer than the best match we
499;;; have so far, then forget it and return to the lookup loop.
500;///////////////////////////////////
501*/
502 cmp eax, r11d
503 jg LongerMatch
504
505 lea rsi,[r10+r11]
506
507 mov rdi, prev_ad
508 mov edx, [chainlenwmask]
509 BEFORE_JMP
510 jmp LookupLoop
511 AFTER_JMP
512/*
513;;; s->match_start = cur_match;
514;;; best_len = len;
515;;; if (len >= nice_match) break;
516;;; scan_end = *(ushf*)(scan+best_len-1);
517*/
518LongerMatch:
519 mov r11d, eax
520 mov match_start, r8d
521 cmp eax, [nicematch]
522 BEFORE_JMP
523 jge LeaveNow
524 AFTER_JMP
525
526 lea rsi,[r10+rax]
527
528 movzx ebx, word ptr [r9 + rax - 1]
529 mov rdi, prev_ad
530 mov edx, [chainlenwmask]
531 BEFORE_JMP
532 jmp LookupLoop
533 AFTER_JMP
534
535//;;; Accept the current string, with the maximum possible length.
536
537LenMaximum:
538 mov r11d,MAX_MATCH
539 mov match_start, r8d
540
541//;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
542//;;; return s->lookahead;
543
544LeaveNow:
545 mov eax, Lookahead
546 cmp r11d, eax
547 cmovng eax, r11d
548
549
550
551//;;; Restore the stack and return from whence we came.
552
553
554// mov rsi,[save_rsi]
555// mov rdi,[save_rdi]
556 mov rbx,[save_rbx]
557 mov rbp,[save_rbp]
558 mov r12,[save_r12]
559 mov r13,[save_r13]
560 mov r14,[save_r14]
561 mov r15,[save_r15]
562
563
564 ret 0
565//; please don't remove this string !
566//; Your can freely use gvmat64 in any free or commercial app
567//; but it is far better don't remove the string in the binary!
568 // 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
569
570
571match_init:
572 ret 0
573
574
diff --git a/contrib/infback9/inftree9.c b/contrib/infback9/inftree9.c
index c2c8af9..8d15fdc 100644
--- a/contrib/infback9/inftree9.c
+++ b/contrib/infback9/inftree9.c
@@ -9,7 +9,7 @@
9#define MAXBITS 15 9#define MAXBITS 15
10 10
11const char inflate9_copyright[] = 11const char inflate9_copyright[] =
12 " inflate9 1.2.3.9 Copyright 1995-2010 Mark Adler "; 12 " inflate9 1.2.4 Copyright 1995-2010 Mark Adler ";
13/* 13/*
14 If you use the zlib library in a product, an acknowledgment is welcome 14 If you use the zlib library in a product, an acknowledgment is welcome
15 in the documentation of your product. If for some reason you cannot 15 in the documentation of your product. If for some reason you cannot
@@ -64,7 +64,7 @@ unsigned short FAR *work;
64 static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 64 static const unsigned short lext[31] = { /* Length codes 257..285 extra */
65 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 65 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
66 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132, 66 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
67 133, 133, 133, 133, 144, 193, 201}; 67 133, 133, 133, 133, 144, 66, 199};
68 static const unsigned short dbase[32] = { /* Distance codes 0..31 base */ 68 static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
69 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 69 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
70 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 70 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,
diff --git a/contrib/masm686/match.asm b/contrib/masm686/match.asm
deleted file mode 100644
index 4b03a71..0000000
--- a/contrib/masm686/match.asm
+++ /dev/null
@@ -1,413 +0,0 @@
1
2; match.asm -- Pentium-Pro optimized version of longest_match()
3;
4; Updated for zlib 1.1.3 and converted to MASM 6.1x
5; Copyright (C) 2000 Dan Higdon <hdan@kinesoft.com>
6; and Chuck Walbourn <chuckw@kinesoft.com>
7; Corrections by Cosmin Truta <cosmint@cs.ubbcluj.ro>
8;
9; This is free software; you can redistribute it and/or modify it
10; under the terms of the GNU General Public License.
11
12; Based on match.S
13; Written for zlib 1.1.2
14; Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
15;
16; Modified by Gilles Vollant (2005) for add gzhead and gzindex
17
18 .686P
19 .MODEL FLAT
20
21;===========================================================================
22; EQUATES
23;===========================================================================
24
25MAX_MATCH EQU 258
26MIN_MATCH EQU 3
27MIN_LOOKAHEAD EQU (MAX_MATCH + MIN_MATCH + 1)
28MAX_MATCH_8 EQU ((MAX_MATCH + 7) AND (NOT 7))
29
30;===========================================================================
31; STRUCTURES
32;===========================================================================
33
34; This STRUCT assumes a 4-byte alignment
35
36DEFLATE_STATE STRUCT
37ds_strm dd ?
38ds_status dd ?
39ds_pending_buf dd ?
40ds_pending_buf_size dd ?
41ds_pending_out dd ?
42ds_pending dd ?
43ds_wrap dd ?
44; gzhead and gzindex are added in zlib 1.2.2.2 (see deflate.h)
45ds_gzhead dd ?
46ds_gzindex dd ?
47ds_data_type db ?
48ds_method db ?
49 db ? ; padding
50 db ? ; padding
51ds_last_flush dd ?
52ds_w_size dd ? ; used
53ds_w_bits dd ?
54ds_w_mask dd ? ; used
55ds_window dd ? ; used
56ds_window_size dd ?
57ds_prev dd ? ; used
58ds_head dd ?
59ds_ins_h dd ?
60ds_hash_size dd ?
61ds_hash_bits dd ?
62ds_hash_mask dd ?
63ds_hash_shift dd ?
64ds_block_start dd ?
65ds_match_length dd ? ; used
66ds_prev_match dd ? ; used
67ds_match_available dd ?
68ds_strstart dd ? ; used
69ds_match_start dd ? ; used
70ds_lookahead dd ? ; used
71ds_prev_length dd ? ; used
72ds_max_chain_length dd ? ; used
73ds_max_laxy_match dd ?
74ds_level dd ?
75ds_strategy dd ?
76ds_good_match dd ? ; used
77ds_nice_match dd ? ; used
78
79; Don't need anymore of the struct for match
80DEFLATE_STATE ENDS
81
82;===========================================================================
83; CODE
84;===========================================================================
85_TEXT SEGMENT
86
87;---------------------------------------------------------------------------
88; match_init
89;---------------------------------------------------------------------------
90 ALIGN 4
91PUBLIC _match_init
92_match_init PROC
93 ; no initialization needed
94 ret
95_match_init ENDP
96
97;---------------------------------------------------------------------------
98; uInt longest_match(deflate_state *deflatestate, IPos curmatch)
99;---------------------------------------------------------------------------
100 ALIGN 4
101
102PUBLIC _longest_match
103_longest_match PROC
104
105; Since this code uses EBP for a scratch register, the stack frame must
106; be manually constructed and referenced relative to the ESP register.
107
108; Stack image
109; Variables
110chainlenwmask = 0 ; high word: current chain len
111 ; low word: s->wmask
112window = 4 ; local copy of s->window
113windowbestlen = 8 ; s->window + bestlen
114scanend = 12 ; last two bytes of string
115scanstart = 16 ; first two bytes of string
116scanalign = 20 ; dword-misalignment of string
117nicematch = 24 ; a good enough match size
118bestlen = 28 ; size of best match so far
119scan = 32 ; ptr to string wanting match
120varsize = 36 ; number of bytes (also offset to last saved register)
121
122; Saved Registers (actually pushed into place)
123ebx_save = 36
124edi_save = 40
125esi_save = 44
126ebp_save = 48
127
128; Parameters
129retaddr = 52
130deflatestate = 56
131curmatch = 60
132
133; Save registers that the compiler may be using
134 push ebp
135 push edi
136 push esi
137 push ebx
138
139; Allocate local variable space
140 sub esp,varsize
141
142; Retrieve the function arguments. ecx will hold cur_match
143; throughout the entire function. edx will hold the pointer to the
144; deflate_state structure during the function's setup (before
145; entering the main loop).
146
147 mov edx, [esp+deflatestate]
148ASSUME edx:PTR DEFLATE_STATE
149
150 mov ecx, [esp+curmatch]
151
152; uInt wmask = s->w_mask;
153; unsigned chain_length = s->max_chain_length;
154; if (s->prev_length >= s->good_match) {
155; chain_length >>= 2;
156; }
157
158 mov eax, [edx].ds_prev_length
159 mov ebx, [edx].ds_good_match
160 cmp eax, ebx
161 mov eax, [edx].ds_w_mask
162 mov ebx, [edx].ds_max_chain_length
163 jl SHORT LastMatchGood
164 shr ebx, 2
165LastMatchGood:
166
167; chainlen is decremented once beforehand so that the function can
168; use the sign flag instead of the zero flag for the exit test.
169; It is then shifted into the high word, to make room for the wmask
170; value, which it will always accompany.
171
172 dec ebx
173 shl ebx, 16
174 or ebx, eax
175 mov [esp+chainlenwmask], ebx
176
177; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
178
179 mov eax, [edx].ds_nice_match
180 mov ebx, [edx].ds_lookahead
181 cmp ebx, eax
182 jl SHORT LookaheadLess
183 mov ebx, eax
184LookaheadLess:
185 mov [esp+nicematch], ebx
186
187;/* register Bytef *scan = s->window + s->strstart; */
188
189 mov esi, [edx].ds_window
190 mov [esp+window], esi
191 mov ebp, [edx].ds_strstart
192 lea edi, [esi+ebp]
193 mov [esp+scan],edi
194
195;/* Determine how many bytes the scan ptr is off from being */
196;/* dword-aligned. */
197
198 mov eax, edi
199 neg eax
200 and eax, 3
201 mov [esp+scanalign], eax
202
203;/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */
204;/* s->strstart - (IPos)MAX_DIST(s) : NIL; */
205
206 mov eax, [edx].ds_w_size
207 sub eax, MIN_LOOKAHEAD
208 sub ebp, eax
209 jg SHORT LimitPositive
210 xor ebp, ebp
211LimitPositive:
212
213;/* int best_len = s->prev_length; */
214
215 mov eax, [edx].ds_prev_length
216 mov [esp+bestlen], eax
217
218;/* Store the sum of s->window + best_len in %esi locally, and in %esi. */
219
220 add esi, eax
221 mov [esp+windowbestlen], esi
222
223;/* register ush scan_start = *(ushf*)scan; */
224;/* register ush scan_end = *(ushf*)(scan+best_len-1); */
225;/* Posf *prev = s->prev; */
226
227 movzx ebx, WORD PTR[edi]
228 mov [esp+scanstart], ebx
229 movzx ebx, WORD PTR[eax+edi-1]
230 mov [esp+scanend], ebx
231 mov edi, [edx].ds_prev
232
233;/* Jump into the main loop. */
234
235 mov edx, [esp+chainlenwmask]
236 jmp SHORT LoopEntry
237
238;/* do {
239; * match = s->window + cur_match;
240; * if (*(ushf*)(match+best_len-1) != scan_end ||
241; * *(ushf*)match != scan_start) continue;
242; * [...]
243; * } while ((cur_match = prev[cur_match & wmask]) > limit
244; * && --chain_length != 0);
245; *
246; * Here is the inner loop of the function. The function will spend the
247; * majority of its time in this loop, and majority of that time will
248; * be spent in the first ten instructions.
249; *
250; * Within this loop:
251; * %ebx = scanend
252; * %ecx = curmatch
253; * %edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
254; * %esi = windowbestlen - i.e., (window + bestlen)
255; * %edi = prev
256; * %ebp = limit
257; */
258
259 ALIGN 4
260LookupLoop:
261 and ecx, edx
262 movzx ecx, WORD PTR[edi+ecx*2]
263 cmp ecx, ebp
264 jbe LeaveNow
265 sub edx, 000010000H
266 js LeaveNow
267
268LoopEntry:
269 movzx eax, WORD PTR[esi+ecx-1]
270 cmp eax, ebx
271 jnz SHORT LookupLoop
272
273 mov eax, [esp+window]
274 movzx eax, WORD PTR[eax+ecx]
275 cmp eax, [esp+scanstart]
276 jnz SHORT LookupLoop
277
278;/* Store the current value of chainlen. */
279
280 mov [esp+chainlenwmask], edx
281
282;/* Point %edi to the string under scrutiny, and %esi to the string we */
283;/* are hoping to match it up with. In actuality, %esi and %edi are */
284;/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */
285;/* initialized to -(MAX_MATCH_8 - scanalign). */
286
287 mov esi, [esp+window]
288 mov edi, [esp+scan]
289 add esi, ecx
290 mov eax, [esp+scanalign]
291 mov edx, -MAX_MATCH_8
292 lea edi, [edi+eax+MAX_MATCH_8]
293 lea esi, [esi+eax+MAX_MATCH_8]
294
295;/* Test the strings for equality, 8 bytes at a time. At the end,
296; * adjust %edx so that it is offset to the exact byte that mismatched.
297; *
298; * We already know at this point that the first three bytes of the
299; * strings match each other, and they can be safely passed over before
300; * starting the compare loop. So what this code does is skip over 0-3
301; * bytes, as much as necessary in order to dword-align the %edi
302; * pointer. (%esi will still be misaligned three times out of four.)
303; *
304; * It should be confessed that this loop usually does not represent
305; * much of the total running time. Replacing it with a more
306; * straightforward "rep cmpsb" would not drastically degrade
307; * performance.
308; */
309
310LoopCmps:
311 mov eax, DWORD PTR[esi+edx]
312 xor eax, DWORD PTR[edi+edx]
313 jnz SHORT LeaveLoopCmps
314
315 mov eax, DWORD PTR[esi+edx+4]
316 xor eax, DWORD PTR[edi+edx+4]
317 jnz SHORT LeaveLoopCmps4
318
319 add edx, 8
320 jnz SHORT LoopCmps
321 jmp LenMaximum
322 ALIGN 4
323
324LeaveLoopCmps4:
325 add edx, 4
326
327LeaveLoopCmps:
328 test eax, 00000FFFFH
329 jnz SHORT LenLower
330
331 add edx, 2
332 shr eax, 16
333
334LenLower:
335 sub al, 1
336 adc edx, 0
337
338;/* Calculate the length of the match. If it is longer than MAX_MATCH, */
339;/* then automatically accept it as the best possible match and leave. */
340
341 lea eax, [edi+edx]
342 mov edi, [esp+scan]
343 sub eax, edi
344 cmp eax, MAX_MATCH
345 jge SHORT LenMaximum
346
347;/* If the length of the match is not longer than the best match we */
348;/* have so far, then forget it and return to the lookup loop. */
349
350 mov edx, [esp+deflatestate]
351 mov ebx, [esp+bestlen]
352 cmp eax, ebx
353 jg SHORT LongerMatch
354 mov esi, [esp+windowbestlen]
355 mov edi, [edx].ds_prev
356 mov ebx, [esp+scanend]
357 mov edx, [esp+chainlenwmask]
358 jmp LookupLoop
359 ALIGN 4
360
361;/* s->match_start = cur_match; */
362;/* best_len = len; */
363;/* if (len >= nice_match) break; */
364;/* scan_end = *(ushf*)(scan+best_len-1); */
365
366LongerMatch:
367 mov ebx, [esp+nicematch]
368 mov [esp+bestlen], eax
369 mov [edx].ds_match_start, ecx
370 cmp eax, ebx
371 jge SHORT LeaveNow
372 mov esi, [esp+window]
373 add esi, eax
374 mov [esp+windowbestlen], esi
375 movzx ebx, WORD PTR[edi+eax-1]
376 mov edi, [edx].ds_prev
377 mov [esp+scanend], ebx
378 mov edx, [esp+chainlenwmask]
379 jmp LookupLoop
380 ALIGN 4
381
382;/* Accept the current string, with the maximum possible length. */
383
384LenMaximum:
385 mov edx, [esp+deflatestate]
386 mov DWORD PTR[esp+bestlen], MAX_MATCH
387 mov [edx].ds_match_start, ecx
388
389;/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */
390;/* return s->lookahead; */
391
392LeaveNow:
393 mov edx, [esp+deflatestate]
394 mov ebx, [esp+bestlen]
395 mov eax, [edx].ds_lookahead
396 cmp ebx, eax
397 jg SHORT LookaheadRet
398 mov eax, ebx
399LookaheadRet:
400
401; Restore the stack and return from whence we came.
402
403 add esp, varsize
404 pop ebx
405 pop esi
406 pop edi
407 pop ebp
408 ret
409
410_longest_match ENDP
411
412_TEXT ENDS
413END
diff --git a/contrib/masmx64/gvmat64.asm b/contrib/masmx64/gvmat64.asm
index d2790cc..9879c28 100644
--- a/contrib/masmx64/gvmat64.asm
+++ b/contrib/masmx64/gvmat64.asm
@@ -2,8 +2,10 @@
2; deflate_state *s, 2; deflate_state *s,
3; IPos cur_match); /* current match */ 3; IPos cur_match); /* current match */
4 4
5; gvmat64.asm -- Asm portion of the optimized longest_match for 32 bits x86 5; gvmat64.asm -- Asm portion of the optimized longest_match for 32 bits x86_64
6; Copyright (C) 1995-2005 Jean-loup Gailly, Brian Raiter and Gilles Vollant. 6; (AMD64 on Athlon 64, Opteron, Phenom
7; and Intel EM64T on Pentium 4 with EM64T, Pentium D, Core 2 Duo, Core I5/I7)
8; Copyright (C) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant.
7; 9;
8; File written by Gilles Vollant, by converting to assembly the longest_match 10; File written by Gilles Vollant, by converting to assembly the longest_match
9; from Jean-loup Gailly in deflate.c of zLib and infoZip zip. 11; from Jean-loup Gailly in deflate.c of zLib and infoZip zip.
@@ -11,6 +13,24 @@
11; and by taking inspiration on asm686 with masm, optimised assembly code 13; and by taking inspiration on asm686 with masm, optimised assembly code
12; from Brian Raiter, written 1998 14; from Brian Raiter, written 1998
13; 15;
16; This software is provided 'as-is', without any express or implied
17; warranty. In no event will the authors be held liable for any damages
18; arising from the use of this software.
19;
20; Permission is granted to anyone to use this software for any purpose,
21; including commercial applications, and to alter it and redistribute it
22; freely, subject to the following restrictions:
23;
24; 1. The origin of this software must not be misrepresented; you must not
25; claim that you wrote the original software. If you use this software
26; in a product, an acknowledgment in the product documentation would be
27; appreciated but is not required.
28; 2. Altered source versions must be plainly marked as such, and must not be
29; misrepresented as being the original software
30; 3. This notice may not be removed or altered from any source distribution.
31;
32;
33;
14; http://www.zlib.net 34; http://www.zlib.net
15; http://www.winimage.com/zLibDll 35; http://www.winimage.com/zLibDll
16; http://www.muppetlabs.com/~breadbox/software/assembly.html 36; http://www.muppetlabs.com/~breadbox/software/assembly.html
@@ -26,10 +46,10 @@
26; 46;
27; This file compile with Microsoft Macro Assembler (x64) for AMD64 47; This file compile with Microsoft Macro Assembler (x64) for AMD64
28; 48;
29; ml64.exe is given with Visual Studio 2005 and Windows 2003 server DDK 49; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK
30; 50;
31; (you can get Windows 2003 server DDK with ml64 and cl for AMD64 from 51; (you can get Windows WDK with ml64 for AMD64 from
32; http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price) 52; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price)
33; 53;
34 54
35 55
@@ -71,6 +91,25 @@ save_r13 equ rsp + 64 - LocalVarsSize
71;save_r15 equ rsp + 80 - LocalVarsSize 91;save_r15 equ rsp + 80 - LocalVarsSize
72 92
73 93
94; summary of register usage
95; scanend ebx
96; scanendw bx
97; chainlenwmask edx
98; curmatch rsi
99; curmatchd esi
100; windowbestlen r8
101; scanalign r9
102; scanalignd r9d
103; window r10
104; bestlen r11
105; bestlend r11d
106; scanstart r12d
107; scanstartw r12w
108; scan r13
109; nicematch r14d
110; limit r15
111; limitd r15d
112; prev rcx
74 113
75; all the +4 offsets are due to the addition of pending_buf_size (in zlib 114; all the +4 offsets are due to the addition of pending_buf_size (in zlib
76; in the deflate_state structure since the asm code was first written 115; in the deflate_state structure since the asm code was first written
diff --git a/contrib/masmx64/inffas8664.c b/contrib/masmx64/inffas8664.c
index 2263d77..e8af06f 100644
--- a/contrib/masmx64/inffas8664.c
+++ b/contrib/masmx64/inffas8664.c
@@ -130,7 +130,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
130 ar.beg = ar.out - (start - strm->avail_out); 130 ar.beg = ar.out - (start - strm->avail_out);
131 ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT); 131 ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT);
132 ar.wsize = state->wsize; 132 ar.wsize = state->wsize;
133 ar.write = state->write; 133 ar.write = state->wnext;
134 ar.window = state->window; 134 ar.window = state->window;
135 ar.hold = state->hold; 135 ar.hold = state->hold;
136 ar.bits = state->bits; 136 ar.bits = state->bits;
diff --git a/contrib/masmx64/inffasx64.asm b/contrib/masmx64/inffasx64.asm
index c2ba03f..60a8d89 100644
--- a/contrib/masmx64/inffasx64.asm
+++ b/contrib/masmx64/inffasx64.asm
@@ -9,12 +9,16 @@
9; ml64.exe /Flinffasx64 /c /Zi inffasx64.asm 9; ml64.exe /Flinffasx64 /c /Zi inffasx64.asm
10; with Microsoft Macro Assembler (x64) for AMD64 10; with Microsoft Macro Assembler (x64) for AMD64
11; 11;
12; ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK 12
13; This file compile with Microsoft Macro Assembler (x64) for AMD64
14;
15; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK
13; 16;
14; (you can get Windows 2003 server DDK with ml64 and cl.exe for AMD64 from 17; (you can get Windows WDK with ml64 for AMD64 from
15; http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price) 18; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price)
16; 19;
17 20
21
18.code 22.code
19inffas8664fnc PROC 23inffas8664fnc PROC
20 24
diff --git a/contrib/masmx86/bld_ml32.bat b/contrib/masmx86/bld_ml32.bat
index 36962e1..e1b86bf 100644
--- a/contrib/masmx86/bld_ml32.bat
+++ b/contrib/masmx86/bld_ml32.bat
@@ -1,2 +1,2 @@
1ml /coff /Zi /c /Flgvmat32.lst gvmat32.asm 1ml /coff /Zi /c /Flmatch686.lst match686.asm
2ml /coff /Zi /c /Flinffas32.lst inffas32.asm 2ml /coff /Zi /c /Flinffas32.lst inffas32.asm
diff --git a/contrib/masmx86/gvmat32.asm b/contrib/masmx86/gvmat32.asm
deleted file mode 100644
index 8111616..0000000
--- a/contrib/masmx86/gvmat32.asm
+++ /dev/null
@@ -1,972 +0,0 @@
1; gvmat32.asm -- Asm portion of the optimized longest_match for 32 bits x86
2; Copyright (C) 1995-1996 Jean-loup Gailly and Gilles Vollant.
3; File written by Gilles Vollant, by modifiying the longest_match
4; from Jean-loup Gailly in deflate.c
5;
6; http://www.zlib.net
7; http://www.winimage.com/zLibDll
8; http://www.muppetlabs.com/~breadbox/software/assembly.html
9;
10; For Visual C++ 4.x and higher and ML 6.x and higher
11; ml.exe is in directory \MASM611C of Win95 DDK
12; ml.exe is also distributed in http://www.masm32.com/masmdl.htm
13; and in VC++2003 toolkit at http://msdn.microsoft.com/visualc/vctoolkit2003/
14;
15; this file contain two implementation of longest_match
16;
17; longest_match_7fff : written 1996 by Gilles Vollant optimized for
18; first Pentium. Assume s->w_mask == 0x7fff
19; longest_match_686 : written by Brian raiter (1998), optimized for Pentium Pro
20;
21; for using an seembly version of longest_match, you need define ASMV in project
22; There is two way in using gvmat32.asm
23;
24; A) Suggested method
25; if you want include both longest_match_7fff and longest_match_686
26; compile the asm file running
27; ml /coff /Zi /Flgvmat32.lst /c gvmat32.asm
28; and include gvmat32c.c in your project
29; if you have an old cpu (386,486 or first Pentium) and s->w_mask==0x7fff,
30; longest_match_7fff will be used
31; if you have a more modern CPU (Pentium Pro, II and higher)
32; longest_match_686 will be used
33; on old cpu with s->w_mask!=0x7fff, longest_match_686 will be used,
34; but this is not a sitation you'll find often
35;
36; B) Alternative
37; if you are not interresed in old cpu performance and want the smaller
38; binaries possible
39;
40; compile the asm file running
41; ml /coff /Zi /c /Flgvmat32.lst /DNOOLDPENTIUMCODE gvmat32.asm
42; and do not include gvmat32c.c in your project (ou define also
43; NOOLDPENTIUMCODE)
44;
45; note : as I known, longest_match_686 is very faster than longest_match_7fff
46; on pentium Pro/II/III, faster (but less) in P4, but it seem
47; longest_match_7fff can be faster (very very litte) on AMD Athlon64/K8
48;
49; see below : zlib1222add must be adjuster if you use a zlib version < 1.2.2.2
50
51;uInt longest_match_7fff(s, cur_match)
52; deflate_state *s;
53; IPos cur_match; /* current match */
54
55 NbStack equ 76
56 cur_match equ dword ptr[esp+NbStack-0]
57 str_s equ dword ptr[esp+NbStack-4]
58; 5 dword on top (ret,ebp,esi,edi,ebx)
59 adrret equ dword ptr[esp+NbStack-8]
60 pushebp equ dword ptr[esp+NbStack-12]
61 pushedi equ dword ptr[esp+NbStack-16]
62 pushesi equ dword ptr[esp+NbStack-20]
63 pushebx equ dword ptr[esp+NbStack-24]
64
65 chain_length equ dword ptr [esp+NbStack-28]
66 limit equ dword ptr [esp+NbStack-32]
67 best_len equ dword ptr [esp+NbStack-36]
68 window equ dword ptr [esp+NbStack-40]
69 prev equ dword ptr [esp+NbStack-44]
70 scan_start equ word ptr [esp+NbStack-48]
71 wmask equ dword ptr [esp+NbStack-52]
72 match_start_ptr equ dword ptr [esp+NbStack-56]
73 nice_match equ dword ptr [esp+NbStack-60]
74 scan equ dword ptr [esp+NbStack-64]
75
76 windowlen equ dword ptr [esp+NbStack-68]
77 match_start equ dword ptr [esp+NbStack-72]
78 strend equ dword ptr [esp+NbStack-76]
79 NbStackAdd equ (NbStack-24)
80
81 .386p
82
83 name gvmatch
84 .MODEL FLAT
85
86
87
88; all the +zlib1222add offsets are due to the addition of fields
89; in zlib in the deflate_state structure since the asm code was first written
90; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)").
91; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
92; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
93
94 zlib1222add equ 8
95
96; Note : these value are good with a 8 bytes boundary pack structure
97 dep_chain_length equ 74h+zlib1222add
98 dep_window equ 30h+zlib1222add
99 dep_strstart equ 64h+zlib1222add
100 dep_prev_length equ 70h+zlib1222add
101 dep_nice_match equ 88h+zlib1222add
102 dep_w_size equ 24h+zlib1222add
103 dep_prev equ 38h+zlib1222add
104 dep_w_mask equ 2ch+zlib1222add
105 dep_good_match equ 84h+zlib1222add
106 dep_match_start equ 68h+zlib1222add
107 dep_lookahead equ 6ch+zlib1222add
108
109
110_TEXT segment
111
112IFDEF NOUNDERLINE
113 IFDEF NOOLDPENTIUMCODE
114 public longest_match
115 public match_init
116 ELSE
117 public longest_match_7fff
118 public cpudetect32
119 public longest_match_686
120 ENDIF
121ELSE
122 IFDEF NOOLDPENTIUMCODE
123 public _longest_match
124 public _match_init
125 ELSE
126 public _longest_match_7fff
127 public _cpudetect32
128 public _longest_match_686
129 ENDIF
130ENDIF
131
132 MAX_MATCH equ 258
133 MIN_MATCH equ 3
134 MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1)
135
136
137
138IFNDEF NOOLDPENTIUMCODE
139IFDEF NOUNDERLINE
140longest_match_7fff proc near
141ELSE
142_longest_match_7fff proc near
143ENDIF
144
145 mov edx,[esp+4]
146
147
148
149 push ebp
150 push edi
151 push esi
152 push ebx
153
154 sub esp,NbStackAdd
155
156; initialize or check the variables used in match.asm.
157 mov ebp,edx
158
159; chain_length = s->max_chain_length
160; if (prev_length>=good_match) chain_length >>= 2
161 mov edx,[ebp+dep_chain_length]
162 mov ebx,[ebp+dep_prev_length]
163 cmp [ebp+dep_good_match],ebx
164 ja noshr
165 shr edx,2
166noshr:
167; we increment chain_length because in the asm, the --chain_lenght is in the beginning of the loop
168 inc edx
169 mov edi,[ebp+dep_nice_match]
170 mov chain_length,edx
171 mov eax,[ebp+dep_lookahead]
172 cmp eax,edi
173; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
174 jae nolookaheadnicematch
175 mov edi,eax
176nolookaheadnicematch:
177; best_len = s->prev_length
178 mov best_len,ebx
179
180; window = s->window
181 mov esi,[ebp+dep_window]
182 mov ecx,[ebp+dep_strstart]
183 mov window,esi
184
185 mov nice_match,edi
186; scan = window + strstart
187 add esi,ecx
188 mov scan,esi
189; dx = *window
190 mov dx,word ptr [esi]
191; bx = *(window+best_len-1)
192 mov bx,word ptr [esi+ebx-1]
193 add esi,MAX_MATCH-1
194; scan_start = *scan
195 mov scan_start,dx
196; strend = scan + MAX_MATCH-1
197 mov strend,esi
198; bx = scan_end = *(window+best_len-1)
199
200; IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
201; s->strstart - (IPos)MAX_DIST(s) : NIL;
202
203 mov esi,[ebp+dep_w_size]
204 sub esi,MIN_LOOKAHEAD
205; here esi = MAX_DIST(s)
206 sub ecx,esi
207 ja nodist
208 xor ecx,ecx
209nodist:
210 mov limit,ecx
211
212; prev = s->prev
213 mov edx,[ebp+dep_prev]
214 mov prev,edx
215
216;
217 mov edx,dword ptr [ebp+dep_match_start]
218 mov bp,scan_start
219 mov eax,cur_match
220 mov match_start,edx
221
222 mov edx,window
223 mov edi,edx
224 add edi,best_len
225 mov esi,prev
226 dec edi
227; windowlen = window + best_len -1
228 mov windowlen,edi
229
230 jmp beginloop2
231 align 4
232
233; here, in the loop
234; eax = ax = cur_match
235; ecx = limit
236; bx = scan_end
237; bp = scan_start
238; edi = windowlen (window + best_len -1)
239; esi = prev
240
241
242;// here; chain_length <=16
243normalbeg0add16:
244 add chain_length,16
245 jz exitloop
246normalbeg0:
247 cmp word ptr[edi+eax],bx
248 je normalbeg2noroll
249rcontlabnoroll:
250; cur_match = prev[cur_match & wmask]
251 and eax,7fffh
252 mov ax,word ptr[esi+eax*2]
253; if cur_match > limit, go to exitloop
254 cmp ecx,eax
255 jnb exitloop
256; if --chain_length != 0, go to exitloop
257 dec chain_length
258 jnz normalbeg0
259 jmp exitloop
260
261normalbeg2noroll:
262; if (scan_start==*(cur_match+window)) goto normalbeg2
263 cmp bp,word ptr[edx+eax]
264 jne rcontlabnoroll
265 jmp normalbeg2
266
267contloop3:
268 mov edi,windowlen
269
270; cur_match = prev[cur_match & wmask]
271 and eax,7fffh
272 mov ax,word ptr[esi+eax*2]
273; if cur_match > limit, go to exitloop
274 cmp ecx,eax
275jnbexitloopshort1:
276 jnb exitloop
277; if --chain_length != 0, go to exitloop
278
279
280; begin the main loop
281beginloop2:
282 sub chain_length,16+1
283; if chain_length <=16, don't use the unrolled loop
284 jna normalbeg0add16
285
286do16:
287 cmp word ptr[edi+eax],bx
288 je normalbeg2dc0
289
290maccn MACRO lab
291 and eax,7fffh
292 mov ax,word ptr[esi+eax*2]
293 cmp ecx,eax
294 jnb exitloop
295 cmp word ptr[edi+eax],bx
296 je lab
297 ENDM
298
299rcontloop0:
300 maccn normalbeg2dc1
301
302rcontloop1:
303 maccn normalbeg2dc2
304
305rcontloop2:
306 maccn normalbeg2dc3
307
308rcontloop3:
309 maccn normalbeg2dc4
310
311rcontloop4:
312 maccn normalbeg2dc5
313
314rcontloop5:
315 maccn normalbeg2dc6
316
317rcontloop6:
318 maccn normalbeg2dc7
319
320rcontloop7:
321 maccn normalbeg2dc8
322
323rcontloop8:
324 maccn normalbeg2dc9
325
326rcontloop9:
327 maccn normalbeg2dc10
328
329rcontloop10:
330 maccn short normalbeg2dc11
331
332rcontloop11:
333 maccn short normalbeg2dc12
334
335rcontloop12:
336 maccn short normalbeg2dc13
337
338rcontloop13:
339 maccn short normalbeg2dc14
340
341rcontloop14:
342 maccn short normalbeg2dc15
343
344rcontloop15:
345 and eax,7fffh
346 mov ax,word ptr[esi+eax*2]
347 cmp ecx,eax
348 jnb exitloop
349
350 sub chain_length,16
351 ja do16
352 jmp normalbeg0add16
353
354;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
355
356normbeg MACRO rcontlab,valsub
357; if we are here, we know that *(match+best_len-1) == scan_end
358 cmp bp,word ptr[edx+eax]
359; if (match != scan_start) goto rcontlab
360 jne rcontlab
361; calculate the good chain_length, and we'll compare scan and match string
362 add chain_length,16-valsub
363 jmp iseq
364 ENDM
365
366
367normalbeg2dc11:
368 normbeg rcontloop11,11
369
370normalbeg2dc12:
371 normbeg short rcontloop12,12
372
373normalbeg2dc13:
374 normbeg short rcontloop13,13
375
376normalbeg2dc14:
377 normbeg short rcontloop14,14
378
379normalbeg2dc15:
380 normbeg short rcontloop15,15
381
382normalbeg2dc10:
383 normbeg rcontloop10,10
384
385normalbeg2dc9:
386 normbeg rcontloop9,9
387
388normalbeg2dc8:
389 normbeg rcontloop8,8
390
391normalbeg2dc7:
392 normbeg rcontloop7,7
393
394normalbeg2dc6:
395 normbeg rcontloop6,6
396
397normalbeg2dc5:
398 normbeg rcontloop5,5
399
400normalbeg2dc4:
401 normbeg rcontloop4,4
402
403normalbeg2dc3:
404 normbeg rcontloop3,3
405
406normalbeg2dc2:
407 normbeg rcontloop2,2
408
409normalbeg2dc1:
410 normbeg rcontloop1,1
411
412normalbeg2dc0:
413 normbeg rcontloop0,0
414
415
416; we go in normalbeg2 because *(ushf*)(match+best_len-1) == scan_end
417
418normalbeg2:
419 mov edi,window
420
421 cmp bp,word ptr[edi+eax]
422 jne contloop3 ; if *(ushf*)match != scan_start, continue
423
424iseq:
425; if we are here, we know that *(match+best_len-1) == scan_end
426; and (match == scan_start)
427
428 mov edi,edx
429 mov esi,scan ; esi = scan
430 add edi,eax ; edi = window + cur_match = match
431
432 mov edx,[esi+3] ; compare manually dword at match+3
433 xor edx,[edi+3] ; and scan +3
434
435 jz begincompare ; if equal, go to long compare
436
437; we will determine the unmatch byte and calculate len (in esi)
438 or dl,dl
439 je eq1rr
440 mov esi,3
441 jmp trfinval
442eq1rr:
443 or dx,dx
444 je eq1
445
446 mov esi,4
447 jmp trfinval
448eq1:
449 and edx,0ffffffh
450 jz eq11
451 mov esi,5
452 jmp trfinval
453eq11:
454 mov esi,6
455 jmp trfinval
456
457begincompare:
458 ; here we now scan and match begin same
459 add edi,6
460 add esi,6
461 mov ecx,(MAX_MATCH-(2+4))/4 ; scan for at most MAX_MATCH bytes
462 repe cmpsd ; loop until mismatch
463
464 je trfin ; go to trfin if not unmatch
465; we determine the unmatch byte
466 sub esi,4
467 mov edx,[edi-4]
468 xor edx,[esi]
469
470 or dl,dl
471 jnz trfin
472 inc esi
473
474 or dx,dx
475 jnz trfin
476 inc esi
477
478 and edx,0ffffffh
479 jnz trfin
480 inc esi
481
482trfin:
483 sub esi,scan ; esi = len
484trfinval:
485; here we have finised compare, and esi contain len of equal string
486 cmp esi,best_len ; if len > best_len, go newbestlen
487 ja short newbestlen
488; now we restore edx, ecx and esi, for the big loop
489 mov esi,prev
490 mov ecx,limit
491 mov edx,window
492 jmp contloop3
493
494newbestlen:
495 mov best_len,esi ; len become best_len
496
497 mov match_start,eax ; save new position as match_start
498 cmp esi,nice_match ; if best_len >= nice_match, exit
499 jae exitloop
500 mov ecx,scan
501 mov edx,window ; restore edx=window
502 add ecx,esi
503 add esi,edx
504
505 dec esi
506 mov windowlen,esi ; windowlen = window + best_len-1
507 mov bx,[ecx-1] ; bx = *(scan+best_len-1) = scan_end
508
509; now we restore ecx and esi, for the big loop :
510 mov esi,prev
511 mov ecx,limit
512 jmp contloop3
513
514exitloop:
515; exit : s->match_start=match_start
516 mov ebx,match_start
517 mov ebp,str_s
518 mov ecx,best_len
519 mov dword ptr [ebp+dep_match_start],ebx
520 mov eax,dword ptr [ebp+dep_lookahead]
521 cmp ecx,eax
522 ja minexlo
523 mov eax,ecx
524minexlo:
525; return min(best_len,s->lookahead)
526
527; restore stack and register ebx,esi,edi,ebp
528 add esp,NbStackAdd
529
530 pop ebx
531 pop esi
532 pop edi
533 pop ebp
534 ret
535InfoAuthor:
536; please don't remove this string !
537; Your are free use gvmat32 in any fre or commercial apps if you don't remove the string in the binary!
538 db 0dh,0ah,"GVMat32 optimised assembly code written 1996-98 by Gilles Vollant",0dh,0ah
539
540
541
542IFDEF NOUNDERLINE
543longest_match_7fff endp
544ELSE
545_longest_match_7fff endp
546ENDIF
547
548
549IFDEF NOUNDERLINE
550cpudetect32 proc near
551ELSE
552_cpudetect32 proc near
553ENDIF
554
555 push ebx
556
557 pushfd ; push original EFLAGS
558 pop eax ; get original EFLAGS
559 mov ecx, eax ; save original EFLAGS
560 xor eax, 40000h ; flip AC bit in EFLAGS
561 push eax ; save new EFLAGS value on stack
562 popfd ; replace current EFLAGS value
563 pushfd ; get new EFLAGS
564 pop eax ; store new EFLAGS in EAX
565 xor eax, ecx ; can’t toggle AC bit, processor=80386
566 jz end_cpu_is_386 ; jump if 80386 processor
567 push ecx
568 popfd ; restore AC bit in EFLAGS first
569
570 pushfd
571 pushfd
572 pop ecx
573
574 mov eax, ecx ; get original EFLAGS
575 xor eax, 200000h ; flip ID bit in EFLAGS
576 push eax ; save new EFLAGS value on stack
577 popfd ; replace current EFLAGS value
578 pushfd ; get new EFLAGS
579 pop eax ; store new EFLAGS in EAX
580 popfd ; restore original EFLAGS
581 xor eax, ecx ; can’t toggle ID bit,
582 je is_old_486 ; processor=old
583
584 mov eax,1
585 db 0fh,0a2h ;CPUID
586
587exitcpudetect:
588 pop ebx
589 ret
590
591end_cpu_is_386:
592 mov eax,0300h
593 jmp exitcpudetect
594
595is_old_486:
596 mov eax,0400h
597 jmp exitcpudetect
598
599IFDEF NOUNDERLINE
600cpudetect32 endp
601ELSE
602_cpudetect32 endp
603ENDIF
604ENDIF
605
606MAX_MATCH equ 258
607MIN_MATCH equ 3
608MIN_LOOKAHEAD equ (MAX_MATCH + MIN_MATCH + 1)
609MAX_MATCH_8_ equ ((MAX_MATCH + 7) AND 0FFF0h)
610
611
612;;; stack frame offsets
613
614chainlenwmask equ esp + 0 ; high word: current chain len
615 ; low word: s->wmask
616window equ esp + 4 ; local copy of s->window
617windowbestlen equ esp + 8 ; s->window + bestlen
618scanstart equ esp + 16 ; first two bytes of string
619scanend equ esp + 12 ; last two bytes of string
620scanalign equ esp + 20 ; dword-misalignment of string
621nicematch equ esp + 24 ; a good enough match size
622bestlen equ esp + 28 ; size of best match so far
623scan equ esp + 32 ; ptr to string wanting match
624
625LocalVarsSize equ 36
626; saved ebx byte esp + 36
627; saved edi byte esp + 40
628; saved esi byte esp + 44
629; saved ebp byte esp + 48
630; return address byte esp + 52
631deflatestate equ esp + 56 ; the function arguments
632curmatch equ esp + 60
633
634;;; Offsets for fields in the deflate_state structure. These numbers
635;;; are calculated from the definition of deflate_state, with the
636;;; assumption that the compiler will dword-align the fields. (Thus,
637;;; changing the definition of deflate_state could easily cause this
638;;; program to crash horribly, without so much as a warning at
639;;; compile time. Sigh.)
640
641dsWSize equ 36+zlib1222add
642dsWMask equ 44+zlib1222add
643dsWindow equ 48+zlib1222add
644dsPrev equ 56+zlib1222add
645dsMatchLen equ 88+zlib1222add
646dsPrevMatch equ 92+zlib1222add
647dsStrStart equ 100+zlib1222add
648dsMatchStart equ 104+zlib1222add
649dsLookahead equ 108+zlib1222add
650dsPrevLen equ 112+zlib1222add
651dsMaxChainLen equ 116+zlib1222add
652dsGoodMatch equ 132+zlib1222add
653dsNiceMatch equ 136+zlib1222add
654
655
656;;; match.asm -- Pentium-Pro-optimized version of longest_match()
657;;; Written for zlib 1.1.2
658;;; Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
659;;; You can look at http://www.muppetlabs.com/~breadbox/software/assembly.html
660;;;
661;;; This is free software; you can redistribute it and/or modify it
662;;; under the terms of the GNU General Public License.
663
664;GLOBAL _longest_match, _match_init
665
666
667;SECTION .text
668
669;;; uInt longest_match(deflate_state *deflatestate, IPos curmatch)
670
671;_longest_match:
672IFDEF NOOLDPENTIUMCODE
673 IFDEF NOUNDERLINE
674 longest_match proc near
675 ELSE
676 _longest_match proc near
677 ENDIF
678ELSE
679 IFDEF NOUNDERLINE
680 longest_match_686 proc near
681 ELSE
682 _longest_match_686 proc near
683 ENDIF
684ENDIF
685
686;;; Save registers that the compiler may be using, and adjust esp to
687;;; make room for our stack frame.
688
689 push ebp
690 push edi
691 push esi
692 push ebx
693 sub esp, LocalVarsSize
694
695;;; Retrieve the function arguments. ecx will hold cur_match
696;;; throughout the entire function. edx will hold the pointer to the
697;;; deflate_state structure during the function's setup (before
698;;; entering the main loop.
699
700 mov edx, [deflatestate]
701 mov ecx, [curmatch]
702
703;;; uInt wmask = s->w_mask;
704;;; unsigned chain_length = s->max_chain_length;
705;;; if (s->prev_length >= s->good_match) {
706;;; chain_length >>= 2;
707;;; }
708
709 mov eax, [edx + dsPrevLen]
710 mov ebx, [edx + dsGoodMatch]
711 cmp eax, ebx
712 mov eax, [edx + dsWMask]
713 mov ebx, [edx + dsMaxChainLen]
714 jl LastMatchGood
715 shr ebx, 2
716LastMatchGood:
717
718;;; chainlen is decremented once beforehand so that the function can
719;;; use the sign flag instead of the zero flag for the exit test.
720;;; It is then shifted into the high word, to make room for the wmask
721;;; value, which it will always accompany.
722
723 dec ebx
724 shl ebx, 16
725 or ebx, eax
726 mov [chainlenwmask], ebx
727
728;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
729
730 mov eax, [edx + dsNiceMatch]
731 mov ebx, [edx + dsLookahead]
732 cmp ebx, eax
733 jl LookaheadLess
734 mov ebx, eax
735LookaheadLess: mov [nicematch], ebx
736
737;;; register Bytef *scan = s->window + s->strstart;
738
739 mov esi, [edx + dsWindow]
740 mov [window], esi
741 mov ebp, [edx + dsStrStart]
742 lea edi, [esi + ebp]
743 mov [scan], edi
744
745;;; Determine how many bytes the scan ptr is off from being
746;;; dword-aligned.
747
748 mov eax, edi
749 neg eax
750 and eax, 3
751 mov [scanalign], eax
752
753;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
754;;; s->strstart - (IPos)MAX_DIST(s) : NIL;
755
756 mov eax, [edx + dsWSize]
757 sub eax, MIN_LOOKAHEAD
758 sub ebp, eax
759 jg LimitPositive
760 xor ebp, ebp
761LimitPositive:
762
763;;; int best_len = s->prev_length;
764
765 mov eax, [edx + dsPrevLen]
766 mov [bestlen], eax
767
768;;; Store the sum of s->window + best_len in esi locally, and in esi.
769
770 add esi, eax
771 mov [windowbestlen], esi
772
773;;; register ush scan_start = *(ushf*)scan;
774;;; register ush scan_end = *(ushf*)(scan+best_len-1);
775;;; Posf *prev = s->prev;
776
777 movzx ebx, word ptr [edi]
778 mov [scanstart], ebx
779 movzx ebx, word ptr [edi + eax - 1]
780 mov [scanend], ebx
781 mov edi, [edx + dsPrev]
782
783;;; Jump into the main loop.
784
785 mov edx, [chainlenwmask]
786 jmp short LoopEntry
787
788align 4
789
790;;; do {
791;;; match = s->window + cur_match;
792;;; if (*(ushf*)(match+best_len-1) != scan_end ||
793;;; *(ushf*)match != scan_start) continue;
794;;; [...]
795;;; } while ((cur_match = prev[cur_match & wmask]) > limit
796;;; && --chain_length != 0);
797;;;
798;;; Here is the inner loop of the function. The function will spend the
799;;; majority of its time in this loop, and majority of that time will
800;;; be spent in the first ten instructions.
801;;;
802;;; Within this loop:
803;;; ebx = scanend
804;;; ecx = curmatch
805;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
806;;; esi = windowbestlen - i.e., (window + bestlen)
807;;; edi = prev
808;;; ebp = limit
809
810LookupLoop:
811 and ecx, edx
812 movzx ecx, word ptr [edi + ecx*2]
813 cmp ecx, ebp
814 jbe LeaveNow
815 sub edx, 00010000h
816 js LeaveNow
817LoopEntry: movzx eax, word ptr [esi + ecx - 1]
818 cmp eax, ebx
819 jnz LookupLoop
820 mov eax, [window]
821 movzx eax, word ptr [eax + ecx]
822 cmp eax, [scanstart]
823 jnz LookupLoop
824
825;;; Store the current value of chainlen.
826
827 mov [chainlenwmask], edx
828
829;;; Point edi to the string under scrutiny, and esi to the string we
830;;; are hoping to match it up with. In actuality, esi and edi are
831;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is
832;;; initialized to -(MAX_MATCH_8 - scanalign).
833
834 mov esi, [window]
835 mov edi, [scan]
836 add esi, ecx
837 mov eax, [scanalign]
838 mov edx, 0fffffef8h; -(MAX_MATCH_8)
839 lea edi, [edi + eax + 0108h] ;MAX_MATCH_8]
840 lea esi, [esi + eax + 0108h] ;MAX_MATCH_8]
841
842;;; Test the strings for equality, 8 bytes at a time. At the end,
843;;; adjust edx so that it is offset to the exact byte that mismatched.
844;;;
845;;; We already know at this point that the first three bytes of the
846;;; strings match each other, and they can be safely passed over before
847;;; starting the compare loop. So what this code does is skip over 0-3
848;;; bytes, as much as necessary in order to dword-align the edi
849;;; pointer. (esi will still be misaligned three times out of four.)
850;;;
851;;; It should be confessed that this loop usually does not represent
852;;; much of the total running time. Replacing it with a more
853;;; straightforward "rep cmpsb" would not drastically degrade
854;;; performance.
855
856LoopCmps:
857 mov eax, [esi + edx]
858 xor eax, [edi + edx]
859 jnz LeaveLoopCmps
860 mov eax, [esi + edx + 4]
861 xor eax, [edi + edx + 4]
862 jnz LeaveLoopCmps4
863 add edx, 8
864 jnz LoopCmps
865 jmp short LenMaximum
866LeaveLoopCmps4: add edx, 4
867LeaveLoopCmps: test eax, 0000FFFFh
868 jnz LenLower
869 add edx, 2
870 shr eax, 16
871LenLower: sub al, 1
872 adc edx, 0
873
874;;; Calculate the length of the match. If it is longer than MAX_MATCH,
875;;; then automatically accept it as the best possible match and leave.
876
877 lea eax, [edi + edx]
878 mov edi, [scan]
879 sub eax, edi
880 cmp eax, MAX_MATCH
881 jge LenMaximum
882
883;;; If the length of the match is not longer than the best match we
884;;; have so far, then forget it and return to the lookup loop.
885
886 mov edx, [deflatestate]
887 mov ebx, [bestlen]
888 cmp eax, ebx
889 jg LongerMatch
890 mov esi, [windowbestlen]
891 mov edi, [edx + dsPrev]
892 mov ebx, [scanend]
893 mov edx, [chainlenwmask]
894 jmp LookupLoop
895
896;;; s->match_start = cur_match;
897;;; best_len = len;
898;;; if (len >= nice_match) break;
899;;; scan_end = *(ushf*)(scan+best_len-1);
900
901LongerMatch: mov ebx, [nicematch]
902 mov [bestlen], eax
903 mov [edx + dsMatchStart], ecx
904 cmp eax, ebx
905 jge LeaveNow
906 mov esi, [window]
907 add esi, eax
908 mov [windowbestlen], esi
909 movzx ebx, word ptr [edi + eax - 1]
910 mov edi, [edx + dsPrev]
911 mov [scanend], ebx
912 mov edx, [chainlenwmask]
913 jmp LookupLoop
914
915;;; Accept the current string, with the maximum possible length.
916
917LenMaximum: mov edx, [deflatestate]
918 mov dword ptr [bestlen], MAX_MATCH
919 mov [edx + dsMatchStart], ecx
920
921;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
922;;; return s->lookahead;
923
924LeaveNow:
925 mov edx, [deflatestate]
926 mov ebx, [bestlen]
927 mov eax, [edx + dsLookahead]
928 cmp ebx, eax
929 jg LookaheadRet
930 mov eax, ebx
931LookaheadRet:
932
933;;; Restore the stack and return from whence we came.
934
935 add esp, LocalVarsSize
936 pop ebx
937 pop esi
938 pop edi
939 pop ebp
940
941 ret
942; please don't remove this string !
943; Your can freely use gvmat32 in any free or commercial app if you don't remove the string in the binary!
944 db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998",0dh,0ah
945
946
947IFDEF NOOLDPENTIUMCODE
948 IFDEF NOUNDERLINE
949 longest_match endp
950 ELSE
951 _longest_match endp
952 ENDIF
953
954 IFDEF NOUNDERLINE
955 match_init proc near
956 ret
957 match_init endp
958 ELSE
959 _match_init proc near
960 ret
961 _match_init endp
962 ENDIF
963ELSE
964 IFDEF NOUNDERLINE
965 longest_match_686 endp
966 ELSE
967 _longest_match_686 endp
968 ENDIF
969ENDIF
970
971_TEXT ends
972end
diff --git a/contrib/masmx86/gvmat32c.c b/contrib/masmx86/gvmat32c.c
deleted file mode 100644
index 7ad2b27..0000000
--- a/contrib/masmx86/gvmat32c.c
+++ /dev/null
@@ -1,62 +0,0 @@
1/* gvmat32.c -- C portion of the optimized longest_match for 32 bits x86
2 * Copyright (C) 1995-1996 Jean-loup Gailly and Gilles Vollant.
3 * File written by Gilles Vollant, by modifiying the longest_match
4 * from Jean-loup Gailly in deflate.c
5 * it prepare all parameters and call the assembly longest_match_gvasm
6 * longest_match execute standard C code is wmask != 0x7fff
7 * (assembly code is faster with a fixed wmask)
8 *
9 * Read comment at beginning of gvmat32.asm for more information
10 */
11
12#if defined(ASMV) && (!defined(NOOLDPENTIUMCODE))
13#include "deflate.h"
14
15/* if your C compiler don't add underline before function name,
16 define ADD_UNDERLINE_ASMFUNC */
17#ifdef ADD_UNDERLINE_ASMFUNC
18#define longest_match_7fff _longest_match_7fff
19#define longest_match_686 _longest_match_686
20#define cpudetect32 _cpudetect32
21#endif
22
23
24unsigned long cpudetect32();
25
26uInt longest_match_c(
27 deflate_state *s,
28 IPos cur_match); /* current match */
29
30
31uInt longest_match_7fff(
32 deflate_state *s,
33 IPos cur_match); /* current match */
34
35uInt longest_match_686(
36 deflate_state *s,
37 IPos cur_match); /* current match */
38
39
40static uInt iIsPPro=2;
41
42void match_init ()
43{
44 iIsPPro = (((cpudetect32()/0x100)&0xf)>=6) ? 1 : 0;
45}
46
47uInt longest_match(
48 deflate_state *s,
49 IPos cur_match) /* current match */
50{
51 if (iIsPPro!=0)
52 return longest_match_686(s,cur_match);
53
54 if (s->w_mask != 0x7fff)
55 return longest_match_686(s,cur_match);
56
57 /* now ((s->w_mask == 0x7fff) && (iIsPPro==0)) */
58 return longest_match_7fff(s,cur_match);
59}
60
61
62#endif /* defined(ASMV) && (!defined(NOOLDPENTIUMCODE)) */
diff --git a/contrib/masmx86/match686.asm b/contrib/masmx86/match686.asm
new file mode 100644
index 0000000..1eaf555
--- /dev/null
+++ b/contrib/masmx86/match686.asm
@@ -0,0 +1,478 @@
1; match686.asm -- Asm portion of the optimized longest_match for 32 bits x86
2; Copyright (C) 1995-1996 Jean-loup Gailly, Brian Raiter and Gilles Vollant.
3; File written by Gilles Vollant, by converting match686.S from Brian Raiter
4; for MASM. This is as assembly version of longest_match
5; from Jean-loup Gailly in deflate.c
6;
7; http://www.zlib.net
8; http://www.winimage.com/zLibDll
9; http://www.muppetlabs.com/~breadbox/software/assembly.html
10;
11; For Visual C++ 4.x and higher and ML 6.x and higher
12; ml.exe is distributed in
13; http://www.microsoft.com/downloads/details.aspx?FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64
14;
15; this file contain two implementation of longest_match
16;
17; this longest_match was written by Brian raiter (1998), optimized for Pentium Pro
18; (and the faster known version of match_init on modern Core 2 Duo and AMD Phenom)
19;
20; for using an assembly version of longest_match, you need define ASMV in project
21;
22; compile the asm file running
23; ml /coff /Zi /c /Flmatch686.lst match686.asm
24; and do not include match686.obj in your project
25;
26; note: contrib of zLib 1.2.3 and earlier contained both a deprecated version for
27; Pentium (prior Pentium Pro) and this version for Pentium Pro and modern processor
28; with autoselect (with cpu detection code)
29; if you want support the old pentium optimization, you can still use these version
30;
31; this file is not optimized for old pentium, but it compatible with all x86 32 bits
32; processor (starting 80386)
33;
34;
35; see below : zlib1222add must be adjuster if you use a zlib version < 1.2.2.2
36
37;uInt longest_match(s, cur_match)
38; deflate_state *s;
39; IPos cur_match; /* current match */
40
41 NbStack equ 76
42 cur_match equ dword ptr[esp+NbStack-0]
43 str_s equ dword ptr[esp+NbStack-4]
44; 5 dword on top (ret,ebp,esi,edi,ebx)
45 adrret equ dword ptr[esp+NbStack-8]
46 pushebp equ dword ptr[esp+NbStack-12]
47 pushedi equ dword ptr[esp+NbStack-16]
48 pushesi equ dword ptr[esp+NbStack-20]
49 pushebx equ dword ptr[esp+NbStack-24]
50
51 chain_length equ dword ptr [esp+NbStack-28]
52 limit equ dword ptr [esp+NbStack-32]
53 best_len equ dword ptr [esp+NbStack-36]
54 window equ dword ptr [esp+NbStack-40]
55 prev equ dword ptr [esp+NbStack-44]
56 scan_start equ word ptr [esp+NbStack-48]
57 wmask equ dword ptr [esp+NbStack-52]
58 match_start_ptr equ dword ptr [esp+NbStack-56]
59 nice_match equ dword ptr [esp+NbStack-60]
60 scan equ dword ptr [esp+NbStack-64]
61
62 windowlen equ dword ptr [esp+NbStack-68]
63 match_start equ dword ptr [esp+NbStack-72]
64 strend equ dword ptr [esp+NbStack-76]
65 NbStackAdd equ (NbStack-24)
66
67 .386p
68
69 name gvmatch
70 .MODEL FLAT
71
72
73
74; all the +zlib1222add offsets are due to the addition of fields
75; in zlib in the deflate_state structure since the asm code was first written
76; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)").
77; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
78; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
79
80 zlib1222add equ 8
81
82; Note : these value are good with a 8 bytes boundary pack structure
83 dep_chain_length equ 74h+zlib1222add
84 dep_window equ 30h+zlib1222add
85 dep_strstart equ 64h+zlib1222add
86 dep_prev_length equ 70h+zlib1222add
87 dep_nice_match equ 88h+zlib1222add
88 dep_w_size equ 24h+zlib1222add
89 dep_prev equ 38h+zlib1222add
90 dep_w_mask equ 2ch+zlib1222add
91 dep_good_match equ 84h+zlib1222add
92 dep_match_start equ 68h+zlib1222add
93 dep_lookahead equ 6ch+zlib1222add
94
95
96_TEXT segment
97
98IFDEF NOUNDERLINE
99 public longest_match
100 public match_init
101ELSE
102 public _longest_match
103 public _match_init
104ENDIF
105
106 MAX_MATCH equ 258
107 MIN_MATCH equ 3
108 MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1)
109
110
111
112MAX_MATCH equ 258
113MIN_MATCH equ 3
114MIN_LOOKAHEAD equ (MAX_MATCH + MIN_MATCH + 1)
115MAX_MATCH_8_ equ ((MAX_MATCH + 7) AND 0FFF0h)
116
117
118;;; stack frame offsets
119
120chainlenwmask equ esp + 0 ; high word: current chain len
121 ; low word: s->wmask
122window equ esp + 4 ; local copy of s->window
123windowbestlen equ esp + 8 ; s->window + bestlen
124scanstart equ esp + 16 ; first two bytes of string
125scanend equ esp + 12 ; last two bytes of string
126scanalign equ esp + 20 ; dword-misalignment of string
127nicematch equ esp + 24 ; a good enough match size
128bestlen equ esp + 28 ; size of best match so far
129scan equ esp + 32 ; ptr to string wanting match
130
131LocalVarsSize equ 36
132; saved ebx byte esp + 36
133; saved edi byte esp + 40
134; saved esi byte esp + 44
135; saved ebp byte esp + 48
136; return address byte esp + 52
137deflatestate equ esp + 56 ; the function arguments
138curmatch equ esp + 60
139
140;;; Offsets for fields in the deflate_state structure. These numbers
141;;; are calculated from the definition of deflate_state, with the
142;;; assumption that the compiler will dword-align the fields. (Thus,
143;;; changing the definition of deflate_state could easily cause this
144;;; program to crash horribly, without so much as a warning at
145;;; compile time. Sigh.)
146
147dsWSize equ 36+zlib1222add
148dsWMask equ 44+zlib1222add
149dsWindow equ 48+zlib1222add
150dsPrev equ 56+zlib1222add
151dsMatchLen equ 88+zlib1222add
152dsPrevMatch equ 92+zlib1222add
153dsStrStart equ 100+zlib1222add
154dsMatchStart equ 104+zlib1222add
155dsLookahead equ 108+zlib1222add
156dsPrevLen equ 112+zlib1222add
157dsMaxChainLen equ 116+zlib1222add
158dsGoodMatch equ 132+zlib1222add
159dsNiceMatch equ 136+zlib1222add
160
161
162;;; match686.asm -- Pentium-Pro-optimized version of longest_match()
163;;; Written for zlib 1.1.2
164;;; Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
165;;; You can look at http://www.muppetlabs.com/~breadbox/software/assembly.html
166;;;
167;;
168;; This software is provided 'as-is', without any express or implied
169;; warranty. In no event will the authors be held liable for any damages
170;; arising from the use of this software.
171;;
172;; Permission is granted to anyone to use this software for any purpose,
173;; including commercial applications, and to alter it and redistribute it
174;; freely, subject to the following restrictions:
175;;
176;; 1. The origin of this software must not be misrepresented; you must not
177;; claim that you wrote the original software. If you use this software
178;; in a product, an acknowledgment in the product documentation would be
179;; appreciated but is not required.
180;; 2. Altered source versions must be plainly marked as such, and must not be
181;; misrepresented as being the original software
182;; 3. This notice may not be removed or altered from any source distribution.
183;;
184
185;GLOBAL _longest_match, _match_init
186
187
188;SECTION .text
189
190;;; uInt longest_match(deflate_state *deflatestate, IPos curmatch)
191
192;_longest_match:
193 IFDEF NOUNDERLINE
194 longest_match proc near
195 ELSE
196 _longest_match proc near
197 ENDIF
198
199;;; Save registers that the compiler may be using, and adjust esp to
200;;; make room for our stack frame.
201
202 push ebp
203 push edi
204 push esi
205 push ebx
206 sub esp, LocalVarsSize
207
208;;; Retrieve the function arguments. ecx will hold cur_match
209;;; throughout the entire function. edx will hold the pointer to the
210;;; deflate_state structure during the function's setup (before
211;;; entering the main loop.
212
213 mov edx, [deflatestate]
214 mov ecx, [curmatch]
215
216;;; uInt wmask = s->w_mask;
217;;; unsigned chain_length = s->max_chain_length;
218;;; if (s->prev_length >= s->good_match) {
219;;; chain_length >>= 2;
220;;; }
221
222 mov eax, [edx + dsPrevLen]
223 mov ebx, [edx + dsGoodMatch]
224 cmp eax, ebx
225 mov eax, [edx + dsWMask]
226 mov ebx, [edx + dsMaxChainLen]
227 jl LastMatchGood
228 shr ebx, 2
229LastMatchGood:
230
231;;; chainlen is decremented once beforehand so that the function can
232;;; use the sign flag instead of the zero flag for the exit test.
233;;; It is then shifted into the high word, to make room for the wmask
234;;; value, which it will always accompany.
235
236 dec ebx
237 shl ebx, 16
238 or ebx, eax
239 mov [chainlenwmask], ebx
240
241;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
242
243 mov eax, [edx + dsNiceMatch]
244 mov ebx, [edx + dsLookahead]
245 cmp ebx, eax
246 jl LookaheadLess
247 mov ebx, eax
248LookaheadLess: mov [nicematch], ebx
249
250;;; register Bytef *scan = s->window + s->strstart;
251
252 mov esi, [edx + dsWindow]
253 mov [window], esi
254 mov ebp, [edx + dsStrStart]
255 lea edi, [esi + ebp]
256 mov [scan], edi
257
258;;; Determine how many bytes the scan ptr is off from being
259;;; dword-aligned.
260
261 mov eax, edi
262 neg eax
263 and eax, 3
264 mov [scanalign], eax
265
266;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
267;;; s->strstart - (IPos)MAX_DIST(s) : NIL;
268
269 mov eax, [edx + dsWSize]
270 sub eax, MIN_LOOKAHEAD
271 sub ebp, eax
272 jg LimitPositive
273 xor ebp, ebp
274LimitPositive:
275
276;;; int best_len = s->prev_length;
277
278 mov eax, [edx + dsPrevLen]
279 mov [bestlen], eax
280
281;;; Store the sum of s->window + best_len in esi locally, and in esi.
282
283 add esi, eax
284 mov [windowbestlen], esi
285
286;;; register ush scan_start = *(ushf*)scan;
287;;; register ush scan_end = *(ushf*)(scan+best_len-1);
288;;; Posf *prev = s->prev;
289
290 movzx ebx, word ptr [edi]
291 mov [scanstart], ebx
292 movzx ebx, word ptr [edi + eax - 1]
293 mov [scanend], ebx
294 mov edi, [edx + dsPrev]
295
296;;; Jump into the main loop.
297
298 mov edx, [chainlenwmask]
299 jmp short LoopEntry
300
301align 4
302
303;;; do {
304;;; match = s->window + cur_match;
305;;; if (*(ushf*)(match+best_len-1) != scan_end ||
306;;; *(ushf*)match != scan_start) continue;
307;;; [...]
308;;; } while ((cur_match = prev[cur_match & wmask]) > limit
309;;; && --chain_length != 0);
310;;;
311;;; Here is the inner loop of the function. The function will spend the
312;;; majority of its time in this loop, and majority of that time will
313;;; be spent in the first ten instructions.
314;;;
315;;; Within this loop:
316;;; ebx = scanend
317;;; ecx = curmatch
318;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
319;;; esi = windowbestlen - i.e., (window + bestlen)
320;;; edi = prev
321;;; ebp = limit
322
323LookupLoop:
324 and ecx, edx
325 movzx ecx, word ptr [edi + ecx*2]
326 cmp ecx, ebp
327 jbe LeaveNow
328 sub edx, 00010000h
329 js LeaveNow
330LoopEntry: movzx eax, word ptr [esi + ecx - 1]
331 cmp eax, ebx
332 jnz LookupLoop
333 mov eax, [window]
334 movzx eax, word ptr [eax + ecx]
335 cmp eax, [scanstart]
336 jnz LookupLoop
337
338;;; Store the current value of chainlen.
339
340 mov [chainlenwmask], edx
341
342;;; Point edi to the string under scrutiny, and esi to the string we
343;;; are hoping to match it up with. In actuality, esi and edi are
344;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is
345;;; initialized to -(MAX_MATCH_8 - scanalign).
346
347 mov esi, [window]
348 mov edi, [scan]
349 add esi, ecx
350 mov eax, [scanalign]
351 mov edx, 0fffffef8h; -(MAX_MATCH_8)
352 lea edi, [edi + eax + 0108h] ;MAX_MATCH_8]
353 lea esi, [esi + eax + 0108h] ;MAX_MATCH_8]
354
355;;; Test the strings for equality, 8 bytes at a time. At the end,
356;;; adjust edx so that it is offset to the exact byte that mismatched.
357;;;
358;;; We already know at this point that the first three bytes of the
359;;; strings match each other, and they can be safely passed over before
360;;; starting the compare loop. So what this code does is skip over 0-3
361;;; bytes, as much as necessary in order to dword-align the edi
362;;; pointer. (esi will still be misaligned three times out of four.)
363;;;
364;;; It should be confessed that this loop usually does not represent
365;;; much of the total running time. Replacing it with a more
366;;; straightforward "rep cmpsb" would not drastically degrade
367;;; performance.
368
369LoopCmps:
370 mov eax, [esi + edx]
371 xor eax, [edi + edx]
372 jnz LeaveLoopCmps
373 mov eax, [esi + edx + 4]
374 xor eax, [edi + edx + 4]
375 jnz LeaveLoopCmps4
376 add edx, 8
377 jnz LoopCmps
378 jmp short LenMaximum
379LeaveLoopCmps4: add edx, 4
380LeaveLoopCmps: test eax, 0000FFFFh
381 jnz LenLower
382 add edx, 2
383 shr eax, 16
384LenLower: sub al, 1
385 adc edx, 0
386
387;;; Calculate the length of the match. If it is longer than MAX_MATCH,
388;;; then automatically accept it as the best possible match and leave.
389
390 lea eax, [edi + edx]
391 mov edi, [scan]
392 sub eax, edi
393 cmp eax, MAX_MATCH
394 jge LenMaximum
395
396;;; If the length of the match is not longer than the best match we
397;;; have so far, then forget it and return to the lookup loop.
398
399 mov edx, [deflatestate]
400 mov ebx, [bestlen]
401 cmp eax, ebx
402 jg LongerMatch
403 mov esi, [windowbestlen]
404 mov edi, [edx + dsPrev]
405 mov ebx, [scanend]
406 mov edx, [chainlenwmask]
407 jmp LookupLoop
408
409;;; s->match_start = cur_match;
410;;; best_len = len;
411;;; if (len >= nice_match) break;
412;;; scan_end = *(ushf*)(scan+best_len-1);
413
414LongerMatch: mov ebx, [nicematch]
415 mov [bestlen], eax
416 mov [edx + dsMatchStart], ecx
417 cmp eax, ebx
418 jge LeaveNow
419 mov esi, [window]
420 add esi, eax
421 mov [windowbestlen], esi
422 movzx ebx, word ptr [edi + eax - 1]
423 mov edi, [edx + dsPrev]
424 mov [scanend], ebx
425 mov edx, [chainlenwmask]
426 jmp LookupLoop
427
428;;; Accept the current string, with the maximum possible length.
429
430LenMaximum: mov edx, [deflatestate]
431 mov dword ptr [bestlen], MAX_MATCH
432 mov [edx + dsMatchStart], ecx
433
434;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
435;;; return s->lookahead;
436
437LeaveNow:
438 mov edx, [deflatestate]
439 mov ebx, [bestlen]
440 mov eax, [edx + dsLookahead]
441 cmp ebx, eax
442 jg LookaheadRet
443 mov eax, ebx
444LookaheadRet:
445
446;;; Restore the stack and return from whence we came.
447
448 add esp, LocalVarsSize
449 pop ebx
450 pop esi
451 pop edi
452 pop ebp
453
454 ret
455; please don't remove this string !
456; Your can freely use match686 in any free or commercial app if you don't remove the string in the binary!
457 db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998",0dh,0ah
458
459
460 IFDEF NOUNDERLINE
461 longest_match endp
462 ELSE
463 _longest_match endp
464 ENDIF
465
466 IFDEF NOUNDERLINE
467 match_init proc near
468 ret
469 match_init endp
470 ELSE
471 _match_init proc near
472 ret
473 _match_init endp
474 ENDIF
475
476
477_TEXT ends
478end
diff --git a/contrib/masmx86/match686.obj b/contrib/masmx86/match686.obj
new file mode 100644
index 0000000..2e4631f
--- /dev/null
+++ b/contrib/masmx86/match686.obj
Binary files differ
diff --git a/contrib/masmx86/mkasm.bat b/contrib/masmx86/mkasm.bat
deleted file mode 100755
index 70a51f8..0000000
--- a/contrib/masmx86/mkasm.bat
+++ /dev/null
@@ -1,3 +0,0 @@
1cl /DASMV /I..\.. /O2 /c gvmat32c.c
2ml /coff /Zi /c /Flgvmat32.lst gvmat32.asm
3ml /coff /Zi /c /Flinffas32.lst inffas32.asm
diff --git a/contrib/masmx86/readme.txt b/contrib/masmx86/readme.txt
index 7b57167..413580e 100644
--- a/contrib/masmx86/readme.txt
+++ b/contrib/masmx86/readme.txt
@@ -14,8 +14,8 @@ appropriate makefile, as suggested below.
14Build instructions 14Build instructions
15------------------ 15------------------
16* With Microsoft C and MASM: 16* With Microsoft C and MASM:
17nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="gvmat32c.obj gvmat32.obj inffas32.obj" 17nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj"
18 18
19* With Borland C and TASM: 19* With Borland C and TASM:
20make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="gvmat32c.obj gvmat32.obj inffas32.obj" OBJPA="+gvmat32c.obj+gvmat32.obj+inffas32.obj" 20make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" OBJPA="+match686c.obj+match686.obj+inffas32.obj"
21 21
diff --git a/contrib/pascal/zlibpas.pas b/contrib/pascal/zlibpas.pas
index 836848c..dc7d37d 100644
--- a/contrib/pascal/zlibpas.pas
+++ b/contrib/pascal/zlibpas.pas
@@ -10,7 +10,7 @@ unit zlibpas;
10interface 10interface
11 11
12const 12const
13 ZLIB_VERSION = '1.2.3'; 13 ZLIB_VERSION = '1.2.4';
14 14
15type 15type
16 alloc_func = function(opaque: Pointer; items, size: Integer): Pointer; 16 alloc_func = function(opaque: Pointer; items, size: Integer): Pointer;
diff --git a/contrib/vstudio/readme.txt b/contrib/vstudio/readme.txt
index a7b7247..904888b 100644
--- a/contrib/vstudio/readme.txt
+++ b/contrib/vstudio/readme.txt
@@ -1,8 +1,8 @@
1Building instructions for the DLL versions of Zlib 1.2.3 1Building instructions for the DLL versions of Zlib 1.2.4
2======================================================== 2========================================================
3 3
4This directory contains projects that build zlib and minizip using 4This directory contains projects that build zlib and minizip using
5Microsoft Visual C++ 7.0/7.1/8.0/9.0/10.0, and Visual C++ . 5Microsoft Visual C++ 9.0/10.0, and Visual C++ .
6 6
7You don't need to build these projects yourself. You can download the 7You don't need to build these projects yourself. You can download the
8binaries from: 8binaries from:
@@ -15,51 +15,17 @@ bld_ml64.bat in contrib\masmx64
15bld_ml32.bat in contrib\masmx86 15bld_ml32.bat in contrib\masmx86
16 16
17 17
18Build instructions for Visual Studio 7.x (32 bits)
19--------------------------------------------------
20- Uncompress current zlib, including all contrib/* files
21- Download the crtdll library from
22 http://www.winimage.com/zLibDll/crtdll.zip
23 Unzip crtdll.zip to extract crtdll.lib on contrib\vstudio\vc7.
24- Open contrib\vstudio\vc7\zlibvc.sln with Microsoft Visual C++ 7.x
25 (Visual Studio .Net 2002 or 2003).
26
27Build instructions for Visual Studio 2005 (32 bits or 64 bits)
28--------------------------------------------------------------
29- Uncompress current zlib, including all contrib/* files
30- For 32 bits only: download the crtdll library from
31 http://www.winimage.com/zLibDll/crtdll.zip
32 Unzip crtdll.zip to extract crtdll.lib on contrib\vstudio\vc8.
33- Open contrib\vstudio\vc8\zlibvc.sln with Microsoft Visual C++ 2005
34
35Build instructions for Visual Studio 2005 64 bits, PSDK compiler
36----------------------------------------------------------------
37at the time of writing this text file, Visual Studio 2005 (and
38 Microsoft Visual C++ 8.0) is on the beta 2 stage.
39Using you can get the free 64 bits compiler from Platform SDK,
40 which is NOT a beta, and compile using the Visual studio 2005 IDE
41see http://www.winimage.com/misc/sdk64onvs2005/ for instruction
42
43- Uncompress current zlib, including all contrib/* files
44- start Visual Studio 2005 from a platform SDK command prompt, using
45 the /useenv switch
46- Open contrib\vstudio\vc8\zlibvc.sln with Microsoft Visual C++ 2005
47 18
48 19
49Build instructions for Visual Studio 2008 (32 bits or 64 bits) 20Build instructions for Visual Studio 2008 (32 bits or 64 bits)
50-------------------------------------------------------------- 21--------------------------------------------------------------
51- Uncompress current zlib, including all contrib/* files 22- Uncompress current zlib, including all contrib/* files
52- For 32 bits only: download the crtdll library from
53 http://www.winimage.com/zLibDll/crtdll.zip
54 Unzip crtdll.zip to extract crtdll.lib on contrib\vstudio\vc9.
55- Open contrib\vstudio\vc9\zlibvc.sln with Microsoft Visual C++ 2008.0 23- Open contrib\vstudio\vc9\zlibvc.sln with Microsoft Visual C++ 2008.0
24- Or run: vcbuild /rebuild contrib\vstudio\vc9\zlibvc.sln "Release|Win32"
56 25
57Build instructions for Visual Studio 2010 (32 bits or 64 bits) 26Build instructions for Visual Studio 2010 (32 bits or 64 bits)
58-------------------------------------------------------------- 27--------------------------------------------------------------
59- Uncompress current zlib, including all contrib/* files 28- Uncompress current zlib, including all contrib/* files
60- For 32 bits only: download the crtdll library from
61 http://www.winimage.com/zLibDll/crtdll.zip
62 Unzip crtdll.zip to extract crtdll.lib on contrib\vstudio\vc10.
63- Open contrib\vstudio\vc10\zlibvc.sln with Microsoft Visual C++ 2010.0 29- Open contrib\vstudio\vc10\zlibvc.sln with Microsoft Visual C++ 2010.0
64 30
65 31
diff --git a/contrib/vstudio/vc10/testzlib.vcxproj b/contrib/vstudio/vc10/testzlib.vcxproj
index 9810412..9088d17 100644
--- a/contrib/vstudio/vc10/testzlib.vcxproj
+++ b/contrib/vstudio/vc10/testzlib.vcxproj
@@ -194,7 +194,7 @@
194 <DebugInformationFormat>EditAndContinue</DebugInformationFormat> 194 <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
195 </ClCompile> 195 </ClCompile>
196 <Link> 196 <Link>
197 <AdditionalDependencies>..\..\masmx86\gvmat32.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies> 197 <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
198 <OutputFile>$(OutDir)testzlib.exe</OutputFile> 198 <OutputFile>$(OutDir)testzlib.exe</OutputFile>
199 <GenerateDebugInformation>true</GenerateDebugInformation> 199 <GenerateDebugInformation>true</GenerateDebugInformation>
200 <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile> 200 <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
@@ -254,7 +254,7 @@
254 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> 254 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
255 </ClCompile> 255 </ClCompile>
256 <Link> 256 <Link>
257 <AdditionalDependencies>..\..\masmx86\gvmat32.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies> 257 <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
258 <OutputFile>$(OutDir)testzlib.exe</OutputFile> 258 <OutputFile>$(OutDir)testzlib.exe</OutputFile>
259 <GenerateDebugInformation>true</GenerateDebugInformation> 259 <GenerateDebugInformation>true</GenerateDebugInformation>
260 <SubSystem>Console</SubSystem> 260 <SubSystem>Console</SubSystem>
@@ -397,14 +397,6 @@
397 <ClCompile Include="..\..\..\compress.c" /> 397 <ClCompile Include="..\..\..\compress.c" />
398 <ClCompile Include="..\..\..\crc32.c" /> 398 <ClCompile Include="..\..\..\crc32.c" />
399 <ClCompile Include="..\..\..\deflate.c" /> 399 <ClCompile Include="..\..\..\deflate.c" />
400 <ClCompile Include="..\..\masmx86\gvmat32c.c">
401 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
402 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
403 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
404 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">true</ExcludedFromBuild>
405 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
406 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
407 </ClCompile>
408 <ClCompile Include="..\..\..\infback.c" /> 400 <ClCompile Include="..\..\..\infback.c" />
409 <ClCompile Include="..\..\masmx64\inffas8664.c"> 401 <ClCompile Include="..\..\masmx64\inffas8664.c">
410 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild> 402 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
diff --git a/contrib/vstudio/vc10/testzlib.vcxproj.filters b/contrib/vstudio/vc10/testzlib.vcxproj.filters
index a0d9b23..249daa8 100644
--- a/contrib/vstudio/vc10/testzlib.vcxproj.filters
+++ b/contrib/vstudio/vc10/testzlib.vcxproj.filters
@@ -27,9 +27,6 @@
27 <ClCompile Include="..\..\..\deflate.c"> 27 <ClCompile Include="..\..\..\deflate.c">
28 <Filter>Source Files</Filter> 28 <Filter>Source Files</Filter>
29 </ClCompile> 29 </ClCompile>
30 <ClCompile Include="..\..\masmx86\gvmat32c.c">
31 <Filter>Source Files</Filter>
32 </ClCompile>
33 <ClCompile Include="..\..\..\infback.c"> 30 <ClCompile Include="..\..\..\infback.c">
34 <Filter>Source Files</Filter> 31 <Filter>Source Files</Filter>
35 </ClCompile> 32 </ClCompile>
diff --git a/contrib/vstudio/vc10/zlib.rc b/contrib/vstudio/vc10/zlib.rc
index 72cb8b4..23802d8 100644
--- a/contrib/vstudio/vc10/zlib.rc
+++ b/contrib/vstudio/vc10/zlib.rc
@@ -2,8 +2,8 @@
2 2
3#define IDR_VERSION1 1 3#define IDR_VERSION1 1
4IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 4IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5 FILEVERSION 1,2,3,0 5 FILEVERSION 1,2,4,0
6 PRODUCTVERSION 1,2,3,0 6 PRODUCTVERSION 1,2,4,0
7 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 7 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
8 FILEFLAGS 0 8 FILEFLAGS 0
9 FILEOS VOS_DOS_WINDOWS32 9 FILEOS VOS_DOS_WINDOWS32
@@ -16,13 +16,13 @@ BEGIN
16 //language ID = U.S. English, char set = Windows, Multilingual 16 //language ID = U.S. English, char set = Windows, Multilingual
17 17
18 BEGIN 18 BEGIN
19 VALUE "FileDescription", "zlib data compression library\0" 19 VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20 VALUE "FileVersion", "1.2.3.0\0" 20 VALUE "FileVersion", "1.2.4.0\0"
21 VALUE "InternalName", "zlib\0" 21 VALUE "InternalName", "zlib\0"
22 VALUE "OriginalFilename", "zlib.dll\0" 22 VALUE "OriginalFilename", "zlib.dll\0"
23 VALUE "ProductName", "ZLib.DLL\0" 23 VALUE "ProductName", "ZLib.DLL\0"
24 VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 24 VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25 VALUE "LegalCopyright", "(C) 1995-2003 Jean-loup Gailly & Mark Adler\0" 25 VALUE "LegalCopyright", "(C) 1995-2010 Jean-loup Gailly & Mark Adler\0"
26 END 26 END
27 END 27 END
28 BLOCK "VarFileInfo" 28 BLOCK "VarFileInfo"
diff --git a/contrib/vstudio/vc10/zlibstat.vcxproj b/contrib/vstudio/vc10/zlibstat.vcxproj
index fbf6c1b..2682fca 100644
--- a/contrib/vstudio/vc10/zlibstat.vcxproj
+++ b/contrib/vstudio/vc10/zlibstat.vcxproj
@@ -206,7 +206,7 @@
206 </ResourceCompile> 206 </ResourceCompile>
207 <Lib> 207 <Lib>
208 <AdditionalOptions>/MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions> 208 <AdditionalOptions>/MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
209 <AdditionalDependencies>..\..\masmx86\gvmat32.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies> 209 <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
210 <OutputFile>$(OutDir)zlibstat.lib</OutputFile> 210 <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
211 <SuppressStartupBanner>true</SuppressStartupBanner> 211 <SuppressStartupBanner>true</SuppressStartupBanner>
212 </Lib> 212 </Lib>
@@ -422,16 +422,7 @@
422 <ClCompile Include="..\..\..\compress.c" /> 422 <ClCompile Include="..\..\..\compress.c" />
423 <ClCompile Include="..\..\..\crc32.c" /> 423 <ClCompile Include="..\..\..\crc32.c" />
424 <ClCompile Include="..\..\..\deflate.c" /> 424 <ClCompile Include="..\..\..\deflate.c" />
425 <ClCompile Include="..\..\masmx86\gvmat32c.c">
426 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
427 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
428 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
429 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">true</ExcludedFromBuild>
430 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
431 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
432 </ClCompile>
433 <ClCompile Include="..\..\..\gzclose.c" /> 425 <ClCompile Include="..\..\..\gzclose.c" />
434 <ClCompile Include="..\..\..\gzio.c" />
435 <ClCompile Include="..\..\..\gzlib.c" /> 426 <ClCompile Include="..\..\..\gzlib.c" />
436 <ClCompile Include="..\..\..\gzread.c" /> 427 <ClCompile Include="..\..\..\gzread.c" />
437 <ClCompile Include="..\..\..\gzwrite.c" /> 428 <ClCompile Include="..\..\..\gzwrite.c" />
diff --git a/contrib/vstudio/vc10/zlibstat.vcxproj.filters b/contrib/vstudio/vc10/zlibstat.vcxproj.filters
index f676c2d..c8c7f7e 100644
--- a/contrib/vstudio/vc10/zlibstat.vcxproj.filters
+++ b/contrib/vstudio/vc10/zlibstat.vcxproj.filters
@@ -18,15 +18,9 @@
18 <ClCompile Include="..\..\..\deflate.c"> 18 <ClCompile Include="..\..\..\deflate.c">
19 <Filter>Source Files</Filter> 19 <Filter>Source Files</Filter>
20 </ClCompile> 20 </ClCompile>
21 <ClCompile Include="..\..\masmx86\gvmat32c.c">
22 <Filter>Source Files</Filter>
23 </ClCompile>
24 <ClCompile Include="..\..\..\gzclose.c"> 21 <ClCompile Include="..\..\..\gzclose.c">
25 <Filter>Source Files</Filter> 22 <Filter>Source Files</Filter>
26 </ClCompile> 23 </ClCompile>
27 <ClCompile Include="..\..\..\gzio.c">
28 <Filter>Source Files</Filter>
29 </ClCompile>
30 <ClCompile Include="..\..\..\gzlib.c"> 24 <ClCompile Include="..\..\..\gzlib.c">
31 <Filter>Source Files</Filter> 25 <Filter>Source Files</Filter>
32 </ClCompile> 26 </ClCompile>
diff --git a/contrib/vstudio/vc10/zlibvc.def b/contrib/vstudio/vc10/zlibvc.def
index 0b6a9e9..b3b7cab 100644
--- a/contrib/vstudio/vc10/zlibvc.def
+++ b/contrib/vstudio/vc10/zlibvc.def
@@ -1,7 +1,7 @@
1LIBRARY
2; zlib data compression and ZIP file I/O library
1 3
2VERSION 1.23 4VERSION 1.24
3
4HEAPSIZE 1048576,8192
5 5
6EXPORTS 6EXPORTS
7 adler32 @1 7 adler32 @1
@@ -90,25 +90,47 @@ EXPORTS
90 unzGoToFilePos @101 90 unzGoToFilePos @101
91 91
92 fill_win32_filefunc @110 92 fill_win32_filefunc @110
93 fill_win32_filefunc64 @111
94 fill_win32_filefunc64A @112
95 fill_win32_filefunc64W @113
96 93
97; quick hack by hkuno@microhouse.co.jp 94; zlibwapi v1.2.4 added:
98 unzOpen64 @120 95 fill_win32_filefunc64 @111
99 unzOpen2_64 @121 96 fill_win32_filefunc64A @112
100 unzGetGlobalInfo64 @122 97 fill_win32_filefunc64W @113
101 unzGetCurrentFileInfo64 @124 98
102 unzGetCurrentFileZStreamPos64 @125 99 unzOpen64 @120
103 unztell64 @126 100 unzOpen2_64 @121
104 unzGetFilePos64 @127 101 unzGetGlobalInfo64 @122
105 unzGoToFilePos64 @128 102 unzGetCurrentFileInfo64 @124
103 unzGetCurrentFileZStreamPos64 @125
104 unztell64 @126
105 unzGetFilePos64 @127
106 unzGoToFilePos64 @128
107
108 zipOpen64 @130
109 zipOpen2_64 @131
110 zipOpenNewFileInZip64 @132
111 zipOpenNewFileInZip2_64 @133
112 zipOpenNewFileInZip3_64 @134
113 zipOpenNewFileInZip4_64 @135
114 zipCloseFileInZipRaw64 @136
106 115
107 zipOpen64 @130 116; zlib1 v1.2.4 added:
108 zipOpen2_64 @131 117 adler32_combine @140
109 zipOpenNewFileInZip64 @132 118 adler32_combine64 @141
110 zipOpenNewFileInZip2_64 @133 119 crc32_combine @142
111 zipOpenNewFileInZip3_64 @134 120 crc32_combine64 @143
112 zipOpenNewFileInZip4_64 @135 121 deflateSetHeader @144
113 zipCloseFileInZipRaw64 @136 122 deflateTune @145
114; end hack 123 gzbuffer @146
124 gzclose_r @147
125 gzclose_w @148
126 gzdirect @149
127 gzoffset @150
128 gzoffset64 @151
129 gzopen64 @152
130 gzseek64 @153
131 gztell64 @154
132 inflateGetHeader @156
133 inflateMark @157
134 inflatePrime @158
135 inflateReset2 @159
136 inflateUndermine @160
diff --git a/contrib/vstudio/vc10/zlibvc.sln b/contrib/vstudio/vc10/zlibvc.sln
index 6d2ef64..6f6ffd5 100644
--- a/contrib/vstudio/vc10/zlibvc.sln
+++ b/contrib/vstudio/vc10/zlibvc.sln
@@ -36,8 +36,8 @@ Global
36 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.Build.0 = Release|Itanium 36 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.Build.0 = Release|Itanium
37 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32 37 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32
38 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32 38 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32
39 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = ReleaseWithoutAsm|x64 39 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = Release|x64
40 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = ReleaseWithoutAsm|x64 40 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = Release|x64
41 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium 41 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium
42 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium 42 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium
43 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 43 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
@@ -94,8 +94,8 @@ Global
94 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.Build.0 = Release|x64 94 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.Build.0 = Release|x64
95 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium 95 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium
96 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium 96 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium
97 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Itanium 97 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
98 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Itanium 98 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
99 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Itanium 99 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Itanium
100 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.Build.0 = Debug|Itanium 100 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.Build.0 = Debug|Itanium
101 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32 101 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
@@ -110,8 +110,8 @@ Global
110 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64 110 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
111 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium 111 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium
112 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium 112 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium
113 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Itanium 113 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
114 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Itanium 114 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
115 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.ActiveCfg = Debug|Itanium 115 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.ActiveCfg = Debug|Itanium
116 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.Build.0 = Debug|Itanium 116 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.Build.0 = Debug|Itanium
117 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.ActiveCfg = Debug|Win32 117 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.ActiveCfg = Debug|Win32
@@ -126,8 +126,8 @@ Global
126 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.Build.0 = Release|x64 126 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.Build.0 = Release|x64
127 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium 127 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium
128 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium 128 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium
129 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Itanium 129 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
130 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Itanium 130 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
131 EndGlobalSection 131 EndGlobalSection
132 GlobalSection(SolutionProperties) = preSolution 132 GlobalSection(SolutionProperties) = preSolution
133 HideSolutionNode = FALSE 133 HideSolutionNode = FALSE
diff --git a/contrib/vstudio/vc10/zlibvc.vcxproj b/contrib/vstudio/vc10/zlibvc.vcxproj
index e1067fa..9862398 100644
--- a/contrib/vstudio/vc10/zlibvc.vcxproj
+++ b/contrib/vstudio/vc10/zlibvc.vcxproj
@@ -213,7 +213,7 @@
213 </ResourceCompile> 213 </ResourceCompile>
214 <Link> 214 <Link>
215 <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions> 215 <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
216 <AdditionalDependencies>..\..\masmx86\gvmat32.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies> 216 <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
217 <OutputFile>$(OutDir)zlibwapi.dll</OutputFile> 217 <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
218 <SuppressStartupBanner>true</SuppressStartupBanner> 218 <SuppressStartupBanner>true</SuppressStartupBanner>
219 <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile> 219 <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
@@ -291,7 +291,7 @@
291 <StringPooling>true</StringPooling> 291 <StringPooling>true</StringPooling>
292 <ExceptionHandling> 292 <ExceptionHandling>
293 </ExceptionHandling> 293 </ExceptionHandling>
294 <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> 294 <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
295 <BufferSecurityCheck>false</BufferSecurityCheck> 295 <BufferSecurityCheck>false</BufferSecurityCheck>
296 <FunctionLevelLinking>true</FunctionLevelLinking> 296 <FunctionLevelLinking>true</FunctionLevelLinking>
297 <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile> 297 <PrecompiledHeaderOutputFile>$(IntDir)zlibvc.pch</PrecompiledHeaderOutputFile>
@@ -310,7 +310,7 @@
310 </ResourceCompile> 310 </ResourceCompile>
311 <Link> 311 <Link>
312 <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions> 312 <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
313 <AdditionalDependencies>..\..\masmx86\gvmat32.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies> 313 <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
314 <OutputFile>$(OutDir)zlibwapi.dll</OutputFile> 314 <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
315 <SuppressStartupBanner>true</SuppressStartupBanner> 315 <SuppressStartupBanner>true</SuppressStartupBanner>
316 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries> 316 <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
@@ -598,17 +598,7 @@
598 <ClCompile Include="..\..\..\compress.c" /> 598 <ClCompile Include="..\..\..\compress.c" />
599 <ClCompile Include="..\..\..\crc32.c" /> 599 <ClCompile Include="..\..\..\crc32.c" />
600 <ClCompile Include="..\..\..\deflate.c" /> 600 <ClCompile Include="..\..\..\deflate.c" />
601 <ClCompile Include="..\..\masmx86\gvmat32c.c">
602 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
603 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
604 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
605 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
606 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|x64'">true</ExcludedFromBuild>
607 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
608 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
609 </ClCompile>
610 <ClCompile Include="..\..\..\gzclose.c" /> 601 <ClCompile Include="..\..\..\gzclose.c" />
611 <ClCompile Include="..\..\..\gzio.c" />
612 <ClCompile Include="..\..\..\gzlib.c" /> 602 <ClCompile Include="..\..\..\gzlib.c" />
613 <ClCompile Include="..\..\..\gzread.c" /> 603 <ClCompile Include="..\..\..\gzread.c" />
614 <ClCompile Include="..\..\..\gzwrite.c" /> 604 <ClCompile Include="..\..\..\gzwrite.c" />
diff --git a/contrib/vstudio/vc10/zlibvc.vcxproj.filters b/contrib/vstudio/vc10/zlibvc.vcxproj.filters
index 7b595c4..180b71c 100644
--- a/contrib/vstudio/vc10/zlibvc.vcxproj.filters
+++ b/contrib/vstudio/vc10/zlibvc.vcxproj.filters
@@ -27,15 +27,9 @@
27 <ClCompile Include="..\..\..\deflate.c"> 27 <ClCompile Include="..\..\..\deflate.c">
28 <Filter>Source Files</Filter> 28 <Filter>Source Files</Filter>
29 </ClCompile> 29 </ClCompile>
30 <ClCompile Include="..\..\masmx86\gvmat32c.c">
31 <Filter>Source Files</Filter>
32 </ClCompile>
33 <ClCompile Include="..\..\..\gzclose.c"> 30 <ClCompile Include="..\..\..\gzclose.c">
34 <Filter>Source Files</Filter> 31 <Filter>Source Files</Filter>
35 </ClCompile> 32 </ClCompile>
36 <ClCompile Include="..\..\..\gzio.c">
37 <Filter>Source Files</Filter>
38 </ClCompile>
39 <ClCompile Include="..\..\..\gzlib.c"> 33 <ClCompile Include="..\..\..\gzlib.c">
40 <Filter>Source Files</Filter> 34 <Filter>Source Files</Filter>
41 </ClCompile> 35 </ClCompile>
diff --git a/contrib/vstudio/vc7/zlibvc.def b/contrib/vstudio/vc7/zlibvc.def
deleted file mode 100644
index 0b6a9e9..0000000
--- a/contrib/vstudio/vc7/zlibvc.def
+++ /dev/null
@@ -1,114 +0,0 @@
1
2VERSION 1.23
3
4HEAPSIZE 1048576,8192
5
6EXPORTS
7 adler32 @1
8 compress @2
9 crc32 @3
10 deflate @4
11 deflateCopy @5
12 deflateEnd @6
13 deflateInit2_ @7
14 deflateInit_ @8
15 deflateParams @9
16 deflateReset @10
17 deflateSetDictionary @11
18 gzclose @12
19 gzdopen @13
20 gzerror @14
21 gzflush @15
22 gzopen @16
23 gzread @17
24 gzwrite @18
25 inflate @19
26 inflateEnd @20
27 inflateInit2_ @21
28 inflateInit_ @22
29 inflateReset @23
30 inflateSetDictionary @24
31 inflateSync @25
32 uncompress @26
33 zlibVersion @27
34 gzprintf @28
35 gzputc @29
36 gzgetc @30
37 gzseek @31
38 gzrewind @32
39 gztell @33
40 gzeof @34
41 gzsetparams @35
42 zError @36
43 inflateSyncPoint @37
44 get_crc_table @38
45 compress2 @39
46 gzputs @40
47 gzgets @41
48 inflateCopy @42
49 inflateBackInit_ @43
50 inflateBack @44
51 inflateBackEnd @45
52 compressBound @46
53 deflateBound @47
54 gzclearerr @48
55 gzungetc @49
56 zlibCompileFlags @50
57 deflatePrime @51
58
59 unzOpen @61
60 unzClose @62
61 unzGetGlobalInfo @63
62 unzGetCurrentFileInfo @64
63 unzGoToFirstFile @65
64 unzGoToNextFile @66
65 unzOpenCurrentFile @67
66 unzReadCurrentFile @68
67 unzOpenCurrentFile3 @69
68 unztell @70
69 unzeof @71
70 unzCloseCurrentFile @72
71 unzGetGlobalComment @73
72 unzStringFileNameCompare @74
73 unzLocateFile @75
74 unzGetLocalExtrafield @76
75 unzOpen2 @77
76 unzOpenCurrentFile2 @78
77 unzOpenCurrentFilePassword @79
78
79 zipOpen @80
80 zipOpenNewFileInZip @81
81 zipWriteInFileInZip @82
82 zipCloseFileInZip @83
83 zipClose @84
84 zipOpenNewFileInZip2 @86
85 zipCloseFileInZipRaw @87
86 zipOpen2 @88
87 zipOpenNewFileInZip3 @89
88
89 unzGetFilePos @100
90 unzGoToFilePos @101
91
92 fill_win32_filefunc @110
93 fill_win32_filefunc64 @111
94 fill_win32_filefunc64A @112
95 fill_win32_filefunc64W @113
96
97; quick hack by hkuno@microhouse.co.jp
98 unzOpen64 @120
99 unzOpen2_64 @121
100 unzGetGlobalInfo64 @122
101 unzGetCurrentFileInfo64 @124
102 unzGetCurrentFileZStreamPos64 @125
103 unztell64 @126
104 unzGetFilePos64 @127
105 unzGoToFilePos64 @128
106
107 zipOpen64 @130
108 zipOpen2_64 @131
109 zipOpenNewFileInZip64 @132
110 zipOpenNewFileInZip2_64 @133
111 zipOpenNewFileInZip3_64 @134
112 zipOpenNewFileInZip4_64 @135
113 zipCloseFileInZipRaw64 @136
114; end hack
diff --git a/contrib/vstudio/vc8/zlibvc.def b/contrib/vstudio/vc8/zlibvc.def
deleted file mode 100644
index 0b6a9e9..0000000
--- a/contrib/vstudio/vc8/zlibvc.def
+++ /dev/null
@@ -1,114 +0,0 @@
1
2VERSION 1.23
3
4HEAPSIZE 1048576,8192
5
6EXPORTS
7 adler32 @1
8 compress @2
9 crc32 @3
10 deflate @4
11 deflateCopy @5
12 deflateEnd @6
13 deflateInit2_ @7
14 deflateInit_ @8
15 deflateParams @9
16 deflateReset @10
17 deflateSetDictionary @11
18 gzclose @12
19 gzdopen @13
20 gzerror @14
21 gzflush @15
22 gzopen @16
23 gzread @17
24 gzwrite @18
25 inflate @19
26 inflateEnd @20
27 inflateInit2_ @21
28 inflateInit_ @22
29 inflateReset @23
30 inflateSetDictionary @24
31 inflateSync @25
32 uncompress @26
33 zlibVersion @27
34 gzprintf @28
35 gzputc @29
36 gzgetc @30
37 gzseek @31
38 gzrewind @32
39 gztell @33
40 gzeof @34
41 gzsetparams @35
42 zError @36
43 inflateSyncPoint @37
44 get_crc_table @38
45 compress2 @39
46 gzputs @40
47 gzgets @41
48 inflateCopy @42
49 inflateBackInit_ @43
50 inflateBack @44
51 inflateBackEnd @45
52 compressBound @46
53 deflateBound @47
54 gzclearerr @48
55 gzungetc @49
56 zlibCompileFlags @50
57 deflatePrime @51
58
59 unzOpen @61
60 unzClose @62
61 unzGetGlobalInfo @63
62 unzGetCurrentFileInfo @64
63 unzGoToFirstFile @65
64 unzGoToNextFile @66
65 unzOpenCurrentFile @67
66 unzReadCurrentFile @68
67 unzOpenCurrentFile3 @69
68 unztell @70
69 unzeof @71
70 unzCloseCurrentFile @72
71 unzGetGlobalComment @73
72 unzStringFileNameCompare @74
73 unzLocateFile @75
74 unzGetLocalExtrafield @76
75 unzOpen2 @77
76 unzOpenCurrentFile2 @78
77 unzOpenCurrentFilePassword @79
78
79 zipOpen @80
80 zipOpenNewFileInZip @81
81 zipWriteInFileInZip @82
82 zipCloseFileInZip @83
83 zipClose @84
84 zipOpenNewFileInZip2 @86
85 zipCloseFileInZipRaw @87
86 zipOpen2 @88
87 zipOpenNewFileInZip3 @89
88
89 unzGetFilePos @100
90 unzGoToFilePos @101
91
92 fill_win32_filefunc @110
93 fill_win32_filefunc64 @111
94 fill_win32_filefunc64A @112
95 fill_win32_filefunc64W @113
96
97; quick hack by hkuno@microhouse.co.jp
98 unzOpen64 @120
99 unzOpen2_64 @121
100 unzGetGlobalInfo64 @122
101 unzGetCurrentFileInfo64 @124
102 unzGetCurrentFileZStreamPos64 @125
103 unztell64 @126
104 unzGetFilePos64 @127
105 unzGoToFilePos64 @128
106
107 zipOpen64 @130
108 zipOpen2_64 @131
109 zipOpenNewFileInZip64 @132
110 zipOpenNewFileInZip2_64 @133
111 zipOpenNewFileInZip3_64 @134
112 zipOpenNewFileInZip4_64 @135
113 zipCloseFileInZipRaw64 @136
114; end hack
diff --git a/contrib/vstudio/vc9/testzlib.vcproj b/contrib/vstudio/vc9/testzlib.vcproj
index 9ad07ae..9cb0bf8 100644
--- a/contrib/vstudio/vc9/testzlib.vcproj
+++ b/contrib/vstudio/vc9/testzlib.vcproj
@@ -1,7 +1,7 @@
1<?xml version="1.0" encoding="Windows-1252"?> 1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject 2<VisualStudioProject
3 ProjectType="Visual C++" 3 ProjectType="Visual C++"
4 Version="9.00" 4 Version="9,00"
5 Name="testzlib" 5 Name="testzlib"
6 ProjectGUID="{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}" 6 ProjectGUID="{AA6666AA-E09F-4135-9C0C-4FE50C3C654B}"
7 RootNamespace="testzlib" 7 RootNamespace="testzlib"
@@ -71,7 +71,7 @@
71 /> 71 />
72 <Tool 72 <Tool
73 Name="VCLinkerTool" 73 Name="VCLinkerTool"
74 AdditionalDependencies="..\..\masmx86\gvmat32.obj ..\..\masmx86\inffas32.obj" 74 AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj"
75 OutputFile="$(OutDir)/testzlib.exe" 75 OutputFile="$(OutDir)/testzlib.exe"
76 LinkIncremental="2" 76 LinkIncremental="2"
77 GenerateManifest="false" 77 GenerateManifest="false"
@@ -105,12 +105,10 @@
105 /> 105 />
106 </Configuration> 106 </Configuration>
107 <Configuration 107 <Configuration
108 Name="ReleaseWithoutAsm|Win32" 108 Name="Debug|x64"
109 OutputDirectory="x86\TestZlib$(ConfigurationName)" 109 OutputDirectory="x64\TestZlib$(ConfigurationName)"
110 IntermediateDirectory="x86\TestZlib$(ConfigurationName)\Tmp" 110 IntermediateDirectory="x64\TestZlib$(ConfigurationName)\Tmp"
111 ConfigurationType="1" 111 ConfigurationType="1"
112 CharacterSet="2"
113 WholeProgramOptimization="1"
114 > 112 >
115 <Tool 113 <Tool
116 Name="VCPreBuildEventTool" 114 Name="VCPreBuildEventTool"
@@ -129,21 +127,12 @@
129 /> 127 />
130 <Tool 128 <Tool
131 Name="VCCLCompilerTool" 129 Name="VCCLCompilerTool"
132 Optimization="2"
133 InlineFunctionExpansion="1"
134 OmitFramePointers="true"
135 AdditionalIncludeDirectories="..\..\.." 130 AdditionalIncludeDirectories="..\..\.."
136 PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS" 131 PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
137 StringPooling="true"
138 BasicRuntimeChecks="0" 132 BasicRuntimeChecks="0"
139 RuntimeLibrary="0" 133 RuntimeLibrary="3"
140 BufferSecurityCheck="false" 134 BufferSecurityCheck="false"
141 EnableFunctionLevelLinking="true"
142 UsePrecompiledHeader="0"
143 AssemblerListingLocation="$(IntDir)\" 135 AssemblerListingLocation="$(IntDir)\"
144 WarningLevel="3"
145 Detect64BitPortabilityProblems="true"
146 DebugInformationFormat="3"
147 /> 136 />
148 <Tool 137 <Tool
149 Name="VCManagedResourceCompilerTool" 138 Name="VCManagedResourceCompilerTool"
@@ -156,17 +145,8 @@
156 /> 145 />
157 <Tool 146 <Tool
158 Name="VCLinkerTool" 147 Name="VCLinkerTool"
159 OutputFile="$(OutDir)/testzlib.exe" 148 AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj"
160 LinkIncremental="1"
161 GenerateManifest="false" 149 GenerateManifest="false"
162 GenerateDebugInformation="true"
163 SubSystem="1"
164 OptimizeReferences="2"
165 EnableCOMDATFolding="2"
166 OptimizeForWindows98="1"
167 RandomizedBaseAddress="1"
168 DataExecutionPrevention="0"
169 TargetMachine="1"
170 /> 150 />
171 <Tool 151 <Tool
172 Name="VCALinkTool" 152 Name="VCALinkTool"
@@ -191,12 +171,11 @@
191 /> 171 />
192 </Configuration> 172 </Configuration>
193 <Configuration 173 <Configuration
194 Name="Release|Win32" 174 Name="Debug|Itanium"
195 OutputDirectory="x86\TestZlib$(ConfigurationName)" 175 OutputDirectory="ia64\TestZlib$(ConfigurationName)"
196 IntermediateDirectory="x86\TestZlib$(ConfigurationName)\Tmp" 176 IntermediateDirectory="ia64\TestZlib$(ConfigurationName)\Tmp"
197 ConfigurationType="1" 177 ConfigurationType="1"
198 CharacterSet="2" 178 CharacterSet="2"
199 WholeProgramOptimization="1"
200 > 179 >
201 <Tool 180 <Tool
202 Name="VCPreBuildEventTool" 181 Name="VCPreBuildEventTool"
@@ -212,20 +191,19 @@
212 /> 191 />
213 <Tool 192 <Tool
214 Name="VCMIDLTool" 193 Name="VCMIDLTool"
194 TargetEnvironment="2"
215 /> 195 />
216 <Tool 196 <Tool
217 Name="VCCLCompilerTool" 197 Name="VCCLCompilerTool"
218 Optimization="2" 198 Optimization="0"
219 InlineFunctionExpansion="1"
220 OmitFramePointers="true"
221 AdditionalIncludeDirectories="..\..\.." 199 AdditionalIncludeDirectories="..\..\.."
222 PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS" 200 PreprocessorDefinitions="ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
223 StringPooling="true" 201 MinimalRebuild="true"
224 BasicRuntimeChecks="0" 202 BasicRuntimeChecks="0"
225 RuntimeLibrary="0" 203 RuntimeLibrary="3"
226 BufferSecurityCheck="false" 204 BufferSecurityCheck="false"
227 EnableFunctionLevelLinking="true"
228 UsePrecompiledHeader="0" 205 UsePrecompiledHeader="0"
206 AssemblerOutput="4"
229 AssemblerListingLocation="$(IntDir)\" 207 AssemblerListingLocation="$(IntDir)\"
230 WarningLevel="3" 208 WarningLevel="3"
231 Detect64BitPortabilityProblems="true" 209 Detect64BitPortabilityProblems="true"
@@ -242,18 +220,13 @@
242 /> 220 />
243 <Tool 221 <Tool
244 Name="VCLinkerTool" 222 Name="VCLinkerTool"
245 AdditionalDependencies="..\..\masmx86\gvmat32.obj ..\..\masmx86\inffas32.obj"
246 OutputFile="$(OutDir)/testzlib.exe" 223 OutputFile="$(OutDir)/testzlib.exe"
247 LinkIncremental="1" 224 LinkIncremental="2"
248 GenerateManifest="false" 225 GenerateManifest="false"
249 GenerateDebugInformation="true" 226 GenerateDebugInformation="true"
227 ProgramDatabaseFile="$(OutDir)/testzlib.pdb"
250 SubSystem="1" 228 SubSystem="1"
251 OptimizeReferences="2" 229 TargetMachine="5"
252 EnableCOMDATFolding="2"
253 OptimizeForWindows98="1"
254 RandomizedBaseAddress="1"
255 DataExecutionPrevention="0"
256 TargetMachine="1"
257 /> 230 />
258 <Tool 231 <Tool
259 Name="VCALinkTool" 232 Name="VCALinkTool"
@@ -278,10 +251,12 @@
278 /> 251 />
279 </Configuration> 252 </Configuration>
280 <Configuration 253 <Configuration
281 Name="Debug|x64" 254 Name="ReleaseWithoutAsm|Win32"
282 OutputDirectory="x64\TestZlib$(ConfigurationName)" 255 OutputDirectory="x86\TestZlib$(ConfigurationName)"
283 IntermediateDirectory="x64\TestZlib$(ConfigurationName)\Tmp" 256 IntermediateDirectory="x86\TestZlib$(ConfigurationName)\Tmp"
284 ConfigurationType="1" 257 ConfigurationType="1"
258 CharacterSet="2"
259 WholeProgramOptimization="1"
285 > 260 >
286 <Tool 261 <Tool
287 Name="VCPreBuildEventTool" 262 Name="VCPreBuildEventTool"
@@ -300,12 +275,21 @@
300 /> 275 />
301 <Tool 276 <Tool
302 Name="VCCLCompilerTool" 277 Name="VCCLCompilerTool"
278 Optimization="2"
279 InlineFunctionExpansion="1"
280 OmitFramePointers="true"
303 AdditionalIncludeDirectories="..\..\.." 281 AdditionalIncludeDirectories="..\..\.."
304 PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS" 282 PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
283 StringPooling="true"
305 BasicRuntimeChecks="0" 284 BasicRuntimeChecks="0"
306 RuntimeLibrary="3" 285 RuntimeLibrary="0"
307 BufferSecurityCheck="false" 286 BufferSecurityCheck="false"
287 EnableFunctionLevelLinking="true"
288 UsePrecompiledHeader="0"
308 AssemblerListingLocation="$(IntDir)\" 289 AssemblerListingLocation="$(IntDir)\"
290 WarningLevel="3"
291 Detect64BitPortabilityProblems="true"
292 DebugInformationFormat="3"
309 /> 293 />
310 <Tool 294 <Tool
311 Name="VCManagedResourceCompilerTool" 295 Name="VCManagedResourceCompilerTool"
@@ -318,8 +302,17 @@
318 /> 302 />
319 <Tool 303 <Tool
320 Name="VCLinkerTool" 304 Name="VCLinkerTool"
321 AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj" 305 OutputFile="$(OutDir)/testzlib.exe"
306 LinkIncremental="1"
322 GenerateManifest="false" 307 GenerateManifest="false"
308 GenerateDebugInformation="true"
309 SubSystem="1"
310 OptimizeReferences="2"
311 EnableCOMDATFolding="2"
312 OptimizeForWindows98="1"
313 RandomizedBaseAddress="1"
314 DataExecutionPrevention="0"
315 TargetMachine="1"
323 /> 316 />
324 <Tool 317 <Tool
325 Name="VCALinkTool" 318 Name="VCALinkTool"
@@ -340,18 +333,15 @@
340 Name="VCAppVerifierTool" 333 Name="VCAppVerifierTool"
341 /> 334 />
342 <Tool 335 <Tool
343 Name="VCWebDeploymentTool"
344 />
345 <Tool
346 Name="VCPostBuildEventTool" 336 Name="VCPostBuildEventTool"
347 /> 337 />
348 </Configuration> 338 </Configuration>
349 <Configuration 339 <Configuration
350 Name="Debug|Itanium" 340 Name="ReleaseWithoutAsm|x64"
351 OutputDirectory="ia64\TestZlib$(ConfigurationName)" 341 OutputDirectory="x64\TestZlib$(ConfigurationName)"
352 IntermediateDirectory="ia64\TestZlib$(ConfigurationName)\Tmp" 342 IntermediateDirectory="x64\TestZlib$(ConfigurationName)\Tmp"
353 ConfigurationType="1" 343 ConfigurationType="1"
354 CharacterSet="2" 344 WholeProgramOptimization="1"
355 > 345 >
356 <Tool 346 <Tool
357 Name="VCPreBuildEventTool" 347 Name="VCPreBuildEventTool"
@@ -367,23 +357,15 @@
367 /> 357 />
368 <Tool 358 <Tool
369 Name="VCMIDLTool" 359 Name="VCMIDLTool"
370 TargetEnvironment="2"
371 /> 360 />
372 <Tool 361 <Tool
373 Name="VCCLCompilerTool" 362 Name="VCCLCompilerTool"
374 Optimization="0"
375 AdditionalIncludeDirectories="..\..\.." 363 AdditionalIncludeDirectories="..\..\.."
376 PreprocessorDefinitions="ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64" 364 PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
377 MinimalRebuild="true"
378 BasicRuntimeChecks="0" 365 BasicRuntimeChecks="0"
379 RuntimeLibrary="3" 366 RuntimeLibrary="2"
380 BufferSecurityCheck="false" 367 BufferSecurityCheck="false"
381 UsePrecompiledHeader="0"
382 AssemblerOutput="4"
383 AssemblerListingLocation="$(IntDir)\" 368 AssemblerListingLocation="$(IntDir)\"
384 WarningLevel="3"
385 Detect64BitPortabilityProblems="true"
386 DebugInformationFormat="3"
387 /> 369 />
388 <Tool 370 <Tool
389 Name="VCManagedResourceCompilerTool" 371 Name="VCManagedResourceCompilerTool"
@@ -396,13 +378,8 @@
396 /> 378 />
397 <Tool 379 <Tool
398 Name="VCLinkerTool" 380 Name="VCLinkerTool"
399 OutputFile="$(OutDir)/testzlib.exe" 381 AdditionalDependencies=""
400 LinkIncremental="2"
401 GenerateManifest="false" 382 GenerateManifest="false"
402 GenerateDebugInformation="true"
403 ProgramDatabaseFile="$(OutDir)/testzlib.pdb"
404 SubSystem="1"
405 TargetMachine="5"
406 /> 383 />
407 <Tool 384 <Tool
408 Name="VCALinkTool" 385 Name="VCALinkTool"
@@ -423,17 +400,15 @@
423 Name="VCAppVerifierTool" 400 Name="VCAppVerifierTool"
424 /> 401 />
425 <Tool 402 <Tool
426 Name="VCWebDeploymentTool"
427 />
428 <Tool
429 Name="VCPostBuildEventTool" 403 Name="VCPostBuildEventTool"
430 /> 404 />
431 </Configuration> 405 </Configuration>
432 <Configuration 406 <Configuration
433 Name="ReleaseWithoutAsm|x64" 407 Name="ReleaseWithoutAsm|Itanium"
434 OutputDirectory="x64\TestZlib$(ConfigurationName)" 408 OutputDirectory="ia64\TestZlib$(ConfigurationName)"
435 IntermediateDirectory="x64\TestZlib$(ConfigurationName)\Tmp" 409 IntermediateDirectory="ia64\TestZlib$(ConfigurationName)\Tmp"
436 ConfigurationType="1" 410 ConfigurationType="1"
411 CharacterSet="2"
437 WholeProgramOptimization="1" 412 WholeProgramOptimization="1"
438 > 413 >
439 <Tool 414 <Tool
@@ -450,15 +425,25 @@
450 /> 425 />
451 <Tool 426 <Tool
452 Name="VCMIDLTool" 427 Name="VCMIDLTool"
428 TargetEnvironment="2"
453 /> 429 />
454 <Tool 430 <Tool
455 Name="VCCLCompilerTool" 431 Name="VCCLCompilerTool"
432 Optimization="2"
433 InlineFunctionExpansion="1"
434 OmitFramePointers="true"
456 AdditionalIncludeDirectories="..\..\.." 435 AdditionalIncludeDirectories="..\..\.."
457 PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS" 436 PreprocessorDefinitions="ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
437 StringPooling="true"
458 BasicRuntimeChecks="0" 438 BasicRuntimeChecks="0"
459 RuntimeLibrary="2" 439 RuntimeLibrary="2"
460 BufferSecurityCheck="false" 440 BufferSecurityCheck="false"
441 EnableFunctionLevelLinking="true"
442 UsePrecompiledHeader="0"
461 AssemblerListingLocation="$(IntDir)\" 443 AssemblerListingLocation="$(IntDir)\"
444 WarningLevel="3"
445 Detect64BitPortabilityProblems="true"
446 DebugInformationFormat="3"
462 /> 447 />
463 <Tool 448 <Tool
464 Name="VCManagedResourceCompilerTool" 449 Name="VCManagedResourceCompilerTool"
@@ -471,8 +456,15 @@
471 /> 456 />
472 <Tool 457 <Tool
473 Name="VCLinkerTool" 458 Name="VCLinkerTool"
474 AdditionalDependencies="" 459 OutputFile="$(OutDir)/testzlib.exe"
460 LinkIncremental="1"
475 GenerateManifest="false" 461 GenerateManifest="false"
462 GenerateDebugInformation="true"
463 SubSystem="1"
464 OptimizeReferences="2"
465 EnableCOMDATFolding="2"
466 OptimizeForWindows98="1"
467 TargetMachine="5"
476 /> 468 />
477 <Tool 469 <Tool
478 Name="VCALinkTool" 470 Name="VCALinkTool"
@@ -493,16 +485,13 @@
493 Name="VCAppVerifierTool" 485 Name="VCAppVerifierTool"
494 /> 486 />
495 <Tool 487 <Tool
496 Name="VCWebDeploymentTool"
497 />
498 <Tool
499 Name="VCPostBuildEventTool" 488 Name="VCPostBuildEventTool"
500 /> 489 />
501 </Configuration> 490 </Configuration>
502 <Configuration 491 <Configuration
503 Name="ReleaseWithoutAsm|Itanium" 492 Name="Release|Win32"
504 OutputDirectory="ia64\TestZlib$(ConfigurationName)" 493 OutputDirectory="x86\TestZlib$(ConfigurationName)"
505 IntermediateDirectory="ia64\TestZlib$(ConfigurationName)\Tmp" 494 IntermediateDirectory="x86\TestZlib$(ConfigurationName)\Tmp"
506 ConfigurationType="1" 495 ConfigurationType="1"
507 CharacterSet="2" 496 CharacterSet="2"
508 WholeProgramOptimization="1" 497 WholeProgramOptimization="1"
@@ -521,7 +510,6 @@
521 /> 510 />
522 <Tool 511 <Tool
523 Name="VCMIDLTool" 512 Name="VCMIDLTool"
524 TargetEnvironment="2"
525 /> 513 />
526 <Tool 514 <Tool
527 Name="VCCLCompilerTool" 515 Name="VCCLCompilerTool"
@@ -529,10 +517,10 @@
529 InlineFunctionExpansion="1" 517 InlineFunctionExpansion="1"
530 OmitFramePointers="true" 518 OmitFramePointers="true"
531 AdditionalIncludeDirectories="..\..\.." 519 AdditionalIncludeDirectories="..\..\.."
532 PreprocessorDefinitions="ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64" 520 PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
533 StringPooling="true" 521 StringPooling="true"
534 BasicRuntimeChecks="0" 522 BasicRuntimeChecks="0"
535 RuntimeLibrary="2" 523 RuntimeLibrary="0"
536 BufferSecurityCheck="false" 524 BufferSecurityCheck="false"
537 EnableFunctionLevelLinking="true" 525 EnableFunctionLevelLinking="true"
538 UsePrecompiledHeader="0" 526 UsePrecompiledHeader="0"
@@ -552,6 +540,7 @@
552 /> 540 />
553 <Tool 541 <Tool
554 Name="VCLinkerTool" 542 Name="VCLinkerTool"
543 AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj"
555 OutputFile="$(OutDir)/testzlib.exe" 544 OutputFile="$(OutDir)/testzlib.exe"
556 LinkIncremental="1" 545 LinkIncremental="1"
557 GenerateManifest="false" 546 GenerateManifest="false"
@@ -560,7 +549,9 @@
560 OptimizeReferences="2" 549 OptimizeReferences="2"
561 EnableCOMDATFolding="2" 550 EnableCOMDATFolding="2"
562 OptimizeForWindows98="1" 551 OptimizeForWindows98="1"
563 TargetMachine="5" 552 RandomizedBaseAddress="1"
553 DataExecutionPrevention="0"
554 TargetMachine="1"
564 /> 555 />
565 <Tool 556 <Tool
566 Name="VCALinkTool" 557 Name="VCALinkTool"
@@ -581,9 +572,6 @@
581 Name="VCAppVerifierTool" 572 Name="VCAppVerifierTool"
582 /> 573 />
583 <Tool 574 <Tool
584 Name="VCWebDeploymentTool"
585 />
586 <Tool
587 Name="VCPostBuildEventTool" 575 Name="VCPostBuildEventTool"
588 /> 576 />
589 </Configuration> 577 </Configuration>
@@ -614,7 +602,7 @@
614 AdditionalIncludeDirectories="..\..\.." 602 AdditionalIncludeDirectories="..\..\.."
615 PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS" 603 PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
616 BasicRuntimeChecks="0" 604 BasicRuntimeChecks="0"
617 RuntimeLibrary="2" 605 RuntimeLibrary="0"
618 BufferSecurityCheck="false" 606 BufferSecurityCheck="false"
619 AssemblerListingLocation="$(IntDir)\" 607 AssemblerListingLocation="$(IntDir)\"
620 /> 608 />
@@ -651,9 +639,6 @@
651 Name="VCAppVerifierTool" 639 Name="VCAppVerifierTool"
652 /> 640 />
653 <Tool 641 <Tool
654 Name="VCWebDeploymentTool"
655 />
656 <Tool
657 Name="VCPostBuildEventTool" 642 Name="VCPostBuildEventTool"
658 /> 643 />
659 </Configuration> 644 </Configuration>
@@ -739,9 +724,6 @@
739 Name="VCAppVerifierTool" 724 Name="VCAppVerifierTool"
740 /> 725 />
741 <Tool 726 <Tool
742 Name="VCWebDeploymentTool"
743 />
744 <Tool
745 Name="VCPostBuildEventTool" 727 Name="VCPostBuildEventTool"
746 /> 728 />
747 </Configuration> 729 </Configuration>
@@ -770,82 +752,6 @@
770 > 752 >
771 </File> 753 </File>
772 <File 754 <File
773 RelativePath="..\..\masmx86\gvmat32c.c"
774 >
775 <FileConfiguration
776 Name="Debug|x64"
777 ExcludedFromBuild="true"
778 >
779 <Tool
780 Name="VCCLCompilerTool"
781 />
782 </FileConfiguration>
783 <FileConfiguration
784 Name="Debug|Itanium"
785 ExcludedFromBuild="true"
786 >
787 <Tool
788 Name="VCCLCompilerTool"
789 />
790 </FileConfiguration>
791 <FileConfiguration
792 Name="ReleaseWithoutAsm|x64"
793 ExcludedFromBuild="true"
794 >
795 <Tool
796 Name="VCCLCompilerTool"
797 />
798 </FileConfiguration>
799 <FileConfiguration
800 Name="ReleaseWithoutAsm|Itanium"
801 ExcludedFromBuild="true"
802 >
803 <Tool
804 Name="VCCLCompilerTool"
805 />
806 </FileConfiguration>
807 <FileConfiguration
808 Name="Release|x64"
809 ExcludedFromBuild="true"
810 >
811 <Tool
812 Name="VCCLCompilerTool"
813 />
814 </FileConfiguration>
815 <FileConfiguration
816 Name="Release|Itanium"
817 ExcludedFromBuild="true"
818 >
819 <Tool
820 Name="VCCLCompilerTool"
821 />
822 </FileConfiguration>
823 <FileConfiguration
824 Name="Debug|Win64 (AMD64)"
825 ExcludedFromBuild="TRUE"
826 >
827 <Tool
828 Name="VCCLCompilerTool"
829 />
830 </FileConfiguration>
831 <FileConfiguration
832 Name="Release|Win64 (AMD64)"
833 ExcludedFromBuild="TRUE"
834 >
835 <Tool
836 Name="VCCLCompilerTool"
837 />
838 </FileConfiguration>
839 <FileConfiguration
840 Name="ReleaseAsm|Win64 (AMD64)"
841 ExcludedFromBuild="TRUE"
842 >
843 <Tool
844 Name="VCCLCompilerTool"
845 />
846 </FileConfiguration>
847 </File>
848 <File
849 RelativePath="..\..\..\infback.c" 755 RelativePath="..\..\..\infback.c"
850 > 756 >
851 </File> 757 </File>
@@ -861,7 +767,7 @@
861 /> 767 />
862 </FileConfiguration> 768 </FileConfiguration>
863 <FileConfiguration 769 <FileConfiguration
864 Name="ReleaseWithoutAsm|Win32" 770 Name="Debug|Itanium"
865 ExcludedFromBuild="true" 771 ExcludedFromBuild="true"
866 > 772 >
867 <Tool 773 <Tool
@@ -869,7 +775,7 @@
869 /> 775 />
870 </FileConfiguration> 776 </FileConfiguration>
871 <FileConfiguration 777 <FileConfiguration
872 Name="Release|Win32" 778 Name="ReleaseWithoutAsm|Win32"
873 ExcludedFromBuild="true" 779 ExcludedFromBuild="true"
874 > 780 >
875 <Tool 781 <Tool
@@ -877,7 +783,7 @@
877 /> 783 />
878 </FileConfiguration> 784 </FileConfiguration>
879 <FileConfiguration 785 <FileConfiguration
880 Name="Debug|Itanium" 786 Name="ReleaseWithoutAsm|Itanium"
881 ExcludedFromBuild="true" 787 ExcludedFromBuild="true"
882 > 788 >
883 <Tool 789 <Tool
@@ -885,7 +791,7 @@
885 /> 791 />
886 </FileConfiguration> 792 </FileConfiguration>
887 <FileConfiguration 793 <FileConfiguration
888 Name="ReleaseWithoutAsm|Itanium" 794 Name="Release|Win32"
889 ExcludedFromBuild="true" 795 ExcludedFromBuild="true"
890 > 796 >
891 <Tool 797 <Tool
diff --git a/contrib/vstudio/vc9/zlib.rc b/contrib/vstudio/vc9/zlib.rc
index 72cb8b4..23802d8 100644
--- a/contrib/vstudio/vc9/zlib.rc
+++ b/contrib/vstudio/vc9/zlib.rc
@@ -2,8 +2,8 @@
2 2
3#define IDR_VERSION1 1 3#define IDR_VERSION1 1
4IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 4IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5 FILEVERSION 1,2,3,0 5 FILEVERSION 1,2,4,0
6 PRODUCTVERSION 1,2,3,0 6 PRODUCTVERSION 1,2,4,0
7 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 7 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
8 FILEFLAGS 0 8 FILEFLAGS 0
9 FILEOS VOS_DOS_WINDOWS32 9 FILEOS VOS_DOS_WINDOWS32
@@ -16,13 +16,13 @@ BEGIN
16 //language ID = U.S. English, char set = Windows, Multilingual 16 //language ID = U.S. English, char set = Windows, Multilingual
17 17
18 BEGIN 18 BEGIN
19 VALUE "FileDescription", "zlib data compression library\0" 19 VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20 VALUE "FileVersion", "1.2.3.0\0" 20 VALUE "FileVersion", "1.2.4.0\0"
21 VALUE "InternalName", "zlib\0" 21 VALUE "InternalName", "zlib\0"
22 VALUE "OriginalFilename", "zlib.dll\0" 22 VALUE "OriginalFilename", "zlib.dll\0"
23 VALUE "ProductName", "ZLib.DLL\0" 23 VALUE "ProductName", "ZLib.DLL\0"
24 VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" 24 VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25 VALUE "LegalCopyright", "(C) 1995-2003 Jean-loup Gailly & Mark Adler\0" 25 VALUE "LegalCopyright", "(C) 1995-2010 Jean-loup Gailly & Mark Adler\0"
26 END 26 END
27 END 27 END
28 BLOCK "VarFileInfo" 28 BLOCK "VarFileInfo"
diff --git a/contrib/vstudio/vc9/zlibstat.vcproj b/contrib/vstudio/vc9/zlibstat.vcproj
index ff9813a..61c76c7 100644
--- a/contrib/vstudio/vc9/zlibstat.vcproj
+++ b/contrib/vstudio/vc9/zlibstat.vcproj
@@ -1,7 +1,7 @@
1<?xml version="1.0" encoding="Windows-1252"?> 1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject 2<VisualStudioProject
3 ProjectType="Visual C++" 3 ProjectType="Visual C++"
4 Version="9.00" 4 Version="9,00"
5 Name="zlibstat" 5 Name="zlibstat"
6 ProjectGUID="{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}" 6 ProjectGUID="{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}"
7 TargetFrameworkVersion="131072" 7 TargetFrameworkVersion="131072"
@@ -94,9 +94,9 @@
94 /> 94 />
95 </Configuration> 95 </Configuration>
96 <Configuration 96 <Configuration
97 Name="Release|Win32" 97 Name="Debug|x64"
98 OutputDirectory="x86\ZlibStat$(ConfigurationName)" 98 OutputDirectory="x64\ZlibStat$(ConfigurationName)"
99 IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp" 99 IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp"
100 ConfigurationType="4" 100 ConfigurationType="4"
101 InheritedPropertySheets="UpgradeFromVC70.vsprops" 101 InheritedPropertySheets="UpgradeFromVC70.vsprops"
102 UseOfMFC="0" 102 UseOfMFC="0"
@@ -116,23 +116,24 @@
116 /> 116 />
117 <Tool 117 <Tool
118 Name="VCMIDLTool" 118 Name="VCMIDLTool"
119 TargetEnvironment="3"
119 /> 120 />
120 <Tool 121 <Tool
121 Name="VCCLCompilerTool" 122 Name="VCCLCompilerTool"
122 InlineFunctionExpansion="1" 123 Optimization="0"
123 AdditionalIncludeDirectories="..\..\..;..\..\masmx86" 124 AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
124 PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF" 125 PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
125 StringPooling="true"
126 ExceptionHandling="0" 126 ExceptionHandling="0"
127 RuntimeLibrary="0" 127 RuntimeLibrary="3"
128 BufferSecurityCheck="false" 128 BufferSecurityCheck="false"
129 EnableFunctionLevelLinking="true"
130 PrecompiledHeaderFile="$(IntDir)/zlibstat.pch" 129 PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
131 AssemblerListingLocation="$(IntDir)\" 130 AssemblerListingLocation="$(IntDir)\"
132 ObjectFile="$(IntDir)\" 131 ObjectFile="$(IntDir)\"
133 ProgramDataBaseFileName="$(OutDir)\" 132 ProgramDataBaseFileName="$(OutDir)\"
134 WarningLevel="3" 133 WarningLevel="3"
135 SuppressStartupBanner="true" 134 SuppressStartupBanner="true"
135 Detect64BitPortabilityProblems="true"
136 DebugInformationFormat="1"
136 /> 137 />
137 <Tool 138 <Tool
138 Name="VCManagedResourceCompilerTool" 139 Name="VCManagedResourceCompilerTool"
@@ -146,8 +147,7 @@
146 /> 147 />
147 <Tool 148 <Tool
148 Name="VCLibrarianTool" 149 Name="VCLibrarianTool"
149 AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB" 150 AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB"
150 AdditionalDependencies="..\..\masmx86\gvmat32.obj ..\..\masmx86\inffas32.obj "
151 OutputFile="$(OutDir)\zlibstat.lib" 151 OutputFile="$(OutDir)\zlibstat.lib"
152 SuppressStartupBanner="true" 152 SuppressStartupBanner="true"
153 /> 153 />
@@ -168,9 +168,9 @@
168 /> 168 />
169 </Configuration> 169 </Configuration>
170 <Configuration 170 <Configuration
171 Name="ReleaseWithoutAsm|Win32" 171 Name="Debug|Itanium"
172 OutputDirectory="x86\ZlibStat$(ConfigurationName)" 172 OutputDirectory="ia64\ZlibStat$(ConfigurationName)"
173 IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp" 173 IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp"
174 ConfigurationType="4" 174 ConfigurationType="4"
175 InheritedPropertySheets="UpgradeFromVC70.vsprops" 175 InheritedPropertySheets="UpgradeFromVC70.vsprops"
176 UseOfMFC="0" 176 UseOfMFC="0"
@@ -190,23 +190,24 @@
190 /> 190 />
191 <Tool 191 <Tool
192 Name="VCMIDLTool" 192 Name="VCMIDLTool"
193 TargetEnvironment="2"
193 /> 194 />
194 <Tool 195 <Tool
195 Name="VCCLCompilerTool" 196 Name="VCCLCompilerTool"
196 InlineFunctionExpansion="1" 197 Optimization="0"
197 AdditionalIncludeDirectories="..\..\..;..\..\masmx86" 198 AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
198 PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS" 199 PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
199 StringPooling="true"
200 ExceptionHandling="0" 200 ExceptionHandling="0"
201 RuntimeLibrary="0" 201 RuntimeLibrary="3"
202 BufferSecurityCheck="false" 202 BufferSecurityCheck="false"
203 EnableFunctionLevelLinking="true"
204 PrecompiledHeaderFile="$(IntDir)/zlibstat.pch" 203 PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
205 AssemblerListingLocation="$(IntDir)\" 204 AssemblerListingLocation="$(IntDir)\"
206 ObjectFile="$(IntDir)\" 205 ObjectFile="$(IntDir)\"
207 ProgramDataBaseFileName="$(OutDir)\" 206 ProgramDataBaseFileName="$(OutDir)\"
208 WarningLevel="3" 207 WarningLevel="3"
209 SuppressStartupBanner="true" 208 SuppressStartupBanner="true"
209 Detect64BitPortabilityProblems="true"
210 DebugInformationFormat="1"
210 /> 211 />
211 <Tool 212 <Tool
212 Name="VCManagedResourceCompilerTool" 213 Name="VCManagedResourceCompilerTool"
@@ -220,7 +221,7 @@
220 /> 221 />
221 <Tool 222 <Tool
222 Name="VCLibrarianTool" 223 Name="VCLibrarianTool"
223 AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB" 224 AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB"
224 OutputFile="$(OutDir)\zlibstat.lib" 225 OutputFile="$(OutDir)\zlibstat.lib"
225 SuppressStartupBanner="true" 226 SuppressStartupBanner="true"
226 /> 227 />
@@ -241,9 +242,9 @@
241 /> 242 />
242 </Configuration> 243 </Configuration>
243 <Configuration 244 <Configuration
244 Name="Debug|x64" 245 Name="Release|Win32"
245 OutputDirectory="x64\ZlibStat$(ConfigurationName)" 246 OutputDirectory="x86\ZlibStat$(ConfigurationName)"
246 IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp" 247 IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp"
247 ConfigurationType="4" 248 ConfigurationType="4"
248 InheritedPropertySheets="UpgradeFromVC70.vsprops" 249 InheritedPropertySheets="UpgradeFromVC70.vsprops"
249 UseOfMFC="0" 250 UseOfMFC="0"
@@ -263,24 +264,23 @@
263 /> 264 />
264 <Tool 265 <Tool
265 Name="VCMIDLTool" 266 Name="VCMIDLTool"
266 TargetEnvironment="3"
267 /> 267 />
268 <Tool 268 <Tool
269 Name="VCCLCompilerTool" 269 Name="VCCLCompilerTool"
270 Optimization="0" 270 InlineFunctionExpansion="1"
271 AdditionalIncludeDirectories="..\..\..;..\..\masmx86" 271 AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
272 PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64" 272 PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF"
273 StringPooling="true"
273 ExceptionHandling="0" 274 ExceptionHandling="0"
274 RuntimeLibrary="3" 275 RuntimeLibrary="0"
275 BufferSecurityCheck="false" 276 BufferSecurityCheck="false"
277 EnableFunctionLevelLinking="true"
276 PrecompiledHeaderFile="$(IntDir)/zlibstat.pch" 278 PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
277 AssemblerListingLocation="$(IntDir)\" 279 AssemblerListingLocation="$(IntDir)\"
278 ObjectFile="$(IntDir)\" 280 ObjectFile="$(IntDir)\"
279 ProgramDataBaseFileName="$(OutDir)\" 281 ProgramDataBaseFileName="$(OutDir)\"
280 WarningLevel="3" 282 WarningLevel="3"
281 SuppressStartupBanner="true" 283 SuppressStartupBanner="true"
282 Detect64BitPortabilityProblems="true"
283 DebugInformationFormat="1"
284 /> 284 />
285 <Tool 285 <Tool
286 Name="VCManagedResourceCompilerTool" 286 Name="VCManagedResourceCompilerTool"
@@ -294,7 +294,8 @@
294 /> 294 />
295 <Tool 295 <Tool
296 Name="VCLibrarianTool" 296 Name="VCLibrarianTool"
297 AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB" 297 AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB"
298 AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj "
298 OutputFile="$(OutDir)\zlibstat.lib" 299 OutputFile="$(OutDir)\zlibstat.lib"
299 SuppressStartupBanner="true" 300 SuppressStartupBanner="true"
300 /> 301 />
@@ -315,9 +316,9 @@
315 /> 316 />
316 </Configuration> 317 </Configuration>
317 <Configuration 318 <Configuration
318 Name="Debug|Itanium" 319 Name="Release|x64"
319 OutputDirectory="ia64\ZlibStat$(ConfigurationName)" 320 OutputDirectory="x64\ZlibStat$(ConfigurationName)"
320 IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp" 321 IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp"
321 ConfigurationType="4" 322 ConfigurationType="4"
322 InheritedPropertySheets="UpgradeFromVC70.vsprops" 323 InheritedPropertySheets="UpgradeFromVC70.vsprops"
323 UseOfMFC="0" 324 UseOfMFC="0"
@@ -337,24 +338,24 @@
337 /> 338 />
338 <Tool 339 <Tool
339 Name="VCMIDLTool" 340 Name="VCMIDLTool"
340 TargetEnvironment="2" 341 TargetEnvironment="3"
341 /> 342 />
342 <Tool 343 <Tool
343 Name="VCCLCompilerTool" 344 Name="VCCLCompilerTool"
344 Optimization="0" 345 InlineFunctionExpansion="1"
345 AdditionalIncludeDirectories="..\..\..;..\..\masmx86" 346 AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
346 PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64" 347 PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64"
348 StringPooling="true"
347 ExceptionHandling="0" 349 ExceptionHandling="0"
348 RuntimeLibrary="3" 350 RuntimeLibrary="2"
349 BufferSecurityCheck="false" 351 BufferSecurityCheck="false"
352 EnableFunctionLevelLinking="true"
350 PrecompiledHeaderFile="$(IntDir)/zlibstat.pch" 353 PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
351 AssemblerListingLocation="$(IntDir)\" 354 AssemblerListingLocation="$(IntDir)\"
352 ObjectFile="$(IntDir)\" 355 ObjectFile="$(IntDir)\"
353 ProgramDataBaseFileName="$(OutDir)\" 356 ProgramDataBaseFileName="$(OutDir)\"
354 WarningLevel="3" 357 WarningLevel="3"
355 SuppressStartupBanner="true" 358 SuppressStartupBanner="true"
356 Detect64BitPortabilityProblems="true"
357 DebugInformationFormat="1"
358 /> 359 />
359 <Tool 360 <Tool
360 Name="VCManagedResourceCompilerTool" 361 Name="VCManagedResourceCompilerTool"
@@ -368,7 +369,8 @@
368 /> 369 />
369 <Tool 370 <Tool
370 Name="VCLibrarianTool" 371 Name="VCLibrarianTool"
371 AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB" 372 AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB"
373 AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj "
372 OutputFile="$(OutDir)\zlibstat.lib" 374 OutputFile="$(OutDir)\zlibstat.lib"
373 SuppressStartupBanner="true" 375 SuppressStartupBanner="true"
374 /> 376 />
@@ -389,9 +391,9 @@
389 /> 391 />
390 </Configuration> 392 </Configuration>
391 <Configuration 393 <Configuration
392 Name="Release|x64" 394 Name="Release|Itanium"
393 OutputDirectory="x64\ZlibStat$(ConfigurationName)" 395 OutputDirectory="ia64\ZlibStat$(ConfigurationName)"
394 IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp" 396 IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp"
395 ConfigurationType="4" 397 ConfigurationType="4"
396 InheritedPropertySheets="UpgradeFromVC70.vsprops" 398 InheritedPropertySheets="UpgradeFromVC70.vsprops"
397 UseOfMFC="0" 399 UseOfMFC="0"
@@ -411,13 +413,13 @@
411 /> 413 />
412 <Tool 414 <Tool
413 Name="VCMIDLTool" 415 Name="VCMIDLTool"
414 TargetEnvironment="3" 416 TargetEnvironment="2"
415 /> 417 />
416 <Tool 418 <Tool
417 Name="VCCLCompilerTool" 419 Name="VCCLCompilerTool"
418 InlineFunctionExpansion="1" 420 InlineFunctionExpansion="1"
419 AdditionalIncludeDirectories="..\..\..;..\..\masmx86" 421 AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
420 PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64" 422 PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
421 StringPooling="true" 423 StringPooling="true"
422 ExceptionHandling="0" 424 ExceptionHandling="0"
423 RuntimeLibrary="2" 425 RuntimeLibrary="2"
@@ -442,8 +444,7 @@
442 /> 444 />
443 <Tool 445 <Tool
444 Name="VCLibrarianTool" 446 Name="VCLibrarianTool"
445 AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB" 447 AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB"
446 AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj "
447 OutputFile="$(OutDir)\zlibstat.lib" 448 OutputFile="$(OutDir)\zlibstat.lib"
448 SuppressStartupBanner="true" 449 SuppressStartupBanner="true"
449 /> 450 />
@@ -464,9 +465,9 @@
464 /> 465 />
465 </Configuration> 466 </Configuration>
466 <Configuration 467 <Configuration
467 Name="Release|Itanium" 468 Name="ReleaseWithoutAsm|Win32"
468 OutputDirectory="ia64\ZlibStat$(ConfigurationName)" 469 OutputDirectory="x86\ZlibStat$(ConfigurationName)"
469 IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp" 470 IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp"
470 ConfigurationType="4" 471 ConfigurationType="4"
471 InheritedPropertySheets="UpgradeFromVC70.vsprops" 472 InheritedPropertySheets="UpgradeFromVC70.vsprops"
472 UseOfMFC="0" 473 UseOfMFC="0"
@@ -486,16 +487,15 @@
486 /> 487 />
487 <Tool 488 <Tool
488 Name="VCMIDLTool" 489 Name="VCMIDLTool"
489 TargetEnvironment="2"
490 /> 490 />
491 <Tool 491 <Tool
492 Name="VCCLCompilerTool" 492 Name="VCCLCompilerTool"
493 InlineFunctionExpansion="1" 493 InlineFunctionExpansion="1"
494 AdditionalIncludeDirectories="..\..\..;..\..\masmx86" 494 AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
495 PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64" 495 PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
496 StringPooling="true" 496 StringPooling="true"
497 ExceptionHandling="0" 497 ExceptionHandling="0"
498 RuntimeLibrary="2" 498 RuntimeLibrary="0"
499 BufferSecurityCheck="false" 499 BufferSecurityCheck="false"
500 EnableFunctionLevelLinking="true" 500 EnableFunctionLevelLinking="true"
501 PrecompiledHeaderFile="$(IntDir)/zlibstat.pch" 501 PrecompiledHeaderFile="$(IntDir)/zlibstat.pch"
@@ -517,7 +517,7 @@
517 /> 517 />
518 <Tool 518 <Tool
519 Name="VCLibrarianTool" 519 Name="VCLibrarianTool"
520 AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB" 520 AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB"
521 OutputFile="$(OutDir)\zlibstat.lib" 521 OutputFile="$(OutDir)\zlibstat.lib"
522 SuppressStartupBanner="true" 522 SuppressStartupBanner="true"
523 /> 523 />
@@ -709,63 +709,11 @@
709 > 709 >
710 </File> 710 </File>
711 <File 711 <File
712 RelativePath="..\..\masmx86\gvmat32c.c"
713 >
714 <FileConfiguration
715 Name="Debug|x64"
716 ExcludedFromBuild="true"
717 >
718 <Tool
719 Name="VCCLCompilerTool"
720 />
721 </FileConfiguration>
722 <FileConfiguration
723 Name="Debug|Itanium"
724 ExcludedFromBuild="true"
725 >
726 <Tool
727 Name="VCCLCompilerTool"
728 />
729 </FileConfiguration>
730 <FileConfiguration
731 Name="Release|x64"
732 ExcludedFromBuild="true"
733 >
734 <Tool
735 Name="VCCLCompilerTool"
736 />
737 </FileConfiguration>
738 <FileConfiguration
739 Name="Release|Itanium"
740 ExcludedFromBuild="true"
741 >
742 <Tool
743 Name="VCCLCompilerTool"
744 />
745 </FileConfiguration>
746 <FileConfiguration
747 Name="ReleaseWithoutAsm|x64"
748 ExcludedFromBuild="true"
749 >
750 <Tool
751 Name="VCCLCompilerTool"
752 />
753 </FileConfiguration>
754 <FileConfiguration
755 Name="ReleaseWithoutAsm|Itanium"
756 ExcludedFromBuild="true"
757 >
758 <Tool
759 Name="VCCLCompilerTool"
760 />
761 </FileConfiguration>
762 </File>
763 <File
764 RelativePath="..\..\..\gzclose.c" 712 RelativePath="..\..\..\gzclose.c"
765 > 713 >
766 </File> 714 </File>
767 <File 715 <File
768 RelativePath="..\..\..\gzio.c" 716 RelativePath="..\..\..\gzguts.h"
769 > 717 >
770 </File> 718 </File>
771 <File 719 <File
@@ -796,7 +744,7 @@
796 /> 744 />
797 </FileConfiguration> 745 </FileConfiguration>
798 <FileConfiguration 746 <FileConfiguration
799 Name="Release|Win32" 747 Name="Debug|Itanium"
800 ExcludedFromBuild="true" 748 ExcludedFromBuild="true"
801 > 749 >
802 <Tool 750 <Tool
@@ -804,7 +752,7 @@
804 /> 752 />
805 </FileConfiguration> 753 </FileConfiguration>
806 <FileConfiguration 754 <FileConfiguration
807 Name="ReleaseWithoutAsm|Win32" 755 Name="Release|Win32"
808 ExcludedFromBuild="true" 756 ExcludedFromBuild="true"
809 > 757 >
810 <Tool 758 <Tool
@@ -812,7 +760,7 @@
812 /> 760 />
813 </FileConfiguration> 761 </FileConfiguration>
814 <FileConfiguration 762 <FileConfiguration
815 Name="Debug|Itanium" 763 Name="Release|Itanium"
816 ExcludedFromBuild="true" 764 ExcludedFromBuild="true"
817 > 765 >
818 <Tool 766 <Tool
@@ -820,7 +768,7 @@
820 /> 768 />
821 </FileConfiguration> 769 </FileConfiguration>
822 <FileConfiguration 770 <FileConfiguration
823 Name="Release|Itanium" 771 Name="ReleaseWithoutAsm|Win32"
824 ExcludedFromBuild="true" 772 ExcludedFromBuild="true"
825 > 773 >
826 <Tool 774 <Tool
diff --git a/contrib/vstudio/vc9/zlibvc.def b/contrib/vstudio/vc9/zlibvc.def
index 0b6a9e9..b3b7cab 100644
--- a/contrib/vstudio/vc9/zlibvc.def
+++ b/contrib/vstudio/vc9/zlibvc.def
@@ -1,7 +1,7 @@
1LIBRARY
2; zlib data compression and ZIP file I/O library
1 3
2VERSION 1.23 4VERSION 1.24
3
4HEAPSIZE 1048576,8192
5 5
6EXPORTS 6EXPORTS
7 adler32 @1 7 adler32 @1
@@ -90,25 +90,47 @@ EXPORTS
90 unzGoToFilePos @101 90 unzGoToFilePos @101
91 91
92 fill_win32_filefunc @110 92 fill_win32_filefunc @110
93 fill_win32_filefunc64 @111
94 fill_win32_filefunc64A @112
95 fill_win32_filefunc64W @113
96 93
97; quick hack by hkuno@microhouse.co.jp 94; zlibwapi v1.2.4 added:
98 unzOpen64 @120 95 fill_win32_filefunc64 @111
99 unzOpen2_64 @121 96 fill_win32_filefunc64A @112
100 unzGetGlobalInfo64 @122 97 fill_win32_filefunc64W @113
101 unzGetCurrentFileInfo64 @124 98
102 unzGetCurrentFileZStreamPos64 @125 99 unzOpen64 @120
103 unztell64 @126 100 unzOpen2_64 @121
104 unzGetFilePos64 @127 101 unzGetGlobalInfo64 @122
105 unzGoToFilePos64 @128 102 unzGetCurrentFileInfo64 @124
103 unzGetCurrentFileZStreamPos64 @125
104 unztell64 @126
105 unzGetFilePos64 @127
106 unzGoToFilePos64 @128
107
108 zipOpen64 @130
109 zipOpen2_64 @131
110 zipOpenNewFileInZip64 @132
111 zipOpenNewFileInZip2_64 @133
112 zipOpenNewFileInZip3_64 @134
113 zipOpenNewFileInZip4_64 @135
114 zipCloseFileInZipRaw64 @136
106 115
107 zipOpen64 @130 116; zlib1 v1.2.4 added:
108 zipOpen2_64 @131 117 adler32_combine @140
109 zipOpenNewFileInZip64 @132 118 adler32_combine64 @141
110 zipOpenNewFileInZip2_64 @133 119 crc32_combine @142
111 zipOpenNewFileInZip3_64 @134 120 crc32_combine64 @143
112 zipOpenNewFileInZip4_64 @135 121 deflateSetHeader @144
113 zipCloseFileInZipRaw64 @136 122 deflateTune @145
114; end hack 123 gzbuffer @146
124 gzclose_r @147
125 gzclose_w @148
126 gzdirect @149
127 gzoffset @150
128 gzoffset64 @151
129 gzopen64 @152
130 gzseek64 @153
131 gztell64 @154
132 inflateGetHeader @156
133 inflateMark @157
134 inflatePrime @158
135 inflateReset2 @159
136 inflateUndermine @160
diff --git a/contrib/vstudio/vc9/zlibvc.sln b/contrib/vstudio/vc9/zlibvc.sln
index c7f1b0b..b482967 100644
--- a/contrib/vstudio/vc9/zlibvc.sln
+++ b/contrib/vstudio/vc9/zlibvc.sln
@@ -45,8 +45,8 @@ Global
45 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.Build.0 = Release|Itanium 45 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Itanium.Build.0 = Release|Itanium
46 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32 46 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.ActiveCfg = Release|Win32
47 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32 47 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|Win32.Build.0 = Release|Win32
48 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = ReleaseWithoutAsm|x64 48 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.ActiveCfg = Release|x64
49 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = ReleaseWithoutAsm|x64 49 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.Release|x64.Build.0 = Release|x64
50 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium 50 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium
51 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium 51 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium
52 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 52 {8FD826F8-3739-44E6-8CC8-997122E53B8D}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
@@ -103,8 +103,8 @@ Global
103 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.Build.0 = Release|x64 103 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.Release|x64.Build.0 = Release|x64
104 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium 104 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium
105 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium 105 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium
106 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Itanium 106 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
107 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Itanium 107 {C52F9E7B-498A-42BE-8DB4-85A15694366A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
108 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Itanium 108 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.ActiveCfg = Debug|Itanium
109 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.Build.0 = Debug|Itanium 109 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Itanium.Build.0 = Debug|Itanium
110 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32 110 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Debug|Win32.ActiveCfg = Debug|Win32
@@ -119,8 +119,8 @@ Global
119 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64 119 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.Release|x64.Build.0 = Release|x64
120 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium 120 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium
121 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium 121 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium
122 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Itanium 122 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
123 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Itanium 123 {48CDD9DC-E09F-4135-9C0C-4FE50C3C654B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
124 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.ActiveCfg = Debug|Itanium 124 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.ActiveCfg = Debug|Itanium
125 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.Build.0 = Debug|Itanium 125 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Itanium.Build.0 = Debug|Itanium
126 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.ActiveCfg = Debug|Win32 126 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Debug|Win32.ActiveCfg = Debug|Win32
@@ -135,8 +135,8 @@ Global
135 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.Build.0 = Release|x64 135 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.Release|x64.Build.0 = Release|x64
136 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium 136 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|Itanium
137 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium 137 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Itanium.Build.0 = Release|Itanium
138 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Itanium 138 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32
139 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Itanium 139 {C52F9E7B-498A-42BE-8DB4-85A15694382A}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
140 EndGlobalSection 140 EndGlobalSection
141 GlobalSection(SolutionProperties) = preSolution 141 GlobalSection(SolutionProperties) = preSolution
142 HideSolutionNode = FALSE 142 HideSolutionNode = FALSE
diff --git a/contrib/vstudio/vc9/zlibvc.vcproj b/contrib/vstudio/vc9/zlibvc.vcproj
index ee86786..c9a8947 100644
--- a/contrib/vstudio/vc9/zlibvc.vcproj
+++ b/contrib/vstudio/vc9/zlibvc.vcproj
@@ -1,9 +1,10 @@
1<?xml version="1.0" encoding="Windows-1252"?> 1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject 2<VisualStudioProject
3 ProjectType="Visual C++" 3 ProjectType="Visual C++"
4 Version="9.00" 4 Version="9,00"
5 Name="zlibvc" 5 Name="zlibvc"
6 ProjectGUID="{8FD826F8-3739-44E6-8CC8-997122E53B8D}" 6 ProjectGUID="{8FD826F8-3739-44E6-8CC8-997122E53B8D}"
7 RootNamespace="zlibvc"
7 TargetFrameworkVersion="131072" 8 TargetFrameworkVersion="131072"
8 > 9 >
9 <Platforms> 10 <Platforms>
@@ -80,7 +81,7 @@
80 <Tool 81 <Tool
81 Name="VCLinkerTool" 82 Name="VCLinkerTool"
82 AdditionalOptions="/MACHINE:I386" 83 AdditionalOptions="/MACHINE:I386"
83 AdditionalDependencies="..\..\masmx86\gvmat32.obj ..\..\masmx86\inffas32.obj" 84 AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj"
84 OutputFile="$(OutDir)\zlibwapi.dll" 85 OutputFile="$(OutDir)\zlibwapi.dll"
85 LinkIncremental="2" 86 LinkIncremental="2"
86 SuppressStartupBanner="true" 87 SuppressStartupBanner="true"
@@ -118,14 +119,13 @@
118 /> 119 />
119 </Configuration> 120 </Configuration>
120 <Configuration 121 <Configuration
121 Name="ReleaseWithoutAsm|Win32" 122 Name="Debug|x64"
122 OutputDirectory="x86\ZlibDll$(ConfigurationName)" 123 OutputDirectory="x64\ZlibDll$(ConfigurationName)"
123 IntermediateDirectory="x86\ZlibDll$(ConfigurationName)\Tmp" 124 IntermediateDirectory="x64\ZlibDll$(ConfigurationName)\Tmp"
124 ConfigurationType="2" 125 ConfigurationType="2"
125 InheritedPropertySheets="UpgradeFromVC70.vsprops" 126 InheritedPropertySheets="UpgradeFromVC70.vsprops"
126 UseOfMFC="0" 127 UseOfMFC="0"
127 ATLMinimizesCRunTimeLibraryUsage="false" 128 ATLMinimizesCRunTimeLibraryUsage="false"
128 WholeProgramOptimization="1"
129 > 129 >
130 <Tool 130 <Tool
131 Name="VCPreBuildEventTool" 131 Name="VCPreBuildEventTool"
@@ -141,37 +141,35 @@
141 /> 141 />
142 <Tool 142 <Tool
143 Name="VCMIDLTool" 143 Name="VCMIDLTool"
144 PreprocessorDefinitions="NDEBUG" 144 PreprocessorDefinitions="_DEBUG"
145 MkTypLibCompatible="true" 145 MkTypLibCompatible="true"
146 SuppressStartupBanner="true" 146 SuppressStartupBanner="true"
147 TargetEnvironment="1" 147 TargetEnvironment="3"
148 TypeLibraryName="$(OutDir)/zlibvc.tlb" 148 TypeLibraryName="$(OutDir)/zlibvc.tlb"
149 /> 149 />
150 <Tool 150 <Tool
151 Name="VCCLCompilerTool" 151 Name="VCCLCompilerTool"
152 InlineFunctionExpansion="1" 152 Optimization="0"
153 AdditionalIncludeDirectories="..\..\..;..\..\masmx86" 153 AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
154 PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI" 154 PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64"
155 StringPooling="true"
156 ExceptionHandling="0" 155 ExceptionHandling="0"
157 RuntimeLibrary="2" 156 RuntimeLibrary="3"
158 BufferSecurityCheck="false" 157 BufferSecurityCheck="false"
159 EnableFunctionLevelLinking="true"
160 PrecompiledHeaderFile="$(IntDir)/zlibvc.pch" 158 PrecompiledHeaderFile="$(IntDir)/zlibvc.pch"
161 AssemblerOutput="2"
162 AssemblerListingLocation="$(IntDir)\" 159 AssemblerListingLocation="$(IntDir)\"
163 ObjectFile="$(IntDir)\" 160 ObjectFile="$(IntDir)\"
164 ProgramDataBaseFileName="$(OutDir)\" 161 ProgramDataBaseFileName="$(OutDir)\"
165 BrowseInformation="0" 162 BrowseInformation="0"
166 WarningLevel="3" 163 WarningLevel="3"
167 SuppressStartupBanner="true" 164 SuppressStartupBanner="true"
165 DebugInformationFormat="3"
168 /> 166 />
169 <Tool 167 <Tool
170 Name="VCManagedResourceCompilerTool" 168 Name="VCManagedResourceCompilerTool"
171 /> 169 />
172 <Tool 170 <Tool
173 Name="VCResourceCompilerTool" 171 Name="VCResourceCompilerTool"
174 PreprocessorDefinitions="NDEBUG" 172 PreprocessorDefinitions="_DEBUG"
175 Culture="1036" 173 Culture="1036"
176 /> 174 />
177 <Tool 175 <Tool
@@ -179,21 +177,19 @@
179 /> 177 />
180 <Tool 178 <Tool
181 Name="VCLinkerTool" 179 Name="VCLinkerTool"
182 AdditionalOptions="/MACHINE:I386" 180 AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj "
183 OutputFile="$(OutDir)\zlibwapi.dll" 181 OutputFile="$(OutDir)\zlibwapi.dll"
184 LinkIncremental="1" 182 LinkIncremental="2"
185 SuppressStartupBanner="true" 183 SuppressStartupBanner="true"
186 GenerateManifest="false" 184 GenerateManifest="false"
187 IgnoreAllDefaultLibraries="false"
188 ModuleDefinitionFile=".\zlibvc.def" 185 ModuleDefinitionFile=".\zlibvc.def"
186 GenerateDebugInformation="true"
189 ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb" 187 ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb"
190 GenerateMapFile="true" 188 GenerateMapFile="true"
191 MapFileName="$(OutDir)/zlibwapi.map" 189 MapFileName="$(OutDir)/zlibwapi.map"
192 SubSystem="2" 190 SubSystem="2"
193 OptimizeForWindows98="1"
194 RandomizedBaseAddress="1"
195 DataExecutionPrevention="0"
196 ImportLibrary="$(OutDir)/zlibwapi.lib" 191 ImportLibrary="$(OutDir)/zlibwapi.lib"
192 TargetMachine="17"
197 /> 193 />
198 <Tool 194 <Tool
199 Name="VCALinkTool" 195 Name="VCALinkTool"
@@ -218,14 +214,13 @@
218 /> 214 />
219 </Configuration> 215 </Configuration>
220 <Configuration 216 <Configuration
221 Name="Release|Win32" 217 Name="Debug|Itanium"
222 OutputDirectory="x86\ZlibDll$(ConfigurationName)" 218 OutputDirectory="ia64\ZlibDll$(ConfigurationName)"
223 IntermediateDirectory="x86\ZlibDll$(ConfigurationName)\Tmp" 219 IntermediateDirectory="ia64\ZlibDll$(ConfigurationName)\Tmp"
224 ConfigurationType="2" 220 ConfigurationType="2"
225 InheritedPropertySheets="UpgradeFromVC70.vsprops" 221 InheritedPropertySheets="UpgradeFromVC70.vsprops"
226 UseOfMFC="0" 222 UseOfMFC="0"
227 ATLMinimizesCRunTimeLibraryUsage="false" 223 ATLMinimizesCRunTimeLibraryUsage="false"
228 WholeProgramOptimization="1"
229 > 224 >
230 <Tool 225 <Tool
231 Name="VCPreBuildEventTool" 226 Name="VCPreBuildEventTool"
@@ -241,37 +236,35 @@
241 /> 236 />
242 <Tool 237 <Tool
243 Name="VCMIDLTool" 238 Name="VCMIDLTool"
244 PreprocessorDefinitions="NDEBUG" 239 PreprocessorDefinitions="_DEBUG"
245 MkTypLibCompatible="true" 240 MkTypLibCompatible="true"
246 SuppressStartupBanner="true" 241 SuppressStartupBanner="true"
247 TargetEnvironment="1" 242 TargetEnvironment="2"
248 TypeLibraryName="$(OutDir)/zlibvc.tlb" 243 TypeLibraryName="$(OutDir)/zlibvc.tlb"
249 /> 244 />
250 <Tool 245 <Tool
251 Name="VCCLCompilerTool" 246 Name="VCCLCompilerTool"
252 InlineFunctionExpansion="1" 247 Optimization="0"
253 AdditionalIncludeDirectories="..\..\..;..\..\masmx86" 248 AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
254 PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF" 249 PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64"
255 StringPooling="true"
256 ExceptionHandling="0" 250 ExceptionHandling="0"
257 RuntimeLibrary="2" 251 RuntimeLibrary="3"
258 BufferSecurityCheck="false" 252 BufferSecurityCheck="false"
259 EnableFunctionLevelLinking="true"
260 PrecompiledHeaderFile="$(IntDir)/zlibvc.pch" 253 PrecompiledHeaderFile="$(IntDir)/zlibvc.pch"
261 AssemblerOutput="2"
262 AssemblerListingLocation="$(IntDir)\" 254 AssemblerListingLocation="$(IntDir)\"
263 ObjectFile="$(IntDir)\" 255 ObjectFile="$(IntDir)\"
264 ProgramDataBaseFileName="$(OutDir)\" 256 ProgramDataBaseFileName="$(OutDir)\"
265 BrowseInformation="0" 257 BrowseInformation="0"
266 WarningLevel="3" 258 WarningLevel="3"
267 SuppressStartupBanner="true" 259 SuppressStartupBanner="true"
260 DebugInformationFormat="3"
268 /> 261 />
269 <Tool 262 <Tool
270 Name="VCManagedResourceCompilerTool" 263 Name="VCManagedResourceCompilerTool"
271 /> 264 />
272 <Tool 265 <Tool
273 Name="VCResourceCompilerTool" 266 Name="VCResourceCompilerTool"
274 PreprocessorDefinitions="NDEBUG" 267 PreprocessorDefinitions="_DEBUG"
275 Culture="1036" 268 Culture="1036"
276 /> 269 />
277 <Tool 270 <Tool
@@ -279,22 +272,18 @@
279 /> 272 />
280 <Tool 273 <Tool
281 Name="VCLinkerTool" 274 Name="VCLinkerTool"
282 AdditionalOptions="/MACHINE:I386"
283 AdditionalDependencies="..\..\masmx86\gvmat32.obj ..\..\masmx86\inffas32.obj "
284 OutputFile="$(OutDir)\zlibwapi.dll" 275 OutputFile="$(OutDir)\zlibwapi.dll"
285 LinkIncremental="1" 276 LinkIncremental="2"
286 SuppressStartupBanner="true" 277 SuppressStartupBanner="true"
287 GenerateManifest="false" 278 GenerateManifest="false"
288 IgnoreAllDefaultLibraries="false"
289 ModuleDefinitionFile=".\zlibvc.def" 279 ModuleDefinitionFile=".\zlibvc.def"
280 GenerateDebugInformation="true"
290 ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb" 281 ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb"
291 GenerateMapFile="true" 282 GenerateMapFile="true"
292 MapFileName="$(OutDir)/zlibwapi.map" 283 MapFileName="$(OutDir)/zlibwapi.map"
293 SubSystem="2" 284 SubSystem="2"
294 OptimizeForWindows98="1"
295 RandomizedBaseAddress="1"
296 DataExecutionPrevention="0"
297 ImportLibrary="$(OutDir)/zlibwapi.lib" 285 ImportLibrary="$(OutDir)/zlibwapi.lib"
286 TargetMachine="5"
298 /> 287 />
299 <Tool 288 <Tool
300 Name="VCALinkTool" 289 Name="VCALinkTool"
@@ -319,13 +308,14 @@
319 /> 308 />
320 </Configuration> 309 </Configuration>
321 <Configuration 310 <Configuration
322 Name="Debug|x64" 311 Name="ReleaseWithoutAsm|Win32"
323 OutputDirectory="x64\ZlibDll$(ConfigurationName)" 312 OutputDirectory="x86\ZlibDll$(ConfigurationName)"
324 IntermediateDirectory="x64\ZlibDll$(ConfigurationName)\Tmp" 313 IntermediateDirectory="x86\ZlibDll$(ConfigurationName)\Tmp"
325 ConfigurationType="2" 314 ConfigurationType="2"
326 InheritedPropertySheets="UpgradeFromVC70.vsprops" 315 InheritedPropertySheets="UpgradeFromVC70.vsprops"
327 UseOfMFC="0" 316 UseOfMFC="0"
328 ATLMinimizesCRunTimeLibraryUsage="false" 317 ATLMinimizesCRunTimeLibraryUsage="false"
318 WholeProgramOptimization="1"
329 > 319 >
330 <Tool 320 <Tool
331 Name="VCPreBuildEventTool" 321 Name="VCPreBuildEventTool"
@@ -341,35 +331,37 @@
341 /> 331 />
342 <Tool 332 <Tool
343 Name="VCMIDLTool" 333 Name="VCMIDLTool"
344 PreprocessorDefinitions="_DEBUG" 334 PreprocessorDefinitions="NDEBUG"
345 MkTypLibCompatible="true" 335 MkTypLibCompatible="true"
346 SuppressStartupBanner="true" 336 SuppressStartupBanner="true"
347 TargetEnvironment="3" 337 TargetEnvironment="1"
348 TypeLibraryName="$(OutDir)/zlibvc.tlb" 338 TypeLibraryName="$(OutDir)/zlibvc.tlb"
349 /> 339 />
350 <Tool 340 <Tool
351 Name="VCCLCompilerTool" 341 Name="VCCLCompilerTool"
352 Optimization="0" 342 InlineFunctionExpansion="1"
353 AdditionalIncludeDirectories="..\..\..;..\..\masmx86" 343 AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
354 PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64" 344 PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI"
345 StringPooling="true"
355 ExceptionHandling="0" 346 ExceptionHandling="0"
356 RuntimeLibrary="3" 347 RuntimeLibrary="2"
357 BufferSecurityCheck="false" 348 BufferSecurityCheck="false"
349 EnableFunctionLevelLinking="true"
358 PrecompiledHeaderFile="$(IntDir)/zlibvc.pch" 350 PrecompiledHeaderFile="$(IntDir)/zlibvc.pch"
351 AssemblerOutput="2"
359 AssemblerListingLocation="$(IntDir)\" 352 AssemblerListingLocation="$(IntDir)\"
360 ObjectFile="$(IntDir)\" 353 ObjectFile="$(IntDir)\"
361 ProgramDataBaseFileName="$(OutDir)\" 354 ProgramDataBaseFileName="$(OutDir)\"
362 BrowseInformation="0" 355 BrowseInformation="0"
363 WarningLevel="3" 356 WarningLevel="3"
364 SuppressStartupBanner="true" 357 SuppressStartupBanner="true"
365 DebugInformationFormat="3"
366 /> 358 />
367 <Tool 359 <Tool
368 Name="VCManagedResourceCompilerTool" 360 Name="VCManagedResourceCompilerTool"
369 /> 361 />
370 <Tool 362 <Tool
371 Name="VCResourceCompilerTool" 363 Name="VCResourceCompilerTool"
372 PreprocessorDefinitions="_DEBUG" 364 PreprocessorDefinitions="NDEBUG"
373 Culture="1036" 365 Culture="1036"
374 /> 366 />
375 <Tool 367 <Tool
@@ -377,19 +369,21 @@
377 /> 369 />
378 <Tool 370 <Tool
379 Name="VCLinkerTool" 371 Name="VCLinkerTool"
380 AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj " 372 AdditionalOptions="/MACHINE:I386"
381 OutputFile="$(OutDir)\zlibwapi.dll" 373 OutputFile="$(OutDir)\zlibwapi.dll"
382 LinkIncremental="2" 374 LinkIncremental="1"
383 SuppressStartupBanner="true" 375 SuppressStartupBanner="true"
384 GenerateManifest="false" 376 GenerateManifest="false"
377 IgnoreAllDefaultLibraries="false"
385 ModuleDefinitionFile=".\zlibvc.def" 378 ModuleDefinitionFile=".\zlibvc.def"
386 GenerateDebugInformation="true"
387 ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb" 379 ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb"
388 GenerateMapFile="true" 380 GenerateMapFile="true"
389 MapFileName="$(OutDir)/zlibwapi.map" 381 MapFileName="$(OutDir)/zlibwapi.map"
390 SubSystem="2" 382 SubSystem="2"
383 OptimizeForWindows98="1"
384 RandomizedBaseAddress="1"
385 DataExecutionPrevention="0"
391 ImportLibrary="$(OutDir)/zlibwapi.lib" 386 ImportLibrary="$(OutDir)/zlibwapi.lib"
392 TargetMachine="17"
393 /> 387 />
394 <Tool 388 <Tool
395 Name="VCALinkTool" 389 Name="VCALinkTool"
@@ -410,20 +404,18 @@
410 Name="VCAppVerifierTool" 404 Name="VCAppVerifierTool"
411 /> 405 />
412 <Tool 406 <Tool
413 Name="VCWebDeploymentTool"
414 />
415 <Tool
416 Name="VCPostBuildEventTool" 407 Name="VCPostBuildEventTool"
417 /> 408 />
418 </Configuration> 409 </Configuration>
419 <Configuration 410 <Configuration
420 Name="Debug|Itanium" 411 Name="ReleaseWithoutAsm|x64"
421 OutputDirectory="ia64\ZlibDll$(ConfigurationName)" 412 OutputDirectory="x64\ZlibDll$(ConfigurationName)"
422 IntermediateDirectory="ia64\ZlibDll$(ConfigurationName)\Tmp" 413 IntermediateDirectory="x64\ZlibDll$(ConfigurationName)\Tmp"
423 ConfigurationType="2" 414 ConfigurationType="2"
424 InheritedPropertySheets="UpgradeFromVC70.vsprops" 415 InheritedPropertySheets="UpgradeFromVC70.vsprops"
425 UseOfMFC="0" 416 UseOfMFC="0"
426 ATLMinimizesCRunTimeLibraryUsage="false" 417 ATLMinimizesCRunTimeLibraryUsage="false"
418 WholeProgramOptimization="1"
427 > 419 >
428 <Tool 420 <Tool
429 Name="VCPreBuildEventTool" 421 Name="VCPreBuildEventTool"
@@ -439,35 +431,37 @@
439 /> 431 />
440 <Tool 432 <Tool
441 Name="VCMIDLTool" 433 Name="VCMIDLTool"
442 PreprocessorDefinitions="_DEBUG" 434 PreprocessorDefinitions="NDEBUG"
443 MkTypLibCompatible="true" 435 MkTypLibCompatible="true"
444 SuppressStartupBanner="true" 436 SuppressStartupBanner="true"
445 TargetEnvironment="2" 437 TargetEnvironment="3"
446 TypeLibraryName="$(OutDir)/zlibvc.tlb" 438 TypeLibraryName="$(OutDir)/zlibvc.tlb"
447 /> 439 />
448 <Tool 440 <Tool
449 Name="VCCLCompilerTool" 441 Name="VCCLCompilerTool"
450 Optimization="0" 442 InlineFunctionExpansion="1"
451 AdditionalIncludeDirectories="..\..\..;..\..\masmx86" 443 AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
452 PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64" 444 PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64"
445 StringPooling="true"
453 ExceptionHandling="0" 446 ExceptionHandling="0"
454 RuntimeLibrary="3" 447 RuntimeLibrary="2"
455 BufferSecurityCheck="false" 448 BufferSecurityCheck="false"
449 EnableFunctionLevelLinking="true"
456 PrecompiledHeaderFile="$(IntDir)/zlibvc.pch" 450 PrecompiledHeaderFile="$(IntDir)/zlibvc.pch"
451 AssemblerOutput="2"
457 AssemblerListingLocation="$(IntDir)\" 452 AssemblerListingLocation="$(IntDir)\"
458 ObjectFile="$(IntDir)\" 453 ObjectFile="$(IntDir)\"
459 ProgramDataBaseFileName="$(OutDir)\" 454 ProgramDataBaseFileName="$(OutDir)\"
460 BrowseInformation="0" 455 BrowseInformation="0"
461 WarningLevel="3" 456 WarningLevel="3"
462 SuppressStartupBanner="true" 457 SuppressStartupBanner="true"
463 DebugInformationFormat="3"
464 /> 458 />
465 <Tool 459 <Tool
466 Name="VCManagedResourceCompilerTool" 460 Name="VCManagedResourceCompilerTool"
467 /> 461 />
468 <Tool 462 <Tool
469 Name="VCResourceCompilerTool" 463 Name="VCResourceCompilerTool"
470 PreprocessorDefinitions="_DEBUG" 464 PreprocessorDefinitions="NDEBUG"
471 Culture="1036" 465 Culture="1036"
472 /> 466 />
473 <Tool 467 <Tool
@@ -476,17 +470,18 @@
476 <Tool 470 <Tool
477 Name="VCLinkerTool" 471 Name="VCLinkerTool"
478 OutputFile="$(OutDir)\zlibwapi.dll" 472 OutputFile="$(OutDir)\zlibwapi.dll"
479 LinkIncremental="2" 473 LinkIncremental="1"
480 SuppressStartupBanner="true" 474 SuppressStartupBanner="true"
481 GenerateManifest="false" 475 GenerateManifest="false"
476 IgnoreAllDefaultLibraries="false"
482 ModuleDefinitionFile=".\zlibvc.def" 477 ModuleDefinitionFile=".\zlibvc.def"
483 GenerateDebugInformation="true"
484 ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb" 478 ProgramDatabaseFile="$(OutDir)/zlibwapi.pdb"
485 GenerateMapFile="true" 479 GenerateMapFile="true"
486 MapFileName="$(OutDir)/zlibwapi.map" 480 MapFileName="$(OutDir)/zlibwapi.map"
487 SubSystem="2" 481 SubSystem="2"
482 OptimizeForWindows98="1"
488 ImportLibrary="$(OutDir)/zlibwapi.lib" 483 ImportLibrary="$(OutDir)/zlibwapi.lib"
489 TargetMachine="5" 484 TargetMachine="17"
490 /> 485 />
491 <Tool 486 <Tool
492 Name="VCALinkTool" 487 Name="VCALinkTool"
@@ -507,16 +502,13 @@
507 Name="VCAppVerifierTool" 502 Name="VCAppVerifierTool"
508 /> 503 />
509 <Tool 504 <Tool
510 Name="VCWebDeploymentTool"
511 />
512 <Tool
513 Name="VCPostBuildEventTool" 505 Name="VCPostBuildEventTool"
514 /> 506 />
515 </Configuration> 507 </Configuration>
516 <Configuration 508 <Configuration
517 Name="ReleaseWithoutAsm|x64" 509 Name="ReleaseWithoutAsm|Itanium"
518 OutputDirectory="x64\ZlibDll$(ConfigurationName)" 510 OutputDirectory="ia64\ZlibDll$(ConfigurationName)"
519 IntermediateDirectory="x64\ZlibDll$(ConfigurationName)\Tmp" 511 IntermediateDirectory="ia64\ZlibDll$(ConfigurationName)\Tmp"
520 ConfigurationType="2" 512 ConfigurationType="2"
521 InheritedPropertySheets="UpgradeFromVC70.vsprops" 513 InheritedPropertySheets="UpgradeFromVC70.vsprops"
522 UseOfMFC="0" 514 UseOfMFC="0"
@@ -540,7 +532,7 @@
540 PreprocessorDefinitions="NDEBUG" 532 PreprocessorDefinitions="NDEBUG"
541 MkTypLibCompatible="true" 533 MkTypLibCompatible="true"
542 SuppressStartupBanner="true" 534 SuppressStartupBanner="true"
543 TargetEnvironment="3" 535 TargetEnvironment="2"
544 TypeLibraryName="$(OutDir)/zlibvc.tlb" 536 TypeLibraryName="$(OutDir)/zlibvc.tlb"
545 /> 537 />
546 <Tool 538 <Tool
@@ -587,7 +579,7 @@
587 SubSystem="2" 579 SubSystem="2"
588 OptimizeForWindows98="1" 580 OptimizeForWindows98="1"
589 ImportLibrary="$(OutDir)/zlibwapi.lib" 581 ImportLibrary="$(OutDir)/zlibwapi.lib"
590 TargetMachine="17" 582 TargetMachine="5"
591 /> 583 />
592 <Tool 584 <Tool
593 Name="VCALinkTool" 585 Name="VCALinkTool"
@@ -608,16 +600,13 @@
608 Name="VCAppVerifierTool" 600 Name="VCAppVerifierTool"
609 /> 601 />
610 <Tool 602 <Tool
611 Name="VCWebDeploymentTool"
612 />
613 <Tool
614 Name="VCPostBuildEventTool" 603 Name="VCPostBuildEventTool"
615 /> 604 />
616 </Configuration> 605 </Configuration>
617 <Configuration 606 <Configuration
618 Name="ReleaseWithoutAsm|Itanium" 607 Name="Release|Win32"
619 OutputDirectory="ia64\ZlibDll$(ConfigurationName)" 608 OutputDirectory="x86\ZlibDll$(ConfigurationName)"
620 IntermediateDirectory="ia64\ZlibDll$(ConfigurationName)\Tmp" 609 IntermediateDirectory="x86\ZlibDll$(ConfigurationName)\Tmp"
621 ConfigurationType="2" 610 ConfigurationType="2"
622 InheritedPropertySheets="UpgradeFromVC70.vsprops" 611 InheritedPropertySheets="UpgradeFromVC70.vsprops"
623 UseOfMFC="0" 612 UseOfMFC="0"
@@ -641,17 +630,17 @@
641 PreprocessorDefinitions="NDEBUG" 630 PreprocessorDefinitions="NDEBUG"
642 MkTypLibCompatible="true" 631 MkTypLibCompatible="true"
643 SuppressStartupBanner="true" 632 SuppressStartupBanner="true"
644 TargetEnvironment="2" 633 TargetEnvironment="1"
645 TypeLibraryName="$(OutDir)/zlibvc.tlb" 634 TypeLibraryName="$(OutDir)/zlibvc.tlb"
646 /> 635 />
647 <Tool 636 <Tool
648 Name="VCCLCompilerTool" 637 Name="VCCLCompilerTool"
649 InlineFunctionExpansion="1" 638 InlineFunctionExpansion="1"
650 AdditionalIncludeDirectories="..\..\..;..\..\masmx86" 639 AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
651 PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64" 640 PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF"
652 StringPooling="true" 641 StringPooling="true"
653 ExceptionHandling="0" 642 ExceptionHandling="0"
654 RuntimeLibrary="2" 643 RuntimeLibrary="0"
655 BufferSecurityCheck="false" 644 BufferSecurityCheck="false"
656 EnableFunctionLevelLinking="true" 645 EnableFunctionLevelLinking="true"
657 PrecompiledHeaderFile="$(IntDir)/zlibvc.pch" 646 PrecompiledHeaderFile="$(IntDir)/zlibvc.pch"
@@ -676,6 +665,8 @@
676 /> 665 />
677 <Tool 666 <Tool
678 Name="VCLinkerTool" 667 Name="VCLinkerTool"
668 AdditionalOptions="/MACHINE:I386"
669 AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj "
679 OutputFile="$(OutDir)\zlibwapi.dll" 670 OutputFile="$(OutDir)\zlibwapi.dll"
680 LinkIncremental="1" 671 LinkIncremental="1"
681 SuppressStartupBanner="true" 672 SuppressStartupBanner="true"
@@ -687,8 +678,9 @@
687 MapFileName="$(OutDir)/zlibwapi.map" 678 MapFileName="$(OutDir)/zlibwapi.map"
688 SubSystem="2" 679 SubSystem="2"
689 OptimizeForWindows98="1" 680 OptimizeForWindows98="1"
681 RandomizedBaseAddress="1"
682 DataExecutionPrevention="0"
690 ImportLibrary="$(OutDir)/zlibwapi.lib" 683 ImportLibrary="$(OutDir)/zlibwapi.lib"
691 TargetMachine="5"
692 /> 684 />
693 <Tool 685 <Tool
694 Name="VCALinkTool" 686 Name="VCALinkTool"
@@ -709,9 +701,6 @@
709 Name="VCAppVerifierTool" 701 Name="VCAppVerifierTool"
710 /> 702 />
711 <Tool 703 <Tool
712 Name="VCWebDeploymentTool"
713 />
714 <Tool
715 Name="VCPostBuildEventTool" 704 Name="VCPostBuildEventTool"
716 /> 705 />
717 </Configuration> 706 </Configuration>
@@ -811,9 +800,6 @@
811 Name="VCAppVerifierTool" 800 Name="VCAppVerifierTool"
812 /> 801 />
813 <Tool 802 <Tool
814 Name="VCWebDeploymentTool"
815 />
816 <Tool
817 Name="VCPostBuildEventTool" 803 Name="VCPostBuildEventTool"
818 /> 804 />
819 </Configuration> 805 </Configuration>
@@ -912,9 +898,6 @@
912 Name="VCAppVerifierTool" 898 Name="VCAppVerifierTool"
913 /> 899 />
914 <Tool 900 <Tool
915 Name="VCWebDeploymentTool"
916 />
917 <Tool
918 Name="VCPostBuildEventTool" 901 Name="VCPostBuildEventTool"
919 /> 902 />
920 </Configuration> 903 </Configuration>
@@ -943,71 +926,11 @@
943 > 926 >
944 </File> 927 </File>
945 <File 928 <File
946 RelativePath="..\..\masmx86\gvmat32c.c"
947 >
948 <FileConfiguration
949 Name="ReleaseWithoutAsm|Win32"
950 ExcludedFromBuild="true"
951 >
952 <Tool
953 Name="VCCLCompilerTool"
954 />
955 </FileConfiguration>
956 <FileConfiguration
957 Name="Debug|x64"
958 ExcludedFromBuild="true"
959 >
960 <Tool
961 Name="VCCLCompilerTool"
962 />
963 </FileConfiguration>
964 <FileConfiguration
965 Name="Debug|Itanium"
966 ExcludedFromBuild="true"
967 >
968 <Tool
969 Name="VCCLCompilerTool"
970 />
971 </FileConfiguration>
972 <FileConfiguration
973 Name="ReleaseWithoutAsm|x64"
974 ExcludedFromBuild="true"
975 >
976 <Tool
977 Name="VCCLCompilerTool"
978 />
979 </FileConfiguration>
980 <FileConfiguration
981 Name="ReleaseWithoutAsm|Itanium"
982 ExcludedFromBuild="true"
983 >
984 <Tool
985 Name="VCCLCompilerTool"
986 />
987 </FileConfiguration>
988 <FileConfiguration
989 Name="Release|x64"
990 ExcludedFromBuild="true"
991 >
992 <Tool
993 Name="VCCLCompilerTool"
994 />
995 </FileConfiguration>
996 <FileConfiguration
997 Name="Release|Itanium"
998 ExcludedFromBuild="true"
999 >
1000 <Tool
1001 Name="VCCLCompilerTool"
1002 />
1003 </FileConfiguration>
1004 </File>
1005 <File
1006 RelativePath="..\..\..\gzclose.c" 929 RelativePath="..\..\..\gzclose.c"
1007 > 930 >
1008 </File> 931 </File>
1009 <File 932 <File
1010 RelativePath="..\..\..\gzio.c" 933 RelativePath="..\..\..\gzguts.h"
1011 > 934 >
1012 </File> 935 </File>
1013 <File 936 <File
@@ -1038,7 +961,7 @@
1038 /> 961 />
1039 </FileConfiguration> 962 </FileConfiguration>
1040 <FileConfiguration 963 <FileConfiguration
1041 Name="ReleaseWithoutAsm|Win32" 964 Name="Debug|Itanium"
1042 ExcludedFromBuild="true" 965 ExcludedFromBuild="true"
1043 > 966 >
1044 <Tool 967 <Tool
@@ -1046,7 +969,7 @@
1046 /> 969 />
1047 </FileConfiguration> 970 </FileConfiguration>
1048 <FileConfiguration 971 <FileConfiguration
1049 Name="Release|Win32" 972 Name="ReleaseWithoutAsm|Win32"
1050 ExcludedFromBuild="true" 973 ExcludedFromBuild="true"
1051 > 974 >
1052 <Tool 975 <Tool
@@ -1054,7 +977,7 @@
1054 /> 977 />
1055 </FileConfiguration> 978 </FileConfiguration>
1056 <FileConfiguration 979 <FileConfiguration
1057 Name="Debug|Itanium" 980 Name="ReleaseWithoutAsm|Itanium"
1058 ExcludedFromBuild="true" 981 ExcludedFromBuild="true"
1059 > 982 >
1060 <Tool 983 <Tool
@@ -1062,7 +985,7 @@
1062 /> 985 />
1063 </FileConfiguration> 986 </FileConfiguration>
1064 <FileConfiguration 987 <FileConfiguration
1065 Name="ReleaseWithoutAsm|Itanium" 988 Name="Release|Win32"
1066 ExcludedFromBuild="true" 989 ExcludedFromBuild="true"
1067 > 990 >
1068 <Tool 991 <Tool
diff --git a/deflate.c b/deflate.c
index 414a67a..fcd698c 100644
--- a/deflate.c
+++ b/deflate.c
@@ -52,7 +52,7 @@
52#include "deflate.h" 52#include "deflate.h"
53 53
54const char deflate_copyright[] = 54const char deflate_copyright[] =
55 " deflate 1.2.3.9 Copyright 1995-2010 Jean-loup Gailly and Mark Adler "; 55 " deflate 1.2.4 Copyright 1995-2010 Jean-loup Gailly and Mark Adler ";
56/* 56/*
57 If you use the zlib library in a product, an acknowledgment is welcome 57 If you use the zlib library in a product, an acknowledgment is welcome
58 in the documentation of your product. If for some reason you cannot 58 in the documentation of your product. If for some reason you cannot
@@ -1433,21 +1433,21 @@ local void fill_window(s)
1433 * Flush the current block, with given end-of-file flag. 1433 * Flush the current block, with given end-of-file flag.
1434 * IN assertion: strstart is set to the end of the current match. 1434 * IN assertion: strstart is set to the end of the current match.
1435 */ 1435 */
1436#define FLUSH_BLOCK_ONLY(s, eof) { \ 1436#define FLUSH_BLOCK_ONLY(s, last) { \
1437 _tr_flush_block(s, (s->block_start >= 0L ? \ 1437 _tr_flush_block(s, (s->block_start >= 0L ? \
1438 (charf *)&s->window[(unsigned)s->block_start] : \ 1438 (charf *)&s->window[(unsigned)s->block_start] : \
1439 (charf *)Z_NULL), \ 1439 (charf *)Z_NULL), \
1440 (ulg)((long)s->strstart - s->block_start), \ 1440 (ulg)((long)s->strstart - s->block_start), \
1441 (eof)); \ 1441 (last)); \
1442 s->block_start = s->strstart; \ 1442 s->block_start = s->strstart; \
1443 flush_pending(s->strm); \ 1443 flush_pending(s->strm); \
1444 Tracev((stderr,"[FLUSH]")); \ 1444 Tracev((stderr,"[FLUSH]")); \
1445} 1445}
1446 1446
1447/* Same but force premature exit if necessary. */ 1447/* Same but force premature exit if necessary. */
1448#define FLUSH_BLOCK(s, eof) { \ 1448#define FLUSH_BLOCK(s, last) { \
1449 FLUSH_BLOCK_ONLY(s, eof); \ 1449 FLUSH_BLOCK_ONLY(s, last); \
1450 if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \ 1450 if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
1451} 1451}
1452 1452
1453/* =========================================================================== 1453/* ===========================================================================
diff --git a/deflate.h b/deflate.h
index f1df04c..f53deba 100644
--- a/deflate.h
+++ b/deflate.h
@@ -293,10 +293,10 @@ typedef struct internal_state {
293void _tr_init OF((deflate_state *s)); 293void _tr_init OF((deflate_state *s));
294int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); 294int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
295void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, 295void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len,
296 int eof)); 296 int last));
297void _tr_align OF((deflate_state *s)); 297void _tr_align OF((deflate_state *s));
298void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, 298void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
299 int eof)); 299 int last));
300 300
301#define d_code(dist) \ 301#define d_code(dist) \
302 ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) 302 ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
diff --git a/gzlib.c b/gzlib.c
index 03240b1..6fdb08a 100644
--- a/gzlib.c
+++ b/gzlib.c
@@ -147,6 +147,14 @@ local gzFile gz_open(path, fd, mode)
147 return NULL; 147 return NULL;
148 } 148 }
149 149
150 /* save the path name for error messages */
151 state->path = malloc(strlen(path) + 1);
152 if (state->path == NULL) {
153 free(state);
154 return NULL;
155 }
156 strcpy(state->path, path);
157
150 /* open the file with the appropriate mode (or just use fd) */ 158 /* open the file with the appropriate mode (or just use fd) */
151 state->fd = fd != -1 ? fd : 159 state->fd = fd != -1 ? fd :
152 open(path, 160 open(path,
@@ -170,14 +178,6 @@ local gzFile gz_open(path, fd, mode)
170 if (state->mode == GZ_APPEND) 178 if (state->mode == GZ_APPEND)
171 state->mode = GZ_WRITE; /* simplify later checks */ 179 state->mode = GZ_WRITE; /* simplify later checks */
172 180
173 /* save the path name for error messages */
174 state->path = malloc(strlen(path) + 1);
175 if (state->path == NULL) {
176 free(state);
177 return NULL;
178 }
179 strcpy(state->path, path);
180
181 /* save the current position for rewinding (only if reading) */ 181 /* save the current position for rewinding (only if reading) */
182 if (state->mode == GZ_READ) { 182 if (state->mode == GZ_READ) {
183 state->start = LSEEK(state->fd, 0, SEEK_CUR); 183 state->start = LSEEK(state->fd, 0, SEEK_CUR);
@@ -450,7 +450,8 @@ const char * ZEXPORT gzerror(file, errnum)
450 return NULL; 450 return NULL;
451 451
452 /* return error information */ 452 /* return error information */
453 *errnum = state->err; 453 if (errnum != NULL)
454 *errnum = state->err;
454 return state->msg == NULL ? "" : state->msg; 455 return state->msg == NULL ? "" : state->msg;
455} 456}
456 457
diff --git a/gzread.c b/gzread.c
index 7f68055..434ef02 100644
--- a/gzread.c
+++ b/gzread.c
@@ -645,6 +645,7 @@ int ZEXPORT gzclose_r(file)
645 free(state->in); 645 free(state->in);
646 } 646 }
647 gz_error(state, Z_OK, NULL); 647 gz_error(state, Z_OK, NULL);
648 free(state->path);
648 ret = close(state->fd); 649 ret = close(state->fd);
649 free(state); 650 free(state);
650 return ret ? Z_ERRNO : Z_OK; 651 return ret ? Z_ERRNO : Z_OK;
diff --git a/gzwrite.c b/gzwrite.c
index 844312a..427840d 100644
--- a/gzwrite.c
+++ b/gzwrite.c
@@ -523,8 +523,9 @@ int ZEXPORT gzclose_w(file)
523 (void)deflateEnd(&(state->strm)); 523 (void)deflateEnd(&(state->strm));
524 free(state->out); 524 free(state->out);
525 free(state->in); 525 free(state->in);
526 ret += close(state->fd);
527 gz_error(state, Z_OK, NULL); 526 gz_error(state, Z_OK, NULL);
527 free(state->path);
528 ret += close(state->fd);
528 free(state); 529 free(state);
529 return ret ? Z_ERRNO : Z_OK; 530 return ret ? Z_ERRNO : Z_OK;
530} 531}
diff --git a/inftrees.c b/inftrees.c
index b766799..3ee7d06 100644
--- a/inftrees.c
+++ b/inftrees.c
@@ -9,7 +9,7 @@
9#define MAXBITS 15 9#define MAXBITS 15
10 10
11const char inflate_copyright[] = 11const char inflate_copyright[] =
12 " inflate 1.2.3.9 Copyright 1995-2010 Mark Adler "; 12 " inflate 1.2.4 Copyright 1995-2010 Mark Adler ";
13/* 13/*
14 If you use the zlib library in a product, an acknowledgment is welcome 14 If you use the zlib library in a product, an acknowledgment is welcome
15 in the documentation of your product. If for some reason you cannot 15 in the documentation of your product. If for some reason you cannot
@@ -62,7 +62,7 @@ unsigned short FAR *work;
62 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; 62 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
63 static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 63 static const unsigned short lext[31] = { /* Length codes 257..285 extra */
64 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 64 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
65 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 193, 201}; 65 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 66, 199};
66 static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 66 static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
67 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 67 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
68 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 68 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
diff --git a/make_vms.com b/make_vms.com
index f35a48f..deee87f 100644
--- a/make_vms.com
+++ b/make_vms.com
@@ -13,8 +13,10 @@ $! 0.01 20060120 First version to receive a number
13$! 0.02 20061008 Adapt to new Makefile.in 13$! 0.02 20061008 Adapt to new Makefile.in
14$! 0.03 20091224 Add support for large file check 14$! 0.03 20091224 Add support for large file check
15$! 0.04 20100110 Add new gzclose, gzlib, gzread, gzwrite 15$! 0.04 20100110 Add new gzclose, gzlib, gzread, gzwrite
16$! 0.05 20100221 Exchange zlibdefs.h by zconf.h.in
16$! 17$!
17$ on error then goto err_exit 18$ on error then goto err_exit
19$ set proc/parse=ext
18$! 20$!
19$ true = 1 21$ true = 1
20$ false = 0 22$ false = 0
@@ -38,7 +40,7 @@ $ v_file = "zlib.h"
38$ ccopt = "" 40$ ccopt = ""
39$ lopts = "" 41$ lopts = ""
40$ dnsrl = "" 42$ dnsrl = ""
41$ aconf_in_file = "config.hin" 43$ aconf_in_file = "zconf.h.in#zconf.h_in"
42$ conf_check_string = "" 44$ conf_check_string = ""
43$ linkonly = false 45$ linkonly = false
44$ optfile = name + ".opt" 46$ optfile = name + ".opt"
@@ -104,13 +106,16 @@ $ i = i + 1
104$ goto find_aconf 106$ goto find_aconf
105$ endif 107$ endif
106$ open/read/err=aconf_err aconf_in 'fname' 108$ open/read/err=aconf_err aconf_in 'fname'
107$ open/write aconf zlibdefs.h 109$ open/write aconf zconf.h
108$ACONF_LOOP: 110$ACONF_LOOP:
109$ read/end_of_file=aconf_exit aconf_in line 111$ read/end_of_file=aconf_exit aconf_in line
110$ work = f$edit(line, "compress,trim") 112$ work = f$edit(line, "compress,trim")
111$ if f$extract(0,6,work) .nes. "#undef" 113$ if f$extract(0,6,work) .nes. "#undef"
112$ then 114$ then
113$ write aconf line 115$ if f$extract(0,12,work) .nes. "#cmakedefine"
116$ then
117$ write aconf line
118$ endif
114$ else 119$ else
115$ cdef = f$element(1," ",work) 120$ cdef = f$element(1," ",work)
116$ gosub check_config 121$ gosub check_config
diff --git a/minigzip.c b/minigzip.c
index 9d18266..84d823b 100644
--- a/minigzip.c
+++ b/minigzip.c
@@ -262,6 +262,11 @@ void file_compress(file, mode)
262 FILE *in; 262 FILE *in;
263 gzFile out; 263 gzFile out;
264 264
265 if (strlen(file) + strlen(GZ_SUFFIX) >= sizeof(outfile)) {
266 fprintf(stderr, "%s: filename too long\n", prog);
267 exit(1);
268 }
269
265 strcpy(outfile, file); 270 strcpy(outfile, file);
266 strcat(outfile, GZ_SUFFIX); 271 strcat(outfile, GZ_SUFFIX);
267 272
@@ -291,7 +296,12 @@ void file_uncompress(file)
291 char *infile, *outfile; 296 char *infile, *outfile;
292 FILE *out; 297 FILE *out;
293 gzFile in; 298 gzFile in;
294 uInt len = (uInt)strlen(file); 299 size_t len = strlen(file);
300
301 if (len + strlen(GZ_SUFFIX) >= sizeof(buf)) {
302 fprintf(stderr, "%s: filename too long\n", prog);
303 exit(1);
304 }
295 305
296 strcpy(buf, file); 306 strcpy(buf, file);
297 307
@@ -322,7 +332,8 @@ void file_uncompress(file)
322 332
323 333
324/* =========================================================================== 334/* ===========================================================================
325 * Usage: minigzip [-d] [-f] [-h] [-r] [-1 to -9] [files...] 335 * Usage: minigzip [-c] [-d] [-f] [-h] [-r] [-1 to -9] [files...]
336 * -c : write to standard output
326 * -d : decompress 337 * -d : decompress
327 * -f : compress with Z_FILTERED 338 * -f : compress with Z_FILTERED
328 * -h : compress with Z_HUFFMAN_ONLY 339 * -h : compress with Z_HUFFMAN_ONLY
@@ -334,17 +345,30 @@ int main(argc, argv)
334 int argc; 345 int argc;
335 char *argv[]; 346 char *argv[];
336{ 347{
348 int copyout = 0;
337 int uncompr = 0; 349 int uncompr = 0;
338 gzFile file; 350 gzFile file;
339 char outmode[20]; 351 char *bname, outmode[20];
340 352
341 strcpy(outmode, "wb6 "); 353 strcpy(outmode, "wb6 ");
342 354
343 prog = argv[0]; 355 prog = argv[0];
356 bname = strrchr(argv[0], '/');
357 if (bname)
358 bname++;
359 else
360 bname = argv[0];
344 argc--, argv++; 361 argc--, argv++;
345 362
363 if (!strcmp(bname, "gunzip"))
364 uncompr = 1;
365 else if (!strcmp(bname, "zcat"))
366 copyout = uncompr = 1;
367
346 while (argc > 0) { 368 while (argc > 0) {
347 if (strcmp(*argv, "-d") == 0) 369 if (strcmp(*argv, "-c") == 0)
370 copyout = 1;
371 else if (strcmp(*argv, "-d") == 0)
348 uncompr = 1; 372 uncompr = 1;
349 else if (strcmp(*argv, "-f") == 0) 373 else if (strcmp(*argv, "-f") == 0)
350 outmode[3] = 'f'; 374 outmode[3] = 'f';
@@ -374,11 +398,36 @@ int main(argc, argv)
374 gz_compress(stdin, file); 398 gz_compress(stdin, file);
375 } 399 }
376 } else { 400 } else {
401 if (copyout) {
402 SET_BINARY_MODE(stdout);
403 }
377 do { 404 do {
378 if (uncompr) { 405 if (uncompr) {
379 file_uncompress(*argv); 406 if (copyout) {
407 file = gzopen(*argv, "rb");
408 if (file == NULL)
409 fprintf(stderr, "%s: can't gzopen %s\n", prog, *argv);
410 else
411 gz_uncompress(file, stdout);
412 } else {
413 file_uncompress(*argv);
414 }
380 } else { 415 } else {
381 file_compress(*argv, outmode); 416 if (copyout) {
417 FILE * in = fopen(*argv, "rb");
418
419 if (in == NULL) {
420 perror(*argv);
421 } else {
422 file = gzdopen(fileno(stdout), outmode);
423 if (file == NULL) error("can't gzdopen stdout");
424
425 gz_compress(in, file);
426 }
427
428 } else {
429 file_compress(*argv, outmode);
430 }
382 } 431 }
383 } while (argv++, --argc); 432 } while (argv++, --argc);
384 } 433 }
diff --git a/qnx/package.qpg b/qnx/package.qpg
index fea73cc..470d2d5 100644
--- a/qnx/package.qpg
+++ b/qnx/package.qpg
@@ -25,10 +25,10 @@
25 <QPG:Files> 25 <QPG:Files>
26 <QPG:Add file="../zconf.h" install="/opt/include/" user="root:sys" permission="644"/> 26 <QPG:Add file="../zconf.h" install="/opt/include/" user="root:sys" permission="644"/>
27 <QPG:Add file="../zlib.h" install="/opt/include/" user="root:sys" permission="644"/> 27 <QPG:Add file="../zlib.h" install="/opt/include/" user="root:sys" permission="644"/>
28 <QPG:Add file="../libz.so.1.2.3.9" install="/opt/lib/" user="root:bin" permission="644"/> 28 <QPG:Add file="../libz.so.1.2.4" install="/opt/lib/" user="root:bin" permission="644"/>
29 <QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.3.9"/> 29 <QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.4"/>
30 <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.3.9"/> 30 <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.4"/>
31 <QPG:Add file="../libz.so.1.2.3.9" install="/opt/lib/" component="slib"/> 31 <QPG:Add file="../libz.so.1.2.4" install="/opt/lib/" component="slib"/>
32 </QPG:Files> 32 </QPG:Files>
33 33
34 <QPG:PackageFilter> 34 <QPG:PackageFilter>
@@ -63,7 +63,7 @@
63 </QPM:ProductDescription> 63 </QPM:ProductDescription>
64 64
65 <QPM:ReleaseDescription> 65 <QPM:ReleaseDescription>
66 <QPM:ReleaseVersion>1.2.3.9</QPM:ReleaseVersion> 66 <QPM:ReleaseVersion>1.2.4</QPM:ReleaseVersion>
67 <QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency> 67 <QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
68 <QPM:ReleaseStability>Stable</QPM:ReleaseStability> 68 <QPM:ReleaseStability>Stable</QPM:ReleaseStability>
69 <QPM:ReleaseNoteMinor></QPM:ReleaseNoteMinor> 69 <QPM:ReleaseNoteMinor></QPM:ReleaseNoteMinor>
diff --git a/treebuild.xml b/treebuild.xml
index f81b449..91ee891 100644
--- a/treebuild.xml
+++ b/treebuild.xml
@@ -1,6 +1,6 @@
1<?xml version="1.0" ?> 1<?xml version="1.0" ?>
2<package name="zlib" version="1.2.3"> 2<package name="zlib" version="1.2.4">
3 <library name="zlib" dlversion="1.2.3" dlname="z"> 3 <library name="zlib" dlversion="1.2.4" dlname="z">
4 <property name="description"> zip compression library </property> 4 <property name="description"> zip compression library </property>
5 <property name="include-target-dir" value="$(@PACKAGE/install-includedir)" /> 5 <property name="include-target-dir" value="$(@PACKAGE/install-includedir)" />
6 6
diff --git a/trees.c b/trees.c
index aa599a5..1a6e997 100644
--- a/trees.c
+++ b/trees.c
@@ -867,13 +867,13 @@ local void send_all_trees(s, lcodes, dcodes, blcodes)
867/* =========================================================================== 867/* ===========================================================================
868 * Send a stored block 868 * Send a stored block
869 */ 869 */
870void _tr_stored_block(s, buf, stored_len, eof) 870void _tr_stored_block(s, buf, stored_len, last)
871 deflate_state *s; 871 deflate_state *s;
872 charf *buf; /* input block */ 872 charf *buf; /* input block */
873 ulg stored_len; /* length of input block */ 873 ulg stored_len; /* length of input block */
874 int eof; /* true if this is the last block for a file */ 874 int last; /* one if this is the last block for a file */
875{ 875{
876 send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */ 876 send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */
877#ifdef DEBUG 877#ifdef DEBUG
878 s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; 878 s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
879 s->compressed_len += (stored_len + 4) << 3; 879 s->compressed_len += (stored_len + 4) << 3;
@@ -921,11 +921,11 @@ void _tr_align(s)
921 * Determine the best encoding for the current block: dynamic trees, static 921 * Determine the best encoding for the current block: dynamic trees, static
922 * trees or store, and output the encoded block to the zip file. 922 * trees or store, and output the encoded block to the zip file.
923 */ 923 */
924void _tr_flush_block(s, buf, stored_len, eof) 924void _tr_flush_block(s, buf, stored_len, last)
925 deflate_state *s; 925 deflate_state *s;
926 charf *buf; /* input block, or NULL if too old */ 926 charf *buf; /* input block, or NULL if too old */
927 ulg stored_len; /* length of input block */ 927 ulg stored_len; /* length of input block */
928 int eof; /* true if this is the last block for a file */ 928 int last; /* one if this is the last block for a file */
929{ 929{
930 ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ 930 ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
931 int max_blindex = 0; /* index of last bit length code of non zero freq */ 931 int max_blindex = 0; /* index of last bit length code of non zero freq */
@@ -981,20 +981,20 @@ void _tr_flush_block(s, buf, stored_len, eof)
981 * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to 981 * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
982 * transform a block into a stored block. 982 * transform a block into a stored block.
983 */ 983 */
984 _tr_stored_block(s, buf, stored_len, eof); 984 _tr_stored_block(s, buf, stored_len, last);
985 985
986#ifdef FORCE_STATIC 986#ifdef FORCE_STATIC
987 } else if (static_lenb >= 0) { /* force static trees */ 987 } else if (static_lenb >= 0) { /* force static trees */
988#else 988#else
989 } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) { 989 } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
990#endif 990#endif
991 send_bits(s, (STATIC_TREES<<1)+eof, 3); 991 send_bits(s, (STATIC_TREES<<1)+last, 3);
992 compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree); 992 compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
993#ifdef DEBUG 993#ifdef DEBUG
994 s->compressed_len += 3 + s->static_len; 994 s->compressed_len += 3 + s->static_len;
995#endif 995#endif
996 } else { 996 } else {
997 send_bits(s, (DYN_TREES<<1)+eof, 3); 997 send_bits(s, (DYN_TREES<<1)+last, 3);
998 send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, 998 send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
999 max_blindex+1); 999 max_blindex+1);
1000 compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree); 1000 compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
@@ -1008,14 +1008,14 @@ void _tr_flush_block(s, buf, stored_len, eof)
1008 */ 1008 */
1009 init_block(s); 1009 init_block(s);
1010 1010
1011 if (eof) { 1011 if (last) {
1012 bi_windup(s); 1012 bi_windup(s);
1013#ifdef DEBUG 1013#ifdef DEBUG
1014 s->compressed_len += 7; /* align on byte boundary */ 1014 s->compressed_len += 7; /* align on byte boundary */
1015#endif 1015#endif
1016 } 1016 }
1017 Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, 1017 Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
1018 s->compressed_len-7*eof)); 1018 s->compressed_len-7*last));
1019} 1019}
1020 1020
1021/* =========================================================================== 1021/* ===========================================================================
diff --git a/win32/Makefile.gcc b/win32/Makefile.gcc
index 97571c2..abe3d5a 100644
--- a/win32/Makefile.gcc
+++ b/win32/Makefile.gcc
@@ -25,7 +25,7 @@
25 25
26STATICLIB = libz.a 26STATICLIB = libz.a
27SHAREDLIB = zlib1.dll 27SHAREDLIB = zlib1.dll
28IMPLIB = libz.dll.a 28IMPLIB = libzdll.a
29 29
30#LOC = -DASMV 30#LOC = -DASMV
31#LOC = -DDEBUG -g 31#LOC = -DDEBUG -g
diff --git a/win32/Makefile.msc b/win32/Makefile.msc
index 3722b23..a731c0c 100644
--- a/win32/Makefile.msc
+++ b/win32/Makefile.msc
@@ -21,10 +21,10 @@ AS = ml
21LD = link 21LD = link
22AR = lib 22AR = lib
23RC = rc 23RC = rc
24CFLAGS = -nologo -MD -O2 -Oy- $(LOC) 24CFLAGS = -nologo -MD -W3 -O2 -Oy- -Zi -Fd"zlib" $(LOC)
25WFLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE 25WFLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
26ASFLAGS = -coff 26ASFLAGS = -coff -Zi
27LDFLAGS = -nologo -debug -release 27LDFLAGS = -nologo -debug -incremental:no -opt:ref
28ARFLAGS = -nologo 28ARFLAGS = -nologo
29RCFLAGS = /dWIN32 /r 29RCFLAGS = /dWIN32 /r
30 30
@@ -44,7 +44,7 @@ $(IMPLIB): $(SHAREDLIB)
44 44
45$(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlib1.res 45$(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlib1.res
46 $(LD) $(LDFLAGS) -def:win32/zlib.def -dll -implib:$(IMPLIB) \ 46 $(LD) $(LDFLAGS) -def:win32/zlib.def -dll -implib:$(IMPLIB) \
47 -out:$@ $(OBJS) $(OBJA) zlib1.res 47 -out:$@ -base:0x5A4C0000 $(OBJS) $(OBJA) zlib1.res
48 if exist $@.manifest \ 48 if exist $@.manifest \
49 mt -nologo -manifest $@.manifest -outputresource:$@;2 49 mt -nologo -manifest $@.manifest -outputresource:$@;2
50 50
diff --git a/zconf.h b/zconf.h
new file mode 100644
index 0000000..5888024
--- /dev/null
+++ b/zconf.h
@@ -0,0 +1,416 @@
1/* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-2010 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/* @(#) $Id$ */
7
8#ifndef ZCONF_H
9#define ZCONF_H
10
11/*
12 * If you *really* need a unique prefix for all types and library functions,
13 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
14 * Even better than compiling with -DZ_PREFIX would be to use configure to set
15 * this permanently in zconf.h using "./configure --zprefix".
16 */
17#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
18
19/* all linked symbols */
20# define _dist_code z__dist_code
21# define _length_code z__length_code
22# define _tr_align z__tr_align
23# define _tr_flush_block z__tr_flush_block
24# define _tr_init z__tr_init
25# define _tr_stored_block z__tr_stored_block
26# define _tr_tally z__tr_tally
27# define adler32 z_adler32
28# define adler32_combine z_adler32_combine
29# define adler32_combine64 z_adler32_combine64
30# define compress z_compress
31# define compress2 z_compress2
32# define compressBound z_compressBound
33# define crc32 z_crc32
34# define crc32_combine z_crc32_combine
35# define crc32_combine64 z_crc32_combine64
36# define deflate z_deflate
37# define deflateBound z_deflateBound
38# define deflateCopy z_deflateCopy
39# define deflateEnd z_deflateEnd
40# define deflateInit2_ z_deflateInit2_
41# define deflateInit_ z_deflateInit_
42# define deflateParams z_deflateParams
43# define deflatePrime z_deflatePrime
44# define deflateReset z_deflateReset
45# define deflateSetDictionary z_deflateSetDictionary
46# define deflateSetHeader z_deflateSetHeader
47# define deflateTune z_deflateTune
48# define deflate_copyright z_deflate_copyright
49# define get_crc_table z_get_crc_table
50# define gz_error z_gz_error
51# define gz_intmax z_gz_intmax
52# define gz_strwinerror z_gz_strwinerror
53# define gzbuffer z_gzbuffer
54# define gzclearerr z_gzclearerr
55# define gzclose z_gzclose
56# define gzclose_r z_gzclose_r
57# define gzclose_w z_gzclose_w
58# define gzdirect z_gzdirect
59# define gzdopen z_gzdopen
60# define gzeof z_gzeof
61# define gzerror z_gzerror
62# define gzflush z_gzflush
63# define gzgetc z_gzgetc
64# define gzgets z_gzgets
65# define gzoffset z_gzoffset
66# define gzoffset64 z_gzoffset64
67# define gzopen z_gzopen
68# define gzopen64 z_gzopen64
69# define gzprintf z_gzprintf
70# define gzputc z_gzputc
71# define gzputs z_gzputs
72# define gzread z_gzread
73# define gzrewind z_gzrewind
74# define gzseek z_gzseek
75# define gzseek64 z_gzseek64
76# define gzsetparams z_gzsetparams
77# define gztell z_gztell
78# define gztell64 z_gztell64
79# define gzungetc z_gzungetc
80# define gzwrite z_gzwrite
81# define inflate z_inflate
82# define inflateBack z_inflateBack
83# define inflateBackEnd z_inflateBackEnd
84# define inflateBackInit_ z_inflateBackInit_
85# define inflateCopy z_inflateCopy
86# define inflateEnd z_inflateEnd
87# define inflateGetHeader z_inflateGetHeader
88# define inflateInit2_ z_inflateInit2_
89# define inflateInit_ z_inflateInit_
90# define inflateMark z_inflateMark
91# define inflatePrime z_inflatePrime
92# define inflateReset z_inflateReset
93# define inflateReset2 z_inflateReset2
94# define inflateSetDictionary z_inflateSetDictionary
95# define inflateSync z_inflateSync
96# define inflateSyncPoint z_inflateSyncPoint
97# define inflateUndermine z_inflateUndermine
98# define inflate_copyright z_inflate_copyright
99# define inflate_fast z_inflate_fast
100# define inflate_table z_inflate_table
101# define uncompress z_uncompress
102# define zError z_zError
103# define zcalloc z_zcalloc
104# define zcfree z_zcfree
105# define zlibCompileFlags z_zlibCompileFlags
106# define zlibVersion z_zlibVersion
107
108/* all zlib typedefs in zlib.h and zconf.h */
109# define Byte z_Byte
110# define Bytef z_Bytef
111# define alloc_func z_alloc_func
112# define charf z_charf
113# define free_func z_free_func
114# define gzFile z_gzFile
115# define gz_header z_gz_header
116# define gz_headerp z_gz_headerp
117# define in_func z_in_func
118# define intf z_intf
119# define out_func z_out_func
120# define uInt z_uInt
121# define uIntf z_uIntf
122# define uLong z_uLong
123# define uLongf z_uLongf
124# define voidp z_voidp
125# define voidpc z_voidpc
126# define voidpf z_voidpf
127
128/* all zlib structs in zlib.h and zconf.h */
129# define gz_header_s z_gz_header_s
130# define internal_state z_internal_state
131
132#endif
133
134#if defined(__MSDOS__) && !defined(MSDOS)
135# define MSDOS
136#endif
137#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
138# define OS2
139#endif
140#if defined(_WINDOWS) && !defined(WINDOWS)
141# define WINDOWS
142#endif
143#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
144# ifndef WIN32
145# define WIN32
146# endif
147#endif
148#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
149# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
150# ifndef SYS16BIT
151# define SYS16BIT
152# endif
153# endif
154#endif
155
156/*
157 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
158 * than 64k bytes at a time (needed on systems with 16-bit int).
159 */
160#ifdef SYS16BIT
161# define MAXSEG_64K
162#endif
163#ifdef MSDOS
164# define UNALIGNED_OK
165#endif
166
167#ifdef __STDC_VERSION__
168# ifndef STDC
169# define STDC
170# endif
171# if __STDC_VERSION__ >= 199901L
172# ifndef STDC99
173# define STDC99
174# endif
175# endif
176#endif
177#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
178# define STDC
179#endif
180#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
181# define STDC
182#endif
183#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
184# define STDC
185#endif
186#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
187# define STDC
188#endif
189
190#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
191# define STDC
192#endif
193
194#ifndef STDC
195# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
196# define const /* note: need a more gentle solution here */
197# endif
198#endif
199
200/* Some Mac compilers merge all .h files incorrectly: */
201#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
202# define NO_DUMMY_DECL
203#endif
204
205/* Maximum value for memLevel in deflateInit2 */
206#ifndef MAX_MEM_LEVEL
207# ifdef MAXSEG_64K
208# define MAX_MEM_LEVEL 8
209# else
210# define MAX_MEM_LEVEL 9
211# endif
212#endif
213
214/* Maximum value for windowBits in deflateInit2 and inflateInit2.
215 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
216 * created by gzip. (Files created by minigzip can still be extracted by
217 * gzip.)
218 */
219#ifndef MAX_WBITS
220# define MAX_WBITS 15 /* 32K LZ77 window */
221#endif
222
223/* The memory requirements for deflate are (in bytes):
224 (1 << (windowBits+2)) + (1 << (memLevel+9))
225 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
226 plus a few kilobytes for small objects. For example, if you want to reduce
227 the default memory requirements from 256K to 128K, compile with
228 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
229 Of course this will generally degrade compression (there's no free lunch).
230
231 The memory requirements for inflate are (in bytes) 1 << windowBits
232 that is, 32K for windowBits=15 (default value) plus a few kilobytes
233 for small objects.
234*/
235
236 /* Type declarations */
237
238#ifndef OF /* function prototypes */
239# ifdef STDC
240# define OF(args) args
241# else
242# define OF(args) ()
243# endif
244#endif
245
246/* The following definitions for FAR are needed only for MSDOS mixed
247 * model programming (small or medium model with some far allocations).
248 * This was tested only with MSC; for other MSDOS compilers you may have
249 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
250 * just define FAR to be empty.
251 */
252#ifdef SYS16BIT
253# if defined(M_I86SM) || defined(M_I86MM)
254 /* MSC small or medium model */
255# define SMALL_MEDIUM
256# ifdef _MSC_VER
257# define FAR _far
258# else
259# define FAR far
260# endif
261# endif
262# if (defined(__SMALL__) || defined(__MEDIUM__))
263 /* Turbo C small or medium model */
264# define SMALL_MEDIUM
265# ifdef __BORLANDC__
266# define FAR _far
267# else
268# define FAR far
269# endif
270# endif
271#endif
272
273#if defined(WINDOWS) || defined(WIN32)
274 /* If building or using zlib as a DLL, define ZLIB_DLL.
275 * This is not mandatory, but it offers a little performance increase.
276 */
277# ifdef ZLIB_DLL
278# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
279# ifdef ZLIB_INTERNAL
280# define ZEXTERN extern __declspec(dllexport)
281# else
282# define ZEXTERN extern __declspec(dllimport)
283# endif
284# endif
285# endif /* ZLIB_DLL */
286 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
287 * define ZLIB_WINAPI.
288 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
289 */
290# ifdef ZLIB_WINAPI
291# ifdef FAR
292# undef FAR
293# endif
294# include <windows.h>
295 /* No need for _export, use ZLIB.DEF instead. */
296 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
297# define ZEXPORT WINAPI
298# ifdef WIN32
299# define ZEXPORTVA WINAPIV
300# else
301# define ZEXPORTVA FAR CDECL
302# endif
303# endif
304#endif
305
306#if defined (__BEOS__)
307# ifdef ZLIB_DLL
308# ifdef ZLIB_INTERNAL
309# define ZEXPORT __declspec(dllexport)
310# define ZEXPORTVA __declspec(dllexport)
311# else
312# define ZEXPORT __declspec(dllimport)
313# define ZEXPORTVA __declspec(dllimport)
314# endif
315# endif
316#endif
317
318#ifdef HAVE_VISIBILITY_PRAGMA
319# define ZEXTERN __attribute__((visibility ("default"))) extern
320#endif
321
322#ifndef ZEXTERN
323# define ZEXTERN extern
324#endif
325#ifndef ZEXPORT
326# define ZEXPORT
327#endif
328#ifndef ZEXPORTVA
329# define ZEXPORTVA
330#endif
331
332#ifndef FAR
333# define FAR
334#endif
335
336#if !defined(__MACTYPES__)
337typedef unsigned char Byte; /* 8 bits */
338#endif
339typedef unsigned int uInt; /* 16 bits or more */
340typedef unsigned long uLong; /* 32 bits or more */
341
342#ifdef SMALL_MEDIUM
343 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
344# define Bytef Byte FAR
345#else
346 typedef Byte FAR Bytef;
347#endif
348typedef char FAR charf;
349typedef int FAR intf;
350typedef uInt FAR uIntf;
351typedef uLong FAR uLongf;
352
353#ifdef STDC
354 typedef void const *voidpc;
355 typedef void FAR *voidpf;
356 typedef void *voidp;
357#else
358 typedef Byte const *voidpc;
359 typedef Byte FAR *voidpf;
360 typedef Byte *voidp;
361#endif
362
363#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
364# define Z_HAVE_UNISTD_H
365#endif
366
367#ifdef Z_HAVE_UNISTD_H
368# include <sys/types.h> /* for off_t */
369# include <unistd.h> /* for SEEK_* and off_t */
370# ifdef VMS
371# include <unixio.h> /* for off_t */
372# endif
373# ifndef z_off_t
374# define z_off_t off_t
375# endif
376#endif
377
378#ifdef _LARGEFILE64_SOURCE
379# include <sys/types.h>
380#endif
381
382#ifndef SEEK_SET
383# define SEEK_SET 0 /* Seek from beginning of file. */
384# define SEEK_CUR 1 /* Seek from current position. */
385# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
386#endif
387#ifndef z_off_t
388# define z_off_t long
389#endif
390
391#if defined(__OS400__)
392# define NO_vsnprintf
393#endif
394
395#if defined(__MVS__)
396# define NO_vsnprintf
397#endif
398
399/* MVS linker does not support external names larger than 8 bytes */
400#if defined(__MVS__)
401 #pragma map(deflateInit_,"DEIN")
402 #pragma map(deflateInit2_,"DEIN2")
403 #pragma map(deflateEnd,"DEEND")
404 #pragma map(deflateBound,"DEBND")
405 #pragma map(inflateInit_,"ININ")
406 #pragma map(inflateInit2_,"ININ2")
407 #pragma map(inflateEnd,"INEND")
408 #pragma map(inflateSync,"INSY")
409 #pragma map(inflateSetDictionary,"INSEDI")
410 #pragma map(compressBound,"CMBND")
411 #pragma map(inflate_table,"INTABL")
412 #pragma map(inflate_fast,"INFA")
413 #pragma map(inflate_copyright,"INCOPY")
414#endif
415
416#endif /* ZCONF_H */
diff --git a/zconf.h.cmakein b/zconf.h.cmakein
new file mode 100644
index 0000000..eec8ab0
--- /dev/null
+++ b/zconf.h.cmakein
@@ -0,0 +1,418 @@
1/* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-2010 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/* @(#) $Id$ */
7
8#ifndef ZCONF_H
9#define ZCONF_H
10#cmakedefine Z_PREFIX
11#cmakedefine Z_HAVE_UNISTD_H
12
13/*
14 * If you *really* need a unique prefix for all types and library functions,
15 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
16 * Even better than compiling with -DZ_PREFIX would be to use configure to set
17 * this permanently in zconf.h using "./configure --zprefix".
18 */
19#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
20
21/* all linked symbols */
22# define _dist_code z__dist_code
23# define _length_code z__length_code
24# define _tr_align z__tr_align
25# define _tr_flush_block z__tr_flush_block
26# define _tr_init z__tr_init
27# define _tr_stored_block z__tr_stored_block
28# define _tr_tally z__tr_tally
29# define adler32 z_adler32
30# define adler32_combine z_adler32_combine
31# define adler32_combine64 z_adler32_combine64
32# define compress z_compress
33# define compress2 z_compress2
34# define compressBound z_compressBound
35# define crc32 z_crc32
36# define crc32_combine z_crc32_combine
37# define crc32_combine64 z_crc32_combine64
38# define deflate z_deflate
39# define deflateBound z_deflateBound
40# define deflateCopy z_deflateCopy
41# define deflateEnd z_deflateEnd
42# define deflateInit2_ z_deflateInit2_
43# define deflateInit_ z_deflateInit_
44# define deflateParams z_deflateParams
45# define deflatePrime z_deflatePrime
46# define deflateReset z_deflateReset
47# define deflateSetDictionary z_deflateSetDictionary
48# define deflateSetHeader z_deflateSetHeader
49# define deflateTune z_deflateTune
50# define deflate_copyright z_deflate_copyright
51# define get_crc_table z_get_crc_table
52# define gz_error z_gz_error
53# define gz_intmax z_gz_intmax
54# define gz_strwinerror z_gz_strwinerror
55# define gzbuffer z_gzbuffer
56# define gzclearerr z_gzclearerr
57# define gzclose z_gzclose
58# define gzclose_r z_gzclose_r
59# define gzclose_w z_gzclose_w
60# define gzdirect z_gzdirect
61# define gzdopen z_gzdopen
62# define gzeof z_gzeof
63# define gzerror z_gzerror
64# define gzflush z_gzflush
65# define gzgetc z_gzgetc
66# define gzgets z_gzgets
67# define gzoffset z_gzoffset
68# define gzoffset64 z_gzoffset64
69# define gzopen z_gzopen
70# define gzopen64 z_gzopen64
71# define gzprintf z_gzprintf
72# define gzputc z_gzputc
73# define gzputs z_gzputs
74# define gzread z_gzread
75# define gzrewind z_gzrewind
76# define gzseek z_gzseek
77# define gzseek64 z_gzseek64
78# define gzsetparams z_gzsetparams
79# define gztell z_gztell
80# define gztell64 z_gztell64
81# define gzungetc z_gzungetc
82# define gzwrite z_gzwrite
83# define inflate z_inflate
84# define inflateBack z_inflateBack
85# define inflateBackEnd z_inflateBackEnd
86# define inflateBackInit_ z_inflateBackInit_
87# define inflateCopy z_inflateCopy
88# define inflateEnd z_inflateEnd
89# define inflateGetHeader z_inflateGetHeader
90# define inflateInit2_ z_inflateInit2_
91# define inflateInit_ z_inflateInit_
92# define inflateMark z_inflateMark
93# define inflatePrime z_inflatePrime
94# define inflateReset z_inflateReset
95# define inflateReset2 z_inflateReset2
96# define inflateSetDictionary z_inflateSetDictionary
97# define inflateSync z_inflateSync
98# define inflateSyncPoint z_inflateSyncPoint
99# define inflateUndermine z_inflateUndermine
100# define inflate_copyright z_inflate_copyright
101# define inflate_fast z_inflate_fast
102# define inflate_table z_inflate_table
103# define uncompress z_uncompress
104# define zError z_zError
105# define zcalloc z_zcalloc
106# define zcfree z_zcfree
107# define zlibCompileFlags z_zlibCompileFlags
108# define zlibVersion z_zlibVersion
109
110/* all zlib typedefs in zlib.h and zconf.h */
111# define Byte z_Byte
112# define Bytef z_Bytef
113# define alloc_func z_alloc_func
114# define charf z_charf
115# define free_func z_free_func
116# define gzFile z_gzFile
117# define gz_header z_gz_header
118# define gz_headerp z_gz_headerp
119# define in_func z_in_func
120# define intf z_intf
121# define out_func z_out_func
122# define uInt z_uInt
123# define uIntf z_uIntf
124# define uLong z_uLong
125# define uLongf z_uLongf
126# define voidp z_voidp
127# define voidpc z_voidpc
128# define voidpf z_voidpf
129
130/* all zlib structs in zlib.h and zconf.h */
131# define gz_header_s z_gz_header_s
132# define internal_state z_internal_state
133
134#endif
135
136#if defined(__MSDOS__) && !defined(MSDOS)
137# define MSDOS
138#endif
139#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
140# define OS2
141#endif
142#if defined(_WINDOWS) && !defined(WINDOWS)
143# define WINDOWS
144#endif
145#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
146# ifndef WIN32
147# define WIN32
148# endif
149#endif
150#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
151# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
152# ifndef SYS16BIT
153# define SYS16BIT
154# endif
155# endif
156#endif
157
158/*
159 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
160 * than 64k bytes at a time (needed on systems with 16-bit int).
161 */
162#ifdef SYS16BIT
163# define MAXSEG_64K
164#endif
165#ifdef MSDOS
166# define UNALIGNED_OK
167#endif
168
169#ifdef __STDC_VERSION__
170# ifndef STDC
171# define STDC
172# endif
173# if __STDC_VERSION__ >= 199901L
174# ifndef STDC99
175# define STDC99
176# endif
177# endif
178#endif
179#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
180# define STDC
181#endif
182#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
183# define STDC
184#endif
185#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
186# define STDC
187#endif
188#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
189# define STDC
190#endif
191
192#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
193# define STDC
194#endif
195
196#ifndef STDC
197# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
198# define const /* note: need a more gentle solution here */
199# endif
200#endif
201
202/* Some Mac compilers merge all .h files incorrectly: */
203#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
204# define NO_DUMMY_DECL
205#endif
206
207/* Maximum value for memLevel in deflateInit2 */
208#ifndef MAX_MEM_LEVEL
209# ifdef MAXSEG_64K
210# define MAX_MEM_LEVEL 8
211# else
212# define MAX_MEM_LEVEL 9
213# endif
214#endif
215
216/* Maximum value for windowBits in deflateInit2 and inflateInit2.
217 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
218 * created by gzip. (Files created by minigzip can still be extracted by
219 * gzip.)
220 */
221#ifndef MAX_WBITS
222# define MAX_WBITS 15 /* 32K LZ77 window */
223#endif
224
225/* The memory requirements for deflate are (in bytes):
226 (1 << (windowBits+2)) + (1 << (memLevel+9))
227 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
228 plus a few kilobytes for small objects. For example, if you want to reduce
229 the default memory requirements from 256K to 128K, compile with
230 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
231 Of course this will generally degrade compression (there's no free lunch).
232
233 The memory requirements for inflate are (in bytes) 1 << windowBits
234 that is, 32K for windowBits=15 (default value) plus a few kilobytes
235 for small objects.
236*/
237
238 /* Type declarations */
239
240#ifndef OF /* function prototypes */
241# ifdef STDC
242# define OF(args) args
243# else
244# define OF(args) ()
245# endif
246#endif
247
248/* The following definitions for FAR are needed only for MSDOS mixed
249 * model programming (small or medium model with some far allocations).
250 * This was tested only with MSC; for other MSDOS compilers you may have
251 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
252 * just define FAR to be empty.
253 */
254#ifdef SYS16BIT
255# if defined(M_I86SM) || defined(M_I86MM)
256 /* MSC small or medium model */
257# define SMALL_MEDIUM
258# ifdef _MSC_VER
259# define FAR _far
260# else
261# define FAR far
262# endif
263# endif
264# if (defined(__SMALL__) || defined(__MEDIUM__))
265 /* Turbo C small or medium model */
266# define SMALL_MEDIUM
267# ifdef __BORLANDC__
268# define FAR _far
269# else
270# define FAR far
271# endif
272# endif
273#endif
274
275#if defined(WINDOWS) || defined(WIN32)
276 /* If building or using zlib as a DLL, define ZLIB_DLL.
277 * This is not mandatory, but it offers a little performance increase.
278 */
279# ifdef ZLIB_DLL
280# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
281# ifdef ZLIB_INTERNAL
282# define ZEXTERN extern __declspec(dllexport)
283# else
284# define ZEXTERN extern __declspec(dllimport)
285# endif
286# endif
287# endif /* ZLIB_DLL */
288 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
289 * define ZLIB_WINAPI.
290 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
291 */
292# ifdef ZLIB_WINAPI
293# ifdef FAR
294# undef FAR
295# endif
296# include <windows.h>
297 /* No need for _export, use ZLIB.DEF instead. */
298 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
299# define ZEXPORT WINAPI
300# ifdef WIN32
301# define ZEXPORTVA WINAPIV
302# else
303# define ZEXPORTVA FAR CDECL
304# endif
305# endif
306#endif
307
308#if defined (__BEOS__)
309# ifdef ZLIB_DLL
310# ifdef ZLIB_INTERNAL
311# define ZEXPORT __declspec(dllexport)
312# define ZEXPORTVA __declspec(dllexport)
313# else
314# define ZEXPORT __declspec(dllimport)
315# define ZEXPORTVA __declspec(dllimport)
316# endif
317# endif
318#endif
319
320#ifdef HAVE_VISIBILITY_PRAGMA
321# define ZEXTERN __attribute__((visibility ("default"))) extern
322#endif
323
324#ifndef ZEXTERN
325# define ZEXTERN extern
326#endif
327#ifndef ZEXPORT
328# define ZEXPORT
329#endif
330#ifndef ZEXPORTVA
331# define ZEXPORTVA
332#endif
333
334#ifndef FAR
335# define FAR
336#endif
337
338#if !defined(__MACTYPES__)
339typedef unsigned char Byte; /* 8 bits */
340#endif
341typedef unsigned int uInt; /* 16 bits or more */
342typedef unsigned long uLong; /* 32 bits or more */
343
344#ifdef SMALL_MEDIUM
345 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
346# define Bytef Byte FAR
347#else
348 typedef Byte FAR Bytef;
349#endif
350typedef char FAR charf;
351typedef int FAR intf;
352typedef uInt FAR uIntf;
353typedef uLong FAR uLongf;
354
355#ifdef STDC
356 typedef void const *voidpc;
357 typedef void FAR *voidpf;
358 typedef void *voidp;
359#else
360 typedef Byte const *voidpc;
361 typedef Byte FAR *voidpf;
362 typedef Byte *voidp;
363#endif
364
365#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
366# define Z_HAVE_UNISTD_H
367#endif
368
369#ifdef Z_HAVE_UNISTD_H
370# include <sys/types.h> /* for off_t */
371# include <unistd.h> /* for SEEK_* and off_t */
372# ifdef VMS
373# include <unixio.h> /* for off_t */
374# endif
375# ifndef z_off_t
376# define z_off_t off_t
377# endif
378#endif
379
380#ifdef _LARGEFILE64_SOURCE
381# include <sys/types.h>
382#endif
383
384#ifndef SEEK_SET
385# define SEEK_SET 0 /* Seek from beginning of file. */
386# define SEEK_CUR 1 /* Seek from current position. */
387# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
388#endif
389#ifndef z_off_t
390# define z_off_t long
391#endif
392
393#if defined(__OS400__)
394# define NO_vsnprintf
395#endif
396
397#if defined(__MVS__)
398# define NO_vsnprintf
399#endif
400
401/* MVS linker does not support external names larger than 8 bytes */
402#if defined(__MVS__)
403 #pragma map(deflateInit_,"DEIN")
404 #pragma map(deflateInit2_,"DEIN2")
405 #pragma map(deflateEnd,"DEEND")
406 #pragma map(deflateBound,"DEBND")
407 #pragma map(inflateInit_,"ININ")
408 #pragma map(inflateInit2_,"ININ2")
409 #pragma map(inflateEnd,"INEND")
410 #pragma map(inflateSync,"INSY")
411 #pragma map(inflateSetDictionary,"INSEDI")
412 #pragma map(compressBound,"CMBND")
413 #pragma map(inflate_table,"INTABL")
414 #pragma map(inflate_fast,"INFA")
415 #pragma map(inflate_copyright,"INCOPY")
416#endif
417
418#endif /* ZCONF_H */
diff --git a/zconf.h.in b/zconf.h.in
index eec8ab0..5888024 100644
--- a/zconf.h.in
+++ b/zconf.h.in
@@ -7,8 +7,6 @@
7 7
8#ifndef ZCONF_H 8#ifndef ZCONF_H
9#define ZCONF_H 9#define ZCONF_H
10#cmakedefine Z_PREFIX
11#cmakedefine Z_HAVE_UNISTD_H
12 10
13/* 11/*
14 * If you *really* need a unique prefix for all types and library functions, 12 * If you *really* need a unique prefix for all types and library functions,
diff --git a/zlib.3 b/zlib.3
index 82b9eca..57f0307 100644
--- a/zlib.3
+++ b/zlib.3
@@ -1,4 +1,4 @@
1.TH ZLIB 3 "21 February 2010" 1.TH ZLIB 3 "11 March 2010"
2.SH NAME 2.SH NAME
3zlib \- compression/decompression library 3zlib \- compression/decompression library
4.SH SYNOPSIS 4.SH SYNOPSIS
@@ -9,12 +9,13 @@ for full description]
9The 9The
10.I zlib 10.I zlib
11library is a general purpose data compression library. 11library is a general purpose data compression library.
12The code is thread safe. 12The code is thread safe, assuming that the standard library functions
13used are thread safe, such as memory allocation routines.
13It provides in-memory compression and decompression functions, 14It provides in-memory compression and decompression functions,
14including integrity checks of the uncompressed data. 15including integrity checks of the uncompressed data.
15This version of the library supports only one compression method (deflation) 16This version of the library supports only one compression method (deflation)
16but other algorithms will be added later 17but other algorithms may be added later
17and will have the same stream interface. 18with the same stream interface.
18.LP 19.LP
19Compression can be done in a single step if the buffers are large enough 20Compression can be done in a single step if the buffers are large enough
20or can be done by repeated calls of the compression function. 21or can be done by repeated calls of the compression function.
@@ -29,7 +30,7 @@ with an interface similar to that of stdio.
29.LP 30.LP
30The library does not install any signal handler. 31The library does not install any signal handler.
31The decoder checks the consistency of the compressed data, 32The decoder checks the consistency of the compressed data,
32so the library should never crash even in case of corrupted input. 33so the library should never crash even in the case of corrupted input.
33.LP 34.LP
34All functions of the compression library are documented in the file 35All functions of the compression library are documented in the file
35.IR zlib.h . 36.IR zlib.h .
@@ -37,18 +38,19 @@ The distribution source includes examples of use of the library
37in the files 38in the files
38.I example.c 39.I example.c
39and 40and
40.IR minigzip.c . 41.IR minigzip.c,
42as well as other examples in the
43.IR examples/
44directory.
41.LP 45.LP
42Changes to this version are documented in the file 46Changes to this version are documented in the file
43.I ChangeLog 47.I ChangeLog
44that accompanies the source, 48that accompanies the source.
45and are concerned primarily with bug fixes and portability enhancements.
46.LP 49.LP
47A Java implementation of
48.I zlib 50.I zlib
49is available in the Java Development Kit 1.1: 51is available in Java using the java.util.zip package:
50.IP 52.IP
51http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html 53http://java.sun.com/developer/technicalArticles/Programming/compression/
52.LP 54.LP
53A Perl interface to 55A Perl interface to
54.IR zlib , 56.IR zlib ,
@@ -56,7 +58,7 @@ written by Paul Marquess (pmqs@cpan.org),
56is available at CPAN (Comprehensive Perl Archive Network) sites, 58is available at CPAN (Comprehensive Perl Archive Network) sites,
57including: 59including:
58.IP 60.IP
59http://www.cpan.org/modules/by-module/Compress/ 61http://search.cpan.org/~pmqs/IO-Compress-Zlib/
60.LP 62.LP
61A Python interface to 63A Python interface to
62.IR zlib , 64.IR zlib ,
@@ -65,14 +67,11 @@ is available in Python 1.5 and later versions:
65.IP 67.IP
66http://www.python.org/doc/lib/module-zlib.html 68http://www.python.org/doc/lib/module-zlib.html
67.LP 69.LP
68A
69.I zlib 70.I zlib
70binding for 71is built into
71.IR tcl (1), 72.IR tcl:
72written by Andreas Kupries (a.kupries@westend.com),
73is availlable at:
74.IP 73.IP
75http://www.westend.com/~kupries/doc/trf/man/man.html 74http://wiki.tcl.tk/4610
76.LP 75.LP
77An experimental package to read and write files in .zip format, 76An experimental package to read and write files in .zip format,
78written on top of 77written on top of
@@ -80,40 +79,34 @@ written on top of
80by Gilles Vollant (info@winimage.com), 79by Gilles Vollant (info@winimage.com),
81is available at: 80is available at:
82.IP 81.IP
83http://www.winimage.com/zLibDll/unzip.html 82http://www.winimage.com/zLibDll/minizip.html
84and also in the 83and also in the
85.I contrib/minizip 84.I contrib/minizip
86directory of the main 85directory of the main
87.I zlib 86.I zlib
88web site. 87source distribution.
89.SH "SEE ALSO" 88.SH "SEE ALSO"
90The 89The
91.I zlib 90.I zlib
92web site can be found at either of these locations: 91web site can be found at:
93.IP 92.IP
94http://www.zlib.org 93http://zlib.net/
95.br
96http://www.gzip.org/zlib/
97.LP 94.LP
98The data format used by the zlib library is described by RFC 95The data format used by the zlib library is described by RFC
99(Request for Comments) 1950 to 1952 in the files: 96(Request for Comments) 1950 to 1952 in the files:
100.IP 97.IP
101http://www.ietf.org/rfc/rfc1950.txt (concerning zlib format) 98http://www.ietf.org/rfc/rfc1950.txt (for the zlib header and trailer format)
102.br 99.br
103http://www.ietf.org/rfc/rfc1951.txt (concerning deflate format) 100http://www.ietf.org/rfc/rfc1951.txt (for the deflate compressed data format)
104.br 101.br
105http://www.ietf.org/rfc/rfc1952.txt (concerning gzip format) 102http://www.ietf.org/rfc/rfc1952.txt (for the gzip header and trailer format)
106.LP
107These documents are also available in other formats from:
108.IP
109ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
110.LP 103.LP
111Mark Nelson (markn@ieee.org) wrote an article about 104Mark Nelson wrote an article about
112.I zlib 105.I zlib
113for the Jan. 1997 issue of Dr. Dobb's Journal; 106for the Jan. 1997 issue of Dr. Dobb's Journal;
114a copy of the article is available at: 107a copy of the article is available at:
115.IP 108.IP
116http://dogma.net/markn/articles/zlibtool/zlibtool.htm 109http://marknelson.us/1997/01/01/zlib-engine/
117.SH "REPORTING PROBLEMS" 110.SH "REPORTING PROBLEMS"
118Before reporting a problem, 111Before reporting a problem,
119please check the 112please check the
@@ -126,13 +119,13 @@ Please read the
126.I zlib 119.I zlib
127FAQ at: 120FAQ at:
128.IP 121.IP
129http://www.gzip.org/zlib/zlib_faq.html 122http://zlib.net/zlib_faq.html
130.LP 123.LP
131before asking for help. 124before asking for help.
132Send questions and/or comments to zlib@gzip.org, 125Send questions and/or comments to zlib@gzip.org,
133or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). 126or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
134.SH AUTHORS 127.SH AUTHORS
135Version 1.2.3.9 128Version 1.2.4
136Copyright (C) 1995-2010 Jean-loup Gailly (jloup@gzip.org) 129Copyright (C) 1995-2010 Jean-loup Gailly (jloup@gzip.org)
137and Mark Adler (madler@alumni.caltech.edu). 130and Mark Adler (madler@alumni.caltech.edu).
138.LP 131.LP
diff --git a/zlib.3.pdf b/zlib.3.pdf
new file mode 100644
index 0000000..3442d5b
--- /dev/null
+++ b/zlib.3.pdf
Binary files differ
diff --git a/zlib.h b/zlib.h
index e1cfd0e..dfc0bba 100644
--- a/zlib.h
+++ b/zlib.h
@@ -1,5 +1,5 @@
1/* zlib.h -- interface of the 'zlib' general purpose compression library 1/* zlib.h -- interface of the 'zlib' general purpose compression library
2 version 1.2.3.9, Feb 21st, 2010 2 version 1.2.3.9, Mar 11th, 2010
3 3
4 Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler 4 Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
5 5
@@ -37,11 +37,12 @@
37extern "C" { 37extern "C" {
38#endif 38#endif
39 39
40#define ZLIB_VERSION "1.2.3.9" 40#define ZLIB_VERSION "1.2.4"
41#define ZLIB_VERNUM 0x1239 41#define ZLIB_VERNUM 0x1240
42#define ZLIB_VER_MAJOR 1 42#define ZLIB_VER_MAJOR 1
43#define ZLIB_VER_MINOR 2 43#define ZLIB_VER_MINOR 2
44#define ZLIB_VER_REVISION 3 44#define ZLIB_VER_REVISION 4
45#define ZLIB_VER_SUBREVISION 0
45 46
46/* 47/*
47 The 'zlib' compression library provides in-memory compression and 48 The 'zlib' compression library provides in-memory compression and