ChangeLog file for zlib
+Changes in 1.2.1.2 (9 September 2004)
+- Update INDEX file
+- Fix trees.c to update strm->data_type (no one ever noticed!)
+- Fix bug in error case in inflate.c, infback.c, and infback9.c [Brown]
+- Add "volatile" to crc table flag declaration (for DYNAMIC_CRC_TABLE)
+- Add limited multitasking protection to DYNAMIC_CRC_TABLE
+- Add NO_vsnprintf for VMS in zutil.h [Mozilla]
+- Don't declare strerror() under VMS [Mozilla]
+- Add comment to DYNAMIC_CRC_TABLE to use get_crc_table() to initialize
+- Update contrib/ada [Anisimkov]
+- Update contrib/minizip [Vollant]
+- Fix configure to not hardcode directories for Darwin [Peterson]
+- Fix gzio.c to not return error on empty files [Brown]
+- Fix indentation; update version in contrib/delphi/ZLib.pas and
+ contrib/pascal/zlibpas.pas [Truta]
+- Update mkasm.bat in contrib/masmx86 [Truta]
+- Update contrib/untgz [Truta]
+- Add projects/README.projects [Truta]
+- Add project for MS Visual C++ 6.0 in projects/visualc6 [Cadieux, Truta]
+- Update win32/DLL_FAQ.txt [Truta]
+- Update list of Z_PREFIX symbols in zconf.h [Randers-Pehrson, Truta]
+- Remove an unnecessary assignment to curr in inftrees.c [Truta]
+- Add OS/2 to exe builds in configure [Poltorak]
+- Remove err dummy parameter in zlib.h [Kientzle]
+
Changes in 1.2.1.1 (9 January 2004)
-- Updated email address in README
+- Update email address in README
- Several FAQ updates
-- Fixed a big fat bug in inftrees.c that prevented decoding valid
- dynamic blocks with only literals and no distance codes.
+- Fix a big fat bug in inftrees.c that prevented decoding valid
+ dynamic blocks with only literals and no distance codes --
+ Thanks to "Hot Emu" for the bug report and sample file
- Add a note to puff.c on no distance codes case.
Changes in 1.2.1 (17 November 2003)
configure configure script for Unix
zconf.in.h template for zconf.h (used by configure)
+amiga/ makefiles for Amiga SAS C
+as400/ makefiles for IBM AS/400
msdos/ makefiles for MSDOS
old/ makefiles for various architectures and zlib documentation
files that have not yet been updated for zlib 1.2.x
+projects/ projects for various Integrated Development Environments
qnx/ makefiles for QNX
win32/ makefiles for Windows
LIBS=libz.a
SHAREDLIB=libz.so
-SHAREDLIBV=libz.so.1.2.1.1
+SHAREDLIBV=libz.so.1.2.1.2
SHAREDLIBM=libz.so.1
AR=ar rc
LIBS=libz.a
SHAREDLIB=libz.so
-SHAREDLIBV=libz.so.1.2.1.1
+SHAREDLIBV=libz.so.1.2.1.2
SHAREDLIBM=libz.so.1
AR=ar rc
ZLIB DATA COMPRESSION LIBRARY
-zlib 1.2.1.1 is a general purpose data compression library. All the code is
+zlib 1.2.1.2 is a general purpose data compression library. All the code is
thread safe. The data format used by the zlib library is described by RFCs
(Request for Comments) 1950 to 1952 in the files
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
issue of Dr. Dobb's Journal; a copy of the article is available in
http://dogma.net/markn/articles/zlibtool/zlibtool.htm
-The changes made in version 1.2.1.1 are documented in the file ChangeLog.
+The changes made in version 1.2.1.2 are documented in the file ChangeLog.
Unsupported third party contributions are provided in directory "contrib".
Copyright notice:
- (C) 1995-2003 Jean-loup Gailly and Mark Adler
+ (C) 1995-2004 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
* ZLIB.INC - Interface to the general purpose compression library
*
* ILE RPG400 version by Patrick Monnerat, DATASPHERE.
- * Version 1.2.1.1
+ * Version 1.2.1.2
*
*
* WARNING:
* Constants
**************************************************************************
*
- D ZLIB_VERSION C '1.2.1.1' Header's version
- D ZLIB_VERNUM C X'1211'
+ D ZLIB_VERSION C '1.2.1.2' Header's version
+ D ZLIB_VERNUM C X'1212'
*
D Z_NO_FLUSH C 0
D Z_SYNC_FLUSH C 2
CFLAGS="$cflags"
case `(uname -s || echo unknown) 2>/dev/null` in
Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};;
- CYGWIN* | Cygwin* | cygwin* )
+ CYGWIN* | Cygwin* | cygwin* | OS/2* )
EXE='.exe';;
QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
# (alain.bonnefoy@icbt.com)
SHAREDLIB=libz$shared_ext
SHAREDLIBV=libz.$VER$shared_ext
SHAREDLIBM=libz.$VER1$shared_ext
- LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name /usr/lib/$SHAREDLIBV -compatibility_version $VER2 -current_version $VER"}
- libdir='/usr/lib'
- includedir='/usr/include';;
+ LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBV -compatibility_version $VER2 -current_version $VER"};;
*) LDSHARED=${LDSHARED-"$cc -shared"};;
esac
else
How to use compress(), uncompress() and the gz* functions from VB
vstudio/ by Gilles Vollant <info@winimage.com>
- Building zlib with Visual Studio .NET
+ Building a minizip-enhanced zlib with Visual Studio .NET
--- /dev/null
+----------------------------------------------------------------
+-- ZLib for Ada thick binding. --
+-- --
+-- Copyright (C) 2002-2004 Dmitriy Anisimkov --
+-- --
+-- Open source license information is in the zlib.ads file. --
+----------------------------------------------------------------
+--
+-- $Id: buffer_demo.adb,v 1.3 2004/09/06 06:55:35 vagul Exp $
+
+-- This demo program provided by Dr Steve Sangwine <sjs@essex.ac.uk>
+--
+-- Demonstration of a problem with Zlib-Ada (already fixed) when a buffer
+-- of exactly the correct size is used for decompressed data, and the last
+-- few bytes passed in to Zlib are checksum bytes.
+
+-- This program compresses a string of text, and then decompresses the
+-- compressed text into a buffer of the same size as the original text.
+
+with Ada.Streams; use Ada.Streams;
+with Ada.Text_IO;
+
+with ZLib; use ZLib;
+
+procedure Buffer_Demo is
+ EOL : Character renames ASCII.LF;
+ Text : constant String
+ := "Four score and seven years ago our fathers brought forth," & EOL &
+ "upon this continent, a new nation, conceived in liberty," & EOL &
+ "and dedicated to the proposition that `all men are created equal'.";
+
+ Source : Stream_Element_Array (1 .. Text'Length);
+ for Source'Address use Text'Address;
+
+begin
+ Ada.Text_IO.Put (Text);
+ Ada.Text_IO.New_Line;
+ Ada.Text_IO.Put_Line
+ ("Uncompressed size : " & Positive'Image (Text'Length) & " bytes");
+
+ declare
+ Compressed_Data : Stream_Element_Array (1 .. Text'Length);
+ L : Stream_Element_Offset;
+ begin
+ Compress : declare
+ Compressor : Filter_Type;
+ I : Stream_Element_Offset;
+ begin
+ Deflate_Init (Compressor);
+
+ -- Compress the whole of T at once.
+
+ Translate (Compressor, Source, I, Compressed_Data, L, Finish);
+ pragma Assert (I = Source'Last);
+
+ Close (Compressor);
+
+ Ada.Text_IO.Put_Line
+ ("Compressed size : "
+ & Stream_Element_Offset'Image (L) & " bytes");
+ end Compress;
+
+ -- Now we decompress the data, passing short blocks of data to Zlib
+ -- (because this demonstrates the problem - the last block passed will
+ -- contain checksum information and there will be no output, only a
+ -- check inside Zlib that the checksum is correct).
+
+ Decompress : declare
+ Decompressor : Filter_Type;
+
+ Uncompressed_Data : Stream_Element_Array (1 .. Text'Length);
+
+ Block_Size : constant := 4;
+ -- This makes sure that the last block contains
+ -- only Adler checksum data.
+
+ P : Stream_Element_Offset := Compressed_Data'First - 1;
+ O : Stream_Element_Offset;
+ begin
+ Inflate_Init (Decompressor);
+
+ loop
+ Translate
+ (Decompressor,
+ Compressed_Data
+ (P + 1 .. Stream_Element_Offset'Min (P + Block_Size, L)),
+ P,
+ Uncompressed_Data
+ (Total_Out (Decompressor) + 1 .. Uncompressed_Data'Last),
+ O,
+ No_Flush);
+
+ Ada.Text_IO.Put_Line
+ ("Total in : " & Count'Image (Total_In (Decompressor)) &
+ ", out : " & Count'Image (Total_Out (Decompressor)));
+
+ exit when P = L;
+ end loop;
+
+ Ada.Text_IO.New_Line;
+ Ada.Text_IO.Put_Line
+ ("Decompressed text matches original text : "
+ & Boolean'Image (Uncompressed_Data = Source));
+ end Decompress;
+ end;
+end Buffer_Demo;
-- --
-- Open source license information is in the zlib.ads file. --
----------------------------------------------------------------
--- Continuous test for ZLib multithreading. If the test is fail
--- Wou should provide thread safe allocation routines for the Z_Stream.
+-- Continuous test for ZLib multithreading. If the test would fail
+-- we should provide thread safe allocation routines for the Z_Stream.
--
--- $Id: mtest.adb,v 1.2 2003/08/12 12:11:05 vagul Exp $
+-- $Id: mtest.adb,v 1.4 2004/07/23 07:49:54 vagul Exp $
with ZLib;
with Ada.Streams;
pragma Unreferenced (Test);
+ Dummy : Character;
+
begin
- null;
+ Ada.Text_IO.Get_Immediate (Dummy);
+ Stop := True;
end MTest;
-- Open source license information is in the zlib.ads file. --
----------------------------------------------------------------
--- $Id: read.adb,v 1.7 2003/08/12 12:12:35 vagul Exp $
+-- $Id: read.adb,v 1.8 2004/05/31 10:53:40 vagul Exp $
-- Test/demo program for the generic read interface.
-- ZLib.Read
-- reading data from the File_In.
- procedure Read is new ZLib.Read (Read, Read_Buffer, Read_First, Read_Last);
+ procedure Read is new ZLib.Read
+ (Read,
+ Read_Buffer,
+ Rest_First => Read_First,
+ Rest_Last => Read_Last);
----------
-- Read --
Pack_Size := 0;
Offset := 1;
Read_First := Read_Buffer'Last + 1;
+ Read_Last := Read_Buffer'Last;
end Reset;
begin
-
ZLib for Ada thick binding (ZLib.Ada)
- Release 1.2
+ Release 1.3
ZLib.Ada is a thick binding interface to the popular ZLib data
compression library, available at http://www.gzip.org/zlib/.
It provides Ada-style access to the ZLib C library.
- Here are the main changes since ZLib.Ada 1.1:
+ Here are the main changes since ZLib.Ada 1.2:
+
+- Attension: ZLib.Read generic routine have a initialization requirement
+ for Read_Last parameter now. It is a bit incompartible with previous version,
+ but extends functionality, we could use new parameters Allow_Read_Some and
+ Flush now.
+
+- Added Is_Open routines to ZLib and ZLib.Streams packages.
-- The default header type has a name "Default" now. Auto is used only for
- automatic GZip/ZLib header detection.
+- Add pragma Assert to check Stream_Element is 8 bit.
-- Added test for multitasking mtest.adb.
+- Fix extraction to buffer with exact known decompressed size. Error reported by
+ Steve Sangwine.
-- Added GNAT project file zlib.gpr.
+- Fix definition of ULong (changed to unsigned_long), fix regression on 64 bits
+ computers. Patch provided by Pascal Obry.
+
+- Add Status_Error exception definition.
+
+- Add pragma Assertion that Ada.Streams.Stream_Element size is 8 bit.
How to build ZLib.Ada under GNAT
Homepage: http://zlib-ada.sourceforge.net/
Author: Dmitriy Anisimkov <anisimkov@yahoo.com>
+
+Contributors: Pascal Obry <pascal@obry.org>, Steve Sangwine <sjs@essex.ac.uk>
-- Open source license information is in the zlib.ads file. --
----------------------------------------------------------------
--- $Id: zlib-streams.adb,v 1.9 2003/08/12 13:15:31 vagul Exp $
+-- $Id: zlib-streams.adb,v 1.10 2004/05/31 10:53:40 vagul Exp $
with Ada.Unchecked_Deallocation;
Stream.Buffer := new Buffer_Subtype;
Stream.Rest_First := Stream.Buffer'Last + 1;
+ Stream.Rest_Last := Stream.Buffer'Last;
end if;
end Create;
end loop;
end Flush;
+ -------------
+ -- Is_Open --
+ -------------
+
+ function Is_Open (Stream : Stream_Type) return Boolean is
+ begin
+ return Is_Open (Stream.Reader) or else Is_Open (Stream.Writer);
+ end Is_Open;
+
----------
-- Read --
----------
return Total_Out (Stream.Writer);
end Write_Total_Out;
-end ZLib.Streams;
+end ZLib.Streams;
\ No newline at end of file
-- Open source license information is in the zlib.ads file. --
----------------------------------------------------------------
--- $Id: zlib-streams.ads,v 1.11 2003/08/12 13:15:31 vagul Exp $
+-- $Id: zlib-streams.ads,v 1.12 2004/05/31 10:53:40 vagul Exp $
package ZLib.Streams is
-- !!! When the Need_Header is False ZLib-Ada is using undocumented
-- ZLib 1.1.4 functionality to do not create/wait for ZLib headers.
+ function Is_Open (Stream : Stream_Type) return Boolean;
+
procedure Close (Stream : in out Stream_Type);
private
Writer : Filter_Type;
end record;
-end ZLib.Streams;
+end ZLib.Streams;
\ No newline at end of file
-- Open source license information is in the zlib.ads file. --
----------------------------------------------------------------
--- $Id: zlib-thin.adb,v 1.6 2003/01/21 15:26:37 vagul Exp $
+-- $Id: zlib-thin.adb,v 1.8 2003/12/14 18:27:31 vagul Exp $
package body ZLib.Thin is
- ZLIB_VERSION : constant Chars_Ptr :=
- Interfaces.C.Strings.New_String ("1.1.4");
+ ZLIB_VERSION : constant Chars_Ptr := zlibVersion;
Z_Stream_Size : constant Int := Z_Stream'Size / System.Storage_Unit;
-- Deflate_Init --
------------------
- function Deflate_Init
- (strm : in Z_Streamp;
- level : in Int := Z_DEFAULT_COMPRESSION)
- return Int is
- begin
- return deflateInit (strm, level, ZLIB_VERSION, Z_Stream_Size);
- end Deflate_Init;
-
function Deflate_Init
(strm : Z_Streamp;
level : Int;
-- Inflate_Init --
------------------
- function Inflate_Init (strm : Z_Streamp) return Int is
- begin
- return inflateInit (strm, ZLIB_VERSION, Z_Stream_Size);
- end Inflate_Init;
-
function Inflate_Init (strm : Z_Streamp; windowBits : Int) return Int is
begin
return inflateInit2 (strm, windowBits, ZLIB_VERSION, Z_Stream_Size);
end Inflate_Init;
+ ------------------------
+ -- Last_Error_Message --
+ ------------------------
+
function Last_Error_Message (Strm : in Z_Stream) return String is
use Interfaces.C.Strings;
begin
end if;
end Last_Error_Message;
- -------------
- -- Need_In --
- -------------
-
- function Need_In (strm : Z_Stream) return Boolean is
- begin
- return strm.Avail_In = 0;
- end Need_In;
-
- --------------
- -- Need_Out --
- --------------
-
- function Need_Out (strm : Z_Stream) return Boolean is
- begin
- return strm.Avail_Out = 0;
- end Need_Out;
-
------------
-- Set_In --
------------
procedure Set_In
(Strm : in out Z_Stream;
- Buffer : in Byte_Access;
- Size : in UInt) is
+ Buffer : in Voidp;
+ Size : in UInt) is
begin
Strm.Next_In := Buffer;
Strm.Avail_In := Size;
end Set_In;
- procedure Set_In
- (Strm : in out Z_Stream;
- Buffer : in Voidp;
- Size : in UInt) is
- begin
- Set_In (Strm, Bytes.To_Pointer (Buffer), Size);
- end Set_In;
-
------------------
-- Set_Mem_Func --
------------------
procedure Set_Mem_Func
(Strm : in out Z_Stream;
- Opaque : in Voidp;
- Alloc : in alloc_func;
- Free : in free_func) is
+ Opaque : in Voidp;
+ Alloc : in alloc_func;
+ Free : in free_func) is
begin
Strm.opaque := Opaque;
Strm.zalloc := Alloc;
procedure Set_Out
(Strm : in out Z_Stream;
- Buffer : in Byte_Access;
- Size : in UInt) is
+ Buffer : in Voidp;
+ Size : in UInt) is
begin
Strm.Next_Out := Buffer;
Strm.Avail_Out := Size;
end Set_Out;
- procedure Set_Out
- (Strm : in out Z_Stream;
- Buffer : in Voidp;
- Size : in UInt) is
- begin
- Set_Out (Strm, Bytes.To_Pointer (Buffer), Size);
- end Set_Out;
-
--------------
-- Total_In --
--------------
-- Open source license information is in the zlib.ads file. --
----------------------------------------------------------------
--- $Id: zlib-thin.ads,v 1.8 2003/08/12 13:16:51 vagul Exp $
+-- $Id: zlib-thin.ads,v 1.11 2004/07/23 06:33:11 vagul Exp $
with Interfaces.C.Strings;
-with System.Address_To_Access_Conversions;
+
+with System;
private package ZLib.Thin is
-- zconf.h:216
type Int is new Interfaces.C.int;
- type ULong is new Interfaces.C.unsigned; -- 32 bits or more
- -- zconf.h:217
+ type ULong is new Interfaces.C.unsigned_long; -- 32 bits or more
+ -- zconf.h:217
subtype Chars_Ptr is Interfaces.C.Strings.chars_ptr;
type ULong_Access is access ULong;
type Int_Access is access Int;
- subtype Voidp is System.Address; -- zconf.h:232
- package Bytes is new System.Address_To_Access_Conversions (Byte);
+ subtype Voidp is System.Address; -- zconf.h:232
- subtype Byte_Access is Bytes.Object_Pointer;
+ subtype Byte_Access is Voidp;
+ Nul : constant Voidp := System.Null_Address;
-- end from zconf
Z_NO_FLUSH : constant := 8#0000#; -- zlib.h:125
stream_size : Int)
return Int;
- function Deflate_Init
- (strm : in Z_Streamp;
- level : in Int := Z_DEFAULT_COMPRESSION)
- return Int;
- pragma Inline (Deflate_Init);
-
function deflateInit2
(strm : Z_Streamp;
level : Int;
stream_size : Int)
return Int;
- function Inflate_Init (strm : Z_Streamp) return Int;
- pragma Inline (Inflate_Init);
-
function inflateInit2
(strm : in Z_Streamp;
windowBits : in Int;
-- has dropped to zero. The application must initialize zalloc, zfree and
-- opaque before calling the init function.
- function Need_In (strm : in Z_Stream) return Boolean;
- -- return true when we do not need to setup Next_In and Avail_In fields.
- pragma Inline (Need_In);
-
- function Need_Out (strm : in Z_Stream) return Boolean;
- -- return true when we do not need to setup Next_Out and Avail_Out field.
- pragma Inline (Need_Out);
-
- procedure Set_In
- (Strm : in out Z_Stream;
- Buffer : in Byte_Access;
- Size : in UInt);
- pragma Inline (Set_In);
-
procedure Set_In
(Strm : in out Z_Stream;
Buffer : in Voidp;
Size : in UInt);
pragma Inline (Set_In);
- procedure Set_Out
- (Strm : in out Z_Stream;
- Buffer : in Byte_Access;
- Size : in UInt);
- pragma Inline (Set_Out);
-
procedure Set_Out
(Strm : in out Z_Stream;
Buffer : in Voidp;
function zlibCompileFlags return ULong;
- function deflatePrime
- (strm : Z_Streamp;
- bits : Int;
- value : Int)
- return Int;
-
private
type Z_Stream is record -- zlib.h:68
- Next_In : Byte_Access; -- next input byte
+ Next_In : Voidp := Nul; -- next input byte
Avail_In : UInt := 0; -- number of bytes available at next_in
Total_In : ULong := 0; -- total nb of input bytes read so far
- Next_Out : Byte_Access; -- next output byte should be put there
+ Next_Out : Voidp := Nul; -- next output byte should be put there
Avail_Out : UInt := 0; -- remaining free space at next_out
Total_Out : ULong := 0; -- total nb of bytes output so far
msg : Chars_Ptr; -- last error message, NULL if no error
pragma Import (C, inflateSyncPoint, "inflateSyncPoint");
pragma Import (C, get_crc_table, "get_crc_table");
- -- added in zlib 1.2.1:
+ -- since zlib 1.2.0:
pragma Import (C, inflateCopy, "inflateCopy");
pragma Import (C, compressBound, "compressBound");
pragma Import (C, deflateBound, "deflateBound");
pragma Import (C, gzungetc, "gzungetc");
pragma Import (C, zlibCompileFlags, "zlibCompileFlags");
- pragma Import (C, deflatePrime, "deflatePrime");
pragma Import (C, inflateBackInit, "inflateBackInit_");
----------------------------------------------------------------
-- ZLib for Ada thick binding. --
-- --
--- Copyright (C) 2002-2003 Dmitriy Anisimkov --
+-- Copyright (C) 2002-2004 Dmitriy Anisimkov --
-- --
-- Open source license information is in the zlib.ads file. --
----------------------------------------------------------------
--- $Id: zlib.adb,v 1.19 2003/07/13 16:02:19 vagul Exp $
+-- $Id: zlib.adb,v 1.31 2004/09/06 06:53:19 vagul Exp $
with Ada.Exceptions;
with Ada.Unchecked_Conversion;
VERSION_ERROR);
type Flate_Step_Function is access
- function (Strm : Thin.Z_Streamp; flush : Thin.Int) return Thin.Int;
+ function (Strm : in Thin.Z_Streamp; Flush : in Thin.Int) return Thin.Int;
pragma Convention (C, Flate_Step_Function);
type Flate_End_Function is access
Flush_Finish : constant array (Boolean) of Flush_Mode
:= (True => Finish, False => No_Flush);
- procedure Raise_Error (Stream : Z_Stream);
+ procedure Raise_Error (Stream : in Z_Stream);
pragma Inline (Raise_Error);
- procedure Raise_Error (Message : String);
+ procedure Raise_Error (Message : in String);
pragma Inline (Raise_Error);
- procedure Check_Error (Stream : Z_Stream; Code : Thin.Int);
+ procedure Check_Error (Stream : in Z_Stream; Code : in Thin.Int);
procedure Free is new Ada.Unchecked_Deallocation
(Z_Stream, Z_Stream_Access);
-- Check_Error --
-----------------
- procedure Check_Error (Stream : Z_Stream; Code : Thin.Int) is
+ procedure Check_Error (Stream : in Z_Stream; Code : in Thin.Int) is
use type Thin.Int;
begin
if Code /= Thin.Z_OK then
is
Code : Thin.Int;
begin
- Code := Flate (Filter.Compression).Done
- (To_Thin_Access (Filter.Strm));
+ if not Ignore_Error and then not Is_Open (Filter) then
+ raise Status_Error;
+ end if;
- Filter.Opened := False;
+ Code := Flate (Filter.Compression).Done (To_Thin_Access (Filter.Strm));
if Ignore_Error or else Code = Thin.Z_OK then
Free (Filter.Strm);
Ada.Exceptions.Raise_Exception
(ZLib_Error'Identity,
Return_Code_Enum'Image (Return_Code (Code))
- & ": " & Error_Message);
+ & ": " & Error_Message);
end;
end if;
end Close;
is
use Thin;
begin
- return Unsigned_32 (crc32
- (ULong (CRC),
- Bytes.To_Pointer (Data'Address),
- Data'Length));
+ return Unsigned_32 (crc32 (ULong (CRC),
+ Data'Address,
+ Data'Length));
end CRC32;
procedure CRC32
Level : in Compression_Level := Default_Compression;
Strategy : in Strategy_Type := Default_Strategy;
Method : in Compression_Method := Deflated;
- Window_Bits : in Window_Bits_Type := 15;
- Memory_Level : in Memory_Level_Type := 8;
+ Window_Bits : in Window_Bits_Type := Default_Window_Bits;
+ Memory_Level : in Memory_Level_Type := Default_Memory_Level;
Header : in Header_Type := Default)
is
use type Thin.Int;
Win_Bits : Thin.Int := Thin.Int (Window_Bits);
begin
+ if Is_Open (Filter) then
+ raise Status_Error;
+ end if;
+
-- We allow ZLib to make header only in case of default header type.
-- Otherwise we would either do header by ourselfs, or do not do
-- header at all.
Filter.Offset := Simple_GZip_Header'Last + 1;
end if;
- Filter.Strm := new Z_Stream;
+ Filter.Strm := new Z_Stream;
Filter.Compression := True;
Filter.Stream_End := False;
- Filter.Opened := True;
Filter.Header := Header;
if Thin.Deflate_Init
-----------------------
procedure Generic_Translate
- (Filter : in out ZLib.Filter_Type;
- In_Buffer_Size : Integer := Default_Buffer_Size;
- Out_Buffer_Size : Integer := Default_Buffer_Size)
+ (Filter : in out ZLib.Filter_Type;
+ In_Buffer_Size : in Integer := Default_Buffer_Size;
+ Out_Buffer_Size : in Integer := Default_Buffer_Size)
is
- In_Buffer : Stream_Element_Array
- (1 .. Stream_Element_Offset (In_Buffer_Size));
+ In_Buffer : Stream_Element_Array
+ (1 .. Stream_Element_Offset (In_Buffer_Size));
Out_Buffer : Stream_Element_Array
- (1 .. Stream_Element_Offset (Out_Buffer_Size));
- Last : Stream_Element_Offset;
- In_Last : Stream_Element_Offset;
- In_First : Stream_Element_Offset;
- Out_Last : Stream_Element_Offset;
+ (1 .. Stream_Element_Offset (Out_Buffer_Size));
+ Last : Stream_Element_Offset;
+ In_Last : Stream_Element_Offset;
+ In_First : Stream_Element_Offset;
+ Out_Last : Stream_Element_Offset;
begin
Main : loop
Data_In (In_Buffer, Last);
loop
Translate
- (Filter,
- In_Buffer (In_First .. Last),
- In_Last,
- Out_Buffer,
- Out_Last,
- Flush_Finish (Last < In_Buffer'First));
+ (Filter => Filter,
+ In_Data => In_Buffer (In_First .. Last),
+ In_Last => In_Last,
+ Out_Data => Out_Buffer,
+ Out_Last => Out_Last,
+ Flush => Flush_Finish (Last < In_Buffer'First));
- Data_Out (Out_Buffer (Out_Buffer'First .. Out_Last));
+ if Out_Buffer'First <= Out_Last then
+ Data_Out (Out_Buffer (Out_Buffer'First .. Out_Last));
+ end if;
exit Main when Stream_End (Filter);
-- The end of in buffer.
+
exit when In_Last = Last;
In_First := In_Last + 1;
procedure Inflate_Init
(Filter : in out Filter_Type;
- Window_Bits : in Window_Bits_Type := 15;
+ Window_Bits : in Window_Bits_Type := Default_Window_Bits;
Header : in Header_Type := Default)
is
use type Thin.Int;
end Check_Version;
begin
+ if Is_Open (Filter) then
+ raise Status_Error;
+ end if;
+
case Header is
when None =>
Check_Version;
when Default => null;
end case;
- Filter.Strm := new Z_Stream;
+ Filter.Strm := new Z_Stream;
Filter.Compression := False;
Filter.Stream_End := False;
- Filter.Opened := True;
Filter.Header := Header;
if Thin.Inflate_Init
end if;
end Inflate_Init;
+ -------------
+ -- Is_Open --
+ -------------
+
+ function Is_Open (Filter : in Filter_Type) return Boolean is
+ begin
+ return Filter.Strm /= null;
+ end Is_Open;
+
-----------------
-- Raise_Error --
-----------------
- procedure Raise_Error (Message : String) is
+ procedure Raise_Error (Message : in String) is
begin
Ada.Exceptions.Raise_Exception (ZLib_Error'Identity, Message);
end Raise_Error;
- procedure Raise_Error (Stream : Z_Stream) is
+ procedure Raise_Error (Stream : in Z_Stream) is
begin
Raise_Error (Last_Error_Message (Stream));
end Raise_Error;
procedure Read
(Filter : in out Filter_Type;
Item : out Ada.Streams.Stream_Element_Array;
- Last : out Ada.Streams.Stream_Element_Offset)
+ Last : out Ada.Streams.Stream_Element_Offset;
+ Flush : in Flush_Mode := No_Flush)
is
In_Last : Stream_Element_Offset;
Item_First : Ada.Streams.Stream_Element_Offset := Item'First;
+ V_Flush : Flush_Mode := Flush;
begin
pragma Assert (Rest_First in Buffer'First .. Buffer'Last + 1);
+ pragma Assert (Rest_Last in Buffer'First - 1 .. Buffer'Last);
loop
- if Rest_First > Buffer'Last then
+ if Rest_Last = Buffer'First - 1 then
+ V_Flush := Finish;
+
+ elsif Rest_First > Rest_Last then
Read (Buffer, Rest_Last);
Rest_First := Buffer'First;
- end if;
- pragma Assert (Rest_Last in Buffer'First - 1 .. Buffer'Last);
+ if Rest_Last < Buffer'First then
+ V_Flush := Finish;
+ end if;
+ end if;
Translate
(Filter => Filter,
In_Last => In_Last,
Out_Data => Item (Item_First .. Item'Last),
Out_Last => Last,
- Flush => Flush_Finish (Rest_Last < Rest_First));
+ Flush => V_Flush);
Rest_First := In_Last + 1;
- exit when Last = Item'Last or else Stream_End (Filter);
+ exit when Stream_End (Filter)
+ or else Last = Item'Last
+ or else (Last >= Item'First and then Allow_Read_Some);
Item_First := Last + 1;
end loop;
Code : Thin.Int;
begin
- if Filter.Opened = False then
- raise ZLib_Error;
+ if not Is_Open (Filter) then
+ raise Status_Error;
end if;
- if Out_Data'Length = 0 then
+ if Out_Data'Length = 0 and then In_Data'Length = 0 then
raise Constraint_Error;
end if;
- Stream_Element_Offset (Avail_In (Filter.Strm.all));
Out_Last := Out_Data'Last
- Stream_Element_Offset (Avail_Out (Filter.Strm.all));
-
end Translate_Auto;
--------------------
Out_Last : out Ada.Streams.Stream_Element_Offset;
Flush : in Flush_Mode)
is
- Out_First : Stream_Element_Offset;
+ Out_First : Stream_Element_Offset;
procedure Add_Data (Data : in Stream_Element_Array);
-- Add data to stream from the Filter.Offset till necessary,
Add_Data (Simple_GZip_Header);
Translate_Auto
- (Filter => Filter,
+ (Filter => Filter,
In_Data => In_Data,
In_Last => In_Last,
Out_Data => Out_Data (Out_First .. Out_Data'Last),
Flush => Flush);
CRC32 (Filter.CRC, In_Data (In_Data'First .. In_Last));
-
end if;
if Filter.Stream_End and then Out_Last <= Out_Data'Last then
procedure Write
(Filter : in out Filter_Type;
Item : in Ada.Streams.Stream_Element_Array;
- Flush : in Flush_Mode)
+ Flush : in Flush_Mode := No_Flush)
is
- Buffer : Stream_Element_Array (1 .. Buffer_Size);
- In_Last, Out_Last : Stream_Element_Offset;
+ Buffer : Stream_Element_Array (1 .. Buffer_Size);
+ In_Last : Stream_Element_Offset;
+ Out_Last : Stream_Element_Offset;
In_First : Stream_Element_Offset := Item'First;
begin
if Item'Length = 0 and Flush = No_Flush then
loop
Translate
- (Filter => Filter,
+ (Filter => Filter,
In_Data => Item (In_First .. Item'Last),
In_Last => In_Last,
Out_Data => Buffer,
------------------------------------------------------------------------------
-- ZLib for Ada thick binding. --
-- --
--- Copyright (C) 2002-2003 Dmitriy Anisimkov --
+-- Copyright (C) 2002-2004 Dmitriy Anisimkov --
-- --
-- This library is free software; you can redistribute it and/or modify --
-- it under the terms of the GNU General Public License as published by --
-- covered by the GNU Public License. --
------------------------------------------------------------------------------
--- $Id: zlib.ads,v 1.17 2003/08/12 13:19:07 vagul Exp $
+-- $Id: zlib.ads,v 1.26 2004/09/06 06:53:19 vagul Exp $
with Ada.Streams;
package ZLib is
- ZLib_Error : exception;
+ ZLib_Error : exception;
+ Status_Error : exception;
type Compression_Level is new Integer range -1 .. 9;
subtype Count is Ada.Streams.Stream_Element_Count;
+ Default_Memory_Level : constant Memory_Level_Type := 8;
+ Default_Window_Bits : constant Window_Bits_Type := 15;
+
----------------------------------
-- Compression method constants --
----------------------------------
Deflated : constant Compression_Method;
- -- Only one method allowed in this ZLib version.
+ -- Only one method allowed in this ZLib version
---------------------------------
-- Compression level constants --
-- Regular way for compression, no flush
Partial_Flush : constant Flush_Mode;
- -- will be removed, use Z_SYNC_FLUSH instead
+ -- Will be removed, use Z_SYNC_FLUSH instead
Sync_Flush : constant Flush_Mode;
- -- all pending output is flushed to the output buffer and the output
+ -- All pending output is flushed to the output buffer and the output
-- is aligned on a byte boundary, so that the decompressor can get all
-- input data available so far. (In particular avail_in is zero after the
-- call if enough output space has been provided before the call.)
-- Flushing may degrade compression for some compression algorithms and so
-- it should be used only when necessary.
+ Block_Flush : constant Flush_Mode;
+ -- Z_BLOCK requests that inflate() stop
+ -- if and when it get to the next deflate block boundary. When decoding the
+ -- zlib or gzip format, this will cause inflate() to return immediately
+ -- after the header and before the first block. When doing a raw inflate,
+ -- inflate() will go ahead and process the first block, and will return
+ -- when it gets to the end of that block, or when it runs out of data.
+
Full_Flush : constant Flush_Mode;
- -- all output is flushed as with SYNC_FLUSH, and the compression state
+ -- All output is flushed as with SYNC_FLUSH, and the compression state
-- is reset so that decompression can restart from this point if previous
-- compressed data has been damaged or if random access is desired. Using
- -- FULL_FLUSH too often can seriously degrade the compression.
+ -- Full_Flush too often can seriously degrade the compression.
Finish : constant Flush_Mode;
-- Just for tell the compressor that input data is complete.
Default_Buffer_Size : constant := 4096;
- type Filter_Type is limited private;
+ type Filter_Type is tagged limited private;
-- The filter is for compression and for decompression.
-- The usage of the type is depend of its initialization.
Level : in Compression_Level := Default_Compression;
Strategy : in Strategy_Type := Default_Strategy;
Method : in Compression_Method := Deflated;
- Window_Bits : in Window_Bits_Type := 15;
- Memory_Level : in Memory_Level_Type := 8;
+ Window_Bits : in Window_Bits_Type := Default_Window_Bits;
+ Memory_Level : in Memory_Level_Type := Default_Memory_Level;
Header : in Header_Type := Default);
-- Compressor initialization.
-- When Header parameter is Auto or Default, then default zlib header
procedure Inflate_Init
(Filter : in out Filter_Type;
- Window_Bits : in Window_Bits_Type := 15;
+ Window_Bits : in Window_Bits_Type := Default_Window_Bits;
Header : in Header_Type := Default);
-- Decompressor initialization.
-- Default header type mean that ZLib default header is expecting in the
-- input compressed stream.
-- Auto header type mean that header type (GZip or Native) would be
-- detected automatically in the input stream.
- -- Note that header types parameter values None, GZip and Auto is
- -- supporting for inflate routine only in ZLib versions 1.2.0.2 and later.
+ -- Note that header types parameter values None, GZip and Auto are
+ -- supported for inflate routine only in ZLib versions 1.2.0.2 and later.
-- Deflate_Init is supporting all header types.
+ function Is_Open (Filter : in Filter_Type) return Boolean;
+ pragma Inline (Is_Open);
+ -- Is the filter opened for compression or decompression.
+
procedure Close
(Filter : in out Filter_Type;
Ignore_Error : in Boolean := False);
(Filter : in out Filter_Type;
In_Buffer_Size : in Integer := Default_Buffer_Size;
Out_Buffer_Size : in Integer := Default_Buffer_Size);
- -- Compressing/decompressing data arrived from Data_In routine
+ -- Compress/decompress data fetch from Data_In routine and pass the result
-- to the Data_Out routine. User should provide Data_In and Data_Out
-- for compression/decompression data flow.
- -- Compression or decompression depend on initialization of Filter.
+ -- Compression or decompression depend on Filter initialization.
function Total_In (Filter : in Filter_Type) return Count;
pragma Inline (Total_In);
- -- Return total number of input bytes read so far.
+ -- Returns total number of input bytes read so far
function Total_Out (Filter : in Filter_Type) return Count;
pragma Inline (Total_Out);
- -- Return total number of bytes output so far.
+ -- Returns total number of bytes output so far
function CRC32
(CRC : in Unsigned_32;
Data : in Ada.Streams.Stream_Element_Array)
return Unsigned_32;
pragma Inline (CRC32);
- -- Calculate CRC32, it could be necessary for make gzip format.
+ -- Compute CRC32, it could be necessary for make gzip format
procedure CRC32
(CRC : in out Unsigned_32;
Data : in Ada.Streams.Stream_Element_Array);
pragma Inline (CRC32);
- -- Calculate CRC32, it could be necessary for make gzip format.
+ -- Compute CRC32, it could be necessary for make gzip format
-------------------------------------------------
-- Below is more complex low level routines. --
Out_Data : out Ada.Streams.Stream_Element_Array;
Out_Last : out Ada.Streams.Stream_Element_Offset;
Flush : in Flush_Mode);
- -- Compressing/decompressing the datas from In_Data buffer to the
- -- Out_Data buffer.
- -- In_Data is incoming data portion,
- -- In_Last is the index of last element from In_Data accepted by the
- -- Filter.
- -- Out_Data is the buffer for output data from the filter.
- -- Out_Last is the last element of the received data from Filter.
- -- To tell the filter that incoming data is complete put the
- -- Flush parameter to FINISH.
+ -- Compress/decompress the In_Data buffer and place the result into
+ -- Out_Data. In_Last is the index of last element from In_Data accepted by
+ -- the Filter. Out_Last is the last element of the received data from
+ -- Filter. To tell the filter that incoming data are complete put the
+ -- Flush parameter to Finish.
function Stream_End (Filter : in Filter_Type) return Boolean;
pragma Inline (Stream_End);
procedure Write
(Filter : in out Filter_Type;
Item : in Ada.Streams.Stream_Element_Array;
- Flush : in Flush_Mode);
- -- Compressing/Decompressing data from Item to the
- -- generic parameter procedure Write.
- -- Output buffer size could be set in Buffer_Size generic parameter.
+ Flush : in Flush_Mode := No_Flush);
+ -- Compress/Decompress data from Item to the generic parameter procedure
+ -- Write. Output buffer size could be set in Buffer_Size generic parameter.
generic
with procedure Read
Rest_First, Rest_Last : in out Ada.Streams.Stream_Element_Offset;
-- Rest_First have to be initialized to Buffer'Last + 1
+ -- Rest_Last have to be initialized to Buffer'Last
-- before usage.
+ Allow_Read_Some : in Boolean := False;
+ -- Is it allowed to return Last < Item'Last before end of data.
+
procedure Read
(Filter : in out Filter_Type;
Item : out Ada.Streams.Stream_Element_Array;
- Last : out Ada.Streams.Stream_Element_Offset);
- -- Compressing/Decompressing data from generic parameter
- -- procedure Read to the Item.
- -- User should provide Buffer for the operation
- -- and Rest_First variable first time initialized to the Buffer'Last + 1.
+ Last : out Ada.Streams.Stream_Element_Offset;
+ Flush : in Flush_Mode := No_Flush);
+ -- Compress/Decompress data from generic parameter procedure Read to the
+ -- Item. User should provide Buffer and initialized Rest_First, Rest_Last
+ -- indicators. If Allow_Read_Some is True, Read routines could return
+ -- Last < Item'Last only at end of stream.
private
use Ada.Streams;
- type Flush_Mode is new Integer range 0 .. 4;
+ pragma Assert (Ada.Streams.Stream_Element'Size = 8);
+ pragma Assert (Ada.Streams.Stream_Element'Modulus = 2**8);
+
+ type Flush_Mode is new Integer range 0 .. 5;
type Compression_Method is new Integer range 8 .. 8;
type Strategy_Type is new Integer range 0 .. 3;
No_Flush : constant Flush_Mode := 0;
+ Partial_Flush : constant Flush_Mode := 1;
Sync_Flush : constant Flush_Mode := 2;
Full_Flush : constant Flush_Mode := 3;
Finish : constant Flush_Mode := 4;
- Partial_Flush : constant Flush_Mode := 1;
- -- will be removed, use Z_SYNC_FLUSH instead
+ Block_Flush : constant Flush_Mode := 5;
Filtered : constant Strategy_Type := 1;
Huffman_Only : constant Strategy_Type := 2;
type Z_Stream_Access is access all Z_Stream;
- type Filter_Type is record
+ type Filter_Type is tagged limited record
Strm : Z_Stream_Access;
Compression : Boolean;
Stream_End : Boolean;
CRC : Unsigned_32;
Offset : Stream_Element_Offset;
-- Offset for gzip header/footer output.
-
- Opened : Boolean := False;
end record;
end ZLib;
-project Zlib is
-
- for Languages use ("Ada");
- for Source_Dirs use (".");
- for Object_Dir use ".";
- for Main use ("test.adb", "mtest.adb", "read.adb");
-
- package Compiler is
- for Default_Switches ("ada") use ("-gnatwbcfilopru", "-gnatVcdfimorst", "-gnatyabcefhiklmnoprst");
- end Compiler;
-
- package Linker is
- for Default_Switches ("ada") use ("-lz");
- end Linker;
-
- package Builder is
- for Default_Switches ("ada") use ("-s", "-gnatQ");
- end Builder;
-
-end Zlib;
-
+project Zlib is\r
+\r
+ for Languages use ("Ada");\r
+ for Source_Dirs use (".");\r
+ for Object_Dir use ".";\r
+ for Main use ("test.adb", "mtest.adb", "read.adb", "buffer_demo");\r
+\r
+ package Compiler is\r
+ for Default_Switches ("ada") use ("-gnatwcfilopru", "-gnatVcdfimorst", "-gnatyabcefhiklmnoprst");\r
+ end Compiler;\r
+\r
+ package Linker is\r
+ for Default_Switches ("ada") use ("-lz");\r
+ end Linker;\r
+\r
+ package Builder is\r
+ for Default_Switches ("ada") use ("-s", "-gnatQ");\r
+ end Builder;\r
+\r
+end Zlib;\r
+\r
const OutBuf: Pointer; BufSize: Integer);
const
- zlib_version = '1.2.1';
+ zlib_version = '1.2.2';
type
EZlibError = class(Exception);
Result := Count - FZRec.avail_out;
Exit;
end;
- FZRec.next_in := FBuffer;
+ FZRec.next_in := FBuffer;
FStrmPos := FStrm.Position;
Progress(Self);
end;
}
}
+ /* handle error breaks in while */
+ if (mode == BAD) break;
+
/* build code tables */
state->next = state->codes;
lencode = (code const FAR *)(state->next);
#define MAXBITS 15
const char inflate9_copyright[] =
- " inflate9 1.2.1.1 Copyright 1995-2003 Mark Adler ";
+ " inflate9 1.2.1.2 Copyright 1995-2004 Mark Adler ";
/*
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
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
- 133, 133, 133, 133, 144, 202, 196};
+ 133, 133, 133, 133, 144, 77, 194};
static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,
-cl /I..\.. /O2 /c gvmat32c.c\r
+cl /DASMV /I..\.. /O2 /c gvmat32c.c\r
ml /coff /Zi /c /Flgvmat32.lst gvmat32.asm\r
ml /coff /Zi /c /Flinffas32.lst inffas32.asm\r
+Change in 1.01b (20 may 04)
+- Integrate patch from Debian package (submited by Mark Brown)
+- Add tools mztools from Xavier Roche
+
+Change in 1.01 (8 may 04)
+- fix buffer overrun risk in unzip.c (Xavier Roche)
+- fix a minor buffer insecurity in minizip.c (Mike Whittaker)
+
Change in 1.00: (10 sept 03)
- rename to 1.00
- cosmetic code change
/* crypt.h -- base code for crypt/uncrypt ZIPfile
- Version 1.00, September 10th, 2003
+ Version 1.01, May 8th, 2004
- Copyright (C) 1998-2003 Gilles Vollant
+ Copyright (C) 1998-2004 Gilles Vollant
This code is a modified version of crypting code in Infozip distribution
/* ioapi.c -- IO base function header for compress/uncompress .zip
files using zlib + zip or unzip API
- Version 1.00, September 10th, 2003
+ Version 1.01, May 8th, 2004
- Copyright (C) 1998-2003 Gilles Vollant
+ Copyright (C) 1998-2004 Gilles Vollant
*/
#include <stdio.h>
/* ioapi.h -- IO base function header for compress/uncompress .zip
files using zlib + zip or unzip API
- Version 1.00, September 10th, 2003
+ Version 1.01, May 8th, 2004
- Copyright (C) 1998-2003 Gilles Vollant
+ Copyright (C) 1998-2004 Gilles Vollant
*/
#ifndef _ZLIBIOAPI_H
files using zlib + zip or unzip API
This IO API version uses the Win32 API (for Microsoft Windows)
- Version 1.00, September 10th, 2003
+ Version 1.01, May 8th, 2004
- Copyright (C) 1998-2003 Gilles Vollant
+ Copyright (C) 1998-2004 Gilles Vollant
*/
#include <stdlib.h>
files using zlib + zip or unzip API
This IO API version uses the Win32 API (for Microsoft Windows)
- Version 1.00, September 10th, 2003
+ Version 1.01, May 8th, 2004
- Copyright (C) 1998-2003 Gilles Vollant
+ Copyright (C) 1998-2004 Gilles Vollant
*/
#include <windows.h>
+/*
+ miniunz.c
+ Version 1.01b, May 30th, 2004
+
+ Copyright (C) 1998-2004 Gilles Vollant
+*/
+
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
mini unzip, demo of unzip package
usage :
- Usage : miniunz [-exvlo] file.zip [file_to_extract]
+ Usage : miniunz [-exvlo] file.zip [file_to_extract] [-d extractdir]
list the file in the zipfile, and print the content of FILE_ID.ZIP or README.TXT
if it exists
void do_banner()
{
- printf("MiniUnz 1.00, demo of zLib + Unz package written by Gilles Vollant\n");
+ printf("MiniUnz 1.01b, demo of zLib + Unz package written by Gilles Vollant\n");
printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n");
}
void do_help()
{
- printf("Usage : miniunz [-e] [-x] [-v] [-l] [-o] [-p password] file.zip [file_to_extr.]\n\n" \
+ printf("Usage : miniunz [-e] [-x] [-v] [-l] [-o] [-p password] file.zip [file_to_extr.] [-d extractdir]\n\n" \
" -e Extract without pathname (junk paths)\n" \
" -x Extract with pathname\n" \
" -v list files\n" \
" -l list files\n" \
+ " -d directory to extract into\n" \
" -o overwrite files without prompting\n" \
" -p extract crypted file using password\n\n");
}
do
{
char answer[128];
- printf("The file %s exist. Overwrite ? [y]es, [n]o, [A]ll: ",write_filename);
- scanf("%1s",answer);
+ int ret;
+
+ printf("The file %s exists. Overwrite ? [y]es, [n]o, [A]ll: ",write_filename);
+ ret = scanf("%1s",answer);
+ if (ret != 1)
+ {
+ exit(EXIT_FAILURE);
+ }
rep = answer[0] ;
if ((rep>='a') && (rep<='z'))
rep -= 0x20;
int opt_do_extract=1;
int opt_do_extract_withoutpath=0;
int opt_overwrite=0;
+ int opt_extractdir=0;
+ const char *dirname=NULL;
unzFile uf=NULL;
do_banner();
opt_do_extract = opt_do_extract_withoutpath = 1;
if ((c=='o') || (c=='O'))
opt_overwrite=1;
+ if ((c=='d') || (c=='D'))
+ {
+ opt_extractdir=1;
+ dirname=argv[i+1];
+ }
+
if (((c=='p') || (c=='P')) && (i+1<argc))
{
password=argv[i+1];
{
if (zipfilename == NULL)
zipfilename = argv[i];
- else if (filename_to_extract==NULL)
+ else if ((filename_to_extract==NULL) && (!opt_extractdir))
filename_to_extract = argv[i] ;
}
}
return do_list(uf);
else if (opt_do_extract==1)
{
+ if (opt_extractdir && chdir(dirname))
+ {
+ printf("Error changing into %s, aborting\n", dirname);
+ exit(-1);
+ }
+
if (filename_to_extract == NULL)
return do_extract(uf,opt_do_extract_withoutpath,opt_overwrite,password);
else
+/*
+ minizip.c
+ Version 1.01b, May 30th, 2004
+
+ Copyright (C) 1998-2004 Gilles Vollant
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#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 */
+ 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;
{
char name[MAXFILENAME+1];
int len = strlen(f);
+ if (len > MAXFILENAME)
+ len = MAXFILENAME;
strncpy(name, f,MAXFILENAME-1);
/* strncpy doesnt append the trailing NULL, of the string is too long. */
void do_banner()
{
- printf("MiniZip 1.00, demo of zLib + Zip package written by Gilles Vollant\n");
+ printf("MiniZip 1.01b, demo of zLib + Zip package written by Gilles Vollant\n");
printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n");
}
do
{
char answer[128];
- printf("The file %s exist. Overwrite ? [y]es, [n]o, [a]ppend : ",filename_try);
- scanf("%1s",answer);
+ int ret;
+ printf("The file %s exists. Overwrite ? [y]es, [n]o, [a]ppend : ",filename_try);
+ ret = scanf("%1s",answer);
+ if (ret != 1)
+ {
+ exit(EXIT_FAILURE);
+ }
rep = answer[0] ;
if ((rep>='a') && (rep<='z'))
rep -= 0x20;
for (i=zipfilenamearg+1;(i<argc) && (err==ZIP_OK);i++)
{
- if (((*(argv[i]))!='-') && ((*(argv[i]))!='/'))
+ if (!((((*(argv[i]))=='-') || ((*(argv[i]))=='/')) &&
+ ((argv[i][1]=='o') || (argv[i][1]=='O') ||
+ (argv[i][1]=='a') || (argv[i][1]=='A') ||
+ (argv[i][1]=='p') || (argv[i][1]=='P') ||
+ ((argv[i][1]>='0') || (argv[i][1]<='9'))) &&
+ (strlen(argv[i]) == 2)))
{
FILE * fin;
int size_read;
errclose = zipClose(zf,NULL);
if (errclose != ZIP_OK)
printf("error in closing %s\n",filename_try);
- }
+ }
+ else
+ {
+ do_help();
+ }
free(buf);
return 0;
--- /dev/null
+/*
+ Additional tools for Minizip
+ Code: Xavier Roche '2004
+ License: Same as ZLIB (www.gzip.org)
+*/
+
+/* Code */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "zlib.h"
+#include "unzip.h"
+
+#define READ_8(adr) ((unsigned char)*(adr))
+#define READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) )
+#define READ_32(adr) ( READ_16(adr) | (READ_16((adr)+2) << 16) )
+
+#define WRITE_8(buff, n) do { \
+ *((unsigned char*)(buff)) = (unsigned char) ((n) & 0xff); \
+} while(0)
+#define WRITE_16(buff, n) do { \
+ WRITE_8((unsigned char*)(buff), n); \
+ WRITE_8(((unsigned char*)(buff)) + 1, (n) >> 8); \
+} while(0)
+#define WRITE_32(buff, n) do { \
+ WRITE_16((unsigned char*)(buff), (n) & 0xffff); \
+ WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \
+} while(0)
+
+extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered)
+const char* file;
+const char* fileOut;
+const char* fileOutTmp;
+uLong* nRecovered;
+uLong* bytesRecovered;
+{
+ int err = Z_OK;
+ FILE* fpZip = fopen(file, "rb");
+ FILE* fpOut = fopen(fileOut, "wb");
+ FILE* fpOutCD = fopen(fileOutTmp, "wb");
+ if (fpZip != NULL && fpOut != NULL) {
+ int entries = 0;
+ uLong totalBytes = 0;
+ char header[30];
+ char filename[256];
+ char extra[1024];
+ int offset = 0;
+ int offsetCD = 0;
+ while ( fread(header, 1, 30, fpZip) == 30 ) {
+ int currentOffset = offset;
+
+ /* File entry */
+ if (READ_32(header) == 0x04034b50) {
+ unsigned int version = READ_16(header + 4);
+ unsigned int gpflag = READ_16(header + 6);
+ unsigned int method = READ_16(header + 8);
+ unsigned int filetime = READ_16(header + 10);
+ unsigned int filedate = READ_16(header + 12);
+ unsigned int crc = READ_32(header + 14); /* crc */
+ unsigned int cpsize = READ_32(header + 18); /* compressed size */
+ unsigned int uncpsize = READ_32(header + 22); /* uncompressed sz */
+ unsigned int fnsize = READ_16(header + 26); /* file name length */
+ unsigned int extsize = READ_16(header + 28); /* extra field length */
+ filename[0] = extra[0] = '\0';
+
+ /* Header */
+ if (fwrite(header, 1, 30, fpOut) == 30) {
+ offset += 30;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+
+ /* Filename */
+ if (fnsize > 0) {
+ if (fread(filename, 1, fnsize, fpZip) == fnsize) {
+ if (fwrite(filename, 1, fnsize, fpOut) == fnsize) {
+ offset += fnsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_STREAM_ERROR;
+ break;
+ }
+
+ /* Extra field */
+ if (extsize > 0) {
+ if (fread(extra, 1, extsize, fpZip) == extsize) {
+ if (fwrite(extra, 1, extsize, fpOut) == extsize) {
+ offset += extsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+
+ /* Data */
+ {
+ int dataSize = cpsize;
+ if (dataSize == 0) {
+ dataSize = uncpsize;
+ }
+ if (dataSize > 0) {
+ char* data = malloc(dataSize);
+ if (data != NULL) {
+ if ((int)fread(data, 1, dataSize, fpZip) == dataSize) {
+ if ((int)fwrite(data, 1, dataSize, fpOut) == dataSize) {
+ offset += dataSize;
+ totalBytes += dataSize;
+ } else {
+ err = Z_ERRNO;
+ }
+ } else {
+ err = Z_ERRNO;
+ }
+ free(data);
+ if (err != Z_OK) {
+ break;
+ }
+ } else {
+ err = Z_MEM_ERROR;
+ break;
+ }
+ }
+ }
+
+ /* Central directory entry */
+ {
+ char header[46];
+ char* comment = "";
+ int comsize = (int) strlen(comment);
+ WRITE_32(header, 0x02014b50);
+ WRITE_16(header + 4, version);
+ WRITE_16(header + 6, version);
+ WRITE_16(header + 8, gpflag);
+ WRITE_16(header + 10, method);
+ WRITE_16(header + 12, filetime);
+ WRITE_16(header + 14, filedate);
+ WRITE_32(header + 16, crc);
+ WRITE_32(header + 20, cpsize);
+ WRITE_32(header + 24, uncpsize);
+ WRITE_16(header + 28, fnsize);
+ WRITE_16(header + 30, extsize);
+ WRITE_16(header + 32, comsize);
+ WRITE_16(header + 34, 0); /* disk # */
+ WRITE_16(header + 36, 0); /* int attrb */
+ WRITE_32(header + 38, 0); /* ext attrb */
+ WRITE_32(header + 42, currentOffset);
+ /* Header */
+ if (fwrite(header, 1, 46, fpOutCD) == 46) {
+ offsetCD += 46;
+
+ /* Filename */
+ if (fnsize > 0) {
+ if (fwrite(filename, 1, fnsize, fpOutCD) == fnsize) {
+ offsetCD += fnsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ } else {
+ err = Z_STREAM_ERROR;
+ break;
+ }
+
+ /* Extra field */
+ if (extsize > 0) {
+ if (fwrite(extra, 1, extsize, fpOutCD) == extsize) {
+ offsetCD += extsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+
+ /* Comment field */
+ if (comsize > 0) {
+ if ((int)fwrite(comment, 1, comsize, fpOutCD) == comsize) {
+ offsetCD += comsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+
+
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+
+ /* Success */
+ entries++;
+
+ } else {
+ break;
+ }
+ }
+
+ /* Final central directory */
+ {
+ int entriesZip = entries;
+ char header[22];
+ char* comment = ""; // "ZIP File recovered by zlib/minizip/mztools";
+ int comsize = (int) strlen(comment);
+ if (entriesZip > 0xffff) {
+ entriesZip = 0xffff;
+ }
+ WRITE_32(header, 0x06054b50);
+ WRITE_16(header + 4, 0); /* disk # */
+ WRITE_16(header + 6, 0); /* disk # */
+ WRITE_16(header + 8, entriesZip); /* hack */
+ WRITE_16(header + 10, entriesZip); /* hack */
+ WRITE_32(header + 12, offsetCD); /* size of CD */
+ WRITE_32(header + 16, offset); /* offset to CD */
+ WRITE_16(header + 20, comsize); /* comment */
+
+ /* Header */
+ if (fwrite(header, 1, 22, fpOutCD) == 22) {
+
+ /* Comment field */
+ if (comsize > 0) {
+ if ((int)fwrite(comment, 1, comsize, fpOutCD) != comsize) {
+ err = Z_ERRNO;
+ }
+ }
+
+ } else {
+ err = Z_ERRNO;
+ }
+ }
+
+ /* Final merge (file + central directory) */
+ fclose(fpOutCD);
+ if (err == Z_OK) {
+ fpOutCD = fopen(fileOutTmp, "rb");
+ if (fpOutCD != NULL) {
+ int nRead;
+ char buffer[8192];
+ while ( (nRead = fread(buffer, 1, sizeof(buffer), fpOutCD)) > 0) {
+ if ((int)fwrite(buffer, 1, nRead, fpOut) != nRead) {
+ err = Z_ERRNO;
+ break;
+ }
+ }
+ fclose(fpOutCD);
+ }
+ }
+
+ /* Close */
+ fclose(fpZip);
+ fclose(fpOut);
+
+ /* Wipe temporary file */
+ (void)remove(fileOutTmp);
+
+ /* Number of recovered entries */
+ if (err == Z_OK) {
+ if (nRecovered != NULL) {
+ *nRecovered = entries;
+ }
+ if (bytesRecovered != NULL) {
+ *bytesRecovered = totalBytes;
+ }
+ }
+ } else {
+ err = Z_STREAM_ERROR;
+ }
+ return err;
+}
--- /dev/null
+/*
+ Additional tools for Minizip
+ Code: Xavier Roche '2004
+ License: Same as ZLIB (www.gzip.org)
+*/
+
+#ifndef _zip_tools_H
+#define _zip_tools_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _ZLIB_H
+#include "zlib.h"
+#endif
+
+#include "unzip.h"
+
+/* Repair a ZIP file (missing central directory)
+ file: file to recover
+ fileOut: output file after recovery
+ fileOutTmp: temporary file name used for recovery
+*/
+extern int ZEXPORT unzRepair(const char* file,
+ const char* fileOut,
+ const char* fileOutTmp,
+ uLong* nRecovered,
+ uLong* bytesRecovered);
+
+#endif
/* unzip.c -- IO for uncompress .zip files using zlib
- Version 1.00, September 10th, 2003
+ Version 1.01c, August 23th, 2004
- Copyright (C) 1998-2003 Gilles Vollant
+ Copyright (C) 1998-2004 Gilles Vollant
Read unzip.h for more info
*/
const char unz_copyright[] =
- " unzip 1.00 Copyright 1998-2003 Gilles Vollant - http://www.winimage.com/zLibDll";
+ " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
/* unz_file_info_interntal contain internal info about a file in zipfile*/
typedef struct unz_file_info_internal_s
s=(unz_s*)file;
if (!s->current_file_ok)
return UNZ_END_OF_LIST_OF_FILE;
- if (s->num_file+1==s->gi.number_entry)
+ if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */
+ if (s->num_file+1==s->gi.number_entry)
return UNZ_END_OF_LIST_OF_FILE;
s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename +
pfile_in_zip_read_info->stream.avail_out = (uInt)len;
- if (len>pfile_in_zip_read_info->rest_read_uncompressed)
+ if ((len>pfile_in_zip_read_info->rest_read_uncompressed) &&
+ (!(pfile_in_zip_read_info->raw)))
pfile_in_zip_read_info->stream.avail_out =
- (uInt)pfile_in_zip_read_info->rest_read_uncompressed;
+ (uInt)pfile_in_zip_read_info->rest_read_uncompressed;
+
+ if ((len>pfile_in_zip_read_info->rest_read_compressed) &&
+ (pfile_in_zip_read_info->raw))
+ pfile_in_zip_read_info->stream.avail_out =
+ (uInt)pfile_in_zip_read_info->rest_read_compressed;
while (pfile_in_zip_read_info->stream.avail_out>0)
{
*/
err=inflate(&pfile_in_zip_read_info->stream,flush);
+ if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL))
+ err = Z_DATA_ERROR;
+
uTotalOutAfter = pfile_in_zip_read_info->stream.total_out;
uOutThis = uTotalOutAfter-uTotalOutBefore;
if (ZREAD(pfile_in_zip_read_info->z_filefunc,
pfile_in_zip_read_info->filestream,
- buf,size_to_read)!=size_to_read)
+ buf,read_now)!=read_now)
return UNZ_ERRNO;
return (int)read_now;
*(szComment+s->gi.size_comment)='\0';
return (int)uReadThis;
}
+
+/* Additions by RX '2004 */
+extern uLong ZEXPORT unzGetOffset (file)
+ unzFile file;
+{
+ unz_s* s;
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+ if (!s->current_file_ok)
+ return 0;
+ if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff)
+ if (s->num_file==s->gi.number_entry)
+ return 0;
+ return s->pos_in_central_dir;
+}
+
+extern int ZEXPORT unzSetOffset (file, pos)
+ unzFile file;
+ uLong pos;
+{
+ unz_s* s;
+ int err;
+
+ if (file==NULL)
+ return UNZ_PARAMERROR;
+ s=(unz_s*)file;
+
+ s->pos_in_central_dir = pos;
+ s->num_file = s->gi.number_entry; /* hack */
+ err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info,
+ &s->cur_file_info_internal,
+ NULL,0,NULL,0,NULL,0);
+ s->current_file_ok = (err == UNZ_OK);
+ return err;
+}
/* unzip.h -- IO for uncompress .zip files using zlib
- Version 1.00, September 10th, 2003
+ Version 1.01, May 8th, 2004
- Copyright (C) 1998-2003 Gilles Vollant
+ Copyright (C) 1998-2004 Gilles Vollant
This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
WinZip, InfoZip tools and compatible.
the error code
*/
+/***************************************************************************/
+
+/* Get the current file offset */
+extern uLong ZEXPORT unzGetOffset (unzFile file);
+
+/* Set the current file offset */
+extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
+
+
+
#ifdef __cplusplus
}
#endif
/* zip.c -- IO on .zip files using zlib
- Version 1.00, September 10th, 2003
+ Version 1.01, May 8th, 2004
- Copyright (C) 1998-2003 Gilles Vollant
+ Copyright (C) 1998-2004 Gilles Vollant
Read zip.h for more info
*/
#endif
#endif
const char zip_copyright[] =
- " zip 1.00 Copyright 1998-2003 Gilles Vollant - http://www.winimage.com/zLibDll";
+ " zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
#define SIZEDATA_INDATABLOCK (4096-(4*4))
{
unsigned char buf[4];
int n;
- for (n = 0; n < nbByte; n++) {
+ for (n = 0; n < nbByte; n++)
+ {
buf[n] = (unsigned char)(x & 0xff);
x >>= 8;
}
+ if (x != 0)
+ { /* data overflow - hack for ZIP64 (X Roche) */
+ for (n = 0; n < nbByte; n++)
+ {
+ buf[n] = 0xff;
+ }
+ }
+
if (ZWRITE(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte)
return ZIP_ERRNO;
else
buf[n] = (unsigned char)(x & 0xff);
x >>= 8;
}
+
+ if (x != 0)
+ { /* data overflow - hack for ZIP64 */
+ for (n = 0; n < nbByte; n++)
+ {
+ buf[n] = 0xff;
+ }
+ }
}
+
/****************************************************************************/
/* zip.h -- IO for compress .zip files using zlib
- Version 1.00, September 10th, 2003
+ Version 1.01, May 8th, 2004
- Copyright (C) 1998-2003 Gilles Vollant
+ Copyright (C) 1998-2004 Gilles Vollant
This unzip package allow creates .ZIP file, compatible with PKZip 2.04g
WinZip, InfoZip tools and compatible.
Close the current file in the zipfile
*/
-
extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file,
uLong uncompressed_size,
uLong crc32));
interface
const
- ZLIB_VERSION = '1.2.1';
+ ZLIB_VERSION = '1.2.2';
type
alloc_func = function(opaque: Pointer; items, size: Integer): Pointer;
/*
* untgz.c -- Display contents and extract files from a gzip'd TAR file
*
- * written by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
+ * written by Pedro A. Aranda Gutierrez <paag@tid.es>
* adaptation to Unix by Jean-loup Gailly <jloup@gzip.org>
* various fixes by Cosmin Truta <cosmint@cs.ubbcluj.ro>
*/
#include "zlib.h"
#ifdef unix
-# include <unistd.h>
+# include <unistd.h>
#else
-# include <direct.h>
-# include <io.h>
+# include <direct.h>
+# include <io.h>
#endif
#ifdef WIN32
# endif
# define mkdir(dirname,mode) _mkdir(dirname)
# ifdef _MSC_VER
-# define strdup(str) _strdup(str)
# define access(path,mode) _access(path,mode)
+# define chmod(path,mode) _chmod(path,mode)
+# define strdup(str) _strdup(str)
# endif
#else
# include <utime.h>
#define FIFOTYPE '6' /* FIFO special */
#define CONTTYPE '7' /* reserved */
-#define BLOCKSIZE 512
+/* GNU tar extensions */
+
+#define GNUTYPE_DUMPDIR 'D' /* file names from dumped directory */
+#define GNUTYPE_LONGLINK 'K' /* long link name */
+#define GNUTYPE_LONGNAME 'L' /* long file name */
+#define GNUTYPE_MULTIVOL 'M' /* continuation of file from another volume */
+#define GNUTYPE_NAMES 'N' /* file name that does not fit into main hdr */
+#define GNUTYPE_SPARSE 'S' /* sparse file */
+#define GNUTYPE_VOLHDR 'V' /* tape/volume header */
+
+
+/* tar header */
+
+#define BLOCKSIZE 512
+#define SHORTNAMESIZE 100
struct tar_header
{ /* byte offset */
/* 500 */
};
-union tar_buffer {
+union tar_buffer
+{
char buffer[BLOCKSIZE];
struct tar_header header;
};
+struct attr_item
+{
+ struct attr_item *next;
+ char *fname;
+ int mode;
+ time_t time;
+};
+
enum { TGZ_EXTRACT, TGZ_LIST, TGZ_INVALID };
char *TGZfname OF((const char *));
int getoct OF((char *, int));
char *strtime OF((time_t *));
int setfiletime OF((char *, time_t));
+void push_attr OF((struct attr_item **, char *, int, time_t));
+void restore_attr OF((struct attr_item **));
+
int ExprMatch OF((char *, char *));
int makedir OF((char *));
}
-/* regular expression matching */
+/* push file attributes */
+
+void push_attr(struct attr_item **list,char *fname,int mode,time_t time)
+{
+ struct attr_item *item;
+
+ item = (struct attr_item *)malloc(sizeof(struct attr_item));
+ if (item == NULL)
+ error("Out of memory");
+ item->fname = strdup(fname);
+ item->mode = mode;
+ item->time = time;
+ item->next = *list;
+ *list = item;
+}
+
+
+/* restore file attributes */
+
+void restore_attr(struct attr_item **list)
+{
+ struct attr_item *item, *prev;
+
+ for (item = *list; item != NULL; )
+ {
+ setfiletime(item->fname,item->time);
+ chmod(item->fname,item->mode);
+ prev = item;
+ item = item->next;
+ free(prev);
+ }
+ *list = NULL;
+}
+
+
+/* match regular expression */
#define ISSPECIAL(c) (((c) == '*') || ((c) == '/'))
char fname[BLOCKSIZE];
int tarmode;
time_t tartime;
+ struct attr_item *attributes = NULL;
if (action == TGZ_LIST)
printf(" date time size file\n"
/*
* If we have to get a tar header
*/
- if (getheader == 1)
+ if (getheader >= 1)
{
/*
* if we met the end of the tar
* or the end-of-tar block,
* we are done
*/
- if ((len == 0) || (buffer.header.name[0] == 0)) break;
+ if (len == 0 || buffer.header.name[0] == 0)
+ break;
tarmode = getoct(buffer.header.mode,8);
tartime = (time_t)getoct(buffer.header.mtime,12);
action = TGZ_INVALID;
}
- strcpy(fname,buffer.header.name);
+ if (getheader == 1)
+ {
+ strncpy(fname,buffer.header.name,SHORTNAMESIZE);
+ if (fname[SHORTNAMESIZE-1] != 0)
+ fname[SHORTNAMESIZE] = 0;
+ }
+ else
+ {
+ /*
+ * The file name is longer than SHORTNAMESIZE
+ */
+ if (strncmp(fname,buffer.header.name,SHORTNAMESIZE-1) != 0)
+ error("bad long name");
+ getheader = 1;
+ }
+ /*
+ * Act according to the type flag
+ */
switch (buffer.header.typeflag)
{
case DIRTYPE:
if (action == TGZ_EXTRACT)
{
makedir(fname);
- setfiletime(fname,tartime);
+ push_attr(&attributes,fname,tarmode,tartime);
}
break;
case REGTYPE:
}
getheader = 0;
break;
+ case GNUTYPE_LONGLINK:
+ case GNUTYPE_LONGNAME:
+ remaining = getoct(buffer.header.size,12);
+ if (remaining < 0 || remaining >= BLOCKSIZE)
+ {
+ action = TGZ_INVALID;
+ break;
+ }
+ len = gzread(in, fname, BLOCKSIZE);
+ if (len < 0)
+ error(gzerror(in, &err));
+ if (fname[BLOCKSIZE-1] != 0 || (int)strlen(fname) > remaining)
+ {
+ action = TGZ_INVALID;
+ break;
+ }
+ getheader = 2;
+ break;
default:
if (action == TGZ_LIST)
printf(" %s <---> %s\n",strtime(&tartime),fname);
{
if (fwrite(&buffer,sizeof(char),bytes,outfile) != bytes)
{
- fprintf(stderr,"%s: Error writing %s -- skipping\n",prog,fname);
+ fprintf(stderr,
+ "%s: Error writing %s -- skipping\n",prog,fname);
fclose(outfile);
outfile = NULL;
remove(fname);
fclose(outfile);
outfile = NULL;
if (action != TGZ_INVALID)
- setfiletime(fname,tartime);
+ push_attr(&attributes,fname,tarmode,tartime);
}
}
}
}
+ /*
+ * Restore file modes and time stamps
+ */
+ restore_attr(&attributes);
+
if (gzclose(in) != Z_OK)
error("failed gzclose");
void help(int exitval)
{
- printf("untgz version 0.2\n"
+ printf("untgz version 0.2.1\n"
" using zlib version %s\n\n",
zlibVersion());
printf("Usage: untgz file.tgz extract all files\n"
\r
#define IDR_VERSION1 1\r
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE\r
- FILEVERSION 1,2,1,0\r
- PRODUCTVERSION 1,2,1,0\r
+ FILEVERSION 1,2,1,2\r
+ PRODUCTVERSION 1,2,1,2\r
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK\r
FILEFLAGS 0\r
FILEOS VOS_DOS_WINDOWS32\r
\r
BEGIN\r
VALUE "FileDescription", "zlib data compression library\0"\r
- VALUE "FileVersion", "1.2.1.0\0"\r
+ VALUE "FileVersion", "1.2.1.2\0"\r
VALUE "InternalName", "zlib\0"\r
VALUE "OriginalFilename", "zlib.dll\0"\r
VALUE "ProductName", "ZLib.DLL\0"\r
/* @(#) $Id$ */
+/*
+ Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore protection
+ on the static variables used to control the first-use generation of the crc
+ tables. Therefore if you #define DYNAMIC_CRC_TABLE, you should first call
+ get_crc_table() to initialize the tables before allowing more than on thread
+ to use crc32().
+ */
+
#ifdef MAKECRCH
# include <stdio.h>
# ifndef DYNAMIC_CRC_TABLE
#ifdef DYNAMIC_CRC_TABLE
-local int crc_table_empty = 1;
+local volatile int crc_table_empty = 1;
local unsigned long FAR crc_table[TBLS][256];
local void make_crc_table OF((void));
#ifdef MAKECRCH
{
unsigned long c;
int n, k;
- unsigned long poly; /* polynomial exclusive-or pattern */
+ unsigned long poly; /* polynomial exclusive-or pattern */
/* terms of polynomial defining this crc (except x^32): */
+ static volatile int first = 1; /* flag to limit concurrent making */
static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
- /* make exclusive-or pattern from polynomial (0xedb88320UL) */
- poly = 0UL;
- for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++)
- poly |= 1UL << (31 - p[n]);
-
- /* generate a crc for every 8-bit value */
- for (n = 0; n < 256; n++) {
- c = (unsigned long)n;
- for (k = 0; k < 8; k++)
- c = c & 1 ? poly ^ (c >> 1) : c >> 1;
- crc_table[0][n] = c;
- }
+ /* See if another task is already doing this (not thread-safe, but better
+ than nothing -- significantly reduces duration of vulnerability in
+ case the advice about DYNAMIC_CRC_TABLE is ignored) */
+ if (first) {
+ first = 0;
+
+ /* make exclusive-or pattern from polynomial (0xedb88320UL) */
+ poly = 0UL;
+ for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++)
+ poly |= 1UL << (31 - p[n]);
+
+ /* generate a crc for every 8-bit value */
+ for (n = 0; n < 256; n++) {
+ c = (unsigned long)n;
+ for (k = 0; k < 8; k++)
+ c = c & 1 ? poly ^ (c >> 1) : c >> 1;
+ crc_table[0][n] = c;
+ }
#ifdef BYFOUR
- /* generate crc for each value followed by one, two, and three zeros, and
- then the byte reversal of those as well as the first table */
- for (n = 0; n < 256; n++) {
- c = crc_table[0][n];
- crc_table[4][n] = REV(c);
- for (k = 1; k < 4; k++) {
- c = crc_table[0][c & 0xff] ^ (c >> 8);
- crc_table[k][n] = c;
- crc_table[k + 4][n] = REV(c);
- }
- }
+ /* generate crc for each value followed by one, two, and three zeros, and
+ then the byte reversal of those as well as the first table */
+ for (n = 0; n < 256; n++) {
+ c = crc_table[0][n];
+ crc_table[4][n] = REV(c);
+ for (k = 1; k < 4; k++) {
+ c = crc_table[0][c & 0xff] ^ (c >> 8);
+ crc_table[k][n] = c;
+ crc_table[k + 4][n] = REV(c);
+ }
+ }
#endif /* BYFOUR */
- crc_table_empty = 0;
+ crc_table_empty = 0;
+ }
+ else { /* not first */
+ /* wait for the other guy to finish (not exactly efficient, but rare) */
+ while (crc_table_empty)
+ ;
+ }
#ifdef MAKECRCH
/* write out CRC tables to crc32.h */
const unsigned long FAR * ZEXPORT get_crc_table()
{
#ifdef DYNAMIC_CRC_TABLE
- if (crc_table_empty) make_crc_table();
+ if (crc_table_empty)
+ make_crc_table();
#endif /* DYNAMIC_CRC_TABLE */
- return (const unsigned long FAR *)crc_table;
+ return (const unsigned long FAR *)crc_table;
}
/* ========================================================================= */
#include "deflate.h"
const char deflate_copyright[] =
- " deflate 1.2.1.1 Copyright 1995-2003 Jean-loup Gailly ";
+ " deflate 1.2.1.2 Copyright 1995-2004 Jean-loup Gailly ";
/*
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
Bytef *pending_out; /* next pending byte to output to the stream */
int pending; /* nb of bytes in the pending buffer */
int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
- Byte data_type; /* UNKNOWN, BINARY or ASCII */
Byte method; /* STORED (for zip only) or DEFLATED */
int last_flush; /* value of flush param for previous deflate call */
s->z_err = Z_ERRNO;
break;
}
+ if (feof(s->file)) { /* avoid error for empty file */
+ s->z_err = Z_STREAM_END;
+ break;
+ }
}
s->stream.next_in = s->inbuf;
}
}
}
+ /* handle error breaks in while */
+ if (state->mode == BAD) break;
+
/* build code tables */
state->next = state->codes;
state->lencode = (code const FAR *)(state->next);
/* inffast.c -- fast decoding
- * Copyright (C) 1995-2003 Mark Adler
+ * Copyright (C) 1995-2004 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
- none
No measurable difference:
- Pentium III (Anderson)
- - 68060 (Nikl)
+ - M68060 (Nikl)
*/
#ifdef POSTINC
# define OFF 0
}
}
+ /* handle error breaks in while */
+ if (state->mode == BAD) break;
+
/* build code tables */
state->next = state->codes;
state->lencode = (code const FAR *)(state->next);
#define MAXBITS 15
const char inflate_copyright[] =
- " inflate 1.2.1.1 Copyright 1995-2004 Mark Adler ";
+ " inflate 1.2.1.2 Copyright 1995-2004 Mark Adler ";
/*
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
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
- 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 202, 196};
+ 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 77, 194};
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
drop = 0;
len = root;
next = *table;
- curr = root;
this.bits = (unsigned char)len;
}
--- /dev/null
+This directory contains project files for building zlib under various
+Integrated Development Environments (IDE).
+
+If you wish to submit a new project to this directory, you should comply
+to the following requirements. Otherwise (e.g. if you wish to integrate
+a custom piece of code that changes the zlib interface or its behavior),
+please consider submitting the project to the contrib directory.
+
+
+Requirements
+============
+
+- The project must build zlib using exclusively the source files from
+ the official zlib distribution.
+
+- If there are "official" makefiles in the zlib distribution, the builds
+ given by the makefiles must be compatible with the builds given by the
+ project. These builds are called "official" builds.
+
+- It is possible to add non-official pieces of code to the project,
+ if the resulting build remains compatible with an official build.
+ For example, it is possible to add an "ASM build" target besides
+ the regular target, by including ASM source files from the contrib
+ directory.
+
+- If there are significant differences between the project files created
+ by different versions of an IDE (e.g. Visual C++ 6.0 vs. 7.0), the name
+ of the project directory should contain the version number of the IDE
+ for which the project is intended (e.g. "visualc6" for Visual C++ 6.0,
+ or "visualc7" for Visual C++ 7.0 and 7.1).
+
+
+Current projects
+================
+
+visualc6/ by Simon-Pierre Cadieux <methodex@methodex.ca>
+ and Cosmin Truta <cosmint@cs.ubbcluj.ro>
+ Project for Microsoft Visual C++ 6.0
--- /dev/null
+Microsoft Developer Studio Project Files, Format Version 6.00 for zlib.\r
+\r
+Copyright (C) 2000-2004 Simon-Pierre Cadieux.\r
+Copyright (C) 2004 Cosmin Truta.\r
+For conditions of distribution and use, see copyright notice in zlib.h.\r
+\r
+\r
+To use:\r
+\r
+1) On the main menu, select "File | Open Workspace".\r
+ Open "zlib.dsw".\r
+\r
+2) Select "Build | Set Active Configuration".\r
+ Choose the configuration you wish to build.\r
+\r
+3) Select "Build | Clean".\r
+\r
+4) Select "Build | Build ... (F7)". Ignore warning messages about\r
+ not being able to find certain include files (e.g. alloc.h).\r
+\r
+5) If you built one of the sample programs (example or minigzip),\r
+ select "Build | Execute ... (Ctrl+F5)".\r
+\r
+\r
+This project builds the zlib binaries as follows:\r
+\r
+* Win32_DLL_Release\zlib1.dll DLL build\r
+* Win32_DLL_Debug\zlib1d.dll DLL build (debug version)\r
+* Win32_DLL_ASM_Release\zlib1.dll DLL build using ASM code\r
+* Win32_DLL_ASM_Debug\zlib1d.dll DLL build using ASM code (debug version)\r
+* Win32_LIB_Release\zlib.lib static build\r
+* Win32_LIB_Debug\zlibd.lib static build (debug version)\r
+* Win32_LIB_ASM_Release\zlib.lib static build using ASM code\r
+* Win32_LIB_ASM_Debug\zlibd.lib static build using ASM code (debug version)\r
+\r
+\r
+For more information regarding the DLL builds, please see the DLL FAQ\r
+in ..\..\win32\DLL_FAQ.txt.\r
--- /dev/null
+# Microsoft Developer Studio Project File - Name="example" - Package Owner=<4>\r
+# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
+\r
+CFG=example - Win32 LIB Debug\r
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
+!MESSAGE use the Export Makefile command and run\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "example.mak".\r
+!MESSAGE \r
+!MESSAGE You can specify a configuration when running NMAKE\r
+!MESSAGE by defining the macro CFG on the command line. For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "example.mak" CFG="example - Win32 LIB Debug"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "example - Win32 DLL Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "example - Win32 DLL Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "example - Win32 DLL ASM Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "example - Win32 DLL ASM Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "example - Win32 LIB Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "example - Win32 LIB Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "example - Win32 LIB ASM Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "example - Win32 LIB ASM Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE \r
+\r
+# Begin Project\r
+# PROP AllowPerConfigDependencies 0\r
+# PROP Scc_ProjName ""\r
+# PROP Scc_LocalPath ""\r
+CPP=cl.exe\r
+RSC=rc.exe\r
+\r
+!IF "$(CFG)" == "example - Win32 DLL Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "example___Win32_DLL_Release"\r
+# PROP BASE Intermediate_Dir "example___Win32_DLL_Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_DLL_Release"\r
+# PROP Intermediate_Dir "Win32_DLL_Release"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT BASE CPP /YX\r
+# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:console /machine:I386\r
+# ADD LINK32 zlib1.lib /nologo /subsystem:console /machine:I386 /libpath:"Win32_DLL_Release"\r
+\r
+!ELSEIF "$(CFG)" == "example - Win32 DLL Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "example___Win32_DLL_Debug"\r
+# PROP BASE Intermediate_Dir "example___Win32_DLL_Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_DLL_Debug"\r
+# PROP Intermediate_Dir "Win32_DLL_Debug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT BASE CPP /YX\r
+# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 zlib1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"Win32_DLL_Debug"\r
+\r
+!ELSEIF "$(CFG)" == "example - Win32 DLL ASM Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "example___Win32_DLL_ASM_Release"\r
+# PROP BASE Intermediate_Dir "example___Win32_DLL_ASM_Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_DLL_ASM_Release"\r
+# PROP Intermediate_Dir "Win32_DLL_ASM_Release"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT BASE CPP /YX\r
+# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:console /machine:I386\r
+# ADD LINK32 zlib1.lib /nologo /subsystem:console /machine:I386 /libpath:"Win32_DLL_ASM_Release"\r
+\r
+!ELSEIF "$(CFG)" == "example - Win32 DLL ASM Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "example___Win32_DLL_ASM_Debug"\r
+# PROP BASE Intermediate_Dir "example___Win32_DLL_ASM_Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_DLL_ASM_Debug"\r
+# PROP Intermediate_Dir "Win32_DLL_ASM_Debug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT BASE CPP /YX\r
+# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 zlib1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"Win32_DLL_ASM_Debug"\r
+\r
+!ELSEIF "$(CFG)" == "example - Win32 LIB Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "example___Win32_LIB_Release"\r
+# PROP BASE Intermediate_Dir "example___Win32_LIB_Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_LIB_Release"\r
+# PROP Intermediate_Dir "Win32_LIB_Release"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT BASE CPP /YX\r
+# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:console /machine:I386\r
+# ADD LINK32 zlib.lib /nologo /subsystem:console /machine:I386 /libpath:"Win32_LIB_Release"\r
+\r
+!ELSEIF "$(CFG)" == "example - Win32 LIB Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "example___Win32_LIB_Debug"\r
+# PROP BASE Intermediate_Dir "example___Win32_LIB_Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_LIB_Debug"\r
+# PROP Intermediate_Dir "Win32_LIB_Debug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT BASE CPP /YX\r
+# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 zlibd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"Win32_LIB_Debug"\r
+\r
+!ELSEIF "$(CFG)" == "example - Win32 LIB ASM Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "example___Win32_LIB_ASM_Release"\r
+# PROP BASE Intermediate_Dir "example___Win32_LIB_ASM_Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_LIB_ASM_Release"\r
+# PROP Intermediate_Dir "Win32_LIB_ASM_Release"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT BASE CPP /YX\r
+# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:console /machine:I386\r
+# ADD LINK32 zlib.lib /nologo /subsystem:console /machine:I386 /libpath:"Win32_LIB_ASM_Release"\r
+\r
+!ELSEIF "$(CFG)" == "example - Win32 LIB ASM Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "example___Win32_LIB_ASM_Debug"\r
+# PROP BASE Intermediate_Dir "example___Win32_LIB_ASM_Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_LIB_ASM_Debug"\r
+# PROP Intermediate_Dir "Win32_LIB_ASM_Debug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT BASE CPP /YX\r
+# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 zlibd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"Win32_LIB_ASM_Debug"\r
+\r
+!ENDIF \r
+\r
+# Begin Target\r
+\r
+# Name "example - Win32 DLL Release"\r
+# Name "example - Win32 DLL Debug"\r
+# Name "example - Win32 DLL ASM Release"\r
+# Name "example - Win32 DLL ASM Debug"\r
+# Name "example - Win32 LIB Release"\r
+# Name "example - Win32 LIB Debug"\r
+# Name "example - Win32 LIB ASM Release"\r
+# Name "example - Win32 LIB ASM Debug"\r
+# Begin Group "Source Files"\r
+\r
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
+# Begin Source File\r
+\r
+SOURCE=..\..\example.c\r
+# End Source File\r
+# End Group\r
+# Begin Group "Header Files"\r
+\r
+# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
+# Begin Source File\r
+\r
+SOURCE=..\..\zconf.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\zlib.h\r
+# End Source File\r
+# End Group\r
+# End Target\r
+# End Project\r
--- /dev/null
+# Microsoft Developer Studio Project File - Name="minigzip" - Package Owner=<4>\r
+# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) Console Application" 0x0103\r
+\r
+CFG=minigzip - Win32 LIB Debug\r
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
+!MESSAGE use the Export Makefile command and run\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "minigzip.mak".\r
+!MESSAGE \r
+!MESSAGE You can specify a configuration when running NMAKE\r
+!MESSAGE by defining the macro CFG on the command line. For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "minigzip.mak" CFG="minigzip - Win32 LIB Debug"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "minigzip - Win32 DLL Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "minigzip - Win32 DLL Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "minigzip - Win32 DLL ASM Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "minigzip - Win32 DLL ASM Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "minigzip - Win32 LIB Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "minigzip - Win32 LIB Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "minigzip - Win32 LIB ASM Release" (based on "Win32 (x86) Console Application")\r
+!MESSAGE "minigzip - Win32 LIB ASM Debug" (based on "Win32 (x86) Console Application")\r
+!MESSAGE \r
+\r
+# Begin Project\r
+# PROP AllowPerConfigDependencies 0\r
+# PROP Scc_ProjName ""\r
+# PROP Scc_LocalPath ""\r
+CPP=cl.exe\r
+RSC=rc.exe\r
+\r
+!IF "$(CFG)" == "minigzip - Win32 DLL Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "minigzip___Win32_DLL_Release"\r
+# PROP BASE Intermediate_Dir "minigzip___Win32_DLL_Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_DLL_Release"\r
+# PROP Intermediate_Dir "Win32_DLL_Release"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT BASE CPP /YX\r
+# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:console /machine:I386\r
+# ADD LINK32 zlib1.lib /nologo /subsystem:console /machine:I386 /libpath:"Win32_DLL_Release"\r
+\r
+!ELSEIF "$(CFG)" == "minigzip - Win32 DLL Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "minigzip___Win32_DLL_Debug"\r
+# PROP BASE Intermediate_Dir "minigzip___Win32_DLL_Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_DLL_Debug"\r
+# PROP Intermediate_Dir "Win32_DLL_Debug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT BASE CPP /YX\r
+# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 zlib1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"Win32_DLL_Debug"\r
+\r
+!ELSEIF "$(CFG)" == "minigzip - Win32 DLL ASM Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "minigzip___Win32_DLL_ASM_Release"\r
+# PROP BASE Intermediate_Dir "minigzip___Win32_DLL_ASM_Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_DLL_ASM_Release"\r
+# PROP Intermediate_Dir "Win32_DLL_ASM_Release"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT BASE CPP /YX\r
+# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:console /machine:I386\r
+# ADD LINK32 zlib1.lib /nologo /subsystem:console /machine:I386 /libpath:"Win32_DLL_ASM_Release"\r
+\r
+!ELSEIF "$(CFG)" == "minigzip - Win32 DLL ASM Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "minigzip___Win32_DLL_ASM_Debug"\r
+# PROP BASE Intermediate_Dir "minigzip___Win32_DLL_ASM_Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_DLL_ASM_Debug"\r
+# PROP Intermediate_Dir "Win32_DLL_ASM_Debug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT BASE CPP /YX\r
+# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 zlib1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"Win32_DLL_ASM_Debug"\r
+\r
+!ELSEIF "$(CFG)" == "minigzip - Win32 LIB Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "minigzip___Win32_LIB_Release"\r
+# PROP BASE Intermediate_Dir "minigzip___Win32_LIB_Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_LIB_Release"\r
+# PROP Intermediate_Dir "Win32_LIB_Release"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT BASE CPP /YX\r
+# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:console /machine:I386\r
+# ADD LINK32 zlib.lib /nologo /subsystem:console /machine:I386 /libpath:"Win32_LIB_Release"\r
+\r
+!ELSEIF "$(CFG)" == "minigzip - Win32 LIB Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "minigzip___Win32_LIB_Debug"\r
+# PROP BASE Intermediate_Dir "minigzip___Win32_LIB_Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_LIB_Debug"\r
+# PROP Intermediate_Dir "Win32_LIB_Debug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT BASE CPP /YX\r
+# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 zlibd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"Win32_LIB_Debug"\r
+\r
+!ELSEIF "$(CFG)" == "minigzip - Win32 LIB ASM Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "minigzip___Win32_LIB_ASM_Release"\r
+# PROP BASE Intermediate_Dir "minigzip___Win32_LIB_ASM_Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_LIB_ASM_Release"\r
+# PROP Intermediate_Dir "Win32_LIB_ASM_Release"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT BASE CPP /YX\r
+# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:console /machine:I386\r
+# ADD LINK32 zlib.lib /nologo /subsystem:console /machine:I386 /libpath:"Win32_LIB_ASM_Release"\r
+\r
+!ELSEIF "$(CFG)" == "minigzip - Win32 LIB ASM Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "minigzip___Win32_LIB_ASM_Debug"\r
+# PROP BASE Intermediate_Dir "minigzip___Win32_LIB_ASM_Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_LIB_ASM_Debug"\r
+# PROP Intermediate_Dir "Win32_LIB_ASM_Debug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT BASE CPP /YX\r
+# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT CPP /YX\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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:console /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 zlibd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"Win32_LIB_ASM_Debug"\r
+\r
+!ENDIF \r
+\r
+# Begin Target\r
+\r
+# Name "minigzip - Win32 DLL Release"\r
+# Name "minigzip - Win32 DLL Debug"\r
+# Name "minigzip - Win32 DLL ASM Release"\r
+# Name "minigzip - Win32 DLL ASM Debug"\r
+# Name "minigzip - Win32 LIB Release"\r
+# Name "minigzip - Win32 LIB Debug"\r
+# Name "minigzip - Win32 LIB ASM Release"\r
+# Name "minigzip - Win32 LIB ASM Debug"\r
+# Begin Group "Source Files"\r
+\r
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
+# Begin Source File\r
+\r
+SOURCE=..\..\minigzip.c\r
+# End Source File\r
+# End Group\r
+# Begin Group "Header Files"\r
+\r
+# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
+# Begin Source File\r
+\r
+SOURCE=..\..\zconf.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\zlib.h\r
+# End Source File\r
+# End Group\r
+# End Target\r
+# End Project\r
--- /dev/null
+# Microsoft Developer Studio Project File - Name="zlib" - Package Owner=<4>\r
+# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102\r
+# TARGTYPE "Win32 (x86) Static Library" 0x0104\r
+\r
+CFG=zlib - Win32 LIB Debug\r
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
+!MESSAGE use the Export Makefile command and run\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "zlib.mak".\r
+!MESSAGE \r
+!MESSAGE You can specify a configuration when running NMAKE\r
+!MESSAGE by defining the macro CFG on the command line. For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "zlib.mak" CFG="zlib - Win32 LIB Debug"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "zlib - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library")\r
+!MESSAGE "zlib - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library")\r
+!MESSAGE "zlib - Win32 DLL ASM Release" (based on "Win32 (x86) Dynamic-Link Library")\r
+!MESSAGE "zlib - Win32 DLL ASM Debug" (based on "Win32 (x86) Dynamic-Link Library")\r
+!MESSAGE "zlib - Win32 LIB Release" (based on "Win32 (x86) Static Library")\r
+!MESSAGE "zlib - Win32 LIB Debug" (based on "Win32 (x86) Static Library")\r
+!MESSAGE "zlib - Win32 LIB ASM Release" (based on "Win32 (x86) Static Library")\r
+!MESSAGE "zlib - Win32 LIB ASM Debug" (based on "Win32 (x86) Static Library")\r
+!MESSAGE \r
+\r
+# Begin Project\r
+# PROP AllowPerConfigDependencies 0\r
+# PROP Scc_ProjName ""\r
+# PROP Scc_LocalPath ""\r
+\r
+!IF "$(CFG)" == "zlib - Win32 DLL Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "zlib___Win32_DLL_Release"\r
+# PROP BASE Intermediate_Dir "zlib___Win32_DLL_Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_DLL_Release"\r
+# PROP Intermediate_Dir "Win32_DLL_Release"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+CPP=cl.exe\r
+# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT BASE CPP /YX /Yc /Yu\r
+# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
+MTL=midl.exe\r
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
+RSC=rc.exe\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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 /dll /machine:I386\r
+# ADD LINK32 /nologo /dll /machine:I386 /out:"Win32_DLL_Release\zlib1.dll"\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "zlib___Win32_DLL_Debug"\r
+# PROP BASE Intermediate_Dir "zlib___Win32_DLL_Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_DLL_Debug"\r
+# PROP Intermediate_Dir "Win32_DLL_Debug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+CPP=cl.exe\r
+# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT BASE CPP /YX /Yc /Yu\r
+# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
+MTL=midl.exe\r
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
+RSC=rc.exe\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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 /dll /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 /nologo /dll /debug /machine:I386 /out:"Win32_DLL_Debug\zlib1d.dll" /pdbtype:sept\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "zlib___Win32_DLL_ASM_Release"\r
+# PROP BASE Intermediate_Dir "zlib___Win32_DLL_ASM_Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_DLL_ASM_Release"\r
+# PROP Intermediate_Dir "Win32_DLL_ASM_Release"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+CPP=cl.exe\r
+# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT BASE CPP /YX /Yc /Yu\r
+# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "ASMV" /D "ASMINF" /FD /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
+MTL=midl.exe\r
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
+RSC=rc.exe\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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 /dll /machine:I386\r
+# ADD LINK32 /nologo /dll /machine:I386 /out:"Win32_DLL_ASM_Release\zlib1.dll"\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "zlib___Win32_DLL_ASM_Debug"\r
+# PROP BASE Intermediate_Dir "zlib___Win32_DLL_ASM_Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_DLL_ASM_Debug"\r
+# PROP Intermediate_Dir "Win32_DLL_ASM_Debug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+CPP=cl.exe\r
+# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT BASE CPP /YX /Yc /Yu\r
+# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "ASMV" /D "ASMINF" /FD /GZ /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
+MTL=midl.exe\r
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
+RSC=rc.exe\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LINK32=link.exe\r
+# 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 /dll /debug /machine:I386 /pdbtype:sept\r
+# ADD LINK32 /nologo /dll /debug /machine:I386 /out:"Win32_DLL_ASM_Debug\zlib1d.dll" /pdbtype:sept\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "zlib___Win32_LIB_Release"\r
+# PROP BASE Intermediate_Dir "zlib___Win32_LIB_Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_LIB_Release"\r
+# PROP Intermediate_Dir "Win32_LIB_Release"\r
+# PROP Target_Dir ""\r
+CPP=cl.exe\r
+# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT BASE CPP /YX /Yc /Yu\r
+# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
+RSC=rc.exe\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LIB32=link.exe -lib\r
+# ADD BASE LIB32 /nologo\r
+# ADD LIB32 /nologo\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "zlib___Win32_LIB_Debug"\r
+# PROP BASE Intermediate_Dir "zlib___Win32_LIB_Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_LIB_Debug"\r
+# PROP Intermediate_Dir "Win32_LIB_Debug"\r
+# PROP Target_Dir ""\r
+CPP=cl.exe\r
+# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT BASE CPP /YX /Yc /Yu\r
+# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
+RSC=rc.exe\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LIB32=link.exe -lib\r
+# ADD BASE LIB32 /nologo\r
+# ADD LIB32 /nologo /out:"Win32_LIB_Debug\zlibd.lib"\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "zlib___Win32_LIB_ASM_Release"\r
+# PROP BASE Intermediate_Dir "zlib___Win32_LIB_ASM_Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Win32_LIB_ASM_Release"\r
+# PROP Intermediate_Dir "Win32_LIB_ASM_Release"\r
+# PROP Target_Dir ""\r
+CPP=cl.exe\r
+# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c\r
+# SUBTRACT BASE CPP /YX /Yc /Yu\r
+# ADD CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "ASMV" /D "ASMINF" /FD /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
+RSC=rc.exe\r
+# ADD BASE RSC /l 0x409 /d "NDEBUG"\r
+# ADD RSC /l 0x409 /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LIB32=link.exe -lib\r
+# ADD BASE LIB32 /nologo\r
+# ADD LIB32 /nologo\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "zlib___Win32_LIB_ASM_Debug"\r
+# PROP BASE Intermediate_Dir "zlib___Win32_LIB_ASM_Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Win32_LIB_ASM_Debug"\r
+# PROP Intermediate_Dir "Win32_LIB_ASM_Debug"\r
+# PROP Target_Dir ""\r
+CPP=cl.exe\r
+# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c\r
+# SUBTRACT BASE CPP /YX /Yc /Yu\r
+# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "ASMV" /D "ASMINF" /FD /GZ /c\r
+# SUBTRACT CPP /YX /Yc /Yu\r
+RSC=rc.exe\r
+# ADD BASE RSC /l 0x409 /d "_DEBUG"\r
+# ADD RSC /l 0x409 /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\r
+# ADD BSC32 /nologo\r
+LIB32=link.exe -lib\r
+# ADD BASE LIB32 /nologo\r
+# ADD LIB32 /nologo /out:"Win32_LIB_ASM_Debug\zlibd.lib"\r
+\r
+!ENDIF \r
+\r
+# Begin Target\r
+\r
+# Name "zlib - Win32 DLL Release"\r
+# Name "zlib - Win32 DLL Debug"\r
+# Name "zlib - Win32 DLL ASM Release"\r
+# Name "zlib - Win32 DLL ASM Debug"\r
+# Name "zlib - Win32 LIB Release"\r
+# Name "zlib - Win32 LIB Debug"\r
+# Name "zlib - Win32 LIB ASM Release"\r
+# Name "zlib - Win32 LIB ASM Debug"\r
+# Begin Group "Source Files"\r
+\r
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
+# Begin Source File\r
+\r
+SOURCE=..\..\adler32.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\compress.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\crc32.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\deflate.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\gzio.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\infback.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\inffast.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\inflate.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\inftrees.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\trees.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\uncompr.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\win32\zlib.def\r
+\r
+!IF "$(CFG)" == "zlib - Win32 DLL Release"\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug"\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Release"\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Debug"\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB Release"\r
+\r
+# PROP Exclude_From_Build 1\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug"\r
+\r
+# PROP Exclude_From_Build 1\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Release"\r
+\r
+# PROP Exclude_From_Build 1\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Debug"\r
+\r
+# PROP Exclude_From_Build 1\r
+\r
+!ENDIF \r
+\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\zutil.c\r
+# End Source File\r
+# End Group\r
+# Begin Group "Header Files"\r
+\r
+# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
+# Begin Source File\r
+\r
+SOURCE=..\..\crc32.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\deflate.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\inffast.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\inffixed.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\inflate.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\inftrees.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\trees.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\zconf.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\zlib.h\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\zutil.h\r
+# End Source File\r
+# End Group\r
+# Begin Group "Resource Files"\r
+\r
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
+# Begin Source File\r
+\r
+SOURCE=..\..\win32\zlib1.rc\r
+# End Source File\r
+# End Group\r
+# Begin Group "Assembler Files (Unsupported)"\r
+\r
+# PROP Default_Filter "asm;obj;c;cpp;cxx;h;hpp;hxx"\r
+# Begin Source File\r
+\r
+SOURCE=..\..\contrib\masmx86\gvmat32.asm\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\contrib\masmx86\gvmat32c.c\r
+\r
+!IF "$(CFG)" == "zlib - Win32 DLL Release"\r
+\r
+# PROP Exclude_From_Build 1\r
+# ADD CPP /I "..\.."\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug"\r
+\r
+# PROP Exclude_From_Build 1\r
+# ADD CPP /I "..\.."\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Release"\r
+\r
+# ADD CPP /I "..\.."\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Debug"\r
+\r
+# ADD CPP /I "..\.."\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB Release"\r
+\r
+# PROP Exclude_From_Build 1\r
+# ADD CPP /I "..\.."\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug"\r
+\r
+# PROP Exclude_From_Build 1\r
+# ADD CPP /I "..\.."\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Release"\r
+\r
+# ADD CPP /I "..\.."\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Debug"\r
+\r
+# ADD CPP /I "..\.."\r
+\r
+!ENDIF \r
+\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\contrib\masmx86\inffas32.asm\r
+# PROP Exclude_From_Build 1\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\contrib\masmx86\gvmat32.obj\r
+\r
+!IF "$(CFG)" == "zlib - Win32 DLL Release"\r
+\r
+# PROP Exclude_From_Build 1\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug"\r
+\r
+# PROP Exclude_From_Build 1\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Release"\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Debug"\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB Release"\r
+\r
+# PROP Exclude_From_Build 1\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug"\r
+\r
+# PROP Exclude_From_Build 1\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Release"\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Debug"\r
+\r
+!ENDIF \r
+\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=..\..\contrib\masmx86\inffas32.obj\r
+\r
+!IF "$(CFG)" == "zlib - Win32 DLL Release"\r
+\r
+# PROP Exclude_From_Build 1\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 DLL Debug"\r
+\r
+# PROP Exclude_From_Build 1\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Release"\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 DLL ASM Debug"\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB Release"\r
+\r
+# PROP Exclude_From_Build 1\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB Debug"\r
+\r
+# PROP Exclude_From_Build 1\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Release"\r
+\r
+!ELSEIF "$(CFG)" == "zlib - Win32 LIB ASM Debug"\r
+\r
+!ENDIF \r
+\r
+# End Source File\r
+# End Group\r
+# Begin Source File\r
+\r
+SOURCE=.\README.txt\r
+# End Source File\r
+# End Target\r
+# End Project\r
--- /dev/null
+Microsoft Developer Studio Workspace File, Format Version 6.00\r
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r
+\r
+###############################################################################\r
+\r
+Project: "example"=.\example.dsp - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+ Begin Project Dependency\r
+ Project_Dep_Name zlib\r
+ End Project Dependency\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Project: "minigzip"=.\minigzip.dsp - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+ Begin Project Dependency\r
+ Project_Dep_Name zlib\r
+ End Project Dependency\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Project: "zlib"=.\zlib.dsp - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Global:\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<3>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
<QPG:Files>
<QPG:Add file="../zconf.h" install="/opt/include/" user="root:sys" permission="644"/>
<QPG:Add file="../zlib.h" install="/opt/include/" user="root:sys" permission="644"/>
- <QPG:Add file="../libz.so.1.2.1.1" install="/opt/lib/" user="root:bin" permission="644"/>
- <QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.1.1"/>
- <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.1.1"/>
- <QPG:Add file="../libz.so.1.2.1.1" install="/opt/lib/" component="slib"/>
+ <QPG:Add file="../libz.so.1.2.1.2" install="/opt/lib/" user="root:bin" permission="644"/>
+ <QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.1.2"/>
+ <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.1.2"/>
+ <QPG:Add file="../libz.so.1.2.1.2" install="/opt/lib/" component="slib"/>
</QPG:Files>
<QPG:PackageFilter>
</QPM:ProductDescription>
<QPM:ReleaseDescription>
- <QPM:ReleaseVersion>1.2.1.1</QPM:ReleaseVersion>
+ <QPM:ReleaseVersion>1.2.1.2</QPM:ReleaseVersion>
<QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
<QPM:ReleaseStability>Stable</QPM:ReleaseStability>
<QPM:ReleaseNoteMinor></QPM:ReleaseNoteMinor>
if (s->level > 0) {
/* Check if the file is ascii or binary */
- if (s->data_type == Z_UNKNOWN) set_data_type(s);
+ if (s->strm->data_type == Z_UNKNOWN) set_data_type(s);
/* Construct the literal and distance trees */
build_tree(s, (tree_desc *)(&(s->l_desc)));
while (n < 7) bin_freq += s->dyn_ltree[n++].Freq;
while (n < 128) ascii_freq += s->dyn_ltree[n++].Freq;
while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq;
- s->data_type = (Byte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII);
+ s->strm->data_type = bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII;
}
/* ===========================================================================
1. What is ZLIB1.DLL, and how can I get it?
- ZLIB1.DLL is the official build of zlib as a DLL.
- (Please remark the symbol '1' in the name.)
+ (Please remark the character '1' in the name.)
Pointers to a precompiled ZLIB1.DLL can be found in the zlib
web site at:
and build settings. If you do build the DLL yourself, please
make sure that it complies with all the above requirements,
and it runs with the precompiled test programs, bundled with
- the original ZLIB1.DLL distribution and available at the zlib
- web site.
+ the original ZLIB1.DLL distribution.
If, for any reason, you need to build an incompatible DLL,
- please use a different name.
+ please use a different file name.
2. Why did you change the name of the DLL to ZLIB1.DLL?
What happened to the old ZLIB.DLL?
- - The old ZLIB.DLL, built from zlib-1.1.x and earlier, required
- compilation settings that were incompatible to those used by a
- static build. The DLL settings were supposed to be enabled by
- defining the macro ZLIB_DLL, before including "zlib.h".
+ - The old ZLIB.DLL, built from zlib-1.1.4 or earlier, required
+ compilation settings that were incompatible to those used by
+ a static build. The DLL settings were supposed to be enabled
+ by defining the macro ZLIB_DLL, before including "zlib.h".
Incorrect handling of this macro was silently accepted at
build time, resulting in two major problems:
functions. Failure to do so resulted in creating binaries
that were unable to run with the official ZLIB.DLL build.
- The only possible solution that we could foresee was to make a
- binary-incompatible change in the DLL interfacing, in order to
+ The only possible solution that we could foresee was to make
+ a binary-incompatible change in the DLL interface, in order to
remove the dependency on the ZLIB_DLL macro, and to release
the new DLL under a different name.
- In principle, you can do it by assigning calling convention
keywords to the macros ZEXPORT and ZEXPORTVA. In practice,
- it depends on what you mean by "an old ZLIB.DLL", because
- the old DLL exists in several mutually-incompatible versions.
-
- If you have a compiled application that works with a certain
- ZLIB.DLL without any known security issues, there is hardly
- a need to rebuild the DLL from new sources only to link it to
- the old app binary. But if you really want to do it, you have
- to find out first what kind of calling convention uses your
- particular ZLIB.DLL build, and to use the same one in the new
- build. If you don't know what this is all about, you might be
- better off if you would just forget it.
+ it depends on what you mean by "an old ZLIB.DLL", because the
+ old DLL exists in several mutually-incompatible versions.
+ You have to find out first what kind of calling convention is
+ being used in your particular ZLIB.DLL build, and to use the
+ same one in the new build. If you don't know what this is all
+ about, you might be better off if you would just leave the old
+ DLL intact.
4. Can I compile my application using the new zlib interface, and
the K&R-style function prototypes, where the argument types
are not specified; but that is another story for another day.
- The fact that remains is that CDECL is the default convention.
- Even if an explicit convention (such as STDCALL or FASTCALL)
- is hard-coded into the function prototypes inside C headers,
- problems may appear. One problem, for example, deals with the
- necessity to expose the convention in users' callbacks.
+ The remaining fact is that CDECL is the default convention.
+ Even if an explicit convention is hard-coded into the function
+ prototypes inside C headers, problems may appear. The
+ necessity to expose the convention in users' callbacks is one
+ of these problems.
The calling convention issues are also important when using
zlib in other programming languages. Some of them, like Ada
(GNAT) and Fortran (GNU G77), have C bindings implemented
initially on Unix, and relying on the C calling convention.
On the other hand, the pre- .NET versions of Microsoft Visual
- Basic require STDCALL, while Borland Delphi prefers (although
- it does not require) FASTCALL.
+ Basic require STDCALL, while Borland Delphi prefers, although
+ it does not require, FASTCALL.
In fairness to all possible uses of zlib outside the C
programming language, we choose the default "C" convention.
zlib distribution.
- 8. If my application uses ZLIB1.DLL, should I link it to
+ 8. I need a DLL for my Microsoft .NET project. What can I do?
+
+ - We did not implement a COM wrapper around zlib, so you will
+ have to develop it yourself, or to get it from somewhere else.
+
+ If you would be so generous as to contribute such a wrapper,
+ we would like to include it in a future zlib version.
+
+
+ 9. If my application uses ZLIB1.DLL, should I link it to
MSVCRT.DLL? Why?
- It is not required, but it is recommended to link your
depend on it should also be linked to MSVCRT.DLL.
- 9. Why are you saying that ZLIB1.DLL and my application must be
+10. Why are you saying that ZLIB1.DLL and my application must be
linked to the same C run-time (CRT) library? I linked my
application and my DLLs to different C libraries (e.g. my
application to a static library, and my DLLs to MSVCRT.DLL),
and DLLs are avoiding the corruption of each of the CRTs'
internal states, maybe by careful design, or maybe by fortune.
- Also note that linking ZLIB1.DLL to non-Microsoft CRTs (such
- as those provided by Borland) raises similar problems.
+ Also note that linking ZLIB1.DLL to non-Microsoft CRTs, such
+ as those provided by Borland, raises similar problems.
-10. Why are you linking ZLIB1.DLL to MSVCRT.DLL?
+11. Why are you linking ZLIB1.DLL to MSVCRT.DLL?
- MSVCRT.DLL exists on every Windows 95 with a new service pack
installed, or with Microsoft Internet Explorer 4 or later, and
software provider for free.
The fact that MSVCRT.DLL does not exist on a virgin Windows 95
- is not so problematic. The number of Windows 95 installations
- is rapidly decreasing, Microsoft stopped supporting it a long
- time ago, and many recent applications from various vendors,
- including Microsoft, do not even run on it. Furthermore, no
- serious user should run Windows 95 without a proper update
- installed.
+ is not so problematic. Windows 95 is scarcely found nowadays,
+ Microsoft ended its support a long time ago, and many recent
+ applications from various vendors, including Microsoft, do not
+ even run on it. Furthermore, no serious user should run
+ Windows 95 without a proper update installed.
There is also the fact that the mainstream C compilers for
Windows are Microsoft Visual C++ 6.0, and gcc/MinGW. Both
select by users.
-11. Why are you not linking ZLIB1.DLL to
+12. Why are you not linking ZLIB1.DLL to
<<my favorite C run-time library>> ?
- We considered and abandoned the following alternatives:
Windows NT systems.
-12. I need to link my own DLL build to a CRT different than
+13. I need to link my own DLL build to a CRT different than
MSVCRT.DLL. What can I do?
- Feel free to rebuild the DLL from the zlib sources, and link
CYGWIN1.DLL, and it is distributed under the name CYGZ.DLL.
-13. May I include additional pieces of code that I find useful,
+14. May I include additional pieces of code that I find useful,
link them in ZLIB1.DLL, and export them?
- No. A legitimate build of ZLIB1.DLL must not include code
But you can make your own private DLL build, under a different
file name, as suggested in the previous answer.
- For example, in Borland Delphi and C++ Builder, zlib is a part
- of the standard VCL library. If an application links to VCL
- dynamically, the name of the distributable binary (VCLxx.DLL)
- does not posess any danger of clashing with a legitimate but
- incompatible ZLIB1.DLL.
+ For example, zlib is a part of the VCL library, distributed
+ with Borland Delphi and C++ Builder. The DLL build of VCL
+ is a redistributable file, named VCLxx.DLL.
-14. May I remove some functionality out of ZLIB1.DLL, by enabling
+15. May I remove some functionality out of ZLIB1.DLL, by enabling
macros like NO_GZCOMPRESS or NO_GZIP at compile time?
- No. A legitimate build of ZLIB1.DLL must provide the complete
different file name, as suggested in the previous answer.
-15. I made my own ZLIB1.DLL build. Can I test it for compliance?
+16. I made my own ZLIB1.DLL build. Can I test it for compliance?
- We prefer that you download the official DLL from the zlib
web site. If you need something peculiar from this DLL, you
#else
VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
#endif
- FILEVERSION 1,2,1,1
- PRODUCTVERSION 1,2,1,1
+ FILEVERSION 1,2,1,2
+ PRODUCTVERSION 1,2,1,2
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS 1
//language ID = U.S. English, char set = Windows, Multilingual
BEGIN
VALUE "FileDescription", "zlib data compression library\0"
- VALUE "FileVersion", "1.2.1.1\0"
+ VALUE "FileVersion", "1.2.1.2\0"
VALUE "InternalName", "zlib1.dll\0"
- VALUE "LegalCopyright", "(C) 1995-2003 Jean-loup Gailly & Mark Adler\0"
+ VALUE "LegalCopyright", "(C) 1995-2004 Jean-loup Gailly & Mark Adler\0"
VALUE "OriginalFilename", "zlib1.dll\0"
VALUE "ProductName", "zlib\0"
- VALUE "ProductVersion", "1.2.1.1\0"
+ VALUE "ProductVersion", "1.2.1.2\0"
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
END
END
/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2003 Jean-loup Gailly.
+ * Copyright (C) 1995-2004 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
*/
#ifdef Z_PREFIX
-# define deflateInit_ z_deflateInit_
-# define deflate z_deflate
-# define deflateEnd z_deflateEnd
-# define inflateInit_ z_inflateInit_
-# define inflate z_inflate
-# define inflateEnd z_inflateEnd
-# define deflateInit2_ z_deflateInit2_
-# define deflateSetDictionary z_deflateSetDictionary
-# define deflateCopy z_deflateCopy
-# define deflateReset z_deflateReset
-# define deflatePrime z_deflatePrime
-# define deflateParams z_deflateParams
-# define deflateBound z_deflateBound
-# define inflateInit2_ z_inflateInit2_
-# define inflateSetDictionary z_inflateSetDictionary
-# define inflateSync z_inflateSync
-# define inflateSyncPoint z_inflateSyncPoint
-# define inflateCopy z_inflateCopy
-# define inflateReset z_inflateReset
-# define compress z_compress
-# define compress2 z_compress2
-# define compressBound z_compressBound
-# define uncompress z_uncompress
-# define adler32 z_adler32
-# define crc32 z_crc32
-# define get_crc_table z_get_crc_table
+# define deflateInit_ z_deflateInit_
+# define deflate z_deflate
+# define deflateEnd z_deflateEnd
+# define inflateInit_ z_inflateInit_
+# define inflate z_inflate
+# define inflateEnd z_inflateEnd
+# define deflateInit2_ z_deflateInit2_
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateCopy z_deflateCopy
+# define deflateReset z_deflateReset
+# define deflateParams z_deflateParams
+# define deflateBound z_deflateBound
+# define deflatePrime z_deflatePrime
+# define inflateInit2_ z_inflateInit2_
+# define inflateSetDictionary z_inflateSetDictionary
+# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
+# define inflateCopy z_inflateCopy
+# define inflateReset z_inflateReset
+# define inflateBack z_inflateBack
+# define inflateBackEnd z_inflateBackEnd
+# define compress z_compress
+# define compress2 z_compress2
+# define compressBound z_compressBound
+# define uncompress z_uncompress
+# define adler32 z_adler32
+# define crc32 z_crc32
+# define get_crc_table z_get_crc_table
+# define zError z_zError
-# define Byte z_Byte
-# define uInt z_uInt
-# define uLong z_uLong
-# define Bytef z_Bytef
-# define charf z_charf
-# define intf z_intf
-# define uIntf z_uIntf
-# define uLongf z_uLongf
-# define voidpf z_voidpf
-# define voidp z_voidp
+# define Byte z_Byte
+# define uInt z_uInt
+# define uLong z_uLong
+# define Bytef z_Bytef
+# define charf z_charf
+# define intf z_intf
+# define uIntf z_uIntf
+# define uLongf z_uLongf
+# define voidpf z_voidpf
+# define voidp z_voidp
#endif
#if defined(__MSDOS__) && !defined(MSDOS)
# ifdef VMS
# include <unixio.h> /* for off_t */
# endif
-# define z_off_t off_t
+# define z_off_t off_t
#endif
#ifndef SEEK_SET
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif
#ifndef z_off_t
-# define z_off_t long
+# define z_off_t long
#endif
#if defined(__OS400__)
-#define NO_vsnprintf
+# define NO_vsnprintf
#endif
#if defined(__MVS__)
/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2003 Jean-loup Gailly.
+ * Copyright (C) 1995-2004 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
*/
#ifdef Z_PREFIX
-# define deflateInit_ z_deflateInit_
-# define deflate z_deflate
-# define deflateEnd z_deflateEnd
-# define inflateInit_ z_inflateInit_
-# define inflate z_inflate
-# define inflateEnd z_inflateEnd
-# define deflateInit2_ z_deflateInit2_
-# define deflateSetDictionary z_deflateSetDictionary
-# define deflateCopy z_deflateCopy
-# define deflateReset z_deflateReset
-# define deflatePrime z_deflatePrime
-# define deflateParams z_deflateParams
-# define deflateBound z_deflateBound
-# define inflateInit2_ z_inflateInit2_
-# define inflateSetDictionary z_inflateSetDictionary
-# define inflateSync z_inflateSync
-# define inflateSyncPoint z_inflateSyncPoint
-# define inflateCopy z_inflateCopy
-# define inflateReset z_inflateReset
-# define compress z_compress
-# define compress2 z_compress2
-# define compressBound z_compressBound
-# define uncompress z_uncompress
-# define adler32 z_adler32
-# define crc32 z_crc32
-# define get_crc_table z_get_crc_table
+# define deflateInit_ z_deflateInit_
+# define deflate z_deflate
+# define deflateEnd z_deflateEnd
+# define inflateInit_ z_inflateInit_
+# define inflate z_inflate
+# define inflateEnd z_inflateEnd
+# define deflateInit2_ z_deflateInit2_
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateCopy z_deflateCopy
+# define deflateReset z_deflateReset
+# define deflateParams z_deflateParams
+# define deflateBound z_deflateBound
+# define deflatePrime z_deflatePrime
+# define inflateInit2_ z_inflateInit2_
+# define inflateSetDictionary z_inflateSetDictionary
+# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
+# define inflateCopy z_inflateCopy
+# define inflateReset z_inflateReset
+# define inflateBack z_inflateBack
+# define inflateBackEnd z_inflateBackEnd
+# define compress z_compress
+# define compress2 z_compress2
+# define compressBound z_compressBound
+# define uncompress z_uncompress
+# define adler32 z_adler32
+# define crc32 z_crc32
+# define get_crc_table z_get_crc_table
+# define zError z_zError
-# define Byte z_Byte
-# define uInt z_uInt
-# define uLong z_uLong
-# define Bytef z_Bytef
-# define charf z_charf
-# define intf z_intf
-# define uIntf z_uIntf
-# define uLongf z_uLongf
-# define voidpf z_voidpf
-# define voidp z_voidp
+# define Byte z_Byte
+# define uInt z_uInt
+# define uLong z_uLong
+# define Bytef z_Bytef
+# define charf z_charf
+# define intf z_intf
+# define uIntf z_uIntf
+# define uLongf z_uLongf
+# define voidpf z_voidpf
+# define voidp z_voidp
#endif
#if defined(__MSDOS__) && !defined(MSDOS)
# ifdef VMS
# include <unixio.h> /* for off_t */
# endif
-# define z_off_t off_t
+# define z_off_t off_t
#endif
#ifndef SEEK_SET
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif
#ifndef z_off_t
-# define z_off_t long
+# define z_off_t long
#endif
#if defined(__OS400__)
-#define NO_vsnprintf
+# define NO_vsnprintf
#endif
#if defined(__MVS__)
-.TH ZLIB 3 "9 January 2004"
+.TH ZLIB 3 "9 September 2004"
.SH NAME
zlib \- compression/decompression library
.SH SYNOPSIS
Send questions and/or comments to zlib@gzip.org,
or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
.SH AUTHORS
-Version 1.2.1.1
+Version 1.2.1.2
Copyright (C) 1995-2004 Jean-loup Gailly (jloup@gzip.org)
and Mark Adler (madler@alumni.caltech.edu).
.LP
/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.2.1.1, January 9th, 2004
+ version 1.2.1.2, September 9th, 2004
Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler
extern "C" {
#endif
-#define ZLIB_VERSION "1.2.1.1"
-#define ZLIB_VERNUM 0x1211
+#define ZLIB_VERSION "1.2.1.2"
+#define ZLIB_VERNUM 0x1212
/*
The 'zlib' compression library provides in-memory compression and
because Z_BLOCK is used.
If a preset dictionary is needed after this call (see inflateSetDictionary
- below), inflate sets strm-adler to the adler32 checksum of the dictionary
+ below), inflate sets strm->adler to the adler32 checksum of the dictionary
chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
strm->adler to the adler32 checksum of all output produced so far (that is,
total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
struct internal_state {int dummy;}; /* hack for buggy compilers */
#endif
-ZEXTERN const char * ZEXPORT zError OF((int err));
+ZEXTERN const char * ZEXPORT zError OF((int));
ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
# define NO_vsnprintf
# endif
#endif
+#ifdef VMS
+# define NO_vsnprintf
+#endif
#ifdef HAVE_STRERROR
- extern char *strerror OF((int));
+# ifndef VMS
+ extern char *strerror OF((int));
+# endif
# define zstrerror(errnum) strerror(errnum)
#else
# define zstrerror(errnum) ""