-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
7,305 additions
and
5,376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
@@ -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". | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"} | ||
|
@@ -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(); | ||
|
@@ -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"} | ||
|
@@ -422,4 +431,5 @@ sed < Makefile.in " | |
/^exec_prefix *=/s%=.*%=$exec_prefix% | ||
/^libdir *=/s%=.*%=$libdir% | ||
/^includedir *=/s%=.*%=$includedir% | ||
/^LDFLAGS *=/s%=.*%=$LDFLAGS% | ||
" > Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
} |
Oops, something went wrong.