Skip to content

Commit

Permalink
zlib 1.2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
madler committed Sep 10, 2011
1 parent 13a294f commit 8e34b3a
Show file tree
Hide file tree
Showing 58 changed files with 7,305 additions and 5,376 deletions.
36 changes: 35 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@

ChangeLog file for zlib
Changes in 1.2.0.2 (13 July 2003)
- Add ZLIB_VERNUM in zlib.h for numerical preprocessor comparisons
- Attempt to avoid warnings in crc32.c for pointer-int conversion
- Add AIX to configure, remove aix directory [Bakker]
- Add some casts to minigzip.c
- Improve checking after insecure sprintf() or vsprintf() calls
- Remove #elif's from crc32.c
- Change leave label to inf_leave in inflate.c and infback.c to avoid
library conflicts
- Remove inflate gzip decoding by default--only enable gzip decoding by
special request for stricter backward compatibility
- Add zlibCompileFlags() function to return compilation information
- More typecasting in deflate.c to avoid warnings
- Remove leading underscore from _Capital #defines [Truta]
- Fix configure to link shared library when testing
- Add some Windows CE target adjustments [Mai]
- Remove #define ZLIB_DLL in zconf.h [Vollant]
- Add zlib.3 [Rodgers]
- Update RFC URL in deflate.c and algorithm.txt [Mai]
- Add zlib_dll_FAQ.txt to contrib [Truta]
- Add UL to some constants [Truta]
- Update minizip and vstudio [Vollant]
- Remove vestigial NEED_DUMMY_RETURN from zconf.in.h
- Expand use of NO_DUMMY_DECL to avoid all dummy structures
- Added iostream3 to contrib [Schwardt]
- Replace rewind() with fseek() for WinCE [Truta]
- Improve setting of zlib format compression level flags
- Report 0 for huffman and rle strategies and for level == 0 or 1
- Report 2 only for level == 6
- Only deal with 64K limit when necessary at compile time [Truta]
- Allow TOO_FAR check to be turned off at compile time [Truta]
- Added gzclearerr() function [Souza]
- Added gzungetc() function

Changes in 1.2.0.1 (17 March 2003)
- Add Z_RLE strategy for run-length encoding [Truta]
- When Z_RLE requested, restrict matches to distance one
Expand All @@ -12,7 +46,7 @@ Changes in 1.2.0.1 (17 March 2003)
- Include additional header file on VMS for off_t typedef
- Try to use _vsnprintf where it supplants vsprintf [Vollant]
- Add some casts in inffast.c
- Enchance comments in zlib.h on what happens if the gzprintf() tries to
- Enchance comments in zlib.h on what happens if gzprintf() tries to
write more than 4095 bytes before compression
- Remove unused state from inflateBackEnd()
- Remove exit(0) from minigzip.c, example.c
Expand Down
3 changes: 2 additions & 1 deletion FAQ
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
hand, if zlib is compiled to use snprintf() or vsnprintf(), which should
normally be the case, then there is no vulnerability. The ./configure
script will display warnings if an insecure variation of sprintf() will
be used by gzprintf().
be used by gzprintf(). Also the zlibCompileFlags() functions will return
information on what variant of sprintf() is used by gzprintf().

If you don't have snprintf() or vsnprintf() and would like one, you can
find a portable implementation here:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ LDFLAGS=libz.a
LDSHARED=$(CC)
CPP=$(CC) -E

VER=1.2.0.1
VER=1.2.0.2
LIBS=libz.a
SHAREDLIB=libz.so

Expand Down
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ LDFLAGS=libz.a
LDSHARED=$(CC)
CPP=$(CC) -E

VER=1.2.0.1
VER=1.2.0.2
LIBS=libz.a
SHAREDLIB=libz.so

Expand Down
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ZLIB DATA COMPRESSION LIBRARY

zlib 1.2.0.1 is a general purpose data compression library. All the code is
zlib 1.2.0.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 <[email protected]> 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.0.1 are documented in the file ChangeLog.
The changes made in version 1.2.0.2 are documented in the file ChangeLog.

Unsupported third party contributions are provided in directory "contrib".

Expand Down
1 change: 1 addition & 0 deletions adler32.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/* @(#) $Id$ */

#define ZLIB_INTERNAL
#include "zlib.h"

#define BASE 65521L /* largest prime smaller than 65536 */
Expand Down
9 changes: 0 additions & 9 deletions aix/README

This file was deleted.

57 changes: 0 additions & 57 deletions aix/configure.diff

This file was deleted.

37 changes: 0 additions & 37 deletions aix/mkexps

This file was deleted.

2 changes: 1 addition & 1 deletion algorithm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,4 @@ Compression,'' IEEE Transactions on Information Theory, Vol. 23, No. 3,
pp. 337-343.

``DEFLATE Compressed Data Format Specification'' available in
ftp://ds.internic.net/rfc/rfc1951.txt
http://www.ietf.org/rfc/rfc1951.txt
1 change: 1 addition & 0 deletions compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/* @(#) $Id$ */

#define ZLIB_INTERNAL
#include "zlib.h"

