Compare commits
	
		
			1 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | c34c1fcbb1 | 
							
								
								
									
										21
									
								
								ChangeLog
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								ChangeLog
									
									
									
									
									
								
							| @@ -1,6 +1,25 @@ | |||||||
|  |  | ||||||
| 		ChangeLog file for zlib | 		ChangeLog file for zlib | ||||||
|  |  | ||||||
|  | Changes in 1.1.2 (19 March 98) | ||||||
|  | - added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant) | ||||||
|  |   See http://www.winimage.com/zLibDll/unzip.html | ||||||
|  | - preinitialize the inflate tables for fixed codes, to make the code | ||||||
|  |   completely thread safe (Mark) | ||||||
|  | - some simplifications and slight speed-up to the inflate code (Mark) | ||||||
|  | - fix gzeof on non-compressed files (Allan Schrum) | ||||||
|  | - add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs) | ||||||
|  | - use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn) | ||||||
|  | - added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny) | ||||||
|  | - add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori) | ||||||
|  | - do not wrap extern "C" around system includes (Tom Lane) | ||||||
|  | - mention zlib binding for TCL in README (Andreas Kupries) | ||||||
|  | - added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert) | ||||||
|  | - allow "make install prefix=..." even after configure (Glenn Randers-Pehrson) | ||||||
|  | - allow "configure --prefix $HOME" (Tim Mooney) | ||||||
|  | - remove warnings in example.c and gzio.c (Glenn Randers-Pehrson) | ||||||
|  | - move Makefile.sas to amiga/Makefile.sas | ||||||
|  |  | ||||||
| Changes in 1.1.1 (27 Feb 98) | Changes in 1.1.1 (27 Feb 98) | ||||||
| - fix macros _tr_tally_* in deflate.h for debug mode  (Glenn Randers-Pehrson) | - fix macros _tr_tally_* in deflate.h for debug mode  (Glenn Randers-Pehrson) | ||||||
| - remove block truncation heuristic which had very marginal effect for zlib | - remove block truncation heuristic which had very marginal effect for zlib | ||||||
| @@ -138,7 +157,7 @@ Changes in 1.0.6 (19 Jan 1998) | |||||||
| - allow compilation with ANSI keywords only enabled for TurboC in large model | - allow compilation with ANSI keywords only enabled for TurboC in large model | ||||||
| - avoid "versionString"[0] (Borland bug) | - avoid "versionString"[0] (Borland bug) | ||||||
| - add NEED_DUMMY_RETURN for Borland | - add NEED_DUMMY_RETURN for Borland | ||||||
| - use variable z_verbose for tracing in debug mode (Peter Deutsch). | - use variable z_verbose for tracing in debug mode (L. Peter Deutsch). | ||||||
| - allow compilation with CC | - allow compilation with CC | ||||||
| - defined STDC for OS/2 (David Charlap)	 | - defined STDC for OS/2 (David Charlap)	 | ||||||
| - limit external names to 8 chars for MVS (Thomas Lund) | - limit external names to 8 chars for MVS (Thomas Lund) | ||||||
|   | |||||||
							
								
								
									
										9
									
								
								INDEX
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								INDEX
									
									
									
									
									
								
							| @@ -5,7 +5,6 @@ Makefile		makefile for Unix (generated by configure) | |||||||
| Makefile.in		makefile for Unix (template for configure) | Makefile.in		makefile for Unix (template for configure) | ||||||
| Makefile.msc		makefile for Microsoft C 16-bit | Makefile.msc		makefile for Microsoft C 16-bit | ||||||
| Makefile.riscos 	makefile for RISCOS | Makefile.riscos 	makefile for RISCOS | ||||||
| Makefile.sas		makefile for Amiga SAS/C |  | ||||||
| README			guess what | README			guess what | ||||||
| algorithm.txt		description of the (de)compression algorithm | algorithm.txt		description of the (de)compression algorithm | ||||||
| configure		configure script for Unix | configure		configure script for Unix | ||||||
| @@ -13,6 +12,9 @@ descrip.mms		makefile for Vax/VMS | |||||||
| zlib.3			mini man page for zlib (volunteers to write full | zlib.3			mini man page for zlib (volunteers to write full | ||||||
| 			man pages from zlib.h welcome. write to jloup@gzip.org) | 			man pages from zlib.h welcome. write to jloup@gzip.org) | ||||||
|  |  | ||||||
|  | amiga/Makefile.sas	makefile for Amiga SAS/C | ||||||
|  | amiga/Makefile.pup      makefile for Amiga powerUP SAS/C PPC | ||||||
|  |  | ||||||
| msdos/Makefile.w32      makefile for Microsoft Visual C++ 32-bit | msdos/Makefile.w32      makefile for Microsoft Visual C++ 32-bit | ||||||
| msdos/Makefile.b32	makefile for Borland C++   32-bit | msdos/Makefile.b32	makefile for Borland C++   32-bit | ||||||
| msdos/Makefile.bor	makefile for Borland C/C++ 16-bit | msdos/Makefile.bor	makefile for Borland C/C++ 16-bit | ||||||
| @@ -48,6 +50,7 @@ inftrees.c | |||||||
| inftrees.h | inftrees.h | ||||||
| infutil.c | infutil.c | ||||||
| infutil.h | infutil.h | ||||||
|  | maketree.c | ||||||
| trees.c | trees.c | ||||||
| uncompr.c | uncompr.c | ||||||
| zutil.c | zutil.c | ||||||
| @@ -62,6 +65,10 @@ minigzip.c | |||||||
| contrib/asm386/ by Gilles Vollant <info@winimage.com> | contrib/asm386/ by Gilles Vollant <info@winimage.com> | ||||||
| 	386 asm code replacing longest_match(). | 	386 asm code replacing longest_match(). | ||||||
|  |  | ||||||
|  | contrib/minizip/ by Gilles Vollant <info@winimage.com> | ||||||
|  | 	Mini zip and unzip based on zlib | ||||||
|  |         See http://www.winimage.com/zLibDll/unzip.html | ||||||
|  |  | ||||||
| contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu> | contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu> | ||||||
|         A C++ I/O streams interface to the zlib gz* functions |         A C++ I/O streams interface to the zlib gz* functions | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										18
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								Makefile
									
									
									
									
									
								
							| @@ -23,7 +23,7 @@ CFLAGS=-O | |||||||
