Skip to content

Commit

Permalink
zlib 1.2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
madler committed Sep 10, 2011
1 parent f0e76a6 commit 7a69557
Show file tree
Hide file tree
Showing 63 changed files with 2,463 additions and 506 deletions.
32 changes: 29 additions & 3 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@

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)
Expand Down
3 changes: 3 additions & 0 deletions INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ algorithm.txt description of the (de)compression algorithm
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

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CPP=$(CC) -E

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
Expand Down
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CPP=$(CC) -E

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
Expand Down
6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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)
Expand Down Expand Up @@ -34,7 +34,7 @@ Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
issue of Dr. Dobb's Journal; a copy of the article is available in
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".

Expand Down Expand Up @@ -93,7 +93,7 @@ Acknowledgments:

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
Expand Down
6 changes: 3 additions & 3 deletions as400/zlib.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
* 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:
Expand All @@ -20,8 +20,8 @@
* 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
Expand Down
6 changes: 2 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
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)
Expand All @@ -89,9 +89,7 @@ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
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
Expand Down
2 changes: 1 addition & 1 deletion contrib/README.contrib
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
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
106 changes: 106 additions & 0 deletions contrib/ada/buffer_demo.adb
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
----------------------------------------------------------------
-- 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;
11 changes: 7 additions & 4 deletions contrib/ada/mtest.adb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
-- --
-- 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;
Expand Down Expand Up @@ -148,6 +148,9 @@ procedure MTest is

pragma Unreferenced (Test);

Dummy : Character;

begin
null;
Ada.Text_IO.Get_Immediate (Dummy);
Stop := True;
end MTest;
9 changes: 7 additions & 2 deletions contrib/ada/read.adb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
-- 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.

Expand Down Expand Up @@ -68,7 +68,11 @@ procedure Read is
-- 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 --
Expand Down Expand Up @@ -103,6 +107,7 @@ procedure Read is
Pack_Size := 0;
Offset := 1;
Read_First := Read_Buffer'Last + 1;
Read_Last := Read_Buffer'Last;
end Reset;

begin
Expand Down
27 changes: 20 additions & 7 deletions contrib/ada/readme.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@

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
Expand Down Expand Up @@ -50,3 +61,5 @@ The routines from the package specifications are commented.

Homepage: http://zlib-ada.sourceforge.net/
Author: Dmitriy Anisimkov <anisimkov@yahoo.com>

Contributors: Pascal Obry <pascal@obry.org>, Steve Sangwine <sjs@essex.ac.uk>
14 changes: 12 additions & 2 deletions contrib/ada/zlib-streams.adb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
-- 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;

Expand Down Expand Up @@ -90,6 +90,7 @@ package body ZLib.Streams is

Stream.Buffer := new Buffer_Subtype;
Stream.Rest_First := Stream.Buffer'Last + 1;
Stream.Rest_Last := Stream.Buffer'Last;
end if;
end Create;

Expand All @@ -113,6 +114,15 @@ package body ZLib.Streams is
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 --
----------
Expand Down Expand Up @@ -212,4 +222,4 @@ package body ZLib.Streams is
return Total_Out (Stream.Writer);
end Write_Total_Out;

end ZLib.Streams;
end ZLib.Streams;
Loading

0 comments on commit 7a69557

Please sign in to comment.