/* ===========================================================================
Expand Down
10 changes: 10 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# an error.

LIBS=libz.a
LDFLAGS="-L. ${LIBS}"
SHAREDLIB=libz.so
VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
AR=${AR-"ar rc"}
Expand Down Expand Up @@ -53,6 +54,10 @@ case "$1" in
esac
done

if [ $shared -eq 1 ]; then
LDFLAGS="-L. ${SHAREDLIB}"
fi

test=ztest$$
cat > $test.c <<EOF
extern int getchar();
Expand Down Expand Up @@ -123,6 +128,10 @@ else
SFLAGS=${CFLAGS-"-KPIC -O"}
CFLAGS=${CFLAGS-"-O"}
LDSHARED=${LDSHARED-"cc -G"};;
AIX*) # Courtesy of [email protected]
SFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
CFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
LDSHARED=${LDSHARED-"xlc -G"};;
# send working options for other systems to [email protected]
*) SFLAGS=${CFLAGS-"-O"}
CFLAGS=${CFLAGS-"-O"}
Expand Down Expand Up @@ -422,4 +431,5 @@ sed < Makefile.in "
/^exec_prefix *=/s%=.*%=$exec_prefix%
/^libdir *=/s%=.*%=$libdir%
/^includedir *=/s%=.*%=$includedir%
/^LDFLAGS *=/s%=.*%=$LDFLAGS%
" > Makefile
35 changes: 35 additions & 0 deletions contrib/iostream3/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
These classes provide a C++ stream interface to the zlib library. It allows you
to do things like:

gzofstream outf("blah.gz");
outf << "These go into the gzip file " << 123 << endl;

It does this by deriving a specialized stream buffer for gzipped files, which is
the way Stroustrup would have done it. :->

The gzifstream and gzofstream classes were originally written by Kevin Ruland
and made available in the zlib contrib/iostream directory. The older version still
compiles under gcc 2.xx, but not under gcc 3.xx, which sparked the development of
this version.

The new classes are as standard-compliant as possible, closely following the
approach of the standard library's fstream classes. It compiles under gcc versions
3.2 and 3.3, but not under gcc 2.xx. This is mainly due to changes in the standard
library naming scheme. The new version of gzifstream/gzofstream/gzfilebuf differs
from the previous one in the following respects:
- added showmanyc
- added setbuf, with support for unbuffered output via setbuf(0,0)
- a few bug fixes of stream behavior
- gzipped output file opened with default compression level instead of maximum level
- setcompressionlevel()/strategy() members replaced by single setcompression()

The code is provided "as is", with the permission to use, copy, modify, distribute
and sell it for any purpose without fee.

Ludwig Schwardt
<[email protected]>

DSP Lab
Electrical & Electronic Engineering Department
University of Stellenbosch
South Africa
17 changes: 17 additions & 0 deletions contrib/iostream3/TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Possible upgrades to gzfilebuf:

- The ability to do putback (e.g. putbackfail)

- The ability to seek (zlib supports this, but could be slow/tricky)

- Simultaneous read/write access (does it make sense?)

- Support for ios_base::ate open mode

- Locale support?

- Check public interface to see which calls give problems
(due to dependence on library internals)

- Override operator<<(ostream&, gzfilebuf*) to allow direct copying
of stream buffer to stream ( i.e. os << is.rdbuf(); )
50 changes: 50 additions & 0 deletions contrib/iostream3/test.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Test program for gzifstream and gzofstream
*
* by Ludwig Schwardt <[email protected]>
* original version by Kevin Ruland <[email protected]>
*/

#include "zfstream.h"
#include <iostream> // for cout

int main() {

gzofstream outf;
gzifstream inf;
char buf[80];

outf.open("test1.txt.gz");
outf << "The quick brown fox sidestepped the lazy canine\n"
<< 1.3 << "\nPlan " << 9 << std::endl;
outf.close();
std::cout << "Wrote the following message to 'test1.txt.gz' (check with zcat or zless):\n"
<< "The quick brown fox sidestepped the lazy canine\n"
<< 1.3 << "\nPlan " << 9 << std::endl;

std::cout << "\nReading 'test1.txt.gz' (buffered) produces:\n";
inf.open("test1.txt.gz");
while (inf.getline(buf,80,'\n')) {
std::cout << buf << "\t(" << inf.rdbuf()->in_avail() << " chars left in buffer)\n";
}
inf.close();

outf.rdbuf()->pubsetbuf(0,0);
outf.open("test2.txt.gz");
outf << setcompression(Z_NO_COMPRESSION)
<< "The quick brown fox sidestepped the lazy canine\n"
<< 1.3 << "\nPlan " << 9 << std::endl;
outf.close();
std::cout << "\nWrote the same message to 'test2.txt.gz' in uncompressed form";

std::cout << "\nReading 'test2.txt.gz' (unbuffered) produces:\n";
inf.rdbuf()->pubsetbuf(0,0);
inf.open("test2.txt.gz");
while (inf.getline(buf,80,'\n')) {
std::cout << buf << "\t(" << inf.rdbuf()->in_avail() << " chars left in buffer)\n";
}
inf.close();

return 0;

}
Loading

0 comments on commit 8e34b3a

Please sign in to comment.