| LDFLAGS=-L. -lz | LDFLAGS=-L. -lz | ||||||
| LDSHARED=$(CC) | LDSHARED=$(CC) | ||||||
|  |  | ||||||
| VER=1.1.1 | VER=1.1.2 | ||||||
| LIBS=libz.a | LIBS=libz.a | ||||||
| SHAREDLIB=libz.so | SHAREDLIB=libz.so | ||||||
|  |  | ||||||
| @@ -32,8 +32,8 @@ RANLIB=ranlib | |||||||
| TAR=tar | TAR=tar | ||||||
| SHELL=/bin/sh | SHELL=/bin/sh | ||||||
|  |  | ||||||
| prefix=/usr/local | prefix = /usr/local | ||||||
| exec_prefix = $(prefix) | exec_prefix = ${prefix} | ||||||
|  |  | ||||||
| OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ | OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ | ||||||
|        zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o |        zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o | ||||||
| @@ -42,11 +42,13 @@ TEST_OBJS = example.o minigzip.o | |||||||
|  |  | ||||||
| DISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \ | DISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \ | ||||||
|   algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \ |   algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \ | ||||||
|   nt/Makefile.nt nt/zlib.dnt  contrib/README.contrib contrib/*.txt \ |   nt/Makefile.nt nt/zlib.dnt amiga/Make*.??? contrib/README.contrib \ | ||||||
|   contrib/asm386/*.asm contrib/asm386/*.c \ |   contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \ | ||||||
|   contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \ |   contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \ | ||||||
|   contrib/iostream/*.h  contrib/iostream2/*.h contrib/iostream2/*.cpp \ |   contrib/iostream/*.h  contrib/iostream2/*.h contrib/iostream2/*.cpp \ | ||||||
|   contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 |   contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \ | ||||||
|  |   contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? | ||||||
|  |  | ||||||
|  |  | ||||||
| all: example minigzip | all: example minigzip | ||||||
|  |  | ||||||
| @@ -112,14 +114,14 @@ distclean:	clean | |||||||
|  |  | ||||||
| zip: | zip: | ||||||
| 	mv Makefile Makefile~; cp -p Makefile.in Makefile | 	mv Makefile Makefile~; cp -p Makefile.in Makefile | ||||||
| 	rm -f test.c ztest*.c | 	rm -f test.c ztest*.c contrib/minizip/test.zip | ||||||
| 	v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ | 	v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ | ||||||
| 	zip -ul9 zlib$$v $(DISTFILES) | 	zip -ul9 zlib$$v $(DISTFILES) | ||||||
| 	mv Makefile~ Makefile | 	mv Makefile~ Makefile | ||||||
|  |  | ||||||
| dist: | dist: | ||||||
| 	mv Makefile Makefile~; cp -p Makefile.in Makefile | 	mv Makefile Makefile~; cp -p Makefile.in Makefile | ||||||
| 	rm -f test.c ztest*.c | 	rm -f test.c ztest*.c contrib/minizip/test.zip | ||||||
| 	d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ | 	d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ | ||||||
| 	rm -f $$d.tar.gz; \ | 	rm -f $$d.tar.gz; \ | ||||||
| 	if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \ | 	if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \ | ||||||
|   | |||||||
							
								
								
									
										18
									
								
								Makefile.in
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								Makefile.in
									
									
									
									
									
								
							| @@ -23,7 +23,7 @@ CFLAGS=-O | |||||||
| LDFLAGS=-L. -lz | LDFLAGS=-L. -lz | ||||||
| LDSHARED=$(CC) | LDSHARED=$(CC) | ||||||
|  |  | ||||||
| VER=1.1.1 | VER=1.1.2 | ||||||
| LIBS=libz.a | LIBS=libz.a | ||||||
| SHAREDLIB=libz.so | SHAREDLIB=libz.so | ||||||
|  |  | ||||||
| @@ -32,8 +32,8 @@ RANLIB=ranlib | |||||||
| TAR=tar | TAR=tar | ||||||
| SHELL=/bin/sh | SHELL=/bin/sh | ||||||
|  |  | ||||||
| prefix=/usr/local | prefix = /usr/local | ||||||
| exec_prefix = $(prefix) | exec_prefix = ${prefix} | ||||||
|  |  | ||||||
| OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ | OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ | ||||||
|        zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o |        zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o | ||||||
| @@ -42,11 +42,13 @@ TEST_OBJS = example.o minigzip.o | |||||||
|  |  | ||||||
| DISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \ | DISTFILES = README INDEX ChangeLog configure Make*[a-z0-9] *.[ch] descrip.mms \ | ||||||
|   algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \ |   algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \ | ||||||
|   nt/Makefile.nt nt/zlib.dnt  contrib/README.contrib contrib/*.txt \ |   nt/Makefile.nt nt/zlib.dnt amiga/Make*.??? contrib/README.contrib \ | ||||||
|   contrib/asm386/*.asm contrib/asm386/*.c \ |   contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \ | ||||||
|   contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \ |   contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/iostream/*.cpp \ | ||||||
|   contrib/iostream/*.h  contrib/iostream2/*.h contrib/iostream2/*.cpp \ |   contrib/iostream/*.h  contrib/iostream2/*.h contrib/iostream2/*.cpp \ | ||||||
|   contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 |   contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \ | ||||||
|  |   contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? | ||||||
|  |  | ||||||
|  |  | ||||||
| all: example minigzip | all: example minigzip | ||||||
|  |  | ||||||
| @@ -112,14 +114,14 @@ distclean:	clean | |||||||
|  |  | ||||||
| zip: | zip: | ||||||
| 	mv Makefile Makefile~; cp -p Makefile.in Makefile | 	mv Makefile Makefile~; cp -p Makefile.in Makefile | ||||||
| 	rm -f test.c ztest*.c | 	rm -f test.c ztest*.c contrib/minizip/test.zip | ||||||
| 	v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ | 	v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ | ||||||
| 	zip -ul9 zlib$$v $(DISTFILES) | 	zip -ul9 zlib$$v $(DISTFILES) | ||||||
| 	mv Makefile~ Makefile | 	mv Makefile~ Makefile | ||||||
|  |  | ||||||
| dist: | dist: | ||||||
| 	mv Makefile Makefile~; cp -p Makefile.in Makefile | 	mv Makefile Makefile~; cp -p Makefile.in Makefile | ||||||
| 	rm -f test.c ztest*.c | 	rm -f test.c ztest*.c contrib/minizip/test.zip | ||||||
| 	d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ | 	d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ | ||||||
| 	rm -f $$d.tar.gz; \ | 	rm -f $$d.tar.gz; \ | ||||||
| 	if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \ | 	if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \ | ||||||
|   | |||||||
							
								
								
									
										44
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										44
									
								
								README
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| zlib 1.1.1 is a general purpose data compression library.  All the code | zlib 1.1.2 is a general purpose data compression library.  All the code | ||||||
| is thread safe.  The data format used by the zlib library | is thread safe.  The data format used by the zlib library | ||||||
| is described by RFCs (Request for Comments) 1950 to 1952 in the files  | is described by RFCs (Request for Comments) 1950 to 1952 in the files  | ||||||
| ftp://ds.internic.net/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate | ftp://ds.internic.net/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate | ||||||
| @@ -21,18 +21,27 @@ Questions about zlib should be sent to <zlib@quest.jpl.nasa.gov> or, | |||||||
| if this fails, to the addresses given below in the Copyright section. | if this fails, to the addresses given below in the Copyright section. | ||||||
| The zlib home page is http://www.cdrom.com/pub/infozip/zlib/ | The zlib home page is http://www.cdrom.com/pub/infozip/zlib/ | ||||||
| The official zlib ftp site is ftp://ftp.cdrom.com/pub/infozip/zlib/ | The official zlib ftp site is ftp://ftp.cdrom.com/pub/infozip/zlib/ | ||||||
| Mark Nelson wrote an article about zlib for the Jan. 1997 issue of  | Mark Nelson <markn@tiny.com> wrote an article about zlib for the Jan. 1997 | ||||||
| Dr. Dobb's Journal; a copy of the article is available in | issue of  Dr. Dobb's Journal; a copy of the article is available in | ||||||
| http://web2.airmail.net/markn/articles/zlibtool/zlibtool.htm | http://web2.airmail.net/markn/articles/zlibtool/zlibtool.htm | ||||||
|  |  | ||||||
| The changes made in version 1.1.1 are documented in the file ChangeLog. | The changes made in version 1.1.2 are documented in the file ChangeLog. | ||||||
| The main changes since 1.1.0 are: | The main changes since 1.1.1 are: | ||||||
|  |  | ||||||
| - fix macros _tr_tally_* in deflate.h for debug mode  (Glenn Randers-Pehrson) | - added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant) | ||||||
| - remove block truncation heuristic which had very marginal effect for zlib |   See http://www.winimage.com/zLibDll/unzip.html | ||||||
|   (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the | - preinitialize the inflate tables for fixed codes, to make the code | ||||||
|   compression ratio on some files. This also allows inlining _tr_tally for |   completely thread safe (Mark) | ||||||
|   matches in deflate_slow. | - some simplifications and slight speed-up to the inflate code (Mark) | ||||||
|  | - fix gzeof on non-compressed files (Allan Schrum) | ||||||
|  | - add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs) | ||||||
|  | - use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn) | ||||||
|  | - added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny) | ||||||
|  | - add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori) | ||||||
|  | - do not wrap extern "C" around system includes (Tom Lane) | ||||||
|  | - added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert) | ||||||
|  | - allow "make install prefix=..." even after configure (Glenn Randers-Pehrson) | ||||||
|  | - allow "configure --prefix $HOME" (Tim Mooney) | ||||||
|  |  | ||||||
|  |  | ||||||
| Unsupported third party contributions are provided in directory "contrib". | Unsupported third party contributions are provided in directory "contrib". | ||||||
| @@ -49,9 +58,13 @@ A Python interface to zlib written by A.M. Kuchling <amk@magnet.com> | |||||||
| is available from the Python Software Association sites, such as: | is available from the Python Software Association sites, such as: | ||||||
| ftp://ftp.python.org/pub/python/contrib/Encoding/zlib*.tar.gz | ftp://ftp.python.org/pub/python/contrib/Encoding/zlib*.tar.gz | ||||||
|  |  | ||||||
| An experimental package to read files in .zip format, written on top of | A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com> | ||||||
| zlib by Gilles Vollant <info@winimage.com>, is available at | is availlable at http://www.westend.com/~kupries/doc/trf/man/man.html | ||||||
| http://www.winimage.com/zLibDll/unzip.html |  | ||||||
|  | An experimental package to read and write files in .zip format, | ||||||
|  | written on top of zlib by Gilles Vollant <info@winimage.com>, is | ||||||
|  | available at http://www.winimage.com/zLibDll/unzip.html | ||||||
|  | and also in the contrib/minizip directory of zlib. | ||||||
|  |  | ||||||
|  |  | ||||||
| Notes for some targets: | Notes for some targets: | ||||||
| @@ -74,6 +87,9 @@ Notes for some targets: | |||||||
| - zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1    | - zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1    | ||||||
|   it works when compiled with cc. |   it works when compiled with cc. | ||||||
|  |  | ||||||
|  | - on Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 | ||||||
|  |   is necessary to get gzprintf working correctly. This is done by configure. | ||||||
|  |  | ||||||
| - zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works | - zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works | ||||||
|   with other compilers. Use "make test" to check your compiler. |   with other compilers. Use "make test" to check your compiler. | ||||||
|  |  | ||||||
| @@ -90,7 +106,7 @@ Notes for some targets: | |||||||
| Acknowledgments: | Acknowledgments: | ||||||
|  |  | ||||||
|   The deflate format used by zlib was defined by Phil Katz. The deflate |   The deflate format used by zlib was defined by Phil Katz. The deflate | ||||||
|   and zlib specifications were written by Peter Deutsch. Thanks to all the |   and zlib specifications were written by L. Peter Deutsch. Thanks to all the | ||||||
|   people who reported problems and suggested various improvements in zlib; |   people who reported problems and suggested various improvements in zlib; | ||||||
|   they are too numerous to cite here. |   they are too numerous to cite here. | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										66
									
								
								amiga/Makefile.pup
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								amiga/Makefile.pup
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,66 @@ | |||||||
|  | # Amiga powerUP (TM) Makefile | ||||||
|  | # makefile for libpng and SAS C V6.58/7.00 PPC compiler | ||||||
|  | # Copyright (C) 1998 by Andreas R. Kleinert | ||||||
|  |  | ||||||
|  | CC       = scppc | ||||||
|  | CFLAGS   = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL \ | ||||||
|  |            OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8 | ||||||
|  | LIBNAME  = libzip.a | ||||||
|  | AR       = ppc-amigaos-ar | ||||||
|  | AR_FLAGS = cr | ||||||
|  | RANLIB   = ppc-amigaos-ranlib | ||||||
|  | LDFLAGS  = -r -o | ||||||
|  | LDLIBS   = LIB:scppc.a | ||||||
|  | LN       = ppc-amigaos-ld | ||||||
|  | RM       = delete quiet | ||||||
|  |  | ||||||
|  | OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ | ||||||
|  |        zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o | ||||||
|  |  | ||||||
|  | TEST_OBJS = example.o minigzip.o | ||||||
|  |  | ||||||
|  | all: example minigzip | ||||||
|  |  | ||||||
|  | test: all | ||||||
|  |         example | ||||||
|  |         echo hello world | minigzip | minigzip -d | ||||||
|  |  | ||||||
|  | $(LIBNAME): $(OBJS) | ||||||
|  |             $(AR) $(AR_FLAGS) $@ $(OBJS) | ||||||
|  |             $(RANLIB) $@ | ||||||
|  |  | ||||||
|  | example: example.o $(LIBNAME) | ||||||
|  |         $(LN) $(LDFLAGS) example LIB:c_ppc.o example.o $(LIBNAME) $(LDLIBS) LIB:end.o | ||||||
|  |  | ||||||
|  | minigzip: minigzip.o $(LIBNAME) | ||||||
|  |         $(LN) $(LDFLAGS) minigzip LIB:c_ppc.o minigzip.o $(LIBNAME) $(LDLIBS) LIB:end.o | ||||||
|  |  | ||||||
|  | clean: | ||||||
|  |         $(RM) *.o example minigzip $(LIBNAME) foo.gz | ||||||
|  |  | ||||||
|  | zip: | ||||||
|  |         zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \ | ||||||
|  |           descrip.mms *.[ch] | ||||||
|  |  | ||||||
|  | tgz: | ||||||
|  |         cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \ | ||||||
|  |           zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch] | ||||||
|  |  | ||||||
|  | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||||||
|  |  | ||||||
|  | adler32.o: zutil.h zlib.h zconf.h | ||||||
|  | compress.o: zlib.h zconf.h | ||||||
|  | crc32.o: zutil.h zlib.h zconf.h | ||||||
|  | deflate.o: deflate.h zutil.h zlib.h zconf.h | ||||||
|  | example.o: zlib.h zconf.h | ||||||
|  | gzio.o: zutil.h zlib.h zconf.h | ||||||
|  | infblock.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h | ||||||
|  | infcodes.o: zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h | ||||||
|  | inffast.o: zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h | ||||||
|  | inflate.o: zutil.h zlib.h zconf.h infblock.h | ||||||
|  | inftrees.o: zutil.h zlib.h zconf.h inftrees.h | ||||||
|  | infutil.o: zutil.h zlib.h zconf.h inftrees.h infutil.h | ||||||
|  | minigzip.o: zlib.h zconf.h | ||||||
|  | trees.o: deflate.h zutil.h zlib.h zconf.h | ||||||
|  | uncompr.o: zlib.h zconf.h | ||||||
|  | zutil.o: zutil.h zlib.h zconf.h | ||||||
							
								
								
									
										37
									
								
								configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										37
									
								
								configure
									
									
									
									
										vendored
									
									
								
							| @@ -24,7 +24,6 @@ VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h` | |||||||
| AR=${AR-"ar rc"} | AR=${AR-"ar rc"} | ||||||
| RANLIB=${RANLIB-"ranlib"} | RANLIB=${RANLIB-"ranlib"} | ||||||
| prefix=${prefix-/usr/local} | prefix=${prefix-/usr/local} | ||||||
| exec_prefix=${exec_prefix-$prefix} |  | ||||||
| shared_ext='.so' | shared_ext='.so' | ||||||
| shared=0 | shared=0 | ||||||
| gcc=0 | gcc=0 | ||||||
| @@ -32,8 +31,10 @@ old_cc="$CC" | |||||||
| old_cflags="$CFLAGS" | old_cflags="$CFLAGS" | ||||||
|  |  | ||||||
| case "$1" in | case "$1" in | ||||||
|  |   -h* | --h*) echo 'syntax: configure [ --shared ] [--prefix PREFIX]'; exit 0;; | ||||||
|  |   -p*=* | --p*=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;; | ||||||
|  |   -p* | --p*) prefix="$2"; shift; shift;; | ||||||
|   -s* | --s*) shared=1; shift;; |   -s* | --s*) shared=1; shift;; | ||||||
|   -h* | --h*) echo 'syntax: configure [ --shared ]'; exit 0;; |  | ||||||
| esac | esac | ||||||
|  |  | ||||||
| test=ztest$$ | test=ztest$$ | ||||||
| @@ -61,15 +62,18 @@ else | |||||||
|   # find system name and corresponding cc options |   # find system name and corresponding cc options | ||||||
|   CC=${CC-cc} |   CC=${CC-cc} | ||||||
|   case `(uname -sr || echo unknown) 2>/dev/null` in |   case `(uname -sr || echo unknown) 2>/dev/null` in | ||||||
|   SunOS\ 5*) SFLAGS=${CFLAGS-"-fast -xcg89 -KPIC -R."} |   HP-UX*)    SFLAGS=${CFLAGS-"-O +z"} | ||||||
|              CFLAGS=${CFLAGS-"-fast -xcg89"} | 	     CFLAGS=${CFLAGS-"-O"} | ||||||
| 	     LDSHARED=${LDSHARED-"cc -G"};; | #	     LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"} | ||||||
|   SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"} | 	     LDSHARED=${LDSHARED-"ld -b"} | ||||||
| 	     CFLAGS=${CFLAGS-"-O2"} | 	     shared_ext='.sl' | ||||||
| 	     LDSHARED=${LDSHARED-"ld"};; | 	     SHAREDLIB='libz.sl';; | ||||||
|   IRIX*)     SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."} |   IRIX*)     SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."} | ||||||
| 	     CFLAGS=${CFLAGS-"-ansi -O2"} | 	     CFLAGS=${CFLAGS-"-ansi -O2"} | ||||||
| 	     LDSHARED=${LDSHARED-"cc -shared"};; | 	     LDSHARED=${LDSHARED-"cc -shared"};; | ||||||
|  |   OSF1)      SFLAGS=${CFLAGS-"-O -std1"} | ||||||
|  | 	     CFLAGS=${CFLAGS-"-O -std1"} | ||||||
|  | 	     LDSHARED=${LDSHARED-"cc -shared"};; | ||||||
|   QNX*)      SFLAGS=${CFLAGS-"-4 -O"} |   QNX*)      SFLAGS=${CFLAGS-"-4 -O"} | ||||||
|              CFLAGS=${CFLAGS-"-4 -O"} |              CFLAGS=${CFLAGS-"-4 -O"} | ||||||
| 	     LDSHARED=${LDSHARED-"cc"} | 	     LDSHARED=${LDSHARED-"cc"} | ||||||
| @@ -78,16 +82,20 @@ else | |||||||
|   SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "} |   SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "} | ||||||
| 	     CFLAGS=${CFLAGS-"-O3"} | 	     CFLAGS=${CFLAGS-"-O3"} | ||||||
| 	     LDSHARED=${LDSHARED-"cc -dy -KPIC -G"};; | 	     LDSHARED=${LDSHARED-"cc -dy -KPIC -G"};; | ||||||
|   HP-UX*)    SFLAGS=${CFLAGS-"-O +z"} |   SunOS\ 5*) SFLAGS=${CFLAGS-"-fast -xcg89 -KPIC -R."} | ||||||
| 	     CFLAGS=${CFLAGS-"-O"} |              CFLAGS=${CFLAGS-"-fast -xcg89"} | ||||||
| #	     LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"} | 	     LDSHARED=${LDSHARED-"cc -G"};; | ||||||
| 	     LDSHARED=${LDSHARED-"ld -b"} |   SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"} | ||||||
| 	     shared_ext='.sl' | 	     CFLAGS=${CFLAGS-"-O2"} | ||||||
| 	     SHAREDLIB='libz.sl';; | 	     LDSHARED=${LDSHARED-"ld"};; | ||||||
|   UNIX_System_V\ 4.2.0)  |   UNIX_System_V\ 4.2.0)  | ||||||
| 	     SFLAGS=${CFLAGS-"-KPIC -O"} | 	     SFLAGS=${CFLAGS-"-KPIC -O"} | ||||||
| 	     CFLAGS=${CFLAGS-"-O"} | 	     CFLAGS=${CFLAGS-"-O"} | ||||||
| 	     LDSHARED=${LDSHARED-"cc -G"};; | 	     LDSHARED=${LDSHARED-"cc -G"};; | ||||||
|  |   UNIX_SV\ 4.2MP) | ||||||
|  | 	     SFLAGS=${CFLAGS-"-Kconform_pic -O"} | ||||||
|  | 	     CFLAGS=${CFLAGS-"-O"} | ||||||
|  | 	     LDSHARED=${LDSHARED-"cc -G"};; | ||||||
|   # send working options for other systems to support@gzip.org |   # send working options for other systems to support@gzip.org | ||||||
|   *)         SFLAGS=${CFLAGS-"-O"} |   *)         SFLAGS=${CFLAGS-"-O"} | ||||||
| 	     CFLAGS=${CFLAGS-"-O"} | 	     CFLAGS=${CFLAGS-"-O"} | ||||||
| @@ -152,5 +160,4 @@ sed < Makefile.in " | |||||||
| /^RANLIB *=/s%=.*%=$RANLIB% | /^RANLIB *=/s%=.*%=$RANLIB% | ||||||
| /^VER *=/s%=.*%=$VER% | /^VER *=/s%=.*%=$VER% | ||||||
| /^prefix *=/s%=.*%=$prefix% | /^prefix *=/s%=.*%=$prefix% | ||||||
| /^exec_prefix *=/s%=.*%=$exec_prefix% |  | ||||||
| " > Makefile | " > Makefile | ||||||
|   | |||||||
| @@ -7,6 +7,10 @@ for help about these, not the zlib authors. Thanks. | |||||||
| asm386/     by Gilles Vollant <info@winimage.com> | asm386/     by Gilles Vollant <info@winimage.com> | ||||||
| 	386 asm code replacing longest_match(), for Visual C++ 4.2 and ML 6.11c | 	386 asm code replacing longest_match(), for Visual C++ 4.2 and ML 6.11c | ||||||
|  |  | ||||||
|  | minizip/    by Gilles Vollant <info@winimage.com> | ||||||
|  | 	Mini zip and unzip based on zlib | ||||||
|  |         See http://www.winimage.com/zLibDll/unzip.html | ||||||
|  |  | ||||||
| iostream/   by Kevin Ruland <kevin@rodin.wustl.edu> | iostream/   by Kevin Ruland <kevin@rodin.wustl.edu> | ||||||
|         A C++ I/O streams interface to the zlib gz* functions |         A C++ I/O streams interface to the zlib gz* functions | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										74
									
								
								contrib/asm386/zlibvc.def
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								contrib/asm386/zlibvc.def
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,74 @@ | |||||||
|  | LIBRARY		"zlib" | ||||||
|  |  | ||||||
|  | DESCRIPTION	'"""zlib data compression library"""' | ||||||
|  |  | ||||||
|  |  | ||||||
|  | VERSION		1.11 | ||||||
|  |  | ||||||
|  |  | ||||||
|  | HEAPSIZE	1048576,8192 | ||||||
|  |  | ||||||
|  | EXPORTS | ||||||
|  |     adler32                        @1 | ||||||
|  |     compress                       @2 | ||||||
|  |     crc32                          @3 | ||||||
|  |     deflate                        @4 | ||||||
|  |     deflateCopy                    @5 | ||||||
|  |     deflateEnd                     @6 | ||||||
|  |     deflateInit2_                  @7 | ||||||
|  |     deflateInit_                   @8 | ||||||
|  |     deflateParams                  @9 | ||||||
|  |     deflateReset                   @10 | ||||||
|  |     deflateSetDictionary           @11 | ||||||
|  |     gzclose                        @12 | ||||||
|  |     gzdopen                        @13 | ||||||
|  |     gzerror                        @14 | ||||||
|  |     gzflush                        @15 | ||||||
|  |     gzopen                         @16 | ||||||
|  |     gzread                         @17 | ||||||
|  |     gzwrite                        @18 | ||||||
|  |     inflate                        @19 | ||||||
|  |     inflateEnd                     @20 | ||||||
|  |     inflateInit2_                  @21 | ||||||
|  |     inflateInit_                   @22 | ||||||
|  |     inflateReset                   @23 | ||||||
|  |     inflateSetDictionary           @24 | ||||||
|  |     inflateSync                    @25 | ||||||
|  |     uncompress                     @26 | ||||||
|  |     zlibVersion                    @27 | ||||||
|  |     gzprintf                       @28 | ||||||
|  |     gzputc                         @29 | ||||||
|  |     gzgetc                         @30 | ||||||
|  |     gzseek                         @31 | ||||||
|  |     gzrewind                       @32 | ||||||
|  |     gztell                         @33 | ||||||
|  |     gzeof                          @34 | ||||||
|  |     gzsetparams                    @35 | ||||||
|  |     zError                         @36 | ||||||
|  |     inflateSyncPoint               @37 | ||||||
|  |     get_crc_table                  @38 | ||||||
|  |     compress2                      @39 | ||||||
|  |     gzputs                         @40 | ||||||
|  |     gzgets                         @41 | ||||||
|  |  | ||||||
|  | 	unzOpen                       @61 | ||||||
|  | 	unzClose                      @62 | ||||||
|  | 	unzGetGlobalInfo              @63 | ||||||
|  | 	unzGetCurrentFileInfo         @64 | ||||||
|  | 	unzGoToFirstFile              @65 | ||||||
|  | 	unzGoToNextFile               @66 | ||||||
|  | 	unzOpenCurrentFile            @67 | ||||||
|  | 	unzReadCurrentFile            @68 | ||||||
|  | 	unztell                       @70 | ||||||
|  | 	unzeof                        @71 | ||||||
|  | 	unzCloseCurrentFile           @72 | ||||||
|  | 	unzGetGlobalComment           @73 | ||||||
|  | 	unzStringFileNameCompare      @74 | ||||||
|  | 	unzLocateFile                 @75 | ||||||
|  | 	unzGetLocalExtrafield         @76 | ||||||
|  |  | ||||||
|  | 	zipOpen                       @80 | ||||||
|  | 	zipOpenNewFileInZip           @81 | ||||||
|  | 	zipWriteInFileInZip           @82 | ||||||
|  | 	zipCloseFileInZip             @83 | ||||||
|  | 	zipClose                      @84 | ||||||
| @@ -47,7 +47,8 @@ CFG=zlibvc - Win32 Release | |||||||
| # PROP Target_Dir "" | # PROP Target_Dir "" | ||||||
| CPP=cl.exe | CPP=cl.exe | ||||||
| # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c | # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c | ||||||
| # ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /YX /FD /c | # ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c | ||||||
|  | # SUBTRACT CPP /YX | ||||||
| MTL=midl.exe | MTL=midl.exe | ||||||
| # ADD BASE MTL /nologo /D "NDEBUG" /win32 | # ADD BASE MTL /nologo /D "NDEBUG" /win32 | ||||||
| # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | ||||||
| @@ -76,7 +77,8 @@ LINK32=link.exe | |||||||
| # PROP Target_Dir "" | # PROP Target_Dir "" | ||||||
| CPP=cl.exe | CPP=cl.exe | ||||||
| # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c | # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c | ||||||
| # ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /YX /FD /c | # ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /FD /c | ||||||
|  | # SUBTRACT CPP /YX | ||||||
| MTL=midl.exe | MTL=midl.exe | ||||||
| # ADD BASE MTL /nologo /D "_DEBUG" /win32 | # ADD BASE MTL /nologo /D "_DEBUG" /win32 | ||||||
| # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 | # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 | ||||||
| @@ -109,7 +111,8 @@ MTL=midl.exe | |||||||
| # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | ||||||
| CPP=cl.exe | CPP=cl.exe | ||||||
| # ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c | # ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c | ||||||
| # ADD CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c | # ADD CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c | ||||||
|  | # SUBTRACT CPP /YX | ||||||
| RSC=rc.exe | RSC=rc.exe | ||||||
| # ADD BASE RSC /l 0x40c /d "NDEBUG" | # ADD BASE RSC /l 0x40c /d "NDEBUG" | ||||||
| # ADD RSC /l 0x40c /d "NDEBUG" | # ADD RSC /l 0x40c /d "NDEBUG" | ||||||
| @@ -138,7 +141,8 @@ LINK32=link.exe | |||||||
| # PROP Target_Dir "" | # PROP Target_Dir "" | ||||||
| CPP=cl.exe | CPP=cl.exe | ||||||
| # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c | # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c | ||||||
| # ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c | # ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c | ||||||
|  | # SUBTRACT CPP /YX | ||||||
| MTL=midl.exe | MTL=midl.exe | ||||||
| # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | ||||||
| # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | ||||||
| @@ -170,7 +174,8 @@ LINK32=link.exe | |||||||
| # PROP Target_Dir "" | # PROP Target_Dir "" | ||||||
| CPP=cl.exe | CPP=cl.exe | ||||||
| # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /YX /FD /c | # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /YX /FD /c | ||||||
| # ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /YX /FD /c | # ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c | ||||||
|  | # SUBTRACT CPP /YX | ||||||
| MTL=midl.exe | MTL=midl.exe | ||||||
| # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | ||||||
| # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | ||||||
| @@ -525,6 +530,40 @@ DEP_CPP_UNCOM=\ | |||||||
| 	".\zlib.h"\ | 	".\zlib.h"\ | ||||||
| 	 | 	 | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\unzip.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\zip.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
| !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
| !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|   | |||||||
| @@ -3,7 +3,19 @@ Microsoft Developer Studio Workspace File, Format Version 5.00 | |||||||
|  |  | ||||||
| ############################################################################### | ############################################################################### | ||||||
|  |  | ||||||
| Project: "zlibvc"=".\zlibvc.dsp" - Package Owner=<4> | Project: "zlibstat"=.\zlibstat.dsp - Package Owner=<4> | ||||||
|  |  | ||||||
|  | Package=<5> | ||||||
|  | {{{ | ||||||
|  | }}} | ||||||
|  |  | ||||||
|  | Package=<4> | ||||||
|  | {{{ | ||||||
|  | }}} | ||||||
|  |  | ||||||
|  | ############################################################################### | ||||||
|  |  | ||||||
|  | Project: "zlibvc"=.\zlibvc.dsp - Package Owner=<4> | ||||||
|  |  | ||||||
| Package=<5> | Package=<5> | ||||||
| {{{ | {{{ | ||||||
|   | |||||||
							
								
								
									
										38
									
								
								contrib/minizip/ChangeLogUnzip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								contrib/minizip/ChangeLogUnzip
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | |||||||
|  | Change in 0.15: (19 Mar 98) | ||||||
|  | - fix memory leak in minizip.c | ||||||
|  |  | ||||||
|  | Change in 0.14: (10 Mar 98) | ||||||
|  | - fix bugs in minizip.c sample for zipping big file | ||||||
|  | - fix problem in month in date handling | ||||||
|  | - fix bug in unzlocal_GetCurrentFileInfoInternal in unzip.c for  | ||||||
|  |     comment handling | ||||||
|  |  | ||||||
|  | Change in 0.13: (6 Mar 98) | ||||||
|  | - fix bugs in zip.c | ||||||
|  | - add real minizip sample | ||||||
|  |  | ||||||
|  | Change in 0.12: (4 Mar 98) | ||||||
|  | - add zip.c and zip.h for creates .zip file | ||||||
|  | - fix change_file_date in miniunz.c for Unix (Jean-loup Gailly) | ||||||
|  | - fix miniunz.c for file without specific record for directory | ||||||
|  |  | ||||||
|  | Change in 0.11: (3 Mar 98) | ||||||
|  | - fix bug in unzGetCurrentFileInfo for get extra field and comment | ||||||
|  | - enhance miniunz sample, remove the bad unztst.c sample | ||||||
|  |  | ||||||
|  | Change in 0.10: (2 Mar 98) | ||||||
|  | - fix bug in unzReadCurrentFile | ||||||
|  | - rename unzip* to unz* function and structure | ||||||
|  | - remove Windows-like hungary notation variable name | ||||||
|  | - modify some structure in unzip.h | ||||||
|  | - add somes comment in source | ||||||
|  | - remove unzipGetcCurrentFile function | ||||||
|  | - replace ZUNZEXPORT by ZEXPORT | ||||||
|  | - add unzGetLocalExtrafield for get the local extrafield info | ||||||
|  | - add a new sample, miniunz.c | ||||||
|  |  | ||||||
|  | Change in 0.4: (25 Feb 98) | ||||||
|  | - suppress the type unzipFileInZip.  | ||||||
|  |   Only on file in the zipfile can be open at the same time | ||||||
|  | - fix somes typo in code | ||||||
|  | - added tm_unz structure in unzip_file_info (date/time in readable format) | ||||||
							
								
								
									
										25
									
								
								contrib/minizip/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								contrib/minizip/Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | |||||||
|  | CC=cc | ||||||
|  | CFLAGS=-O -I../.. | ||||||
|  |  | ||||||
|  | UNZ_OBJS = miniunz.o unzip.o ../../libz.a | ||||||
|  | ZIP_OBJS = minizip.o zip.o   ../../libz.a | ||||||
|  |  | ||||||
|  | .c.o: | ||||||
|  | 	$(CC) -c $(CFLAGS) $*.c | ||||||
|  |  | ||||||
|  | all: miniunz minizip | ||||||
|  |  | ||||||
|  | miniunz:  $(UNZ_OBJS) | ||||||
|  | 	$(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) | ||||||
|  |  | ||||||
|  | minizip:  $(ZIP_OBJS) | ||||||
|  | 	$(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) | ||||||
|  |  | ||||||
|  | test:	miniunz minizip | ||||||
|  | 	./minizip test readme.txt | ||||||
|  | 	./miniunz -l test.zip | ||||||
|  | 	mv readme.txt readme.old | ||||||
|  | 	./miniunz test.zip | ||||||
|  |  | ||||||
|  | clean: | ||||||
|  | 	/bin/rm -f *.o *~ minizip miniunz | ||||||
							
								
								
									
										508
									
								
								contrib/minizip/miniunz.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										508
									
								
								contrib/minizip/miniunz.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,508 @@ | |||||||
|  | #include <stdio.h> | ||||||
|  | #include <stdlib.h> | ||||||
|  | #include <string.h> | ||||||
|  | #include <time.h> | ||||||
|  | #include <errno.h> | ||||||
|  | #include <fcntl.h> | ||||||
|  |  | ||||||
|  | #ifdef unix | ||||||
|  | # include <unistd.h> | ||||||
|  | # include <utime.h> | ||||||
|  | #else | ||||||
|  | # include <direct.h> | ||||||
|  | # include <io.h> | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #include "unzip.h" | ||||||
|  |  | ||||||
|  | #define CASESENSITIVITY (0) | ||||||
|  | #define WRITEBUFFERSIZE (8192) | ||||||
|  |  | ||||||
|  | /* | ||||||
|  |   mini unzip, demo of unzip package | ||||||
|  |  | ||||||
|  |   usage : | ||||||
|  |   Usage : miniunz [-exvlo] file.zip [file_to_extract] | ||||||
|  |  | ||||||
|  |   list the file in the zipfile, and print the content of FILE_ID.ZIP or README.TXT | ||||||
|  |     if it exists | ||||||
|  | */ | ||||||
|  |  | ||||||
|  |  | ||||||
|  | /* change_file_date : change the date/time of a file | ||||||
|  |     filename : the filename of the file where date/time must be modified | ||||||
|  |     dosdate : the new date at the MSDos format (4 bytes) | ||||||
|  |     tmu_date : the SAME new date at the tm_unz format */ | ||||||
|  | void change_file_date(filename,dosdate,tmu_date) | ||||||
|  | 	const char *filename; | ||||||
|  | 	uLong dosdate; | ||||||
|  | 	tm_unz tmu_date; | ||||||
|  | { | ||||||
|  | #ifdef WIN32 | ||||||
|  |   HANDLE hFile; | ||||||
|  |   FILETIME ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite; | ||||||
|  |  | ||||||
|  |   hFile = CreateFile(filename,GENERIC_READ | GENERIC_WRITE, | ||||||
|  |                       0,NULL,OPEN_EXISTING,0,NULL); | ||||||
|  |   GetFileTime(hFile,&ftCreate,&ftLastAcc,&ftLastWrite); | ||||||
|  |   DosDateTimeToFileTime((WORD)(dosdate>>16),(WORD)dosdate,&ftLocal); | ||||||
|  |   LocalFileTimeToFileTime(&ftLocal,&ftm); | ||||||
|  |   SetFileTime(hFile,&ftm,&ftLastAcc,&ftm); | ||||||
|  |   CloseHandle(hFile); | ||||||
|  | #else | ||||||
|  | #ifdef unix | ||||||
|  |   struct utimbuf ut; | ||||||
|  |   struct tm newdate; | ||||||
|  |   newdate.tm_sec = tmu_date.tm_sec; | ||||||
|  |   newdate.tm_min=tmu_date.tm_min; | ||||||
|  |   newdate.tm_hour=tmu_date.tm_hour; | ||||||
|  |   newdate.tm_mday=tmu_date.tm_mday; | ||||||
|  |   newdate.tm_mon=tmu_date.tm_mon; | ||||||
|  |   if (tmu_date.tm_year > 1900) | ||||||
|  |       newdate.tm_year=tmu_date.tm_year - 1900; | ||||||
|  |   else | ||||||
|  |       newdate.tm_year=tmu_date.tm_year ; | ||||||
|  |   newdate.tm_isdst=-1; | ||||||
|  |  | ||||||
|  |   ut.actime=ut.modtime=mktime(&newdate); | ||||||
|  |   utime(filename,&ut); | ||||||
|  | #endif | ||||||
|  | #endif | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | /* mymkdir and change_file_date are not 100 % portable | ||||||
|  |    As I don't know well Unix, I wait feedback for the unix portion */ | ||||||
|  |  | ||||||
|  | int mymkdir(dirname) | ||||||
|  | 	const char* dirname; | ||||||
|  | { | ||||||
|  |     int ret=0; | ||||||
|  | #ifdef WIN32 | ||||||
|  | 	ret = mkdir(dirname); | ||||||
|  | #else | ||||||
|  | #ifdef unix | ||||||
|  | 	ret = mkdir (dirname,0775); | ||||||
|  | #endif | ||||||
|  | #endif | ||||||
|  | 	return ret; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | int makedir (newdir) | ||||||
|  |     char *newdir; | ||||||
|  | { | ||||||
|  |   char *buffer ; | ||||||
|  |   char *p; | ||||||
|  |   int  len = strlen(newdir);   | ||||||
|  |  | ||||||
|  |   if (len <= 0)  | ||||||
|  |     return 0; | ||||||
|  |  | ||||||
|  |   buffer = (char*)malloc(len+1); | ||||||
|  |   strcpy(buffer,newdir); | ||||||
|  |    | ||||||
|  |   if (buffer[len-1] == '/') { | ||||||
|  |     buffer[len-1] = '\0'; | ||||||
|  |   } | ||||||
|  |   if (mymkdir(buffer) == 0) | ||||||
|  |     { | ||||||
|  |       free(buffer); | ||||||
|  |       return 1; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |   p = buffer+1; | ||||||
|  |   while (1) | ||||||
|  |     { | ||||||
|  |       char hold; | ||||||
|  |  | ||||||
|  |       while(*p && *p != '\\' && *p != '/') | ||||||
|  |         p++; | ||||||
|  |       hold = *p; | ||||||
|  |       *p = 0; | ||||||
|  |       if ((mymkdir(buffer) == -1) && (errno == ENOENT)) | ||||||
|  |         { | ||||||
|  |           printf("couldn't create directory %s\n",buffer); | ||||||
|  |           free(buffer); | ||||||
|  |           return 0; | ||||||
|  |         } | ||||||
|  |       if (hold == 0) | ||||||
|  |         break; | ||||||
|  |       *p++ = hold; | ||||||
|  |     } | ||||||
|  |   free(buffer); | ||||||
|  |   return 1; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | void do_banner() | ||||||
|  | { | ||||||
|  | 	printf("MiniUnz 0.15, demo of zLib + Unz package written by Gilles Vollant\n"); | ||||||
|  | 	printf("more info at http://wwww.winimage/zLibDll/unzip.htm\n\n"); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | void do_help() | ||||||
|  | {	 | ||||||
|  | 	printf("Usage : miniunz [-exvlo] file.zip [file_to_extract]\n\n") ; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | int do_list(uf) | ||||||
|  | 	unzFile uf; | ||||||
|  | { | ||||||
|  | 	uLong i; | ||||||
|  | 	unz_global_info gi; | ||||||
|  | 	int err; | ||||||
|  |  | ||||||
|  | 	err = unzGetGlobalInfo (uf,&gi); | ||||||
|  | 	if (err!=UNZ_OK) | ||||||
|  | 		printf("error %d with zipfile in unzGetGlobalInfo \n",err); | ||||||
|  |     printf(" Length  Method   Size  Ratio   Date    Time   CRC-32     Name\n"); | ||||||
|  |     printf(" ------  ------   ----  -----   ----    ----   ------     ----\n"); | ||||||
|  | 	for (i=0;i<gi.number_entry;i++) | ||||||
|  | 	{ | ||||||
|  | 		char filename_inzip[256]; | ||||||
|  | 		unz_file_info file_info; | ||||||
|  | 		uLong ratio=0; | ||||||
|  | 		const char *string_method; | ||||||
|  | 		err = unzGetCurrentFileInfo(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0); | ||||||
|  | 		if (err!=UNZ_OK) | ||||||
|  | 		{ | ||||||
|  | 			printf("error %d with zipfile in unzGetCurrentFileInfo\n",err); | ||||||
|  | 			break; | ||||||
|  | 		} | ||||||
|  | 		if (file_info.uncompressed_size>0) | ||||||
|  | 			ratio = (file_info.compressed_size*100)/file_info.uncompressed_size; | ||||||
|  |  | ||||||
|  | 		if (file_info.compression_method==0) | ||||||
|  | 			string_method="Stored"; | ||||||
|  | 		else | ||||||
|  | 		if (file_info.compression_method==Z_DEFLATED) | ||||||
|  | 		{ | ||||||
|  | 			uInt iLevel=(uInt)((file_info.flag & 0x6)/2); | ||||||
|  | 			if (iLevel==0) | ||||||
|  | 			  string_method="Defl:N"; | ||||||
|  | 			else if (iLevel==1) | ||||||
|  | 			  string_method="Defl:X"; | ||||||
|  | 			else if ((iLevel==2) || (iLevel==3)) | ||||||
|  | 			  string_method="Defl:F"; /* 2:fast , 3 : extra fast*/ | ||||||
|  | 		} | ||||||
|  | 		else | ||||||
|  | 			string_method="Unkn. "; | ||||||
|  |  | ||||||
|  | 		printf("%7lu  %6s %7lu %3lu%%  %2.2lu-%2.2lu-%2.2lu  %2.2lu:%2.2lu  %8.8lx   %s\n", | ||||||
|  | 			    file_info.uncompressed_size,string_method,file_info.compressed_size, | ||||||
|  | 				ratio, | ||||||
|  | 				(uLong)file_info.tmu_date.tm_mon + 1, | ||||||
|  |                 (uLong)file_info.tmu_date.tm_mday, | ||||||
|  | 				(uLong)file_info.tmu_date.tm_year % 100, | ||||||
|  | 				(uLong)file_info.tmu_date.tm_hour,(uLong)file_info.tmu_date.tm_min, | ||||||
|  | 				(uLong)file_info.crc,filename_inzip); | ||||||
|  | 		if ((i+1)<gi.number_entry) | ||||||
|  | 		{ | ||||||
|  | 			err = unzGoToNextFile(uf); | ||||||
|  | 			if (err!=UNZ_OK) | ||||||
|  | 			{ | ||||||
|  | 				printf("error %d with zipfile in unzGoToNextFile\n",err); | ||||||
|  | 				break; | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	return 0; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite) | ||||||
|  | 	unzFile uf; | ||||||
|  | 	const int* popt_extract_without_path; | ||||||
|  |     int* popt_overwrite; | ||||||
|  | { | ||||||
|  | 	char filename_inzip[256]; | ||||||
|  | 	char* filename_withoutpath; | ||||||
|  | 	char* p; | ||||||
|  |     int err=UNZ_OK; | ||||||
|  |     FILE *fout=NULL; | ||||||
|  |     void* buf; | ||||||
|  |     uInt size_buf; | ||||||
|  | 	 | ||||||
|  | 	unz_file_info file_info; | ||||||
|  | 	uLong ratio=0; | ||||||
|  | 	err = unzGetCurrentFileInfo(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0); | ||||||
|  |  | ||||||
|  | 	if (err!=UNZ_OK) | ||||||
|  | 	{ | ||||||
|  | 		printf("error %d with zipfile in unzGetCurrentFileInfo\n",err); | ||||||
|  | 		return err; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  |     size_buf = WRITEBUFFERSIZE; | ||||||
|  |     buf = (void*)malloc(size_buf); | ||||||
|  |     if (buf==NULL) | ||||||
|  |     { | ||||||
|  |         printf("Error allocating memory\n"); | ||||||
|  |         return UNZ_INTERNALERROR; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | 	p = filename_withoutpath = filename_inzip; | ||||||
|  | 	while ((*p) != '\0') | ||||||
|  | 	{ | ||||||
|  | 		if (((*p)=='/') || ((*p)=='\\')) | ||||||
|  | 			filename_withoutpath = p+1; | ||||||
|  | 		p++; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	if ((*filename_withoutpath)=='\0') | ||||||
|  | 	{ | ||||||
|  | 		if ((*popt_extract_without_path)==0) | ||||||
|  | 		{ | ||||||
|  | 			printf("creating directory: %s\n",filename_inzip); | ||||||
|  | 			mymkdir(filename_inzip); | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 	else | ||||||
|  | 	{ | ||||||
|  | 		const char* write_filename; | ||||||
|  | 		int skip=0; | ||||||
|  |  | ||||||
|  | 		if ((*popt_extract_without_path)==0) | ||||||
|  | 			write_filename = filename_inzip; | ||||||
|  | 		else | ||||||
|  | 			write_filename = filename_withoutpath; | ||||||
|  |  | ||||||
|  | 		err = unzOpenCurrentFile(uf); | ||||||
|  | 		if (err!=UNZ_OK) | ||||||
|  | 		{ | ||||||
|  | 			printf("error %d with zipfile in unzOpenCurrentFile\n",err); | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		if (((*popt_overwrite)==0) && (err==UNZ_OK)) | ||||||
|  | 		{ | ||||||
|  | 			char rep; | ||||||
|  | 			FILE* ftestexist; | ||||||
|  | 			ftestexist = fopen(write_filename,"rb"); | ||||||
|  | 			if (ftestexist!=NULL) | ||||||
|  | 			{ | ||||||
|  | 				fclose(ftestexist); | ||||||
|  | 				do | ||||||
|  | 				{ | ||||||
|  | 					char answer[128]; | ||||||
|  | 					printf("The file %s exist. Overwrite ? [y]es, [n]o, [A]ll: ",write_filename); | ||||||
|  | 					scanf("%1s",answer); | ||||||
|  | 					rep = answer[0] ; | ||||||
|  | 					if ((rep>='a') && (rep<='z')) | ||||||
|  | 						rep -= 0x20; | ||||||
|  | 				} | ||||||
|  | 				while ((rep!='Y') && (rep!='N') && (rep!='A')); | ||||||
|  | 			} | ||||||
|  |  | ||||||
|  | 			if (rep == 'N') | ||||||
|  | 				skip = 1; | ||||||
|  |  | ||||||
|  | 			if (rep == 'A') | ||||||
|  | 				*popt_overwrite=1; | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		if ((skip==0) && (err==UNZ_OK)) | ||||||
|  | 		{ | ||||||
|  | 			fout=fopen(write_filename,"wb"); | ||||||
|  |  | ||||||
|  |             /* some zipfile don't contain directory alone before file */ | ||||||
|  |             if ((fout==NULL) && ((*popt_extract_without_path)==0) &&  | ||||||
|  |                                 (filename_withoutpath!=(char*)filename_inzip)) | ||||||
|  |             { | ||||||
|  |                 char c=*(filename_withoutpath-1); | ||||||
|  |                 *(filename_withoutpath-1)='\0'; | ||||||
|  |                 makedir(write_filename); | ||||||
|  |                 *(filename_withoutpath-1)=c; | ||||||
|  |                 fout=fopen(write_filename,"wb"); | ||||||
|  |             } | ||||||
|  |  | ||||||
|  | 			if (fout==NULL) | ||||||
|  | 			{ | ||||||
|  | 				printf("error opening %s\n",write_filename); | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		if (fout!=NULL) | ||||||
|  | 		{ | ||||||
|  | 			printf(" extracting: %s\n",write_filename); | ||||||
|  |  | ||||||
|  | 			do | ||||||
|  | 			{ | ||||||
|  | 				err = unzReadCurrentFile(uf,buf,size_buf); | ||||||
|  | 				if (err<0)	 | ||||||
|  | 				{ | ||||||
|  | 					printf("error %d with zipfile in unzReadCurrentFile\n",err); | ||||||
|  | 					break; | ||||||
|  | 				} | ||||||
|  | 				if (err>0) | ||||||
|  | 					if (fwrite(buf,err,1,fout)!=1) | ||||||
|  | 					{ | ||||||
|  | 						printf("error in writing extracted file\n"); | ||||||
|  |                         err=UNZ_ERRNO; | ||||||
|  | 						break; | ||||||
|  | 					} | ||||||
|  | 			} | ||||||
|  | 			while (err>0); | ||||||
|  | 			fclose(fout); | ||||||
|  | 			if (err==0)  | ||||||
|  | 				change_file_date(write_filename,file_info.dosDate, | ||||||
|  | 					             file_info.tmu_date); | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  |         if (err==UNZ_OK) | ||||||
|  |         { | ||||||
|  | 		    err = unzCloseCurrentFile (uf); | ||||||
|  | 		    if (err!=UNZ_OK) | ||||||
|  | 		    { | ||||||
|  | 			    printf("error %d with zipfile in unzCloseCurrentFile\n",err); | ||||||
|  | 		    } | ||||||
|  |         } | ||||||
|  |         else | ||||||
|  |             unzCloseCurrentFile(uf); /* don't lose the error */        | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  |     free(buf);     | ||||||
|  |     return err; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | int do_extract(uf,opt_extract_without_path,opt_overwrite) | ||||||
|  | 	unzFile uf; | ||||||
|  | 	int opt_extract_without_path; | ||||||
|  |     int opt_overwrite; | ||||||
|  | { | ||||||
|  | 	uLong i; | ||||||
|  | 	unz_global_info gi; | ||||||
|  | 	int err; | ||||||
|  | 	FILE* fout=NULL;	 | ||||||
|  |  | ||||||
|  | 	err = unzGetGlobalInfo (uf,&gi); | ||||||
|  | 	if (err!=UNZ_OK) | ||||||
|  | 		printf("error %d with zipfile in unzGetGlobalInfo \n",err); | ||||||
|  |  | ||||||
|  | 	for (i=0;i<gi.number_entry;i++) | ||||||
|  | 	{ | ||||||
|  |         if (do_extract_currentfile(uf,&opt_extract_without_path, | ||||||
|  |                                       &opt_overwrite) != UNZ_OK) | ||||||
|  |             break; | ||||||
|  |  | ||||||
|  | 		if ((i+1)<gi.number_entry) | ||||||
|  | 		{ | ||||||
|  | 			err = unzGoToNextFile(uf); | ||||||
|  | 			if (err!=UNZ_OK) | ||||||
|  | 			{ | ||||||
|  | 				printf("error %d with zipfile in unzGoToNextFile\n",err); | ||||||
|  | 				break; | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	return 0; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite) | ||||||
|  | 	unzFile uf; | ||||||
|  | 	const char* filename; | ||||||
|  | 	int opt_extract_without_path; | ||||||
|  |     int opt_overwrite; | ||||||
|  | { | ||||||
|  |     int err = UNZ_OK; | ||||||
|  |     if (unzLocateFile(uf,filename,CASESENSITIVITY)!=UNZ_OK) | ||||||
|  |     { | ||||||
|  |         printf("file %s not found in the zipfile\n",filename); | ||||||
|  |         return 2; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     if (do_extract_currentfile(uf,&opt_extract_without_path, | ||||||
|  |                                       &opt_overwrite) == UNZ_OK) | ||||||
|  |         return 0; | ||||||
|  |     else | ||||||
|  |         return 1; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | int main(argc,argv) | ||||||
|  | 	int argc; | ||||||
|  | 	char *argv[]; | ||||||
|  | { | ||||||
|  | 	const char *zipfilename=NULL; | ||||||
|  |     const char *filename_to_extract=NULL; | ||||||
|  | 	int i; | ||||||
|  | 	int opt_do_list=0; | ||||||
|  | 	int opt_do_extract=1; | ||||||
|  | 	int opt_do_extract_withoutpath=0; | ||||||
|  | 	int opt_overwrite=0; | ||||||
|  | 	char filename_try[512]; | ||||||
|  | 	unzFile uf=NULL; | ||||||
|  |  | ||||||
|  | 	do_banner(); | ||||||
|  | 	if (argc==1) | ||||||
|  | 	{ | ||||||
|  | 		do_help(); | ||||||
|  | 		exit(0); | ||||||
|  | 	} | ||||||
|  | 	else | ||||||
|  | 	{ | ||||||
|  | 		for (i=1;i<argc;i++) | ||||||
|  | 		{ | ||||||
|  | 			if ((*argv[i])=='-') | ||||||
|  | 			{ | ||||||
|  | 				const char *p=argv[i]+1; | ||||||
|  | 				 | ||||||
|  | 				while ((*p)!='\0') | ||||||
|  | 				{			 | ||||||
|  | 					char c=*(p++);; | ||||||
|  | 					if ((c=='l') || (c=='L')) | ||||||
|  | 						opt_do_list = 1; | ||||||
|  | 					if ((c=='v') || (c=='V')) | ||||||
|  | 						opt_do_list = 1; | ||||||
|  | 					if ((c=='x') || (c=='X')) | ||||||
|  | 						opt_do_extract = 1; | ||||||
|  | 					if ((c=='e') || (c=='E')) | ||||||
|  | 						opt_do_extract = opt_do_extract_withoutpath = 1; | ||||||
|  | 					if ((c=='o') || (c=='O')) | ||||||
|  | 						opt_overwrite=1; | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 			else | ||||||
|  |             { | ||||||
|  | 				if (zipfilename == NULL) | ||||||
|  | 					zipfilename = argv[i]; | ||||||
|  |                 else if (filename_to_extract==NULL) | ||||||
|  |                         filename_to_extract = argv[i] ; | ||||||
|  |             } | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	if (zipfilename!=NULL) | ||||||
|  | 	{ | ||||||
|  | 		strcpy(filename_try,zipfilename); | ||||||
|  | 		uf = unzOpen(zipfilename); | ||||||
|  | 		if (uf==NULL) | ||||||
|  | 		{ | ||||||
|  | 			strcat(filename_try,".zip"); | ||||||
|  | 			uf = unzOpen(filename_try); | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	if (uf==NULL) | ||||||
|  | 	{ | ||||||
|  | 		printf("Cannot open %s or %s.zip\n",zipfilename,zipfilename); | ||||||
|  | 		exit (1); | ||||||
|  | 	} | ||||||
|  |     printf("%s opened\n",filename_try); | ||||||
|  |  | ||||||
|  | 	if (opt_do_list==1) | ||||||
|  | 		return do_list(uf); | ||||||
|  | 	else if (opt_do_extract==1) | ||||||
|  |     { | ||||||
|  |         if (filename_to_extract == NULL) | ||||||
|  | 		    return do_extract(uf,opt_do_extract_withoutpath,opt_overwrite); | ||||||
|  |         else | ||||||
|  |             return do_extract_onefile(uf,filename_to_extract, | ||||||
|  |                                       opt_do_extract_withoutpath,opt_overwrite); | ||||||
|  |     } | ||||||
|  | 	unzCloseCurrentFile(uf); | ||||||
|  |  | ||||||
|  | 	return 0;  /* to avoid warning */ | ||||||
|  | } | ||||||
							
								
								
									
										302
									
								
								contrib/minizip/minizip.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										302
									
								
								contrib/minizip/minizip.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,302 @@ | |||||||
|  | #include <stdio.h> | ||||||
|  | #include <stdlib.h> | ||||||
|  | #include <string.h> | ||||||
|  | #include <time.h> | ||||||
|  | #include <errno.h> | ||||||
|  | #include <fcntl.h> | ||||||
|  |  | ||||||
|  | #ifdef unix | ||||||
|  | # include <unistd.h> | ||||||
|  | # include <utime.h> | ||||||
|  | # include <sys/types.h> | ||||||
|  | # include <sys/stat.h> | ||||||
|  | #else | ||||||
|  | # include <direct.h> | ||||||
|  | # include <io.h> | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #include "zip.h" | ||||||
|  |  | ||||||
|  |  | ||||||
|  | #define WRITEBUFFERSIZE (16384) | ||||||
|  | #define MAXFILENAME (256) | ||||||
|  |  | ||||||
|  | #ifdef WIN32 | ||||||
|  | uLong filetime(f, tmzip, dt) | ||||||
|  |     char *f;                /* name of file to get info on */ | ||||||
|  |     tm_zip *tmzip;             /* return value: access, modific. and creation times */ | ||||||
|  |     uLong *dt;             /* dostime */ | ||||||
|  | { | ||||||
|  |   int ret = 0; | ||||||
|  |   { | ||||||
|  |       FILETIME ftLocal; | ||||||
|  |       HANDLE hFind; | ||||||
|  |       WIN32_FIND_DATA  ff32; | ||||||
|  |  | ||||||
|  |       hFind = FindFirstFile(f,&ff32); | ||||||
|  |       if (hFind != INVALID_HANDLE_VALUE) | ||||||
|  |       { | ||||||
|  |         FileTimeToLocalFileTime(&(ff32.ftLastWriteTime),&ftLocal); | ||||||
|  |         FileTimeToDosDateTime(&ftLocal,((LPWORD)dt)+1,((LPWORD)dt)+0); | ||||||
|  |         FindClose(hFind); | ||||||
|  |         ret = 1; | ||||||
|  |       } | ||||||
|  |   } | ||||||
|  |   return ret; | ||||||
|  | } | ||||||
|  | #else | ||||||
|  | #ifdef unix | ||||||
|  | uLong filetime(f, tmzip, dt) | ||||||
|  |     char *f;                /* name of file to get info on */ | ||||||
|  |     tm_zip *tmzip;             /* return value: access, modific. and creation times */ | ||||||
|  |     uLong *dt;             /* dostime */ | ||||||
|  | { | ||||||
|  |   int ret=0; | ||||||
|  |   struct stat s;        /* results of stat() */ | ||||||
|  |   struct tm* filedate; | ||||||
|  |   time_t tm_t=0; | ||||||
|  |    | ||||||
|  |   if (strcmp(f,"-")!=0) | ||||||
|  |   { | ||||||
|  |     char name[MAXFILENAME]; | ||||||
|  |     int len = strlen(f); | ||||||
|  |     strcpy(name, f); | ||||||
|  |     if (name[len - 1] == '/') | ||||||
|  |       name[len - 1] = '\0'; | ||||||
|  |     /* not all systems allow stat'ing a file with / appended */ | ||||||
|  |     if (stat(name,&s)==0) | ||||||
|  |     { | ||||||
|  |       tm_t = s.st_mtime; | ||||||
|  |       ret = 1; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   filedate = localtime(&tm_t); | ||||||
|  |  | ||||||
|  |   tmzip->tm_sec  = filedate->tm_sec; | ||||||
|  |   tmzip->tm_min  = filedate->tm_min; | ||||||
|  |   tmzip->tm_hour = filedate->tm_hour; | ||||||
|  |   tmzip->tm_mday = filedate->tm_mday; | ||||||
|  |   tmzip->tm_mon  = filedate->tm_mon ; | ||||||
|  |   tmzip->tm_year = filedate->tm_year; | ||||||
|  |  | ||||||
|  |   return ret; | ||||||
|  | } | ||||||
|  | #else | ||||||
|  | uLong filetime(f, tmzip, dt) | ||||||
|  |     char *f;                /* name of file to get info on */ | ||||||
|  |     tm_zip *tmzip;             /* return value: access, modific. and creation times */ | ||||||
|  |     uLong *dt;             /* dostime */ | ||||||
|  | { | ||||||
|  |     return 0; | ||||||
|  | } | ||||||
|  | #endif | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | int check_exist_file(filename) | ||||||
|  |     const char* filename; | ||||||
|  | { | ||||||
|  | 	FILE* ftestexist; | ||||||
|  |     int ret = 1; | ||||||
|  | 	ftestexist = fopen(filename,"rb"); | ||||||
|  | 	if (ftestexist==NULL) | ||||||
|  |         ret = 0; | ||||||
|  |     else | ||||||
|  |         fclose(ftestexist); | ||||||
|  |     return ret; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | void do_banner() | ||||||
|  | { | ||||||
|  | 	printf("MiniZip 0.15, demo of zLib + Zip package written by Gilles Vollant\n"); | ||||||
|  | 	printf("more info at http://wwww.winimage/zLibDll/unzip.htm\n\n"); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | void do_help() | ||||||
|  | {	 | ||||||
|  | 	printf("Usage : minizip [-o] file.zip [files_to_add]\n\n") ; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | int main(argc,argv) | ||||||
|  | 	int argc; | ||||||
|  | 	char *argv[]; | ||||||
|  | { | ||||||
|  | 	int i; | ||||||
|  | 	int opt_overwrite=0; | ||||||
|  |     int opt_compress_level=Z_DEFAULT_COMPRESSION; | ||||||
|  |     int zipfilenamearg = 0; | ||||||
|  | 	char filename_try[MAXFILENAME]; | ||||||
|  |     int zipok; | ||||||
|  |     int err=0; | ||||||
|  |     int size_buf=0; | ||||||
|  |     void* buf=NULL, | ||||||
|  |  | ||||||
|  |  | ||||||
|  | 	do_banner(); | ||||||
|  | 	if (argc==1) | ||||||
|  | 	{ | ||||||
|  | 		do_help(); | ||||||
|  | 		exit(0); | ||||||
|  |         return 0; | ||||||
|  | 	} | ||||||
|  | 	else | ||||||
|  | 	{ | ||||||
|  | 		for (i=1;i<argc;i++) | ||||||
|  | 		{ | ||||||
|  | 			if ((*argv[i])=='-') | ||||||
|  | 			{ | ||||||
|  | 				const char *p=argv[i]+1; | ||||||
|  | 				 | ||||||
|  | 				while ((*p)!='\0') | ||||||
|  | 				{			 | ||||||
|  | 					char c=*(p++);; | ||||||
|  | 					if ((c=='o') || (c=='O')) | ||||||
|  | 						opt_overwrite = 1; | ||||||
|  |                     if ((c>='0') && (c<='9')) | ||||||
|  |                         opt_compress_level = c-'0'; | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 			else | ||||||
|  | 				if (zipfilenamearg == 0) | ||||||
|  |                     zipfilenamearg = i ; | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  |     size_buf = WRITEBUFFERSIZE; | ||||||
|  |     buf = (void*)malloc(size_buf); | ||||||
|  |     if (buf==NULL) | ||||||
|  |     { | ||||||
|  |         printf("Error allocating memory\n"); | ||||||
|  |         return ZIP_INTERNALERROR; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  | 	if (zipfilenamearg==0) | ||||||
|  |         zipok=0; | ||||||
|  |     else | ||||||
|  | 	{ | ||||||
|  |         int i,len; | ||||||
|  |         int dot_found=0; | ||||||
|  |  | ||||||
|  |         zipok = 1 ; | ||||||
|  | 		strcpy(filename_try,argv[zipfilenamearg]); | ||||||
|  |         len=strlen(filename_try); | ||||||
|  |         for (i=0;i<len;i++) | ||||||
|  |             if (filename_try[i]=='.') | ||||||
|  |                 dot_found=1; | ||||||
|  |  | ||||||
|  |         if (dot_found==0) | ||||||
|  |             strcat(filename_try,".zip"); | ||||||
|  |  | ||||||
|  |         if (opt_overwrite==0) | ||||||
|  |             if (check_exist_file(filename_try)!=0) | ||||||
|  | 			{ | ||||||
|  |                 char rep; | ||||||
|  | 				do | ||||||
|  | 				{ | ||||||
|  | 					char answer[128]; | ||||||
|  | 					printf("The file %s exist. Overwrite ? [y]es, [n]o : ",filename_try); | ||||||
|  | 					scanf("%1s",answer); | ||||||
|  | 					rep = answer[0] ; | ||||||
|  | 					if ((rep>='a') && (rep<='z')) | ||||||
|  | 						rep -= 0x20; | ||||||
|  | 				} | ||||||
|  | 				while ((rep!='Y') && (rep!='N')); | ||||||
|  |                 if (rep=='N') | ||||||
|  |                     zipok = 0; | ||||||
|  | 			} | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     if (zipok==1) | ||||||
|  |     { | ||||||
|  |         zipFile zf; | ||||||
|  |         int errclose; | ||||||
|  |         zf = zipOpen(filename_try,0); | ||||||
|  |         if (zf == NULL) | ||||||
|  |         { | ||||||
|  |             printf("error opening %s\n",filename_try); | ||||||
|  |             err= ZIP_ERRNO; | ||||||
|  |         } | ||||||
|  |         else  | ||||||
|  |             printf("creating %s\n",filename_try); | ||||||
|  |  | ||||||
|  |         for (i=zipfilenamearg+1;(i<argc) && (err==ZIP_OK);i++) | ||||||
|  |         { | ||||||
|  |             if (((*(argv[i]))!='-') && ((*(argv[i]))!='/')) | ||||||
|  |             { | ||||||
|  |                 FILE * fin; | ||||||
|  |                 int size_read; | ||||||
|  |                 const char* filenameinzip = argv[i]; | ||||||
|  |                 zip_fileinfo zi; | ||||||
|  |  | ||||||
|  |                 zi.tmz_date.tm_sec = zi.tmz_date.tm_min = zi.tmz_date.tm_hour =  | ||||||
|  |                 zi.tmz_date.tm_mday = zi.tmz_date.tm_min = zi.tmz_date.tm_year = 0; | ||||||
|  |                 zi.dosDate = 0; | ||||||
|  |                 zi.internal_fa = 0; | ||||||
|  |                 zi.external_fa = 0; | ||||||
|  |                 filetime(filenameinzip,&zi.tmz_date,&zi.dosDate); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |                 err = zipOpenNewFileInZip(zf,filenameinzip,&zi, | ||||||
|  |                                  NULL,0,NULL,0,NULL /* comment*/, | ||||||
|  |                                  (opt_compress_level != 0) ? Z_DEFLATED : 0, | ||||||
|  |                                  opt_compress_level); | ||||||
|  |  | ||||||
|  |                 if (err != ZIP_OK) | ||||||
|  |                     printf("error in opening %s in zipfile\n",filenameinzip); | ||||||
|  |                 else | ||||||
|  |                 { | ||||||
|  |                     fin = fopen(filenameinzip,"rb"); | ||||||
|  |                     if (fin==NULL) | ||||||
|  |                     { | ||||||
|  |                         err=ZIP_ERRNO; | ||||||
|  |                         printf("error in opening %s for reading\n",filenameinzip); | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  |  | ||||||
|  |                 if (err == ZIP_OK) | ||||||
|  |                     do | ||||||
|  |                     { | ||||||
|  |                         err = ZIP_OK; | ||||||
|  |                         size_read = fread(buf,1,size_buf,fin); | ||||||
|  |                         if (size_read < size_buf) | ||||||
|  |                             if (feof(fin)==0) | ||||||
|  |                         { | ||||||
|  |                             printf("error in reading %s\n",filenameinzip); | ||||||
|  |                             err = ZIP_ERRNO; | ||||||
|  |                         } | ||||||
|  |  | ||||||
|  |                         if (size_read>0) | ||||||
|  |                         { | ||||||
|  |                             err = zipWriteInFileInZip (zf,buf,size_read); | ||||||
|  |                             if (err<0) | ||||||
|  |                             { | ||||||
|  |                                 printf("error in writing %s in the zipfile\n", | ||||||
|  |                                                  filenameinzip); | ||||||
|  |                             } | ||||||
|  |                                  | ||||||
|  |                         } | ||||||
|  |                     } while ((err == ZIP_OK) && (size_read>0)); | ||||||
|  |  | ||||||
|  |                 fclose(fin); | ||||||
|  |                 if (err<0) | ||||||
|  |                     err=ZIP_ERRNO; | ||||||
|  |                 else | ||||||
|  |                 {                     | ||||||
|  |                     err = zipCloseFileInZip(zf); | ||||||
|  |                     if (err!=ZIP_OK) | ||||||
|  |                         printf("error in closing %s in the zipfile\n", | ||||||
|  |                                     filenameinzip); | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         errclose = zipClose(zf,NULL); | ||||||
|  |         if (errclose != ZIP_OK) | ||||||
|  |             printf("error in closing %s\n",filename_try); | ||||||
|  |    } | ||||||
|  |  | ||||||
|  |     free(buf); | ||||||
|  |     exit(0); | ||||||
|  | 	return 0;  /* to avoid warning */ | ||||||
|  | } | ||||||
							
								
								
									
										37
									
								
								contrib/minizip/readme.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								contrib/minizip/readme.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,37 @@ | |||||||
|  |  | ||||||
|  | UnZip 0.15 additionnal library | ||||||
|  |  | ||||||
|  |  | ||||||
|  |   This unzip package allow extract file from .ZIP file, compatible with  | ||||||
|  | PKZip 2.04g, WinZip, InfoZip tools and compatible. | ||||||
|  |  | ||||||
|  |   Multi volume ZipFile (span) are not supported, and old compression used by old  | ||||||
|  | PKZip 1.x are not supported. | ||||||
|  |  | ||||||
|  | See probdesc.zip from PKWare for specification of .ZIP format. | ||||||
|  |  | ||||||
|  | What is Unzip | ||||||
|  |   The Zlib library support the deflate compression and the creation of gzip (.gz)  | ||||||
|  | file. Zlib is free and small. | ||||||
|  |   The .Zip format, which can contain several compressed files (.gz can containt | ||||||
|  | only one file) is a very popular format. This is why I've written a package for reading file compressed in Zipfile. | ||||||
|  |  | ||||||
|  | Using Unzip package | ||||||
|  |  | ||||||
|  | You need source of Zlib (get zlib111.zip and read zlib.h). | ||||||
|  | Get unzlb015.zip and read unzip.h (whith documentation of unzip functions) | ||||||
|  |  | ||||||
|  | The Unzip package is only two file : unzip.h and unzip.c. But it use the Zlib  | ||||||
|  |   files. | ||||||
|  | unztst.c is a simple sample program, which list file in a zipfile and display | ||||||
|  |   README.TXT or FILE_ID.DIZ (if these files are found). | ||||||
|  | miniunz.c is a mini unzip program. | ||||||
|  |  | ||||||
|  | I'm also currenlyt writing a zipping portion (zip.h, zip.c and test with minizip.c) | ||||||
|  |  | ||||||
|  | Please email me for feedback. | ||||||
|  | I hope my source is compatible with Unix system, but I need your help for be sure | ||||||
|  |  | ||||||
|  | Latest revision : Mar 04th, 1998 | ||||||
|  |  | ||||||
|  | Check http://www.winimage.com/zLibDll/unzip.html for up to date info. | ||||||
							
								
								
									
										1294
									
								
								contrib/minizip/unzip.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1294
									
								
								contrib/minizip/unzip.c
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										15
									
								
								contrib/minizip/unzip.def
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								contrib/minizip/unzip.def
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | |||||||
|  | 	unzOpen                       @61 | ||||||
|  | 	unzClose                      @62 | ||||||
|  | 	unzGetGlobalInfo              @63 | ||||||
|  | 	unzGetCurrentFileInfo         @64 | ||||||
|  | 	unzGoToFirstFile              @65 | ||||||
|  | 	unzGoToNextFile               @66 | ||||||
|  | 	unzOpenCurrentFile            @67 | ||||||
|  | 	unzReadCurrentFile            @68 | ||||||
|  | 	unztell                       @70 | ||||||
|  | 	unzeof                        @71 | ||||||
|  | 	unzCloseCurrentFile           @72 | ||||||
|  | 	unzGetGlobalComment           @73 | ||||||
|  | 	unzStringFileNameCompare      @74 | ||||||
|  | 	unzLocateFile                 @75 | ||||||
|  | 	unzGetLocalExtrafield         @76 | ||||||
							
								
								
									
										275
									
								
								contrib/minizip/unzip.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										275
									
								
								contrib/minizip/unzip.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,275 @@ | |||||||
|  | /* unzip.h -- IO for uncompress .zip files using zlib  | ||||||
|  |    Version 0.15 beta, Mar 19th, 1998, | ||||||
|  |  | ||||||
|  |    Copyright (C) 1998 Gilles Vollant | ||||||
|  |  | ||||||
|  |    This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g | ||||||
|  |      WinZip, InfoZip tools and compatible. | ||||||
|  |    Encryption and multi volume ZipFile (span) are not supported. | ||||||
|  |    Old compressions used by old PKZip 1.x are not supported | ||||||
|  |  | ||||||
|  |    THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE | ||||||
|  |    CAN CHANGE IN FUTURE VERSION !! | ||||||
|  |    I WAIT FEEDBACK at mail info@winimage.com | ||||||
|  |    Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution | ||||||
|  |  | ||||||
|  |    Condition of use and distribution are the same than zlib : | ||||||
|  |  | ||||||
|  |   This software is provided 'as-is', without any express or implied | ||||||
|  |   warranty.  In no event will the authors be held liable for any damages | ||||||
|  |   arising from the use of this software. | ||||||
|  |  | ||||||
|  |   Permission is granted to anyone to use this software for any purpose, | ||||||
|  |   including commercial applications, and to alter it and redistribute it | ||||||
|  |   freely, subject to the following restrictions: | ||||||
|  |  | ||||||
|  |   1. The origin of this software must not be misrepresented; you must not | ||||||
|  |      claim that you wrote the original software. If you use this software | ||||||
|  |      in a product, an acknowledgment in the product documentation would be | ||||||
|  |      appreciated but is not required. | ||||||
|  |   2. Altered source versions must be plainly marked as such, and must not be | ||||||
|  |      misrepresented as being the original software. | ||||||
|  |   3. This notice may not be removed or altered from any source distribution. | ||||||
|  |  | ||||||
|  |  | ||||||
|  | */ | ||||||
|  | /* for more info about .ZIP format, see  | ||||||
|  |       ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip | ||||||
|  |    PkWare has also a specification at : | ||||||
|  |       ftp://ftp.pkware.com/probdesc.zip */ | ||||||
|  |  | ||||||
|  | #ifndef _unz_H | ||||||
|  | #define _unz_H | ||||||
|  |  | ||||||
|  | #ifdef __cplusplus | ||||||
|  | extern "C" { | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #ifndef _ZLIB_H | ||||||
|  | #include "zlib.h" | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) | ||||||
|  | /* like the STRICT of WIN32, we define a pointer that cannot be converted | ||||||
|  |     from (void*) without cast */ | ||||||
|  | typedef struct TagunzFile__ { int unused; } unzFile__;  | ||||||
|  | typedef unzFile__ *unzFile; | ||||||
|  | #else | ||||||
|  | typedef voidp unzFile; | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  |  | ||||||
|  | #define UNZ_OK                                  (0) | ||||||
|  | #define UNZ_END_OF_LIST_OF_FILE (-100) | ||||||
|  | #define UNZ_ERRNO               (Z_ERRNO) | ||||||
|  | #define UNZ_EOF                 (0) | ||||||
|  | #define UNZ_PARAMERROR                  (-102) | ||||||
|  | #define UNZ_BADZIPFILE                  (-103) | ||||||
|  | #define UNZ_INTERNALERROR               (-104) | ||||||
|  | #define UNZ_CRCERROR                    (-105) | ||||||
|  |  | ||||||
|  | /* tm_unz contain date/time info */ | ||||||
|  | typedef struct tm_unz_s  | ||||||
|  | { | ||||||
|  | 	uInt tm_sec;            /* seconds after the minute - [0,59] */ | ||||||
|  | 	uInt tm_min;            /* minutes after the hour - [0,59] */ | ||||||
|  | 	uInt tm_hour;           /* hours since midnight - [0,23] */ | ||||||
|  | 	uInt tm_mday;           /* day of the month - [1,31] */ | ||||||
|  | 	uInt tm_mon;            /* months since January - [0,11] */ | ||||||
|  | 	uInt tm_year;           /* years - [1980..2044] */ | ||||||
|  | } tm_unz; | ||||||
|  |  | ||||||
|  | /* unz_global_info structure contain global data about the ZIPfile | ||||||
|  |    These data comes from the end of central dir */ | ||||||
|  | typedef struct unz_global_info_s | ||||||
|  | { | ||||||
|  | 	uLong number_entry;         /* total number of entries in | ||||||
|  | 				       the central dir on this disk */ | ||||||
|  | 	uLong size_comment;         /* size of the global comment of the zipfile */ | ||||||
|  | } unz_global_info; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | /* unz_file_info contain information about a file in the zipfile */ | ||||||
|  | typedef struct unz_file_info_s | ||||||
|  | { | ||||||
|  |     uLong version;              /* version made by                 2 bytes */ | ||||||
|  |     uLong version_needed;       /* version needed to extract       2 bytes */ | ||||||
|  |     uLong flag;                 /* general purpose bit flag        2 bytes */ | ||||||
|  |     uLong compression_method;   /* compression method              2 bytes */ | ||||||
|  |     uLong dosDate;              /* last mod file date in Dos fmt   4 bytes */ | ||||||
|  |     uLong crc;                  /* crc-32                          4 bytes */ | ||||||
|  |     uLong compressed_size;      /* compressed size                 4 bytes */  | ||||||
|  |     uLong uncompressed_size;    /* uncompressed size               4 bytes */  | ||||||
|  |     uLong size_filename;        /* filename length                 2 bytes */ | ||||||
|  |     uLong size_file_extra;      /* extra field length              2 bytes */ | ||||||
|  |     uLong size_file_comment;    /* file comment length             2 bytes */ | ||||||
|  |  | ||||||
|  |     uLong disk_num_start;       /* disk number start               2 bytes */ | ||||||
|  |     uLong internal_fa;          /* internal file attributes        2 bytes */ | ||||||
|  |     uLong external_fa;          /* external file attributes        4 bytes */ | ||||||
|  |  | ||||||
|  |     tm_unz tmu_date; | ||||||
|  | } unz_file_info; | ||||||
|  |  | ||||||
|  | extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, | ||||||
|  | 												 const char* fileName2, | ||||||
|  | 												 int iCaseSensitivity)); | ||||||
|  | /* | ||||||
|  |    Compare two filename (fileName1,fileName2). | ||||||
|  |    If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) | ||||||
|  |    If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi | ||||||
|  | 								or strcasecmp) | ||||||
|  |    If iCaseSenisivity = 0, case sensitivity is defaut of your operating system | ||||||
|  | 	(like 1 on Unix, 2 on Windows) | ||||||
|  | */ | ||||||
|  |  | ||||||
|  |  | ||||||
|  | extern unzFile ZEXPORT unzOpen OF((const char *path)); | ||||||
|  | /* | ||||||
|  |   Open a Zip file. path contain the full pathname (by example, | ||||||
|  |      on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer | ||||||
|  | 	 "zlib/zlib111.zip". | ||||||
|  | 	 If the zipfile cannot be opened (file don't exist or in not valid), the | ||||||
|  | 	   return value is NULL. | ||||||
|  |      Else, the return value is a unzFile Handle, usable with other function | ||||||
|  | 	   of this unzip package. | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | extern int ZEXPORT unzClose OF((unzFile file)); | ||||||
|  | /* | ||||||
|  |   Close a ZipFile opened with unzipOpen. | ||||||
|  |   If there is files inside the .Zip opened with unzOpenCurrentFile (see later), | ||||||
|  |     these files MUST be closed with unzipCloseCurrentFile before call unzipClose. | ||||||
|  |   return UNZ_OK if there is no problem. */ | ||||||
|  |  | ||||||
|  | extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, | ||||||
|  | 					unz_global_info *pglobal_info)); | ||||||
|  | /* | ||||||
|  |   Write info about the ZipFile in the *pglobal_info structure. | ||||||
|  |   No preparation of the structure is needed | ||||||
|  |   return UNZ_OK if there is no problem. */ | ||||||
|  |  | ||||||
|  |  | ||||||
|  | extern int ZEXPORT unzGetGlobalComment OF((unzFile file, | ||||||
|  | 										   char *szComment, | ||||||
|  | 					   uLong uSizeBuf)); | ||||||
|  | /* | ||||||
|  |   Get the global comment string of the ZipFile, in the szComment buffer. | ||||||
|  |   uSizeBuf is the size of the szComment buffer. | ||||||
|  |   return the number of byte copied or an error code <0 | ||||||
|  | */ | ||||||
|  |  | ||||||
|  |  | ||||||
|  | /***************************************************************************/ | ||||||
|  | /* Unzip package allow you browse the directory of the zipfile */ | ||||||
|  |  | ||||||
|  | extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); | ||||||
|  | /* | ||||||
|  |   Set the current file of the zipfile to the first file. | ||||||
|  |   return UNZ_OK if there is no problem | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | extern int ZEXPORT unzGoToNextFile OF((unzFile file)); | ||||||
|  | /* | ||||||
|  |   Set the current file of the zipfile to the next file. | ||||||
|  |   return UNZ_OK if there is no problem | ||||||
|  |   return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | extern int ZEXPORT unzLocateFile OF((unzFile file,  | ||||||
|  | 				     const char *szFileName, | ||||||
|  | 				     int iCaseSensitivity)); | ||||||
|  | /* | ||||||
|  |   Try locate the file szFileName in the zipfile. | ||||||
|  |   For the iCaseSensitivity signification, see unzStringFileNameCompare | ||||||
|  |  | ||||||
|  |   return value : | ||||||
|  |   UNZ_OK if the file is found. It becomes the current file. | ||||||
|  |   UNZ_END_OF_LIST_OF_FILE if the file is not found | ||||||
|  | */ | ||||||
|  |  | ||||||
|  |  | ||||||
|  | extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, | ||||||
|  | 					     unz_file_info *pfile_info, | ||||||
|  | 					     char *szFileName, | ||||||
|  | 					     uLong fileNameBufferSize, | ||||||
|  | 					     void *extraField, | ||||||
|  | 					     uLong extraFieldBufferSize, | ||||||
|  | 					     char *szComment, | ||||||
|  | 					     uLong commentBufferSize)); | ||||||
|  | /* | ||||||
|  |   Get Info about the current file | ||||||
|  |   if pfile_info!=NULL, the *pfile_info structure will contain somes info about | ||||||
|  | 	    the current file | ||||||
|  |   if szFileName!=NULL, the filemane string will be copied in szFileName | ||||||
|  | 			(fileNameBufferSize is the size of the buffer) | ||||||
|  |   if extraField!=NULL, the extra field information will be copied in extraField | ||||||
|  | 			(extraFieldBufferSize is the size of the buffer). | ||||||
|  | 			This is the Central-header version of the extra field | ||||||
|  |   if szComment!=NULL, the comment string of the file will be copied in szComment | ||||||
|  | 			(commentBufferSize is the size of the buffer) | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | /***************************************************************************/ | ||||||
|  | /* for reading the content of the current zipfile, you can open it, read data | ||||||
|  |    from it, and close it (you can close it before reading all the file) | ||||||
|  |    */ | ||||||
|  |  | ||||||
|  | extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); | ||||||
|  | /* | ||||||
|  |   Open for reading data the current file in the zipfile. | ||||||
|  |   If there is no error, the return value is UNZ_OK. | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); | ||||||
|  | /* | ||||||
|  |   Close the file in zip opened with unzOpenCurrentFile | ||||||
|  |   Return UNZ_CRCERROR if all the file was read but the CRC is not good | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | 												 | ||||||
|  | extern int ZEXPORT unzReadCurrentFile OF((unzFile file,  | ||||||
|  | 					  voidp buf, | ||||||
|  | 					  unsigned len)); | ||||||
|  | /* | ||||||
|  |   Read bytes from the current file (opened by unzOpenCurrentFile) | ||||||
|  |   buf contain buffer where data must be copied | ||||||
|  |   len the size of buf. | ||||||
|  |  | ||||||
|  |   return the number of byte copied if somes bytes are copied | ||||||
|  |   return 0 if the end of file was reached | ||||||
|  |   return <0 with error code if there is an error | ||||||
|  |     (UNZ_ERRNO for IO error, or zLib error for uncompress error) | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | extern z_off_t ZEXPORT unztell OF((unzFile file)); | ||||||
|  | /* | ||||||
|  |   Give the current position in uncompressed data | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | extern int ZEXPORT unzeof OF((unzFile file)); | ||||||
|  | /* | ||||||
|  |   return 1 if the end of file was reached, 0 elsewhere  | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, | ||||||
|  | 											 voidp buf, | ||||||
|  | 											 unsigned len)); | ||||||
|  | /* | ||||||
|  |   Read extra field from the current file (opened by unzOpenCurrentFile) | ||||||
|  |   This is the local-header version of the extra field (sometimes, there is | ||||||
|  |     more info in the local-header version than in the central-header) | ||||||
|  |  | ||||||
|  |   if buf==NULL, it return the size of the local extra field | ||||||
|  |  | ||||||
|  |   if buf!=NULL, len is the size of the buffer, the extra header is copied in | ||||||
|  | 	buf. | ||||||
|  |   the return value is the number of bytes copied in buf, or (if <0)  | ||||||
|  | 	the error code | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | #ifdef __cplusplus | ||||||
|  | } | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #endif /* _unz_H */ | ||||||
							
								
								
									
										716
									
								
								contrib/minizip/zip.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										716
									
								
								contrib/minizip/zip.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,716 @@ | |||||||
|  | /* zip.c -- IO on .zip files using zlib  | ||||||
|  |    Version 0.15 beta, Mar 19th, 1998, | ||||||
|  |  | ||||||
|  |    Read zip.h for more info | ||||||
|  | */ | ||||||
|  |  | ||||||
|  |  | ||||||
|  | #include <stdio.h> | ||||||
|  | #include <stdlib.h> | ||||||
|  | #include <string.h> | ||||||
|  | #include "zlib.h" | ||||||
|  | #include "zip.h" | ||||||
|  |  | ||||||
|  | #ifdef STDC | ||||||
|  | #  include <stddef.h> | ||||||
|  | #  include <string.h> | ||||||
|  | #  include <stdlib.h> | ||||||
|  | #endif | ||||||
|  | #ifdef NO_ERRNO_H | ||||||
|  |     extern int errno; | ||||||
|  | #else | ||||||
|  | #   include <errno.h> | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  |  | ||||||
|  | #ifndef local | ||||||
|  | #  define local static | ||||||
|  | #endif | ||||||
|  | /* compile with -Dlocal if your debugger can't find static symbols */ | ||||||
|  |  | ||||||
|  | #ifndef VERSIONMADEBY | ||||||
|  | # define VERSIONMADEBY   (0x0) /* platform depedent */ | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #ifndef Z_BUFSIZE | ||||||
|  | #define Z_BUFSIZE (16384) | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #ifndef Z_MAXFILENAMEINZIP | ||||||
|  | #define Z_MAXFILENAMEINZIP (256) | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #ifndef ALLOC | ||||||
|  | # define ALLOC(size) (malloc(size)) | ||||||
|  | #endif | ||||||
|  | #ifndef TRYFREE | ||||||
|  | # define TRYFREE(p) {if (p) free(p);} | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | /* | ||||||
|  | #define SIZECENTRALDIRITEM (0x2e) | ||||||
|  | #define SIZEZIPLOCALHEADER (0x1e) | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | /* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ | ||||||
|  |  | ||||||
|  | #ifndef SEEK_CUR | ||||||
|  | #define SEEK_CUR    1 | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #ifndef SEEK_END | ||||||
|  | #define SEEK_END    2 | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #ifndef SEEK_SET | ||||||
|  | #define SEEK_SET    0 | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | const char zip_copyright[] = | ||||||
|  |    " zip 0.15 Copyright 1998 Gilles Vollant "; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | #define SIZEDATA_INDATABLOCK (4096-(4*4)) | ||||||
|  |  | ||||||
|  | #define LOCALHEADERMAGIC    (0x04034b50) | ||||||
|  | #define CENTRALHEADERMAGIC  (0x02014b50) | ||||||
|  | #define ENDHEADERMAGIC      (0x06054b50) | ||||||
|  |  | ||||||
|  | #define FLAG_LOCALHEADER_OFFSET (0x06) | ||||||
|  | #define CRC_LOCALHEADER_OFFSET  (0x0e) | ||||||
|  |  | ||||||
|  | #define SIZECENTRALHEADER (0x2e) /* 46 */ | ||||||
|  |  | ||||||
|  | typedef struct linkedlist_datablock_internal_s | ||||||
|  | { | ||||||
|  |   struct linkedlist_datablock_internal_s* next_datablock; | ||||||
|  |   uLong  avail_in_this_block; | ||||||
|  |   uLong  filled_in_this_block; | ||||||
|  |   uLong  unused; /* for future use and alignement */ | ||||||
|  |   unsigned char data[SIZEDATA_INDATABLOCK]; | ||||||
|  | } linkedlist_datablock_internal; | ||||||
|  |  | ||||||
|  | typedef struct linkedlist_data_s | ||||||
|  | { | ||||||
|  |     linkedlist_datablock_internal* first_block; | ||||||
|  |     linkedlist_datablock_internal* last_block; | ||||||
|  | } linkedlist_data; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | typedef struct | ||||||
|  | { | ||||||
|  | 	z_stream stream;            /* zLib stream structure for inflate */ | ||||||
|  |     int  stream_initialised;    /* 1 is stream is initialised */ | ||||||
|  |     uInt pos_in_buffered_data;  /* last written byte in buffered_data */ | ||||||
|  |  | ||||||
|  |     uLong pos_local_header;     /* offset of the local header of the file  | ||||||
|  |                                      currenty writing */ | ||||||
|  |     char* central_header;       /* central header data for the current file */ | ||||||
|  |     uLong size_centralheader;   /* size of the central header for cur file */ | ||||||
|  |     uLong flag;                 /* flag of the file currently writing */ | ||||||
|  |  | ||||||
|  |     int  method;                /* compression method of file currenty wr.*/ | ||||||
|  |     Byte buffered_data[Z_BUFSIZE];/* buffer contain compressed data to be writ*/ | ||||||
|  |     uLong dosDate; | ||||||
|  |     uLong crc32; | ||||||
|  | } curfile_info; | ||||||
|  |  | ||||||
|  | typedef struct | ||||||
|  | { | ||||||
|  |     FILE * filezip; | ||||||
|  |     linkedlist_data central_dir;/* datablock with central dir in construction*/ | ||||||
|  |     int  in_opened_file_inzip;  /* 1 if a file in the zip is currently writ.*/ | ||||||
|  |     curfile_info ci;            /* info on the file curretly writing */ | ||||||
|  |  | ||||||
|  |     uLong begin_pos;            /* position of the beginning of the zipfile */ | ||||||
|  |     uLong number_entry; | ||||||
|  | } zip_internal; | ||||||
|  |  | ||||||
|  | local linkedlist_datablock_internal* allocate_new_datablock() | ||||||
|  | { | ||||||
|  |     linkedlist_datablock_internal* ldi; | ||||||
|  |     ldi = (linkedlist_datablock_internal*) | ||||||
|  |                  ALLOC(sizeof(linkedlist_datablock_internal)); | ||||||
|  |     if (ldi!=NULL) | ||||||
|  |     { | ||||||
|  |         ldi->next_datablock = NULL ; | ||||||
|  |         ldi->filled_in_this_block = 0 ; | ||||||
|  |         ldi->avail_in_this_block = SIZEDATA_INDATABLOCK ; | ||||||
|  |     } | ||||||
|  |     return ldi; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | local void free_datablock(ldi) | ||||||
|  |     linkedlist_datablock_internal* ldi; | ||||||
|  | { | ||||||
|  |     while (ldi!=NULL) | ||||||
|  |     { | ||||||
|  |         linkedlist_datablock_internal* ldinext = ldi->next_datablock; | ||||||
|  |         TRYFREE(ldi); | ||||||
|  |         ldi = ldinext; | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | local void init_linkedlist(ll) | ||||||
|  |     linkedlist_data* ll; | ||||||
|  | { | ||||||
|  |     ll->first_block = ll->last_block = NULL; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | local void free_linkedlist(ll) | ||||||
|  |     linkedlist_data* ll; | ||||||
|  | { | ||||||
|  |     free_datablock(ll->first_block); | ||||||
|  |     ll->first_block = ll->last_block = NULL; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | local int add_data_in_datablock(ll,buf,len) | ||||||
|  |     linkedlist_data* ll;     | ||||||
|  |     const void* buf; | ||||||
|  |     uLong len; | ||||||
|  | { | ||||||
|  |     linkedlist_datablock_internal* ldi; | ||||||
|  |     const unsigned char* from_copy; | ||||||
|  |  | ||||||
|  |     if (ll==NULL) | ||||||
|  |         return ZIP_INTERNALERROR; | ||||||
|  |  | ||||||
|  |     if (ll->last_block == NULL) | ||||||
|  |     { | ||||||
|  |         ll->first_block = ll->last_block = allocate_new_datablock(); | ||||||
|  |         if (ll->first_block == NULL) | ||||||
|  |             return ZIP_INTERNALERROR; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     ldi = ll->last_block; | ||||||
|  |     from_copy = (unsigned char*)buf; | ||||||
|  |  | ||||||
|  |     while (len>0) | ||||||
|  |     { | ||||||
|  |         uInt copy_this; | ||||||
|  |         uInt i; | ||||||
|  |         unsigned char* to_copy; | ||||||
|  |  | ||||||
|  |         if (ldi->avail_in_this_block==0) | ||||||
|  |         { | ||||||
|  |             ldi->next_datablock = allocate_new_datablock(); | ||||||
|  |             if (ldi->next_datablock == NULL) | ||||||
|  |                 return ZIP_INTERNALERROR; | ||||||
|  |             ldi = ldi->next_datablock ; | ||||||
|  |             ll->last_block = ldi; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         if (ldi->avail_in_this_block < len) | ||||||
|  |             copy_this = (uInt)ldi->avail_in_this_block; | ||||||
|  |         else | ||||||
|  |             copy_this = (uInt)len; | ||||||
|  |  | ||||||
|  |         to_copy = &(ldi->data[ldi->filled_in_this_block]); | ||||||
|  |  | ||||||
|  |         for (i=0;i<copy_this;i++) | ||||||
|  |             *(to_copy+i)=*(from_copy+i); | ||||||
|  |  | ||||||
|  |         ldi->filled_in_this_block += copy_this; | ||||||
|  |         ldi->avail_in_this_block -= copy_this; | ||||||
|  |         from_copy += copy_this ; | ||||||
|  |         len -= copy_this; | ||||||
|  |     } | ||||||
|  |     return ZIP_OK; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | local int write_datablock(fout,ll) | ||||||
|  |     FILE * fout; | ||||||
|  |     linkedlist_data* ll;     | ||||||
|  | { | ||||||
|  |     linkedlist_datablock_internal* ldi; | ||||||
|  |     ldi = ll->first_block; | ||||||
|  |     while (ldi!=NULL) | ||||||
|  |     { | ||||||
|  |         if (ldi->filled_in_this_block > 0) | ||||||
|  |             if (fwrite(ldi->data,(uInt)ldi->filled_in_this_block,1,fout)!=1) | ||||||
|  |                 return ZIP_ERRNO; | ||||||
|  |         ldi = ldi->next_datablock; | ||||||
|  |     } | ||||||
|  |     return ZIP_OK; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | /****************************************************************************/ | ||||||
|  |  | ||||||
|  | /* =========================================================================== | ||||||
|  |    Outputs a long in LSB order to the given file | ||||||
|  |    nbByte == 1, 2 or 4 (byte, short or long) | ||||||
|  | */ | ||||||
|  | local int ziplocal_putValue (file, x, nbByte) | ||||||
|  |     FILE *file; | ||||||
|  |     uLong x; | ||||||
|  |     int nbByte; | ||||||
|  | { | ||||||
|  |     unsigned char buf[4]; | ||||||
|  |     int n; | ||||||
|  |     for (n = 0; n < nbByte; n++) { | ||||||
|  |         buf[n] = (unsigned char)(x & 0xff); | ||||||
|  |         x >>= 8; | ||||||
|  |     } | ||||||
|  |     if (fwrite(buf,nbByte,1,file)!=1) | ||||||
|  |         return ZIP_ERRNO; | ||||||
|  |     else | ||||||
|  |         return ZIP_OK; | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | local void ziplocal_putValue_inmemory (dest, x, nbByte) | ||||||
|  |     void* dest; | ||||||
|  |     uLong x; | ||||||
|  |     int nbByte; | ||||||
|  | { | ||||||
|  |     unsigned char* buf=(unsigned char*)dest; | ||||||
|  |     int n; | ||||||
|  |     for (n = 0; n < nbByte; n++) { | ||||||
|  |         buf[n] = (unsigned char)(x & 0xff); | ||||||
|  |         x >>= 8; | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | /****************************************************************************/ | ||||||
|  |  | ||||||
|  |  | ||||||
|  | local uLong ziplocal_TmzDateToDosDate(ptm,dosDate) | ||||||
|  |     tm_zip* ptm; | ||||||
|  |     uLong dosDate; | ||||||
|  | { | ||||||
|  |     uLong year = (uLong)ptm->tm_year; | ||||||
|  |     if (year>1980) | ||||||
|  |         year-=1980; | ||||||
|  |     else if (year>80) | ||||||
|  |         year-=80; | ||||||
|  |     return | ||||||
|  |       (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) | | ||||||
|  |         ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour)); | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | /****************************************************************************/ | ||||||
|  |  | ||||||
|  | extern zipFile ZEXPORT zipOpen (pathname, append) | ||||||
|  |     const char *pathname; | ||||||
|  |     int append; | ||||||
|  | { | ||||||
|  |     zip_internal ziinit; | ||||||
|  |     zip_internal* zi; | ||||||
|  |  | ||||||
|  |     ziinit.filezip = fopen(pathname,(append == 0) ? "wb" : "ab"); | ||||||
|  |     if (ziinit.filezip == NULL) | ||||||
|  |         return NULL; | ||||||
|  |     ziinit.begin_pos = ftell(ziinit.filezip); | ||||||
|  |     ziinit.in_opened_file_inzip = 0; | ||||||
|  |     ziinit.ci.stream_initialised = 0; | ||||||
|  |     ziinit.number_entry = 0; | ||||||
|  |     init_linkedlist(&(ziinit.central_dir)); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     zi = (zip_internal*)ALLOC(sizeof(zip_internal)); | ||||||
|  |     if (zi==NULL) | ||||||
|  |     { | ||||||
|  |         fclose(ziinit.filezip); | ||||||
|  |         return NULL; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     *zi = ziinit; | ||||||
|  |     return (zipFile)zi; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | extern int ZEXPORT zipOpenNewFileInZip (file, filename, zipfi,  | ||||||
|  |                                         extrafield_local, size_extrafield_local, | ||||||
|  |                                         extrafield_global, size_extrafield_global, | ||||||
|  |                                         comment, method, level) | ||||||
|  |     zipFile file; | ||||||
|  |     const char* filename; | ||||||
|  |     const zip_fileinfo* zipfi; | ||||||
|  |     const void* extrafield_local; | ||||||
|  |     uInt size_extrafield_local; | ||||||
|  |     const void* extrafield_global; | ||||||
|  |     uInt size_extrafield_global; | ||||||
|  |     const char* comment; | ||||||
|  |     int method; | ||||||
|  |     int level; | ||||||
|  | { | ||||||
|  |     zip_internal* zi; | ||||||
|  |     uInt size_filename; | ||||||
|  |     uInt size_comment; | ||||||
|  |     uInt i; | ||||||
|  |     int err = ZIP_OK; | ||||||
|  |  | ||||||
|  |     if (file == NULL) | ||||||
|  |         return ZIP_PARAMERROR; | ||||||
|  |     if ((method!=0) && (method!=Z_DEFLATED)) | ||||||
|  |         return ZIP_PARAMERROR; | ||||||
|  |  | ||||||
|  |     zi = (zip_internal*)file; | ||||||
|  |  | ||||||
|  |     if (zi->in_opened_file_inzip == 1) | ||||||
|  |     { | ||||||
|  |         err = zipCloseFileInZip (file); | ||||||
|  |         if (err != ZIP_OK) | ||||||
|  |             return err; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     if (filename==NULL) | ||||||
|  |         filename="-"; | ||||||
|  |  | ||||||
|  |     if (comment==NULL) | ||||||
|  |         size_comment = 0; | ||||||
|  |     else | ||||||
|  |         size_comment = strlen(comment); | ||||||
|  |  | ||||||
|  |     size_filename = strlen(filename); | ||||||
|  |  | ||||||
|  |     if (zipfi == NULL) | ||||||
|  |         zi->ci.dosDate = 0; | ||||||
|  |     else | ||||||
|  |     { | ||||||
|  |         if (zipfi->dosDate != 0) | ||||||
|  |             zi->ci.dosDate = zipfi->dosDate; | ||||||
|  |         else zi->ci.dosDate = ziplocal_TmzDateToDosDate(&zipfi->tmz_date,zipfi->dosDate); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     zi->ci.flag = 0; | ||||||
|  |     if ((level==8) || (level==9)) | ||||||
|  |       zi->ci.flag |= 2; | ||||||
|  |     if ((level==2)) | ||||||
|  |       zi->ci.flag |= 4; | ||||||
|  |     if ((level==1)) | ||||||
|  |       zi->ci.flag |= 6; | ||||||
|  |  | ||||||
|  |     zi->ci.crc32 = 0; | ||||||
|  |     zi->ci.method = method; | ||||||
|  |     zi->ci.stream_initialised = 0; | ||||||
|  |     zi->ci.pos_in_buffered_data = 0; | ||||||
|  |     zi->ci.pos_local_header = ftell(zi->filezip); | ||||||
|  |     zi->ci.size_centralheader = SIZECENTRALHEADER + size_filename +  | ||||||
|  |                                       size_extrafield_global + size_comment; | ||||||
|  |     zi->ci.central_header = (char*)ALLOC(zi->ci.size_centralheader); | ||||||
|  |  | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header,CENTRALHEADERMAGIC,4); | ||||||
|  |     /* version info */ | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header+4,VERSIONMADEBY,2); | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header+6,20,2); | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header+8,zi->ci.flag,2); | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header+10,zi->ci.method,2); | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header+12,zi->ci.dosDate,4); | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header+16,0,4); /*crc*/ | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header+20,0,4); /*compr size*/ | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header+24,0,4); /*uncompr size*/ | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header+28,size_filename,2); | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header+30,size_extrafield_global,2); | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header+32,size_comment,2); | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header+34,0,2); /*disk nm start*/ | ||||||
|  |  | ||||||
|  |     if (zipfi==NULL) | ||||||
|  |         ziplocal_putValue_inmemory(zi->ci.central_header+36,0,2);  | ||||||
|  |     else | ||||||
|  |         ziplocal_putValue_inmemory(zi->ci.central_header+36,zipfi->internal_fa,2);  | ||||||
|  |  | ||||||
|  |     if (zipfi==NULL) | ||||||
|  |         ziplocal_putValue_inmemory(zi->ci.central_header+38,0,4);  | ||||||
|  |     else | ||||||
|  |         ziplocal_putValue_inmemory(zi->ci.central_header+38,zipfi->external_fa,4); | ||||||
|  |  | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header+42,zi->ci.pos_local_header,4); | ||||||
|  |  | ||||||
|  |     for (i=0;i<size_filename;i++) | ||||||
|  |         *(zi->ci.central_header+SIZECENTRALHEADER+i) = *(filename+i); | ||||||
|  |  | ||||||
|  |     for (i=0;i<size_extrafield_global;i++) | ||||||
|  |         *(zi->ci.central_header+SIZECENTRALHEADER+size_filename+i) = | ||||||
|  |               *(((const char*)extrafield_global)+i); | ||||||
|  |  | ||||||
|  |     for (i=0;i<size_comment;i++) | ||||||
|  |         *(zi->ci.central_header+SIZECENTRALHEADER+size_filename+ | ||||||
|  |               size_extrafield_global+i) = *(filename+i); | ||||||
|  |     if (zi->ci.central_header == NULL) | ||||||
|  |         return ZIP_INTERNALERROR; | ||||||
|  |  | ||||||
|  |     /* write the local header */ | ||||||
|  |     err = ziplocal_putValue(zi->filezip,LOCALHEADERMAGIC,4); | ||||||
|  |  | ||||||
|  |     if (err==ZIP_OK) | ||||||
|  |         err = ziplocal_putValue(zi->filezip,20,2);/* version needed to extract */ | ||||||
|  |     if (err==ZIP_OK) | ||||||
|  |         err = ziplocal_putValue(zi->filezip,zi->ci.flag,2); | ||||||
|  |  | ||||||
|  |     if (err==ZIP_OK) | ||||||
|  |         err = ziplocal_putValue(zi->filezip,zi->ci.method,2); | ||||||
|  |  | ||||||
|  |     if (err==ZIP_OK) | ||||||
|  |         err = ziplocal_putValue(zi->filezip,zi->ci.dosDate,4); | ||||||
|  |  | ||||||
|  |     if (err==ZIP_OK) | ||||||
|  |         err = ziplocal_putValue(zi->filezip,0,4); /* crc 32, unknown */ | ||||||
|  |     if (err==ZIP_OK) | ||||||
|  |         err = ziplocal_putValue(zi->filezip,0,4); /* compressed size, unknown */ | ||||||
|  |     if (err==ZIP_OK) | ||||||
|  |         err = ziplocal_putValue(zi->filezip,0,4); /* uncompressed size, unknown */ | ||||||
|  |  | ||||||
|  |     if (err==ZIP_OK) | ||||||
|  |         err = ziplocal_putValue(zi->filezip,(uLong)size_filename,2); | ||||||
|  |  | ||||||
|  |     if (err==ZIP_OK) | ||||||
|  |         err = ziplocal_putValue(zi->filezip,(uLong)size_extrafield_local,2); | ||||||
|  |  | ||||||
|  |     if ((err==ZIP_OK) && (size_filename>0)) | ||||||
|  |         if (fwrite(filename,(uInt)size_filename,1,zi->filezip)!=1) | ||||||
|  |                 err = ZIP_ERRNO; | ||||||
|  |  | ||||||
|  |     if ((err==ZIP_OK) && (size_extrafield_local>0)) | ||||||
|  |         if (fwrite(extrafield_local,(uInt)size_extrafield_local,1,zi->filezip) | ||||||
|  |                                                                            !=1) | ||||||
|  |                 err = ZIP_ERRNO; | ||||||
|  |  | ||||||
|  |     zi->ci.stream.avail_in = (uInt)0; | ||||||
|  |     zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; | ||||||
|  |     zi->ci.stream.next_out = zi->ci.buffered_data; | ||||||
|  |     zi->ci.stream.total_in = 0; | ||||||
|  |     zi->ci.stream.total_out = 0; | ||||||
|  |  | ||||||
|  |     if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED)) | ||||||
|  |     { | ||||||
|  |         zi->ci.stream.zalloc = (alloc_func)0; | ||||||
|  |         zi->ci.stream.zfree = (free_func)0; | ||||||
|  |         zi->ci.stream.opaque = (voidpf)0; | ||||||
|  |  | ||||||
|  |         err = deflateInit2(&zi->ci.stream, level, | ||||||
|  |                Z_DEFLATED, -MAX_WBITS, /*DEF_MEM_LEVEL*/8, 0); | ||||||
|  |  | ||||||
|  |         if (err==Z_OK) | ||||||
|  |             zi->ci.stream_initialised = 1; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     if (err==Z_OK) | ||||||
|  |         zi->in_opened_file_inzip = 1; | ||||||
|  |     return err; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | extern int ZEXPORT zipWriteInFileInZip (file, buf, len) | ||||||
|  |     zipFile file; | ||||||
|  |     const voidp buf; | ||||||
|  |     unsigned len; | ||||||
|  | { | ||||||
|  |     zip_internal* zi; | ||||||
|  |     int err=ZIP_OK; | ||||||
|  |  | ||||||
|  |     if (file == NULL) | ||||||
|  |         return ZIP_PARAMERROR; | ||||||
|  |     zi = (zip_internal*)file; | ||||||
|  |  | ||||||
|  |     if (zi->in_opened_file_inzip == 0) | ||||||
|  |         return ZIP_PARAMERROR; | ||||||
|  |  | ||||||
|  |     zi->ci.stream.next_in = buf; | ||||||
|  |     zi->ci.stream.avail_in = len; | ||||||
|  |     zi->ci.crc32 = crc32(zi->ci.crc32,buf,len); | ||||||
|  |  | ||||||
|  |     while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0)) | ||||||
|  |     { | ||||||
|  |         if (zi->ci.stream.avail_out == 0) | ||||||
|  |         { | ||||||
|  |             if (fwrite(zi->ci.buffered_data,(uInt)zi->ci.pos_in_buffered_data,1,zi->filezip) | ||||||
|  |                                                                            !=1) | ||||||
|  |                 err = ZIP_ERRNO; | ||||||
|  |             zi->ci.pos_in_buffered_data = 0; | ||||||
|  |             zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; | ||||||
|  |             zi->ci.stream.next_out = zi->ci.buffered_data; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         if (zi->ci.method == Z_DEFLATED) | ||||||
|  |         { | ||||||
|  |             uLong uTotalOutBefore = zi->ci.stream.total_out; | ||||||
|  |             err=deflate(&zi->ci.stream,  Z_NO_FLUSH); | ||||||
|  |             zi->ci.pos_in_buffered_data += zi->ci.stream.total_out - uTotalOutBefore ; | ||||||
|  |  | ||||||
|  |         } | ||||||
|  |         else | ||||||
|  |         { | ||||||
|  |             uInt copy_this,i; | ||||||
|  |             if (zi->ci.stream.avail_in < zi->ci.stream.avail_out) | ||||||
|  |                 copy_this = zi->ci.stream.avail_in; | ||||||
|  |             else | ||||||
|  |                 copy_this = zi->ci.stream.avail_out; | ||||||
|  |             for (i=0;i<copy_this;i++) | ||||||
|  |                 *(((char*)zi->ci.stream.next_out)+i) = | ||||||
|  |                     *(((const char*)zi->ci.stream.next_in)+i); | ||||||
|  |             { | ||||||
|  |                 zi->ci.stream.avail_in -= copy_this; | ||||||
|  |                 zi->ci.stream.avail_out-= copy_this; | ||||||
|  |                 zi->ci.stream.next_in+= copy_this; | ||||||
|  |                 zi->ci.stream.next_out+= copy_this; | ||||||
|  |                 zi->ci.stream.total_in+= copy_this; | ||||||
|  |                 zi->ci.stream.total_out+= copy_this; | ||||||
|  |                 zi->ci.pos_in_buffered_data += copy_this; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     return 0; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | extern int ZEXPORT zipCloseFileInZip (file) | ||||||
|  |     zipFile file; | ||||||
|  | { | ||||||
|  |     zip_internal* zi; | ||||||
|  |     int err=ZIP_OK; | ||||||
|  |  | ||||||
|  |     if (file == NULL) | ||||||
|  |         return ZIP_PARAMERROR; | ||||||
|  |     zi = (zip_internal*)file; | ||||||
|  |  | ||||||
|  |     if (zi->in_opened_file_inzip == 0)     | ||||||
|  |         return ZIP_PARAMERROR; | ||||||
|  |     zi->ci.stream.avail_in = 0; | ||||||
|  |      | ||||||
|  |     if (zi->ci.method == Z_DEFLATED) | ||||||
|  |         while (err==ZIP_OK) | ||||||
|  |     { | ||||||
|  |         uLong uTotalOutBefore; | ||||||
|  |         if (zi->ci.stream.avail_out == 0) | ||||||
|  |         { | ||||||
|  |             if (fwrite(zi->ci.buffered_data,(uInt)zi->ci.pos_in_buffered_data,1,zi->filezip) | ||||||
|  |                                                                            !=1) | ||||||
|  |                 err = ZIP_ERRNO; | ||||||
|  |             zi->ci.pos_in_buffered_data = 0; | ||||||
|  |             zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; | ||||||
|  |             zi->ci.stream.next_out = zi->ci.buffered_data; | ||||||
|  |         } | ||||||
|  |         uTotalOutBefore = zi->ci.stream.total_out; | ||||||
|  |         err=deflate(&zi->ci.stream,  Z_FINISH); | ||||||
|  |         zi->ci.pos_in_buffered_data += zi->ci.stream.total_out - uTotalOutBefore ; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     if (err==Z_STREAM_END) | ||||||
|  |         err=ZIP_OK; /* this is normal */ | ||||||
|  |  | ||||||
|  |     if ((zi->ci.pos_in_buffered_data>0) && (err==ZIP_OK)) | ||||||
|  |         if (fwrite(zi->ci.buffered_data,(uInt)zi->ci.pos_in_buffered_data,1,zi->filezip) | ||||||
|  |                                                                        !=1) | ||||||
|  |             err = ZIP_ERRNO; | ||||||
|  |  | ||||||
|  |     if ((zi->ci.method == Z_DEFLATED) && (err==ZIP_OK)) | ||||||
|  |     { | ||||||
|  |         err=deflateEnd(&zi->ci.stream); | ||||||
|  |         zi->ci.stream_initialised = 0; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header+16,zi->ci.crc32,4); /*crc*/ | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header+20, | ||||||
|  |                                 zi->ci.stream.total_out,4); /*compr size*/ | ||||||
|  |     ziplocal_putValue_inmemory(zi->ci.central_header+24, | ||||||
|  |                                 zi->ci.stream.total_in,4); /*uncompr size*/ | ||||||
|  |  | ||||||
|  |     if (err==ZIP_OK) | ||||||
|  |         err = add_data_in_datablock(&zi->central_dir,zi->ci.central_header, | ||||||
|  |                                        (uLong)zi->ci.size_centralheader); | ||||||
|  |     free(zi->ci.central_header); | ||||||
|  |  | ||||||
|  |     if (err==ZIP_OK) | ||||||
|  |     { | ||||||
|  |         long cur_pos_inzip = ftell(zi->filezip); | ||||||
|  | 	    if (fseek(zi->filezip, | ||||||
|  |                   zi->ci.pos_local_header + 14,SEEK_SET)!=0) | ||||||
|  | 		    err = ZIP_ERRNO; | ||||||
|  |  | ||||||
|  |         if (err==ZIP_OK) | ||||||
|  |             err = ziplocal_putValue(zi->filezip,zi->ci.crc32,4); /* crc 32, unknown */ | ||||||
|  |  | ||||||
|  |         if (err==ZIP_OK) /* compressed size, unknown */ | ||||||
|  |             err = ziplocal_putValue(zi->filezip,zi->ci.stream.total_out,4);  | ||||||
|  |  | ||||||
|  |         if (err==ZIP_OK) /* uncompressed size, unknown */ | ||||||
|  |             err = ziplocal_putValue(zi->filezip,zi->ci.stream.total_in,4); | ||||||
|  |  | ||||||
|  | 	    if (fseek(zi->filezip, | ||||||
|  |                   cur_pos_inzip,SEEK_SET)!=0) | ||||||
|  | 		    err = ZIP_ERRNO; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     zi->number_entry ++; | ||||||
|  |     zi->in_opened_file_inzip = 0; | ||||||
|  |  | ||||||
|  |     return err; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | extern int ZEXPORT zipClose (file, global_comment) | ||||||
|  |     zipFile file; | ||||||
|  |     const char* global_comment; | ||||||
|  | { | ||||||
|  |     zip_internal* zi; | ||||||
|  |     int err = 0; | ||||||
|  |     uLong size_centraldir = 0; | ||||||
|  |     uLong centraldir_pos_inzip ; | ||||||
|  |     uInt size_global_comment; | ||||||
|  |     if (file == NULL) | ||||||
|  |         return ZIP_PARAMERROR; | ||||||
|  |     zi = (zip_internal*)file; | ||||||
|  |  | ||||||
|  |     if (zi->in_opened_file_inzip == 1) | ||||||
|  |     { | ||||||
|  |         err = zipCloseFileInZip (file); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     if (global_comment==NULL) | ||||||
|  |         size_global_comment = 0; | ||||||
|  |     else | ||||||
|  |         size_global_comment = strlen(global_comment); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     centraldir_pos_inzip = ftell(zi->filezip); | ||||||
|  |     if (err==ZIP_OK) | ||||||
|  |     { | ||||||
|  |         linkedlist_datablock_internal* ldi = zi->central_dir.first_block ; | ||||||
|  |         while (ldi!=NULL) | ||||||
|  |         { | ||||||
|  |             if ((err==ZIP_OK) && (ldi->filled_in_this_block>0)) | ||||||
|  |                 if (fwrite(ldi->data,(uInt)ldi->filled_in_this_block, | ||||||
|  |                                         1,zi->filezip) !=1 ) | ||||||
|  |                     err = ZIP_ERRNO; | ||||||
|  |  | ||||||
|  |             size_centraldir += ldi->filled_in_this_block; | ||||||
|  |             ldi = ldi->next_datablock; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |     free_datablock(zi->central_dir.first_block); | ||||||
|  |  | ||||||
|  |     if (err==ZIP_OK) /* Magic End */ | ||||||
|  |         err = ziplocal_putValue(zi->filezip,ENDHEADERMAGIC,4); | ||||||
|  |  | ||||||
|  |     if (err==ZIP_OK) /* number of this disk */ | ||||||
|  |         err = ziplocal_putValue(zi->filezip,0,2); | ||||||
|  |  | ||||||
|  |     if (err==ZIP_OK) /* number of the disk with the start of the central directory */ | ||||||
|  |         err = ziplocal_putValue(zi->filezip,0,2); | ||||||
|  |  | ||||||
|  |     if (err==ZIP_OK) /* total number of entries in the central dir on this disk */ | ||||||
|  |         err = ziplocal_putValue(zi->filezip,zi->number_entry,2); | ||||||
|  |  | ||||||
|  |     if (err==ZIP_OK) /* total number of entries in the central dir */ | ||||||
|  |         err = ziplocal_putValue(zi->filezip,zi->number_entry,2); | ||||||
|  |  | ||||||
|  |     if (err==ZIP_OK) /* size of the central directory */ | ||||||
|  |         err = ziplocal_putValue(zi->filezip,size_centraldir,4); | ||||||
|  |  | ||||||
|  |     if (err==ZIP_OK) /* offset of start of central directory with respect to the  | ||||||
|  | 	                        starting disk number */ | ||||||
|  |         err = ziplocal_putValue(zi->filezip,centraldir_pos_inzip ,4); | ||||||
|  |  | ||||||
|  |     if (err==ZIP_OK) /* zipfile comment length */ | ||||||
|  |         err = ziplocal_putValue(zi->filezip,(uLong)size_global_comment,2); | ||||||
|  |  | ||||||
|  |     if ((err==ZIP_OK) && (size_global_comment>0)) | ||||||
|  |         if (fwrite(global_comment,(uInt)size_global_comment,1,zi->filezip) !=1 ) | ||||||
|  |                 err = ZIP_ERRNO; | ||||||
|  |     fclose(zi->filezip); | ||||||
|  |     TRYFREE(zi); | ||||||
|  |  | ||||||
|  |     return err; | ||||||
|  | } | ||||||
							
								
								
									
										5
									
								
								contrib/minizip/zip.def
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								contrib/minizip/zip.def
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | |||||||
|  | 	zipOpen                       @80 | ||||||
|  | 	zipOpenNewFileInZip           @81 | ||||||
|  | 	zipWriteInFileInZip           @82 | ||||||
|  | 	zipCloseFileInZip             @83 | ||||||
|  | 	zipClose                      @84 | ||||||
							
								
								
									
										150
									
								
								contrib/minizip/zip.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										150
									
								
								contrib/minizip/zip.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,150 @@ | |||||||
|  | /* zip.h -- IO for compress .zip files using zlib  | ||||||
|  |    Version 0.15 alpha, Mar 19th, 1998, | ||||||
|  |  | ||||||
|  |    Copyright (C) 1998 Gilles Vollant | ||||||
|  |  | ||||||
|  |    This unzip package allow creates .ZIP file, compatible with PKZip 2.04g | ||||||
|  |      WinZip, InfoZip tools and compatible. | ||||||
|  |    Encryption and multi volume ZipFile (span) are not supported. | ||||||
|  |    Old compressions used by old PKZip 1.x are not supported | ||||||
|  |  | ||||||
|  |   For uncompress .zip file, look at unzip.h | ||||||
|  |  | ||||||
|  |    THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE | ||||||
|  |    CAN CHANGE IN FUTURE VERSION !! | ||||||
|  |    I WAIT FEEDBACK at mail info@winimage.com | ||||||
|  |    Visit also http://www.winimage.com/zLibDll/zip.htm for evolution | ||||||
|  |  | ||||||
|  |    Condition of use and distribution are the same than zlib : | ||||||
|  |  | ||||||
|  |   This software is provided 'as-is', without any express or implied | ||||||
|  |   warranty.  In no event will the authors be held liable for any damages | ||||||
|  |   arising from the use of this software. | ||||||
|  |  | ||||||
|  |   Permission is granted to anyone to use this software for any purpose, | ||||||
|  |   including commercial applications, and to alter it and redistribute it | ||||||
|  |   freely, subject to the following restrictions: | ||||||
|  |  | ||||||
|  |   1. The origin of this software must not be misrepresented; you must not | ||||||
|  |      claim that you wrote the original software. If you use this software | ||||||
|  |      in a product, an acknowledgment in the product documentation would be | ||||||
|  |      appreciated but is not required. | ||||||
|  |   2. Altered source versions must be plainly marked as such, and must not be | ||||||
|  |      misrepresented as being the original software. | ||||||
|  |   3. This notice may not be removed or altered from any source distribution. | ||||||
|  |  | ||||||
|  |  | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | /* for more info about .ZIP format, see  | ||||||
|  |       ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip | ||||||
|  |    PkWare has also a specification at : | ||||||
|  |       ftp://ftp.pkware.com/probdesc.zip | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | #ifndef _zip_H | ||||||
|  | #define _zip_H | ||||||
|  |  | ||||||
|  | #ifdef __cplusplus | ||||||
|  | extern "C" { | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #ifndef _ZLIB_H | ||||||
|  | #include "zlib.h" | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #if defined(STRICTZIP) || defined(STRICTZIPUNZIP) | ||||||
|  | /* like the STRICT of WIN32, we define a pointer that cannot be converted | ||||||
|  |     from (void*) without cast */ | ||||||
|  | typedef struct TagzipFile__ { int unused; } zipFile__;  | ||||||
|  | typedef zipFile__ *zipFile; | ||||||
|  | #else | ||||||
|  | typedef voidp zipFile; | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #define ZIP_OK                                  (0) | ||||||
|  | #define ZIP_ERRNO               (Z_ERRNO) | ||||||
|  | #define ZIP_PARAMERROR                  (-102) | ||||||
|  | #define ZIP_INTERNALERROR               (-104) | ||||||
|  |  | ||||||
|  | /* tm_zip contain date/time info */ | ||||||
|  | typedef struct tm_zip_s  | ||||||
|  | { | ||||||
|  | 	uInt tm_sec;            /* seconds after the minute - [0,59] */ | ||||||
|  | 	uInt tm_min;            /* minutes after the hour - [0,59] */ | ||||||
|  | 	uInt tm_hour;           /* hours since midnight - [0,23] */ | ||||||
|  | 	uInt tm_mday;           /* day of the month - [1,31] */ | ||||||
|  | 	uInt tm_mon;            /* months since January - [0,11] */ | ||||||
|  | 	uInt tm_year;           /* years - [1980..2044] */ | ||||||
|  | } tm_zip; | ||||||
|  |  | ||||||
|  | typedef struct | ||||||
|  | { | ||||||
|  | 	tm_zip      tmz_date;       /* date in understandable format           */ | ||||||
|  |     uLong       dosDate;       /* if dos_date == 0, tmu_date is used      */ | ||||||
|  | /*    uLong       flag;        */   /* general purpose bit flag        2 bytes */ | ||||||
|  |  | ||||||
|  |     uLong       internal_fa;    /* internal file attributes        2 bytes */ | ||||||
|  |     uLong       external_fa;    /* external file attributes        4 bytes */ | ||||||
|  | } zip_fileinfo; | ||||||
|  |  | ||||||
|  | extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); | ||||||
|  | /* | ||||||
|  |   Create a zipfile. | ||||||
|  | 	 pathname contain on Windows NT a filename like "c:\\zlib\\zlib111.zip" or on | ||||||
|  | 	   an Unix computer "zlib/zlib111.zip". | ||||||
|  | 	 if the file pathname exist and append=1, the zip will be created at the end | ||||||
|  | 	   of the file. (useful if the file contain a self extractor code) | ||||||
|  | 	 If the zipfile cannot be opened, the return value is NULL. | ||||||
|  |      Else, the return value is a zipFile Handle, usable with other function | ||||||
|  | 	   of this zip package. | ||||||
|  |  | ||||||
|  |  | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, | ||||||
|  | 					   const char* filename, | ||||||
|  | 					   const zip_fileinfo* zipfi, | ||||||
|  | 					   const void* extrafield_local, | ||||||
|  | 					   uInt size_extrafield_local, | ||||||
|  | 					   const void* extrafield_global, | ||||||
|  | 					   uInt size_extrafield_global, | ||||||
|  | 					   const char* comment, | ||||||
|  | 					   int method, | ||||||
|  | 					   int level)); | ||||||
|  | /* | ||||||
|  |   Open a file in the ZIP for writing. | ||||||
|  |   filename : the filename in zip (if NULL, '-' without quote will be used | ||||||
|  |   *zipfi contain supplemental information | ||||||
|  |   if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local | ||||||
|  |     contains the extrafield data the the local header | ||||||
|  |   if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global | ||||||
|  |     contains the extrafield data the the local header | ||||||
|  |   if comment != NULL, comment contain the comment string | ||||||
|  |   method contain the compression method (0 for store, Z_DEFLATED for deflate) | ||||||
|  |   level contain the level of compression (can be Z_DEFAULT_COMPRESSION) | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, | ||||||
|  | 					   const voidp buf, | ||||||
|  | 					   unsigned len)); | ||||||
|  | /* | ||||||
|  |   Write data in the zipfile | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); | ||||||
|  | /* | ||||||
|  |   Close the current file in the zipfile | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | extern int ZEXPORT zipClose OF((zipFile file, | ||||||
|  | 				const char* global_comment)); | ||||||
|  | /* | ||||||
|  |   Close the zipfile | ||||||
|  | */ | ||||||
|  |  | ||||||
|  | #ifdef __cplusplus | ||||||
|  | } | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  | #endif /* _zip_H */ | ||||||
							
								
								
									
										74
									
								
								contrib/minizip/zlibvc.def
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								contrib/minizip/zlibvc.def
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,74 @@ | |||||||
|  | LIBRARY		"zlib" | ||||||
|  |  | ||||||
|  | DESCRIPTION	'"""zlib data compression library"""' | ||||||
|  |  | ||||||
|  |  | ||||||
|  | VERSION		1.11 | ||||||
|  |  | ||||||
|  |  | ||||||
|  | HEAPSIZE	1048576,8192 | ||||||
|  |  | ||||||
|  | EXPORTS | ||||||
|  |     adler32                        @1 | ||||||
|  |     compress                       @2 | ||||||
|  |     crc32                          @3 | ||||||
|  |     deflate                        @4 | ||||||
|  |     deflateCopy                    @5 | ||||||
|  |     deflateEnd                     @6 | ||||||
|  |     deflateInit2_                  @7 | ||||||
|  |     deflateInit_                   @8 | ||||||
|  |     deflateParams                  @9 | ||||||
|  |     deflateReset                   @10 | ||||||
|  |     deflateSetDictionary           @11 | ||||||
|  |     gzclose                        @12 | ||||||
|  |     gzdopen                        @13 | ||||||
|  |     gzerror                        @14 | ||||||
|  |     gzflush                        @15 | ||||||
|  |     gzopen                         @16 | ||||||
|  |     gzread                         @17 | ||||||
|  |     gzwrite                        @18 | ||||||
|  |     inflate                        @19 | ||||||
|  |     inflateEnd                     @20 | ||||||
|  |     inflateInit2_                  @21 | ||||||
|  |     inflateInit_                   @22 | ||||||
|  |     inflateReset                   @23 | ||||||
|  |     inflateSetDictionary           @24 | ||||||
|  |     inflateSync                    @25 | ||||||
|  |     uncompress                     @26 | ||||||
|  |     zlibVersion                    @27 | ||||||
|  |     gzprintf                       @28 | ||||||
|  |     gzputc                         @29 | ||||||
|  |     gzgetc                         @30 | ||||||
|  |     gzseek                         @31 | ||||||
|  |     gzrewind                       @32 | ||||||
|  |     gztell                         @33 | ||||||
|  |     gzeof                          @34 | ||||||
|  |     gzsetparams                    @35 | ||||||
|  |     zError                         @36 | ||||||
|  |     inflateSyncPoint               @37 | ||||||
|  |     get_crc_table                  @38 | ||||||
|  |     compress2                      @39 | ||||||
|  |     gzputs                         @40 | ||||||
|  |     gzgets                         @41 | ||||||
|  |  | ||||||
|  | 	unzOpen                       @61 | ||||||
|  | 	unzClose                      @62 | ||||||
|  | 	unzGetGlobalInfo              @63 | ||||||
|  | 	unzGetCurrentFileInfo         @64 | ||||||
|  | 	unzGoToFirstFile              @65 | ||||||
|  | 	unzGoToNextFile               @66 | ||||||
|  | 	unzOpenCurrentFile            @67 | ||||||
|  | 	unzReadCurrentFile            @68 | ||||||
|  | 	unztell                       @70 | ||||||
|  | 	unzeof                        @71 | ||||||
|  | 	unzCloseCurrentFile           @72 | ||||||
|  | 	unzGetGlobalComment           @73 | ||||||
|  | 	unzStringFileNameCompare      @74 | ||||||
|  | 	unzLocateFile                 @75 | ||||||
|  | 	unzGetLocalExtrafield         @76 | ||||||
|  |  | ||||||
|  | 	zipOpen                       @80 | ||||||
|  | 	zipOpenNewFileInZip           @81 | ||||||
|  | 	zipWriteInFileInZip           @82 | ||||||
|  | 	zipCloseFileInZip             @83 | ||||||
|  | 	zipClose                      @84 | ||||||
							
								
								
									
										651
									
								
								contrib/minizip/zlibvc.dsp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										651
									
								
								contrib/minizip/zlibvc.dsp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,651 @@ | |||||||
|  | # Microsoft Developer Studio Project File - Name="zlibvc" - Package Owner=<4> | ||||||
|  | # Microsoft Developer Studio Generated Build File, Format Version 5.00 | ||||||
|  | # ** DO NOT EDIT ** | ||||||
|  |  | ||||||
|  | # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 | ||||||
|  | # TARGTYPE "Win32 (ALPHA) Dynamic-Link Library" 0x0602 | ||||||
|  |  | ||||||
|  | CFG=zlibvc - Win32 Release | ||||||
|  | !MESSAGE This is not a valid makefile. To build this project using NMAKE, | ||||||
|  | !MESSAGE use the Export Makefile command and run | ||||||
|  | !MESSAGE  | ||||||
|  | !MESSAGE NMAKE /f "zlibvc.mak". | ||||||
|  | !MESSAGE  | ||||||
|  | !MESSAGE You can specify a configuration when running NMAKE | ||||||
|  | !MESSAGE by defining the macro CFG on the command line. For example: | ||||||
|  | !MESSAGE  | ||||||
|  | !MESSAGE NMAKE /f "zlibvc.mak" CFG="zlibvc - Win32 Release" | ||||||
|  | !MESSAGE  | ||||||
|  | !MESSAGE Possible choices for configuration are: | ||||||
|  | !MESSAGE  | ||||||
|  | !MESSAGE "zlibvc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") | ||||||
|  | !MESSAGE "zlibvc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") | ||||||
|  | !MESSAGE "zlibvc - Win32 ReleaseAxp" (based on\ | ||||||
|  |  "Win32 (ALPHA) Dynamic-Link Library") | ||||||
|  | !MESSAGE "zlibvc - Win32 ReleaseWithoutAsm" (based on\ | ||||||
|  |  "Win32 (x86) Dynamic-Link Library") | ||||||
|  | !MESSAGE "zlibvc - Win32 ReleaseWithoutCrtdll" (based on\ | ||||||
|  |  "Win32 (x86) Dynamic-Link Library") | ||||||
|  | !MESSAGE  | ||||||
|  |  | ||||||
|  | # Begin Project | ||||||
|  | # PROP Scc_ProjName "" | ||||||
|  | # PROP Scc_LocalPath "" | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | # PROP BASE Use_MFC 0 | ||||||
|  | # PROP BASE Use_Debug_Libraries 0 | ||||||
|  | # PROP BASE Output_Dir ".\Release" | ||||||
|  | # PROP BASE Intermediate_Dir ".\Release" | ||||||
|  | # PROP BASE Target_Dir "" | ||||||
|  | # PROP Use_MFC 0 | ||||||
|  | # PROP Use_Debug_Libraries 0 | ||||||
|  | # PROP Output_Dir ".\Release" | ||||||
|  | # PROP Intermediate_Dir ".\Release" | ||||||
|  | # PROP Ignore_Export_Lib 0 | ||||||
|  | # PROP Target_Dir "" | ||||||
|  | CPP=cl.exe | ||||||
|  | # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c | ||||||
|  | # ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c | ||||||
|  | # SUBTRACT CPP /YX | ||||||
|  | MTL=midl.exe | ||||||
|  | # ADD BASE MTL /nologo /D "NDEBUG" /win32 | ||||||
|  | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | ||||||
|  | RSC=rc.exe | ||||||
|  | # ADD BASE RSC /l 0x40c /d "NDEBUG" | ||||||
|  | # ADD RSC /l 0x40c /d "NDEBUG" | ||||||
|  | BSC32=bscmake.exe | ||||||
|  | # ADD BASE BSC32 /nologo | ||||||
|  | # ADD BSC32 /nologo | ||||||
|  | LINK32=link.exe | ||||||
|  | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 | ||||||
|  | # ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll" | ||||||
|  | # SUBTRACT LINK32 /pdb:none | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | # PROP BASE Use_MFC 0 | ||||||
|  | # PROP BASE Use_Debug_Libraries 1 | ||||||
|  | # PROP BASE Output_Dir ".\Debug" | ||||||
|  | # PROP BASE Intermediate_Dir ".\Debug" | ||||||
|  | # PROP BASE Target_Dir "" | ||||||
|  | # PROP Use_MFC 0 | ||||||
|  | # PROP Use_Debug_Libraries 1 | ||||||
|  | # PROP Output_Dir ".\Debug" | ||||||
|  | # PROP Intermediate_Dir ".\Debug" | ||||||
|  | # PROP Target_Dir "" | ||||||
|  | CPP=cl.exe | ||||||
|  | # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c | ||||||
|  | # ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /FD /c | ||||||
|  | # SUBTRACT CPP /YX | ||||||
|  | MTL=midl.exe | ||||||
|  | # ADD BASE MTL /nologo /D "_DEBUG" /win32 | ||||||
|  | # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 | ||||||
|  | RSC=rc.exe | ||||||
|  | # ADD BASE RSC /l 0x40c /d "_DEBUG" | ||||||
|  | # ADD RSC /l 0x40c /d "_DEBUG" | ||||||
|  | BSC32=bscmake.exe | ||||||
|  | # ADD BASE BSC32 /nologo | ||||||
|  | # ADD BSC32 /nologo | ||||||
|  | LINK32=link.exe | ||||||
|  | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 | ||||||
|  | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:".\Debug\zlib.dll" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | # PROP BASE Use_MFC 0 | ||||||
|  | # PROP BASE Use_Debug_Libraries 0 | ||||||
|  | # PROP BASE Output_Dir "zlibvc__" | ||||||
|  | # PROP BASE Intermediate_Dir "zlibvc__" | ||||||
|  | # PROP BASE Ignore_Export_Lib 0 | ||||||
|  | # PROP BASE Target_Dir "" | ||||||
|  | # PROP Use_MFC 0 | ||||||
|  | # PROP Use_Debug_Libraries 0 | ||||||
|  | # PROP Output_Dir "zlibvc__" | ||||||
|  | # PROP Intermediate_Dir "zlibvc__" | ||||||
|  | # PROP Ignore_Export_Lib 0 | ||||||
|  | # PROP Target_Dir "" | ||||||
|  | MTL=midl.exe | ||||||
|  | # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | ||||||
|  | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | ||||||
|  | CPP=cl.exe | ||||||
|  | # ADD BASE CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c | ||||||
|  | # ADD CPP /nologo /MT /Gt0 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c | ||||||
|  | # SUBTRACT CPP /YX | ||||||
|  | RSC=rc.exe | ||||||
|  | # ADD BASE RSC /l 0x40c /d "NDEBUG" | ||||||
|  | # ADD RSC /l 0x40c /d "NDEBUG" | ||||||
|  | BSC32=bscmake.exe | ||||||
|  | # ADD BASE BSC32 /nologo | ||||||
|  | # ADD BSC32 /nologo | ||||||
|  | LINK32=link.exe | ||||||
|  | # ADD BASE LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:".\Release\zlib.dll" | ||||||
|  | # SUBTRACT BASE LINK32 /pdb:none | ||||||
|  | # ADD LINK32 crtdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /map /machine:ALPHA /nodefaultlib /out:"zlibvc__\zlib.dll" | ||||||
|  | # SUBTRACT LINK32 /pdb:none | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | # PROP BASE Use_MFC 0 | ||||||
|  | # PROP BASE Use_Debug_Libraries 0 | ||||||
|  | # PROP BASE Output_Dir "zlibvc_0" | ||||||
|  | # PROP BASE Intermediate_Dir "zlibvc_0" | ||||||
|  | # PROP BASE Ignore_Export_Lib 0 | ||||||
|  | # PROP BASE Target_Dir "" | ||||||
|  | # PROP Use_MFC 0 | ||||||
|  | # PROP Use_Debug_Libraries 0 | ||||||
|  | # PROP Output_Dir "zlibvc_0" | ||||||
|  | # PROP Intermediate_Dir "zlibvc_0" | ||||||
|  | # PROP Ignore_Export_Lib 0 | ||||||
|  | # PROP Target_Dir "" | ||||||
|  | CPP=cl.exe | ||||||
|  | # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /YX /FD /c | ||||||
|  | # ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /FAcs /FR /FD /c | ||||||
|  | # SUBTRACT CPP /YX | ||||||
|  | MTL=midl.exe | ||||||
|  | # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | ||||||
|  | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | ||||||
|  | RSC=rc.exe | ||||||
|  | # ADD BASE RSC /l 0x40c /d "NDEBUG" | ||||||
|  | # ADD RSC /l 0x40c /d "NDEBUG" | ||||||
|  | BSC32=bscmake.exe | ||||||
|  | # ADD BASE BSC32 /nologo | ||||||
|  | # ADD BSC32 /nologo | ||||||
|  | LINK32=link.exe | ||||||
|  | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll" | ||||||
|  | # SUBTRACT BASE LINK32 /pdb:none | ||||||
|  | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_0\zlib.dll" | ||||||
|  | # SUBTRACT LINK32 /pdb:none | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | # PROP BASE Use_MFC 0 | ||||||
|  | # PROP BASE Use_Debug_Libraries 0 | ||||||
|  | # PROP BASE Output_Dir "zlibvc_1" | ||||||
|  | # PROP BASE Intermediate_Dir "zlibvc_1" | ||||||
|  | # PROP BASE Ignore_Export_Lib 0 | ||||||
|  | # PROP BASE Target_Dir "" | ||||||
|  | # PROP Use_MFC 0 | ||||||
|  | # PROP Use_Debug_Libraries 0 | ||||||
|  | # PROP Output_Dir "zlibvc_1" | ||||||
|  | # PROP Intermediate_Dir "zlibvc_1" | ||||||
|  | # PROP Ignore_Export_Lib 0 | ||||||
|  | # PROP Target_Dir "" | ||||||
|  | CPP=cl.exe | ||||||
|  | # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /YX /FD /c | ||||||
|  | # ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_WINDLL" /D "_WIN32" /D "BUILD_ZLIBDLL" /D "ZLIB_DLL" /D "DYNAMIC_CRC_TABLE" /D "ASMV" /FAcs /FR /FD /c | ||||||
|  | # SUBTRACT CPP /YX | ||||||
|  | MTL=midl.exe | ||||||
|  | # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | ||||||
|  | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 | ||||||
|  | RSC=rc.exe | ||||||
|  | # ADD BASE RSC /l 0x40c /d "NDEBUG" | ||||||
|  | # ADD RSC /l 0x40c /d "NDEBUG" | ||||||
|  | BSC32=bscmake.exe | ||||||
|  | # ADD BASE BSC32 /nologo | ||||||
|  | # ADD BSC32 /nologo | ||||||
|  | LINK32=link.exe | ||||||
|  | # ADD BASE LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\Release\zlib.dll" | ||||||
|  | # SUBTRACT BASE LINK32 /pdb:none | ||||||
|  | # ADD LINK32 gvmat32.obj kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib crtdll.lib /nologo /subsystem:windows /dll /map /machine:I386 /nodefaultlib /out:".\zlibvc_1\zlib.dll" | ||||||
|  | # SUBTRACT LINK32 /pdb:none | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # Begin Target | ||||||
|  |  | ||||||
|  | # Name "zlibvc - Win32 Release" | ||||||
|  | # Name "zlibvc - Win32 Debug" | ||||||
|  | # Name "zlibvc - Win32 ReleaseAxp" | ||||||
|  | # Name "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  | # Name "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  | # Begin Group "Source Files" | ||||||
|  |  | ||||||
|  | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90" | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\adler32.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | DEP_CPP_ADLER=\ | ||||||
|  | 	".\zconf.h"\ | ||||||
|  | 	".\zlib.h"\ | ||||||
|  | 	 | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\compress.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | DEP_CPP_COMPR=\ | ||||||
|  | 	".\zconf.h"\ | ||||||
|  | 	".\zlib.h"\ | ||||||
|  | 	 | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\crc32.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | DEP_CPP_CRC32=\ | ||||||
|  | 	".\zconf.h"\ | ||||||
|  | 	".\zlib.h"\ | ||||||
|  | 	 | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\deflate.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | DEP_CPP_DEFLA=\ | ||||||
|  | 	".\deflate.h"\ | ||||||
|  | 	".\zconf.h"\ | ||||||
|  | 	".\zlib.h"\ | ||||||
|  | 	".\zutil.h"\ | ||||||
|  | 	 | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\gvmat32c.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\gzio.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | DEP_CPP_GZIO_=\ | ||||||
|  | 	".\zconf.h"\ | ||||||
|  | 	".\zlib.h"\ | ||||||
|  | 	".\zutil.h"\ | ||||||
|  | 	 | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\infblock.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | DEP_CPP_INFBL=\ | ||||||
|  | 	".\infblock.h"\ | ||||||
|  | 	".\infcodes.h"\ | ||||||
|  | 	".\inftrees.h"\ | ||||||
|  | 	".\infutil.h"\ | ||||||
|  | 	".\zconf.h"\ | ||||||
|  | 	".\zlib.h"\ | ||||||
|  | 	".\zutil.h"\ | ||||||
|  | 	 | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\infcodes.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | DEP_CPP_INFCO=\ | ||||||
|  | 	".\infblock.h"\ | ||||||
|  | 	".\infcodes.h"\ | ||||||
|  | 	".\inffast.h"\ | ||||||
|  | 	".\inftrees.h"\ | ||||||
|  | 	".\infutil.h"\ | ||||||
|  | 	".\zconf.h"\ | ||||||
|  | 	".\zlib.h"\ | ||||||
|  | 	".\zutil.h"\ | ||||||
|  | 	 | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\inffast.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | DEP_CPP_INFFA=\ | ||||||
|  | 	".\infblock.h"\ | ||||||
|  | 	".\infcodes.h"\ | ||||||
|  | 	".\inffast.h"\ | ||||||
|  | 	".\inftrees.h"\ | ||||||
|  | 	".\infutil.h"\ | ||||||
|  | 	".\zconf.h"\ | ||||||
|  | 	".\zlib.h"\ | ||||||
|  | 	".\zutil.h"\ | ||||||
|  | 	 | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\inflate.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | DEP_CPP_INFLA=\ | ||||||
|  | 	".\infblock.h"\ | ||||||
|  | 	".\zconf.h"\ | ||||||
|  | 	".\zlib.h"\ | ||||||
|  | 	".\zutil.h"\ | ||||||
|  | 	 | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\inftrees.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | DEP_CPP_INFTR=\ | ||||||
|  | 	".\inftrees.h"\ | ||||||
|  | 	".\zconf.h"\ | ||||||
|  | 	".\zlib.h"\ | ||||||
|  | 	".\zutil.h"\ | ||||||
|  | 	 | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\infutil.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | DEP_CPP_INFUT=\ | ||||||
|  | 	".\infblock.h"\ | ||||||
|  | 	".\infcodes.h"\ | ||||||
|  | 	".\inftrees.h"\ | ||||||
|  | 	".\infutil.h"\ | ||||||
|  | 	".\zconf.h"\ | ||||||
|  | 	".\zlib.h"\ | ||||||
|  | 	".\zutil.h"\ | ||||||
|  | 	 | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\trees.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | DEP_CPP_TREES=\ | ||||||
|  | 	".\deflate.h"\ | ||||||
|  | 	".\zconf.h"\ | ||||||
|  | 	".\zlib.h"\ | ||||||
|  | 	".\zutil.h"\ | ||||||
|  | 	 | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\uncompr.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | DEP_CPP_UNCOM=\ | ||||||
|  | 	".\zconf.h"\ | ||||||
|  | 	".\zlib.h"\ | ||||||
|  | 	 | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\unzip.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\zip.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\zlib.rc | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\zlibvc.def | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\zutil.c | ||||||
|  |  | ||||||
|  | !IF  "$(CFG)" == "zlibvc - Win32 Release" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 Debug" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseAxp" | ||||||
|  |  | ||||||
|  | DEP_CPP_ZUTIL=\ | ||||||
|  | 	".\zconf.h"\ | ||||||
|  | 	".\zlib.h"\ | ||||||
|  | 	".\zutil.h"\ | ||||||
|  | 	 | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutAsm" | ||||||
|  |  | ||||||
|  | !ELSEIF  "$(CFG)" == "zlibvc - Win32 ReleaseWithoutCrtdll" | ||||||
|  |  | ||||||
|  | !ENDIF  | ||||||
|  |  | ||||||
|  | # End Source File | ||||||
|  | # End Group | ||||||
|  | # Begin Group "Header Files" | ||||||
|  |  | ||||||
|  | # PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\deflate.h | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\infblock.h | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\infcodes.h | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\inffast.h | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\inftrees.h | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\infutil.h | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\zconf.h | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\zlib.h | ||||||
|  | # End Source File | ||||||
|  | # Begin Source File | ||||||
|  |  | ||||||
|  | SOURCE=.\zutil.h | ||||||
|  | # End Source File | ||||||
|  | # End Group | ||||||
|  | # Begin Group "Resource Files" | ||||||
|  |  | ||||||
|  | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" | ||||||
|  | # End Group | ||||||
|  | # End Target | ||||||
|  | # End Project | ||||||
							
								
								
									
										41
									
								
								contrib/minizip/zlibvc.dsw
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								contrib/minizip/zlibvc.dsw
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,41 @@ | |||||||
|  | Microsoft Developer Studio Workspace File, Format Version 5.00 | ||||||
|  | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! | ||||||
|  |  | ||||||
|  | ############################################################################### | ||||||
|  |  | ||||||
|  | Project: "zlibstat"=.\zlibstat.dsp - Package Owner=<4> | ||||||
|  |  | ||||||
|  | Package=<5> | ||||||
|  | {{{ | ||||||
|  | }}} | ||||||
|  |  | ||||||
|  | Package=<4> | ||||||
|  | {{{ | ||||||
|  | }}} | ||||||
|  |  | ||||||
|  | ############################################################################### | ||||||
|  |  | ||||||
|  | Project: "zlibvc"=.\zlibvc.dsp - Package Owner=<4> | ||||||
|  |  | ||||||
|  | Package=<5> | ||||||
|  | {{{ | ||||||
|  | }}} | ||||||
|  |  | ||||||
|  | Package=<4> | ||||||
|  | {{{ | ||||||
|  | }}} | ||||||
|  |  | ||||||
|  | ############################################################################### | ||||||
|  |  | ||||||
|  | Global: | ||||||
|  |  | ||||||
|  | Package=<5> | ||||||
|  | {{{ | ||||||
|  | }}} | ||||||
|  |  | ||||||
|  | Package=<3> | ||||||
|  | {{{ | ||||||
|  | }}} | ||||||
|  |  | ||||||
|  | ############################################################################### | ||||||
|  |  | ||||||
| @@ -52,7 +52,7 @@ | |||||||
| #include "deflate.h" | #include "deflate.h" | ||||||
|  |  | ||||||
| const char deflate_copyright[] = | const char deflate_copyright[] = | ||||||
|    " deflate 1.1.1 Copyright 1995-1998 Jean-loup Gailly "; |    " deflate 1.1.2 Copyright 1995-1998 Jean-loup Gailly "; | ||||||
| /* | /* | ||||||
|   If you use the zlib library in a product, an acknowledgment is welcome |   If you use the zlib library in a product, an acknowledgment is welcome | ||||||
|   in the documentation of your product. If for some reason you cannot |   in the documentation of your product. If for some reason you cannot | ||||||
|   | |||||||
							
								
								
									
										14
									
								
								example.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								example.c
									
									
									
									
									
								
							| @@ -71,7 +71,7 @@ void test_compress(compr, comprLen, uncompr, uncomprLen) | |||||||
|         fprintf(stderr, "bad uncompress\n"); |         fprintf(stderr, "bad uncompress\n"); | ||||||
| 	exit(1); | 	exit(1); | ||||||
|     } else { |     } else { | ||||||
|         printf("uncompress(): %s\n", uncompr); |         printf("uncompress(): %s\n", (char *)uncompr); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -121,13 +121,13 @@ void test_gzio(out, in, uncompr, uncomprLen) | |||||||
|         fprintf(stderr, "bad gzread: %s\n", (char*)uncompr); |         fprintf(stderr, "bad gzread: %s\n", (char*)uncompr); | ||||||
| 	exit(1); | 	exit(1); | ||||||
|     } else { |     } else { | ||||||
|         printf("gzread(): %s\n", uncompr); |         printf("gzread(): %s\n", (char *)uncompr); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     pos = gzseek(file, -8L, SEEK_CUR); |     pos = gzseek(file, -8L, SEEK_CUR); | ||||||
|     if (pos != 6 || gztell(file) != pos) { |     if (pos != 6 || gztell(file) != pos) { | ||||||
| 	fprintf(stderr, "gzseek error, pos=%ld, gztell=%ld\n", | 	fprintf(stderr, "gzseek error, pos=%ld, gztell=%ld\n", | ||||||
| 		pos, gztell(file)); | 		(long)pos, (long)gztell(file)); | ||||||
| 	exit(1); | 	exit(1); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -146,7 +146,7 @@ void test_gzio(out, in, uncompr, uncomprLen) | |||||||
|         fprintf(stderr, "bad gzgets after gzseek\n"); |         fprintf(stderr, "bad gzgets after gzseek\n"); | ||||||
| 	exit(1); | 	exit(1); | ||||||
|     } else { |     } else { | ||||||
|         printf("gzgets() after gzseek: %s\n", uncompr); |         printf("gzgets() after gzseek: %s\n", (char *)uncompr); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     gzclose(file); |     gzclose(file); | ||||||
| @@ -227,7 +227,7 @@ void test_inflate(compr, comprLen, uncompr, uncomprLen) | |||||||
|         fprintf(stderr, "bad inflate\n"); |         fprintf(stderr, "bad inflate\n"); | ||||||
| 	exit(1); | 	exit(1); | ||||||
|     } else { |     } else { | ||||||
|         printf("inflate(): %s\n", uncompr); |         printf("inflate(): %s\n", (char *)uncompr); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -406,7 +406,7 @@ void test_sync(compr, comprLen, uncompr, uncomprLen) | |||||||
|     err = inflateEnd(&d_stream); |     err = inflateEnd(&d_stream); | ||||||
|     CHECK_ERR(err, "inflateEnd"); |     CHECK_ERR(err, "inflateEnd"); | ||||||
|  |  | ||||||
|     printf("after inflateSync(): hel%s\n", uncompr); |     printf("after inflateSync(): hel%s\n", (char *)uncompr); | ||||||
| } | } | ||||||
|  |  | ||||||
| /* =========================================================================== | /* =========================================================================== | ||||||
| @@ -492,7 +492,7 @@ void test_dict_inflate(compr, comprLen, uncompr, uncomprLen) | |||||||
|         fprintf(stderr, "bad inflate with dict\n"); |         fprintf(stderr, "bad inflate with dict\n"); | ||||||
| 	exit(1); | 	exit(1); | ||||||
|     } else { |     } else { | ||||||
|         printf("inflate with dictionary: %s\n", uncompr); |         printf("inflate with dictionary: %s\n", (char *)uncompr); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										23
									
								
								gzio.c
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								gzio.c
									
									
									
									
									
								
							| @@ -13,8 +13,16 @@ | |||||||
|  |  | ||||||
| struct internal_state {int dummy;}; /* for buggy compilers */ | struct internal_state {int dummy;}; /* for buggy compilers */ | ||||||
|  |  | ||||||
| #define Z_BUFSIZE       16384 | #ifndef Z_BUFSIZE | ||||||
| #define Z_PRINTF_BUFSIZE 4096 | #  ifdef MAXSEG_64K | ||||||
|  | #    define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */ | ||||||
|  | #  else | ||||||
|  | #    define Z_BUFSIZE 16384 | ||||||
|  | #  endif | ||||||
|  | #endif | ||||||
|  | #ifndef Z_PRINTF_BUFSIZE | ||||||
|  | #  define Z_PRINTF_BUFSIZE 4096 | ||||||
|  | #endif | ||||||
|  |  | ||||||
| #define ALLOC(size) malloc(size) | #define ALLOC(size) malloc(size) | ||||||
| #define TRYFREE(p) {if (p) free(p);} | #define TRYFREE(p) {if (p) free(p);} | ||||||
| @@ -132,8 +140,12 @@ local gzFile gz_open (path, mode, fd) | |||||||
|         s->stream.next_in  = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); |         s->stream.next_in  = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); | ||||||
|  |  | ||||||
|         err = inflateInit2(&(s->stream), -MAX_WBITS); |         err = inflateInit2(&(s->stream), -MAX_WBITS); | ||||||
|         /* windowBits is passed < 0 to tell that there is no zlib header */ |         /* windowBits is passed < 0 to tell that there is no zlib header. | ||||||
|  |          * Note that in this case inflate *requires* an extra "dummy" byte | ||||||
|  |          * after the compressed stream in order to complete decompression and | ||||||
|  |          * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are | ||||||
|  |          * present after the compressed stream. | ||||||
|  |          */ | ||||||
|         if (err != Z_OK || s->inbuf == Z_NULL) { |         if (err != Z_OK || s->inbuf == Z_NULL) { | ||||||
|             return destroy(s), (gzFile)Z_NULL; |             return destroy(s), (gzFile)Z_NULL; | ||||||
|         } |         } | ||||||
| @@ -379,6 +391,7 @@ int ZEXPORT gzread (file, buf, len) | |||||||
| 	    len -= s->stream.avail_out; | 	    len -= s->stream.avail_out; | ||||||
| 	    s->stream.total_in  += (uLong)len; | 	    s->stream.total_in  += (uLong)len; | ||||||
| 	    s->stream.total_out += (uLong)len; | 	    s->stream.total_out += (uLong)len; | ||||||
|  |             if (len == 0) s->z_eof = 1; | ||||||
| 	    return (int)len; | 	    return (int)len; | ||||||
| 	} | 	} | ||||||
|         if (s->stream.avail_in == 0 && !s->z_eof) { |         if (s->stream.avail_in == 0 && !s->z_eof) { | ||||||
| @@ -572,7 +585,7 @@ int ZEXPORT gzputs(file, s) | |||||||
|     gzFile file; |     gzFile file; | ||||||
|     const char *s; |     const char *s; | ||||||
| { | { | ||||||
|     return gzwrite(file, (const voidp)s, (unsigned)strlen(s)); |     return gzwrite(file, (char*)s, (unsigned)strlen(s)); | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -11,6 +11,10 @@ | |||||||
|  |  | ||||||
| struct inflate_codes_state {int dummy;}; /* for buggy compilers */ | struct inflate_codes_state {int dummy;}; /* for buggy compilers */ | ||||||
|  |  | ||||||
|  | /* simplify the use of the inflate_huft type with some defines */ | ||||||
|  | #define exop word.what.Exop | ||||||
|  | #define bits word.what.Bits | ||||||
|  |  | ||||||
| /* Table for deflate from PKZIP's appnote.txt. */ | /* Table for deflate from PKZIP's appnote.txt. */ | ||||||
| local const uInt border[] = { /* Order of the bit length code lengths */ | local const uInt border[] = { /* Order of the bit length code lengths */ | ||||||
|         16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; |         16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; | ||||||
| @@ -264,8 +268,8 @@ int r; | |||||||
|         t = s->sub.trees.bb; |         t = s->sub.trees.bb; | ||||||
|         NEEDBITS(t) |         NEEDBITS(t) | ||||||
|         h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]); |         h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]); | ||||||
|         t = h->word.what.Bits; |         t = h->bits; | ||||||
|         c = h->more.Base; |         c = h->base; | ||||||
|         if (c < 16) |         if (c < 16) | ||||||
|         { |         { | ||||||
|           DUMPBITS(t) |           DUMPBITS(t) | ||||||
|   | |||||||
| @@ -11,8 +11,6 @@ | |||||||
| #include "inffast.h" | #include "inffast.h" | ||||||
|  |  | ||||||
| /* simplify the use of the inflate_huft type with some defines */ | /* simplify the use of the inflate_huft type with some defines */ | ||||||
| #define base more.Base |  | ||||||
| #define next more.Next |  | ||||||
| #define exop word.what.Exop | #define exop word.what.Exop | ||||||
| #define bits word.what.Bits | #define bits word.what.Bits | ||||||
|  |  | ||||||
| @@ -145,7 +143,7 @@ int r; | |||||||
|       if ((e & 64) == 0)        /* next table */ |       if ((e & 64) == 0)        /* next table */ | ||||||
|       { |       { | ||||||
|         c->sub.code.need = e; |         c->sub.code.need = e; | ||||||
|         c->sub.code.tree = t->next; |         c->sub.code.tree = t + t->base; | ||||||
|         break; |         break; | ||||||
|       } |       } | ||||||
|       if (e & 32)               /* end of block */ |       if (e & 32)               /* end of block */ | ||||||
| @@ -183,7 +181,7 @@ int r; | |||||||
|       if ((e & 64) == 0)        /* next table */ |       if ((e & 64) == 0)        /* next table */ | ||||||
|       { |       { | ||||||
|         c->sub.code.need = e; |         c->sub.code.need = e; | ||||||
|         c->sub.code.tree = t->next; |         c->sub.code.tree = t + t->base; | ||||||
|         break; |         break; | ||||||
|       } |       } | ||||||
|       c->mode = BADCODE;        /* invalid code */ |       c->mode = BADCODE;        /* invalid code */ | ||||||
|   | |||||||
							
								
								
									
										12
									
								
								inffast.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								inffast.c
									
									
									
									
									
								
							| @@ -13,14 +13,12 @@ | |||||||
| struct inflate_codes_state {int dummy;}; /* for buggy compilers */ | struct inflate_codes_state {int dummy;}; /* for buggy compilers */ | ||||||
|  |  | ||||||
| /* simplify the use of the inflate_huft type with some defines */ | /* simplify the use of the inflate_huft type with some defines */ | ||||||
| #define base more.Base |  | ||||||
| #define next more.Next |  | ||||||
| #define exop word.what.Exop | #define exop word.what.Exop | ||||||
| #define bits word.what.Bits | #define bits word.what.Bits | ||||||
|  |  | ||||||
| /* macros for bit input with no checking and for returning unused bytes */ | /* macros for bit input with no checking and for returning unused bytes */ | ||||||
| #define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}} | #define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}} | ||||||
| #define UNGRAB {n+=(c=k>>3);p-=c;k&=7;} | #define UNGRAB {c=z->avail_in-n;c=(k>>3)<c?k>>3:c;n+=c;p-=c;k-=c<<3;} | ||||||
|  |  | ||||||
| /* Called with number of bytes left to write in window at least 258 | /* Called with number of bytes left to write in window at least 258 | ||||||
|    (the maximum string length) and number of input bytes available |    (the maximum string length) and number of input bytes available | ||||||
| @@ -120,7 +118,10 @@ z_streamp z; | |||||||
|             break; |             break; | ||||||
|           } |           } | ||||||
|           else if ((e & 64) == 0) |           else if ((e & 64) == 0) | ||||||
|             e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop; |           { | ||||||
|  |             t += t->base; | ||||||
|  |             e = (t += ((uInt)b & inflate_mask[e]))->exop; | ||||||
|  |           } | ||||||
|           else |           else | ||||||
|           { |           { | ||||||
|             z->msg = (char*)"invalid distance code"; |             z->msg = (char*)"invalid distance code"; | ||||||
| @@ -133,7 +134,8 @@ z_streamp z; | |||||||
|       } |       } | ||||||
|       if ((e & 64) == 0) |       if ((e & 64) == 0) | ||||||
|       { |       { | ||||||
|         if ((e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop) == 0) |         t += t->base; | ||||||
|  |         if ((e = (t += ((uInt)b & inflate_mask[e]))->exop) == 0) | ||||||
|         { |         { | ||||||
|           DUMPBITS(t->bits) |           DUMPBITS(t->bits) | ||||||
|           Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ? |           Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ? | ||||||
|   | |||||||
							
								
								
									
										125
									
								
								inffixed.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										125
									
								
								inffixed.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,125 @@ | |||||||
|  | /* inffixed.h -- table for decoding fixed codes | ||||||
|  |  * Generated automatically by the maketree.c program | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | /* WARNING: this file should *not* be used by applications. It is | ||||||
|  |    part of the implementation of the compression library and is | ||||||
|  |    subject to change. Applications should only use zlib.h. | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | local uInt fixed_bl = 9; | ||||||
|  | local uInt fixed_bd = 5; | ||||||
|  | local inflate_huft fixed_tl[] = { | ||||||
|  |     {{96,7},256}, {{0,8},80}, {{0,8},16}, {{84,8},115}, {{82,7},31}, | ||||||
|  |     {{0,8},112}, {{0,8},48}, {{0,9},192}, {{80,7},10}, {{0,8},96}, | ||||||
|  |     {{0,8},32}, {{0,9},160}, {{0,8},0}, {{0,8},128}, {{0,8},64}, | ||||||
|  |     {{0,9},224}, {{80,7},6}, {{0,8},88}, {{0,8},24}, {{0,9},144}, | ||||||
|  |     {{83,7},59}, {{0,8},120}, {{0,8},56}, {{0,9},208}, {{81,7},17}, | ||||||
|  |     {{0,8},104}, {{0,8},40}, {{0,9},176}, {{0,8},8}, {{0,8},136}, | ||||||
|  |     {{0,8},72}, {{0,9},240}, {{80,7},4}, {{0,8},84}, {{0,8},20}, | ||||||
|  |     {{85,8},227}, {{83,7},43}, {{0,8},116}, {{0,8},52}, {{0,9},200}, | ||||||
|  |     {{81,7},13}, {{0,8},100}, {{0,8},36}, {{0,9},168}, {{0,8},4}, | ||||||
|  |     {{0,8},132}, {{0,8},68}, {{0,9},232}, {{80,7},8}, {{0,8},92}, | ||||||
|  |     {{0,8},28}, {{0,9},152}, {{84,7},83}, {{0,8},124}, {{0,8},60}, | ||||||
|  |     {{0,9},216}, {{82,7},23}, {{0,8},108}, {{0,8},44}, {{0,9},184}, | ||||||
|  |     {{0,8},12}, {{0,8},140}, {{0,8},76}, {{0,9},248}, {{80,7},3}, | ||||||
|  |     {{0,8},82}, {{0,8},18}, {{85,8},163}, {{83,7},35}, {{0,8},114}, | ||||||
|  |     {{0,8},50}, {{0,9},196}, {{81,7},11}, {{0,8},98}, {{0,8},34}, | ||||||
|  |     {{0,9},164}, {{0,8},2}, {{0,8},130}, {{0,8},66}, {{0,9},228}, | ||||||
|  |     {{80,7},7}, {{0,8},90}, {{0,8},26}, {{0,9},148}, {{84,7},67}, | ||||||
|  |     {{0,8},122}, {{0,8},58}, {{0,9},212}, {{82,7},19}, {{0,8},106}, | ||||||
|  |     {{0,8},42}, {{0,9},180}, {{0,8},10}, {{0,8},138}, {{0,8},74}, | ||||||
|  |     {{0,9},244}, {{80,7},5}, {{0,8},86}, {{0,8},22}, {{192,8},0}, | ||||||
|  |     {{83,7},51}, {{0,8},118}, {{0,8},54}, {{0,9},204}, {{81,7},15}, | ||||||
|  |     {{0,8},102}, {{0,8},38}, {{0,9},172}, {{0,8},6}, {{0,8},134}, | ||||||
|  |     {{0,8},70}, {{0,9},236}, {{80,7},9}, {{0,8},94}, {{0,8},30}, | ||||||
|  |     {{0,9},156}, {{84,7},99}, {{0,8},126}, {{0,8},62}, {{0,9},220}, | ||||||
|  |     {{82,7},27}, {{0,8},110}, {{0,8},46}, {{0,9},188}, {{0,8},14}, | ||||||
|  |     {{0,8},142}, {{0,8},78}, {{0,9},252}, {{96,7},256}, {{0,8},81}, | ||||||
|  |     {{0,8},17}, {{85,8},131}, {{82,7},31}, {{0,8},113}, {{0,8},49}, | ||||||
|  |     {{0,9},194}, {{80,7},10}, {{0,8},97}, {{0,8},33}, {{0,9},162}, | ||||||
|  |     {{0,8},1}, {{0,8},129}, {{0,8},65}, {{0,9},226}, {{80,7},6}, | ||||||
|  |     {{0,8},89}, {{0,8},25}, {{0,9},146}, {{83,7},59}, {{0,8},121}, | ||||||
|  |     {{0,8},57}, {{0,9},210}, {{81,7},17}, {{0,8},105}, {{0,8},41}, | ||||||
|  |     {{0,9},178}, {{0,8},9}, {{0,8},137}, {{0,8},73}, {{0,9},242}, | ||||||
|  |     {{80,7},4}, {{0,8},85}, {{0,8},21}, {{80,8},258}, {{83,7},43}, | ||||||
|  |     {{0,8},117}, {{0,8},53}, {{0,9},202}, {{81,7},13}, {{0,8},101}, | ||||||
|  |     {{0,8},37}, {{0,9},170}, {{0,8},5}, {{0,8},133}, {{0,8},69}, | ||||||
|  |     {{0,9},234}, {{80,7},8}, {{0,8},93}, {{0,8},29}, {{0,9},154}, | ||||||
|  |     {{84,7},83}, {{0,8},125}, {{0,8},61}, {{0,9},218}, {{82,7},23}, | ||||||
|  |     {{0,8},109}, {{0,8},45}, {{0,9},186}, {{0,8},13}, {{0,8},141}, | ||||||
|  |     {{0,8},77}, {{0,9},250}, {{80,7},3}, {{0,8},83}, {{0,8},19}, | ||||||
|  |     {{85,8},195}, {{83,7},35}, {{0,8},115}, {{0,8},51}, {{0,9},198}, | ||||||
|  |     {{81,7},11}, {{0,8},99}, {{0,8},35}, {{0,9},166}, {{0,8},3}, | ||||||
|  |     {{0,8},131}, {{0,8},67}, {{0,9},230}, {{80,7},7}, {{0,8},91}, | ||||||
|  |     {{0,8},27}, {{0,9},150}, {{84,7},67}, {{0,8},123}, {{0,8},59}, | ||||||
|  |     {{0,9},214}, {{82,7},19}, {{0,8},107}, {{0,8},43}, {{0,9},182}, | ||||||
|  |     {{0,8},11}, {{0,8},139}, {{0,8},75}, {{0,9},246}, {{80,7},5}, | ||||||
|  |     {{0,8},87}, {{0,8},23}, {{192,8},0}, {{83,7},51}, {{0,8},119}, | ||||||
|  |     {{0,8},55}, {{0,9},206}, {{81,7},15}, {{0,8},103}, {{0,8},39}, | ||||||
|  |     {{0,9},174}, {{0,8},7}, {{0,8},135}, {{0,8},71}, {{0,9},238}, | ||||||
|  |     {{80,7},9}, {{0,8},95}, {{0,8},31}, {{0,9},158}, {{84,7},99}, | ||||||
|  |     {{0,8},127}, {{0,8},63}, {{0,9},222}, {{82,7},27}, {{0,8},111}, | ||||||
|  |     {{0,8},47}, {{0,9},190}, {{0,8},15}, {{0,8},143}, {{0,8},79}, | ||||||
|  |     {{0,9},254}, {{96,7},256}, {{0,8},80}, {{0,8},16}, {{84,8},115}, | ||||||
|  |     {{82,7},31}, {{0,8},112}, {{0,8},48}, {{0,9},193}, {{80,7},10}, | ||||||
|  |     {{0,8},96}, {{0,8},32}, {{0,9},161}, {{0,8},0}, {{0,8},128}, | ||||||
|  |     {{0,8},64}, {{0,9},225}, {{80,7},6}, {{0,8},88}, {{0,8},24}, | ||||||
|  |     {{0,9},145}, {{83,7},59}, {{0,8},120}, {{0,8},56}, {{0,9},209}, | ||||||
|  |     {{81,7},17}, {{0,8},104}, {{0,8},40}, {{0,9},177}, {{0,8},8}, | ||||||
|  |     {{0,8},136}, {{0,8},72}, {{0,9},241}, {{80,7},4}, {{0,8},84}, | ||||||
|  |     {{0,8},20}, {{85,8},227}, {{83,7},43}, {{0,8},116}, {{0,8},52}, | ||||||
|  |     {{0,9},201}, {{81,7},13}, {{0,8},100}, {{0,8},36}, {{0,9},169}, | ||||||
|  |     {{0,8},4}, {{0,8},132}, {{0,8},68}, {{0,9},233}, {{80,7},8}, | ||||||
|  |     {{0,8},92}, {{0,8},28}, {{0,9},153}, {{84,7},83}, {{0,8},124}, | ||||||
|  |     {{0,8},60}, {{0,9},217}, {{82,7},23}, {{0,8},108}, {{0,8},44}, | ||||||
|  |     {{0,9},185}, {{0,8},12}, {{0,8},140}, {{0,8},76}, {{0,9},249}, | ||||||
|  |     {{80,7},3}, {{0,8},82}, {{0,8},18}, {{85,8},163}, {{83,7},35}, | ||||||
|  |     {{0,8},114}, {{0,8},50}, {{0,9},197}, {{81,7},11}, {{0,8},98}, | ||||||
|  |     {{0,8},34}, {{0,9},165}, {{0,8},2}, {{0,8},130}, {{0,8},66}, | ||||||
|  |     {{0,9},229}, {{80,7},7}, {{0,8},90}, {{0,8},26}, {{0,9},149}, | ||||||
|  |     {{84,7},67}, {{0,8},122}, {{0,8},58}, {{0,9},213}, {{82,7},19}, | ||||||
|  |     {{0,8},106}, {{0,8},42}, {{0,9},181}, {{0,8},10}, {{0,8},138}, | ||||||
|  |     {{0,8},74}, {{0,9},245}, {{80,7},5}, {{0,8},86}, {{0,8},22}, | ||||||
|  |     {{192,8},0}, {{83,7},51}, {{0,8},118}, {{0,8},54}, {{0,9},205}, | ||||||
|  |     {{81,7},15}, {{0,8},102}, {{0,8},38}, {{0,9},173}, {{0,8},6}, | ||||||
|  |     {{0,8},134}, {{0,8},70}, {{0,9},237}, {{80,7},9}, {{0,8},94}, | ||||||
|  |     {{0,8},30}, {{0,9},157}, {{84,7},99}, {{0,8},126}, {{0,8},62}, | ||||||
|  |     {{0,9},221}, {{82,7},27}, {{0,8},110}, {{0,8},46}, {{0,9},189}, | ||||||
|  |     {{0,8},14}, {{0,8},142}, {{0,8},78}, {{0,9},253}, {{96,7},256}, | ||||||
|  |     {{0,8},81}, {{0,8},17}, {{85,8},131}, {{82,7},31}, {{0,8},113}, | ||||||
|  |     {{0,8},49}, {{0,9},195}, {{80,7},10}, {{0,8},97}, {{0,8},33}, | ||||||
|  |     {{0,9},163}, {{0,8},1}, {{0,8},129}, {{0,8},65}, {{0,9},227}, | ||||||
|  |     {{80,7},6}, {{0,8},89}, {{0,8},25}, {{0,9},147}, {{83,7},59}, | ||||||
|  |     {{0,8},121}, {{0,8},57}, {{0,9},211}, {{81,7},17}, {{0,8},105}, | ||||||
|  |     {{0,8},41}, {{0,9},179}, {{0,8},9}, {{0,8},137}, {{0,8},73}, | ||||||
|  |     {{0,9},243}, {{80,7},4}, {{0,8},85}, {{0,8},21}, {{80,8},258}, | ||||||
|  |     {{83,7},43}, {{0,8},117}, {{0,8},53}, {{0,9},203}, {{81,7},13}, | ||||||
|  |     {{0,8},101}, {{0,8},37}, {{0,9},171}, {{0,8},5}, {{0,8},133}, | ||||||
|  |     {{0,8},69}, {{0,9},235}, {{80,7},8}, {{0,8},93}, {{0,8},29}, | ||||||
|  |     {{0,9},155}, {{84,7},83}, {{0,8},125}, {{0,8},61}, {{0,9},219}, | ||||||
|  |     {{82,7},23}, {{0,8},109}, {{0,8},45}, {{0,9},187}, {{0,8},13}, | ||||||
|  |     {{0,8},141}, {{0,8},77}, {{0,9},251}, {{80,7},3}, {{0,8},83}, | ||||||
|  |     {{0,8},19}, {{85,8},195}, {{83,7},35}, {{0,8},115}, {{0,8},51}, | ||||||
|  |     {{0,9},199}, {{81,7},11}, {{0,8},99}, {{0,8},35}, {{0,9},167}, | ||||||
|  |     {{0,8},3}, {{0,8},131}, {{0,8},67}, {{0,9},231}, {{80,7},7}, | ||||||
|  |     {{0,8},91}, {{0,8},27}, {{0,9},151}, {{84,7},67}, {{0,8},123}, | ||||||
|  |     {{0,8},59}, {{0,9},215}, {{82,7},19}, {{0,8},107}, {{0,8},43}, | ||||||
|  |     {{0,9},183}, {{0,8},11}, {{0,8},139}, {{0,8},75}, {{0,9},247}, | ||||||
|  |     {{80,7},5}, {{0,8},87}, {{0,8},23}, {{192,8},0}, {{83,7},51}, | ||||||
|  |     {{0,8},119}, {{0,8},55}, {{0,9},207}, {{81,7},15}, {{0,8},103}, | ||||||
|  |     {{0,8},39}, {{0,9},175}, {{0,8},7}, {{0,8},135}, {{0,8},71}, | ||||||
|  |     {{0,9},239}, {{80,7},9}, {{0,8},95}, {{0,8},31}, {{0,9},159}, | ||||||
|  |     {{84,7},99}, {{0,8},127}, {{0,8},63}, {{0,9},223}, {{82,7},27}, | ||||||
|  |     {{0,8},111}, {{0,8},47}, {{0,9},191}, {{0,8},15}, {{0,8},143}, | ||||||
|  |     {{0,8},79}, {{0,9},255} | ||||||
|  |   }; | ||||||
|  | local inflate_huft fixed_td[] = { | ||||||
|  |     {{80,5},1}, {{87,5},257}, {{83,5},17}, {{91,5},4097}, {{81,5},5}, | ||||||
|  |     {{89,5},1025}, {{85,5},65}, {{93,5},16385}, {{80,5},3}, {{88,5},513}, | ||||||
|  |     {{84,5},33}, {{92,5},8193}, {{82,5},9}, {{90,5},2049}, {{86,5},129}, | ||||||
|  |     {{192,5},24577}, {{80,5},2}, {{87,5},385}, {{83,5},25}, {{91,5},6145}, | ||||||
|  |     {{81,5},7}, {{89,5},1537}, {{85,5},97}, {{93,5},24577}, {{80,5},4}, | ||||||
|  |     {{88,5},769}, {{84,5},49}, {{92,5},12289}, {{82,5},13}, {{90,5},3073}, | ||||||
|  |     {{86,5},193}, {{192,5},24577} | ||||||
|  |   }; | ||||||
							
								
								
									
										31
									
								
								inftrees.c
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								inftrees.c
									
									
									
									
									
								
							| @@ -6,8 +6,12 @@ | |||||||
| #include "zutil.h" | #include "zutil.h" | ||||||
| #include "inftrees.h" | #include "inftrees.h" | ||||||
|  |  | ||||||
|  | #if !defined(BUILDFIXED) && !defined(STDC) | ||||||
|  | #  define BUILDFIXED   /* non ANSI compilers may not accept inffixed.h */ | ||||||
|  | #endif | ||||||
|  |  | ||||||
| const char inflate_copyright[] = | const char inflate_copyright[] = | ||||||
|    " inflate 1.1.1 Copyright 1995-1998 Mark Adler "; |    " inflate 1.1.2 Copyright 1995-1998 Mark Adler "; | ||||||
| /* | /* | ||||||
|   If you use the zlib library in a product, an acknowledgment is welcome |   If you use the zlib library in a product, an acknowledgment is welcome | ||||||
|   in the documentation of your product. If for some reason you cannot |   in the documentation of your product. If for some reason you cannot | ||||||
| @@ -17,8 +21,6 @@ const char inflate_copyright[] = | |||||||
| struct internal_state  {int dummy;}; /* for buggy compilers */ | struct internal_state  {int dummy;}; /* for buggy compilers */ | ||||||
|  |  | ||||||
| /* simplify the use of the inflate_huft type with some defines */ | /* simplify the use of the inflate_huft type with some defines */ | ||||||
| #define base more.Base |  | ||||||
| #define next more.Next |  | ||||||
| #define exop word.what.Exop | #define exop word.what.Exop | ||||||
| #define bits word.what.Bits | #define bits word.what.Bits | ||||||
|  |  | ||||||
| @@ -232,11 +234,6 @@ uIntf *v;               /* working area: values in order of bit length */ | |||||||
|           return Z_MEM_ERROR;   /* not enough memory */ |           return Z_MEM_ERROR;   /* not enough memory */ | ||||||
|         u[h] = q = hp + *hn; |         u[h] = q = hp + *hn; | ||||||
|         *hn += z; |         *hn += z; | ||||||
|         if (t != Z_NULL)        /* first table is returned result */ |  | ||||||
|         { |  | ||||||
|           *t = q; |  | ||||||
|           t = Z_NULL; |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         /* connect to last table, if there is one */ |         /* connect to last table, if there is one */ | ||||||
|         if (h) |         if (h) | ||||||
| @@ -244,10 +241,12 @@ uIntf *v;               /* working area: values in order of bit length */ | |||||||
|           x[h] = i;             /* save pattern for backing up */ |           x[h] = i;             /* save pattern for backing up */ | ||||||
|           r.bits = (Byte)l;     /* bits to dump before this table */ |           r.bits = (Byte)l;     /* bits to dump before this table */ | ||||||
|           r.exop = (Byte)j;     /* bits in this table */ |           r.exop = (Byte)j;     /* bits in this table */ | ||||||
|           r.next = q;           /* pointer to this table */ |           j = i >> (w - l); | ||||||
|           j = i >> (w - l);     /* (get around Turbo C bug) */ |           r.base = (uInt)(q - u[h-1] - j);   /* offset to this table */ | ||||||
|           u[h-1][j] = r;        /* connect to last table */ |           u[h-1][j] = r;        /* connect to last table */ | ||||||
|         } |         } | ||||||
|  |         else | ||||||
|  |           *t = q;               /* first table is returned result */ | ||||||
|       } |       } | ||||||
|  |  | ||||||
|       /* set up table entry in r */ |       /* set up table entry in r */ | ||||||
| @@ -384,13 +383,17 @@ z_streamp z;            /* for messages */ | |||||||
|  |  | ||||||
|  |  | ||||||
| /* build fixed tables only once--keep them here */ | /* build fixed tables only once--keep them here */ | ||||||
|  | #ifdef BUILDFIXED | ||||||
| local int fixed_built = 0; | local int fixed_built = 0; | ||||||
| #define FIXEDH 424      /* number of hufts used by fixed tables */ | #define FIXEDH 544      /* number of hufts used by fixed tables */ | ||||||
| local inflate_huft fixed_mem[FIXEDH]; | local inflate_huft fixed_mem[FIXEDH]; | ||||||
| local uInt fixed_bl; | local uInt fixed_bl; | ||||||
| local uInt fixed_bd; | local uInt fixed_bd; | ||||||
| local inflate_huft *fixed_tl; | local inflate_huft *fixed_tl; | ||||||
| local inflate_huft *fixed_td; | local inflate_huft *fixed_td; | ||||||
|  | #else | ||||||
|  | #include "inffixed.h" | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  |  | ||||||
| int inflate_trees_fixed(bl, bd, tl, td, z) | int inflate_trees_fixed(bl, bd, tl, td, z) | ||||||
| @@ -400,7 +403,8 @@ inflate_huft * FAR *tl;  /* literal/length tree result */ | |||||||
| inflate_huft * FAR *td;  /* distance tree result */ | inflate_huft * FAR *td;  /* distance tree result */ | ||||||
| z_streamp z;             /* for memory allocation */ | z_streamp z;             /* for memory allocation */ | ||||||
| { | { | ||||||
|   /* build fixed tables if not already (multiple overlapped executions ok) */ | #ifdef BUILDFIXED | ||||||
|  |   /* build fixed tables if not already */ | ||||||
|   if (!fixed_built) |   if (!fixed_built) | ||||||
|   { |   { | ||||||
|     int k;              /* temporary variable */ |     int k;              /* temporary variable */ | ||||||
| @@ -426,7 +430,7 @@ z_streamp z;             /* for memory allocation */ | |||||||
|       c[k] = 7; |       c[k] = 7; | ||||||
|     for (; k < 288; k++) |     for (; k < 288; k++) | ||||||
|       c[k] = 8; |       c[k] = 8; | ||||||
|     fixed_bl = 7; |     fixed_bl = 9; | ||||||
|     huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl, |     huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl, | ||||||
|                fixed_mem, &f, v); |                fixed_mem, &f, v); | ||||||
|  |  | ||||||
| @@ -442,6 +446,7 @@ z_streamp z;             /* for memory allocation */ | |||||||
|     ZFREE(z, c); |     ZFREE(z, c); | ||||||
|     fixed_built = 1; |     fixed_built = 1; | ||||||
|   } |   } | ||||||
|  | #endif | ||||||
|   *bl = fixed_bl; |   *bl = fixed_bl; | ||||||
|   *bd = fixed_bd; |   *bd = fixed_bd; | ||||||
|   *tl = fixed_tl; |   *tl = fixed_tl; | ||||||
|   | |||||||
							
								
								
									
										14
									
								
								inftrees.h
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								inftrees.h
									
									
									
									
									
								
							| @@ -19,17 +19,15 @@ struct inflate_huft_s { | |||||||
|       Byte Exop;        /* number of extra bits or operation */ |       Byte Exop;        /* number of extra bits or operation */ | ||||||
|       Byte Bits;        /* number of bits in this code or subcode */ |       Byte Bits;        /* number of bits in this code or subcode */ | ||||||
|     } what; |     } what; | ||||||
|     Bytef *pad;         /* pad structure to a power of 2 (4 bytes for */ |     uInt pad;           /* pad structure to a power of 2 (4 bytes for */ | ||||||
|   } word;               /*  16-bit, 8 bytes for 32-bit machines) */ |   } word;               /*  16-bit, 8 bytes for 32-bit int's) */ | ||||||
|   union { |   uInt base;            /* literal, length base, distance base, | ||||||
|     uInt Base;          /* literal, length base, or distance base */ |                            or table offset */ | ||||||
|     inflate_huft *Next; /* pointer to next level of table */ |  | ||||||
|   } more; |  | ||||||
| }; | }; | ||||||
|  |  | ||||||
| /* Maximum size of dynamic tree.  The maximum found in a long but non- | /* Maximum size of dynamic tree.  The maximum found in a long but non- | ||||||
|    exhaustive search was 1041 huft structures (875 for length/literals |    exhaustive search was 1004 huft structures (850 for length/literals | ||||||
|    and 166 for distances, the latter actually the result of an |    and 154 for distances, the latter actually the result of an | ||||||
|    exhaustive search).  The actual maximum is not known, but the |    exhaustive search).  The actual maximum is not known, but the | ||||||
|    value below is more than safe. */ |    value below is more than safe. */ | ||||||
| #define MANY 1440 | #define MANY 1440 | ||||||
|   | |||||||
							
								
								
									
										119
									
								
								maketree.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										119
									
								
								maketree.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,119 @@ | |||||||
|  | /* maketree.c -- make inffixed.h table for decoding fixed codes | ||||||
|  |  * Copyright (C) 1998 Mark Adler | ||||||
|  |  * For conditions of distribution and use, see copyright notice in zlib.h  | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | /* WARNING: this file should *not* be used by applications. It is | ||||||
|  |    part of the implementation of the compression library and is | ||||||
|  |    subject to change. Applications should only use zlib.h. | ||||||
|  |  */ | ||||||
|  |  | ||||||
|  | /* This program is included in the distribution for completeness. | ||||||
|  |    You do not need to compile or run this program since inffixed.h | ||||||
|  |    is already included in the distribution.  To use this program | ||||||
|  |    you need to compile zlib with BUILDFIXED defined and then compile | ||||||
|  |    and link this program with the zlib library.  Then the output of | ||||||
|  |    this program can be piped to inffixed.h. */ | ||||||
|  |  | ||||||
|  | #include <stdio.h> | ||||||
|  | #include <stdlib.h> | ||||||
|  | #include "zutil.h" | ||||||
|  | #include "inftrees.h" | ||||||
|  |  | ||||||
|  | /* simplify the use of the inflate_huft type with some defines */ | ||||||
|  | #define exop word.what.Exop | ||||||
|  | #define bits word.what.Bits | ||||||
|  |  | ||||||
|  | /* showtree is only used for debugging purposes */ | ||||||
|  | void showtree(uInt b, inflate_huft *t, int d) | ||||||
|  | { | ||||||
|  |   int i, e; | ||||||
|  |   char p[2*d+1]; | ||||||
|  |  | ||||||
|  |   for (i = 0; i < 2*d; i++) | ||||||
|  |     p[i] = ' '; | ||||||
|  |   p[i] = 0; | ||||||
|  |   printf("%s[%d]\n", p, 1<<b); | ||||||
|  |   for (i = 0; i < (1<<b); i++) | ||||||
|  |   { | ||||||
|  |     e = t[i].exop; | ||||||
|  |     if (e == 0)                 /* simple code */ | ||||||
|  |       printf("%s%d(%d): literal=%d\n", p, i, t[i].bits, t[i].base); | ||||||
|  |     else if (e & 16)            /* length */ | ||||||
|  |       printf("%s%d(%d): length/distance=%d+(%d)\n", | ||||||
|  |                 p, i, t[i].bits, t[i].base, e & 15); | ||||||
|  |     else if ((e & 64) == 0)     /* next table */ | ||||||
|  |     { | ||||||
|  |       printf("%s%d(%d): *sub table*\n", p, i, t[i].bits); | ||||||
|  |       showtree(e, t + t[i].base, d + 1); | ||||||
|  |     } | ||||||
|  |     else if (e & 32)            /* end of block */ | ||||||
|  |       printf("%s%d(%d): end of block\n", p, i, t[i].bits); | ||||||
|  |     else                        /* bad code */ | ||||||
|  |       printf("%s%d: bad code\n", p, i); | ||||||
|  |   } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | /* generate initialization table for an inflate_huft structure array */ | ||||||
|  | void maketree(uInt b, inflate_huft *t) | ||||||
|  | { | ||||||
|  |   int i, e; | ||||||
|  |  | ||||||
|  |   i = 0; | ||||||
|  |   while (1) | ||||||
|  |   { | ||||||
|  |     e = t[i].exop; | ||||||
|  |     if (e && (e & (16+64)) == 0)        /* table pointer */ | ||||||
|  |     { | ||||||
|  |       fprintf(stderr, "maketree: cannot initialize sub-tables!\n"); | ||||||
|  |       exit(1); | ||||||
|  |     } | ||||||
|  |     if (i % 5 == 0) | ||||||
|  |       printf("\n   "); | ||||||
|  |     printf(" {{%u,%u},%u}", t[i].exop, t[i].bits, t[i].base); | ||||||
|  |     if (++i == (1<<b)) | ||||||
|  |       break; | ||||||
|  |     putchar(','); | ||||||
|  |   } | ||||||
|  |   puts(""); | ||||||
|  | } | ||||||
|  |  | ||||||
|  | /* create the fixed tables in C initialization syntax */ | ||||||
|  | void main(void) | ||||||
|  | { | ||||||
|  |   int r; | ||||||
|  |   uInt bl, bd; | ||||||
|  |   inflate_huft *tl, *td; | ||||||
|  |   z_stream z; | ||||||
|  |  | ||||||
|  |   z.zalloc = zcalloc; | ||||||
|  |   z.opaque = (voidpf)0; | ||||||
|  |   z.zfree = zcfree; | ||||||
|  |   r = inflate_trees_fixed(&bl, &bd, &tl, &td, &z); | ||||||
|  |   if (r) | ||||||
|  |   { | ||||||
|  |     fprintf(stderr, "inflate_trees_fixed error %d\n", r); | ||||||
|  |     return; | ||||||
|  |   } | ||||||
|  |   /* puts("Literal/Length Tree:"); | ||||||
|  |      showtree(bl, tl, 1); | ||||||
|  |      puts("Distance Tree:"); | ||||||
|  |      showtree(bd, td, 1); */ | ||||||
|  |   puts("/* inffixed.h -- table for decoding fixed codes"); | ||||||
|  |   puts(" * Generated automatically by the maketree.c program"); | ||||||
|  |   puts(" */"); | ||||||
|  |   puts(""); | ||||||
|  |   puts("/* WARNING: this file should *not* be used by applications. It is"); | ||||||
|  |   puts("   part of the implementation of the compression library and is"); | ||||||
|  |   puts("   subject to change. Applications should only use zlib.h."); | ||||||
|  |   puts(" */"); | ||||||
|  |   puts(""); | ||||||
|  |   printf("local uInt fixed_bl = %d;\n", bl); | ||||||
|  |   printf("local uInt fixed_bd = %d;\n", bd); | ||||||
|  |   printf("local inflate_huft fixed_tl[] = {"); | ||||||
|  |   maketree(bl, tl); | ||||||
|  |   puts("  };"); | ||||||
|  |   printf("local inflate_huft fixed_td[] = {"); | ||||||
|  |   maketree(bd, td); | ||||||
|  |   puts("  };"); | ||||||
|  | } | ||||||
| @@ -2,8 +2,8 @@ | |||||||
|  |  | ||||||
| #define IDR_VERSION1  1 | #define IDR_VERSION1  1 | ||||||
| IDR_VERSION1	VERSIONINFO	MOVEABLE IMPURE LOADONCALL DISCARDABLE | IDR_VERSION1	VERSIONINFO	MOVEABLE IMPURE LOADONCALL DISCARDABLE | ||||||
|   FILEVERSION	 1,1,1,0 |   FILEVERSION	 1,1,2,0 | ||||||
|   PRODUCTVERSION 1,1,1,0 |   PRODUCTVERSION 1,1,2,0 | ||||||
|   FILEFLAGSMASK	VS_FFI_FILEFLAGSMASK |   FILEFLAGSMASK	VS_FFI_FILEFLAGSMASK | ||||||
|   FILEFLAGS	0 |   FILEFLAGS	0 | ||||||
|   FILEOS	VOS_DOS_WINDOWS32 |   FILEOS	VOS_DOS_WINDOWS32 | ||||||
| @@ -17,7 +17,7 @@ BEGIN | |||||||
|  |  | ||||||
|     BEGIN |     BEGIN | ||||||
|       VALUE "FileDescription", "zlib data compression library\0" |       VALUE "FileDescription", "zlib data compression library\0" | ||||||
|       VALUE "FileVersion",	"1.1.1\0" |       VALUE "FileVersion",	"1.1.2\0" | ||||||
|       VALUE "InternalName",	"zlib\0" |       VALUE "InternalName",	"zlib\0" | ||||||
|       VALUE "OriginalFilename",	"zlib.dll\0" |       VALUE "OriginalFilename",	"zlib.dll\0" | ||||||
|       VALUE "ProductName",	"ZLib.DLL\0" |       VALUE "ProductName",	"ZLib.DLL\0" | ||||||
|   | |||||||
							
								
								
									
										6
									
								
								zlib.3
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								zlib.3
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| .TH ZLIB 3 "27 February 1998" | .TH ZLIB 3 "19 March 1998" | ||||||
| .SH NAME | .SH NAME | ||||||
| zlib \- compression/decompression library | zlib \- compression/decompression library | ||||||
| .SH SYNOPSIS | .SH SYNOPSIS | ||||||
| @@ -81,7 +81,7 @@ These documents are also available in other formats from: | |||||||
| .IP | .IP | ||||||
| ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html | ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html | ||||||
| .SH AUTHORS | .SH AUTHORS | ||||||
| Version 1.1.1 | Version 1.1.2 | ||||||
| Copyright (C) 1995-1998 Jean-loup Gailly (jloup@gzip.org) | Copyright (C) 1995-1998 Jean-loup Gailly (jloup@gzip.org) | ||||||
| and Mark Adler (madler@alumni.caltech.edu). | and Mark Adler (madler@alumni.caltech.edu). | ||||||
| .LP | .LP | ||||||
| @@ -96,7 +96,7 @@ The deflate format used by | |||||||
| was defined by Phil Katz. | was defined by Phil Katz. | ||||||
| The deflate and | The deflate and | ||||||
| .I zlib | .I zlib | ||||||
| specifications were written by Peter Deutsch. | specifications were written by L. Peter Deutsch. | ||||||
| Thanks to all the people who reported problems and suggested various | Thanks to all the people who reported problems and suggested various | ||||||
| improvements in | improvements in | ||||||
| .IR zlib ; | .IR zlib ; | ||||||
|   | |||||||
							
								
								
									
										8
									
								
								zlib.h
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								zlib.h
									
									
									
									
									
								
							| @@ -1,5 +1,5 @@ | |||||||
| /* zlib.h -- interface of the 'zlib' general purpose compression library | /* zlib.h -- interface of the 'zlib' general purpose compression library | ||||||
|   version 1.1.1, Feb 27th, 1998 |   version 1.1.2, March 19th, 1998 | ||||||
|  |  | ||||||
|   Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler |   Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler | ||||||
|  |  | ||||||
| @@ -31,13 +31,13 @@ | |||||||
| #ifndef _ZLIB_H | #ifndef _ZLIB_H | ||||||
| #define _ZLIB_H | #define _ZLIB_H | ||||||
|  |  | ||||||
|  | #include "zconf.h" | ||||||
|  |  | ||||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||||
| extern "C" { | extern "C" { | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #include "zconf.h" | #define ZLIB_VERSION "1.1.2" | ||||||
|  |  | ||||||
| #define ZLIB_VERSION "1.1.1" |  | ||||||
|  |  | ||||||
| /*  | /*  | ||||||
|      The 'zlib' compression library provides in-memory compression and |      The 'zlib' compression library provides in-memory compression and | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user