CHANGES
-------
+ 2.000_10 13 March 2006
+
+ * AnyUncompress doesn't assume that IO-Compress-Zlib is installed any
+ more.
+
+ 2.000_09 3 March 2006
+
+ * Released to CPAN.
+
2.000_08 2 March 2006
* Split IO::Compress::Base into its own distribution.
IO::Compress::Base
- Version 2.000_08
+ Version 2.000_10
- 27 Feb 2006
+ 13 Mar 2006
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
-----------
-This module is a base class for all IO::Compress and IO::Uncompress
+This module is the base class for all IO::Compress and IO::Uncompress
modules.
our (@ISA, $VERSION, $got_encode);
#@ISA = qw(Exporter IO::File);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
#Can't locate object method "SWASHNEW" via package "utf8" (perhaps you forgot to load "utf8"?) at .../ext/Compress-Zlib/Gzip/blib/lib/Compress/Zlib/Common.pm line 16.
-
-
-
=head1 AUTHOR
-The I<IO::Compress::Base> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
require Exporter;
our ($VERSION, @ISA, @EXPORT, %EXPORT_TAGS);
@ISA = qw(Exporter);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
@EXPORT = qw( isaFilehandle isaFilename whatIsInput whatIsOutput
isaFileGlobString cleanFileGlobString oneTarget
use IO::Compress::Base::Common qw(createSelfTiedObject);
-#use IO::Uncompress::Base ;
-use IO::Uncompress::Gunzip ;
-use IO::Uncompress::Inflate ;
-use IO::Uncompress::RawInflate ;
-use IO::Uncompress::Unzip ;
+use IO::Uncompress::Base ;
BEGIN
{
+ eval { require IO::Uncompress::Adapter::Inflate; import IO::Uncompress::Adapter::Inflate };
eval { require IO::Uncompress::Adapter::Bunzip2; import IO::Uncompress::Adapter::Bunzip2 };
- eval { require IO::Uncompress::Adapter::LZO; import IO::Uncompress::Adapter::LZO };
- eval { require IO::Uncompress::Bunzip2; import IO::Uncompress::Bunzip2 };
- eval { require IO::Uncompress::UnLzop; import IO::Uncompress::UnLzop };
+ eval { require IO::Uncompress::Adapter::LZO; import IO::Uncompress::Adapter::LZO };
+
+ eval { require IO::Uncompress::Bunzip2; import IO::Uncompress::Bunzip2 };
+ eval { require IO::Uncompress::UnLzop; import IO::Uncompress::UnLzop };
+ eval { require IO::Uncompress::Gunzip; import IO::Uncompress::Gunzip };
+ eval { require IO::Uncompress::Inflate; import IO::Uncompress::Inflate };
+ eval { require IO::Uncompress::RawInflate; import IO::Uncompress::RawInflate };
+ eval { require IO::Uncompress::Unzip; import IO::Uncompress::Unzip };
}
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyUncompressError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$AnyUncompressError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
my $class = shift ;
my $got = shift ;
+ my $magic ;
+
# try zlib first
- my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Inflate::mkUncompObject();
+ if (defined $IO::Uncompress::RawInflate::VERSION )
+ {
+ my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Inflate::mkUncompObject();
- return $self->saveErrorString(undef, $errstr, $errno)
- if ! defined $obj;
+ return $self->saveErrorString(undef, $errstr, $errno)
+ if ! defined $obj;
- *$self->{Uncomp} = $obj;
-
- my $magic = $self->ckMagic( qw( RawInflate Inflate Gunzip Unzip ) );
+ *$self->{Uncomp} = $obj;
+
+ $magic = $self->ckMagic( qw( RawInflate Inflate Gunzip Unzip ) );
- if ($magic) {
- *$self->{Info} = $self->readHeader($magic)
- or return undef ;
+ if ($magic) {
+ *$self->{Info} = $self->readHeader($magic)
+ or return undef ;
- return 1;
+ return 1;
+ }
}
#foreach my $type ( qw( Bunzip2 UnLzop ) ) {
=head1 NAME
-IO::Uncompress::AnyUncompress - Perl interface to read 1950, 1951 & 1952 files/buffers
+IO::Uncompress::AnyUncompress - Uncompress gzip, zip, bzip2 or lzop file/buffer
=head1 SYNOPSIS
-
This module provides a Perl interface that allows the reading of
-any files/buffers.
+files/buffers that have been compressed with a variety of compression
+libraries.
+
+The formats supported are:
+
+=over 5
+
+=item RFC 1950
+
+=item RFC 1951
+
+=item gzip (RFC 1952)
+
+=item zip
+
+=item bzip2
+
+=item lzop
+
+=back
+
+The module will auto-detect which, if any, of the supported
+compression formats is being used.
+
-For writing 1950, 1951 & 1952 files/buffers, see the companion module IO::Compress::RawDeflate.
-
-
-
=head1 AUTHOR
-The I<IO::Uncompress::AnyUncompress> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
@ISA = qw(Exporter );
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
use constant G_EOF => 0 ;
use constant G_ERR => -1 ;
-
-
-
=head1 AUTHOR
-The I<IO::Uncompress::Base> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
CHANGES
-------
+ 2.000_10 13 March 2006
+
+ * Documentation updates.
+
+ 2.000_09 3 March 2006
+
+ * Released to CPAN.
+
2.000_08 2 March 2006
* Split IO::Compress::Zlib into its own distribution.
? (MAN3PODS => {})
: (PREREQ_PM => { 'Compress::Raw::Zlib' => 0,
'IO::Compress::Base' => 0,
+ 'IO::Uncompress::Base' => 0,
$] >= 5.005 && $] < 5.006
? ('File::BSDGlob' => 0)
: () }
IO::Compress::Zlib
- Version 2.000_08
+ Version 2.000_10
- 27 Feb 2006
+ 13 Mar 2006
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
-----------
-This module provides a Perl interface to allow reading an writing of RFC
+This module provides a Perl interface to allow reading and writing of RFC
1950, 1951, 1952 (i.e. gzip) and zip files/buffers.
-The t/17isize Test Suite
+The t/020isize Test Suite
------------------------
This test suite checks that IO::Compress::Zlib can cope with gzip files
use Compress::Raw::Zlib qw(Z_OK Z_FINISH MAX_WBITS) ;
our ($VERSION);
-$VERSION = '2.000_05';
+$VERSION = '2.000_10';
sub mkCompObject
{
use Compress::Raw::Zlib () ;
our ($VERSION);
-$VERSION = '2.000_05';
+$VERSION = '2.000_10';
sub mkCompObject
{
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $DeflateError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$DeflateError = '';
@ISA = qw(Exporter IO::Compress::RawDeflate);
=head1 NAME
-IO::Compress::Deflate - Perl interface to write RFC 1950 files/buffers
+
+IO::Compress::Deflate - Write RFC 1950 files/buffers
+
=head1 SYNOPSIS
-=item -Merge =E<gt> 0|1
+=item Merge =E<gt> 0|1
This option is used to compress input data and append it to an existing
compressed data stream in C<$output>. The end result is a single compressed
-
-
-
=head1 AUTHOR
-The I<IO::Compress::Deflate> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $GzipError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$GzipError = '' ;
@ISA = qw(Exporter IO::Compress::RawDeflate);
=head1 NAME
-IO::Compress::Gzip - Perl interface to write RFC 1952 files/buffers
+
+IO::Compress::Gzip - Write RFC 1952 files/buffers
+
=head1 SYNOPSIS
If the C<$input> parameter is any other type, C<undef> will be returned.
-
In addition, if C<$input> is a simple filename, the default values for
-a number of the gzip header fields created by this function will
-be sourced from that file --
-
-the NAME gzip header field will be populated with
-the filename itself, and the MTIME header field will be set to the
-modification time of the file.
-The intention here is to mirror part of the behaviour of the gzip
-executable.
+the C<Name> and C<Time> options will be sourced from that file.
If you do not want to use these defaults they can be overridden by
explicitly setting the C<Name> and C<Time> options or by setting the
-=item -Merge =E<gt> 0|1
+=item Merge =E<gt> 0|1
This option is used to compress input data and append it to an existing
compressed data stream in C<$output>. The end result is a single compressed
-
-
-
=head1 AUTHOR
-The I<IO::Compress::Gzip> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
our ($VERSION, @ISA, @EXPORT, %GZIP_OS_Names);
our ($GZIP_FNAME_INVALID_CHAR_RE, $GZIP_FCOMMENT_INVALID_CHAR_RE);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
@ISA = qw(Exporter);
our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$RawDeflateError = '';
@ISA = qw(Exporter IO::Compress::Base);
=head1 NAME
-IO::Compress::RawDeflate - Perl interface to write RFC 1951 files/buffers
+
+IO::Compress::RawDeflate - Write RFC 1951 files/buffers
+
=head1 SYNOPSIS
-=item -Merge =E<gt> 0|1
+=item Merge =E<gt> 0|1
This option is used to compress input data and append it to an existing
compressed data stream in C<$output>. The end result is a single compressed
-
-
-
=head1 AUTHOR
-The I<IO::Compress::RawDeflate> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $ZipError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$ZipError = '';
@ISA = qw(Exporter IO::Compress::RawDeflate);
=head1 NAME
-IO::Compress::Zip - Perl interface to write zip files/buffers
+
+IO::Compress::Zip - Write zip files/buffers
+
=head1 SYNOPSIS
-Note that this module is not intended to be a replacement for the module
+Note that IO::Compress::Zip is not intended to be a replacement for the module
C<Archive::Zip>.
+
The primary aim of this module is not as an archiver, but to provide
streaming write access to zip file files and buffers.
If the C<$input> parameter is any other type, C<undef> will be returned.
-
In addition, if C<$input> is a simple filename, the default values for
-a number of the zip header fields created by this function will
-be sourced from that file --
-
-the NAME gzip header field will be populated with
-the filename itself, and the MTIME header field will be set to the
-modification time of the file.
-The intention here is to mirror part of the behaviour of the
-zip executable.
+the C<Name> and C<Time> options will be sourced from that file.
If you do not want to use these defaults they can be overridden by
explicitly setting the C<Name> and C<Time> options or by setting the
-
-
-
=head1 AUTHOR
-The I<IO::Compress::Zip> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
our ($VERSION, @ISA, @EXPORT, %GZIP_OS_Names);
-$VERSION = '1.00';
+$VERSION = '2.000_10';
@ISA = qw(Exporter);
our ($VERSION, @ISA, @EXPORT);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
@ISA = qw(Exporter);
our ($VERSION);
-$VERSION = '2.000_05';
+$VERSION = '2.000_10';
use Compress::Raw::Zlib ();
use Compress::Raw::Zlib qw(Z_OK Z_DATA_ERROR Z_STREAM_END Z_FINISH MAX_WBITS);
our ($VERSION);
-$VERSION = '2.000_05';
+$VERSION = '2.000_10';
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyInflateError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$AnyInflateError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
=head1 NAME
-IO::Uncompress::AnyInflate - Perl interface to read RFC 1950, 1951 & 1952 files/buffers
+IO::Uncompress::AnyInflate - Uncompress zlib-based (zip, gzip) file/buffer
=head1 SYNOPSIS
-
This module provides a Perl interface that allows the reading of
-files/buffers that conform to RFC's 1950, 1951 and 1952.
+files/buffers that have been compressed in a number of formats that use the
+zlib compression library.
+
+The formats supported are
+
+=over 5
+
+=item RFC 1950
+
+=item RFC 1951
+
+=item gzip (RFC 1952)
+
+=item zip
-The module will auto-detect which, if any, of the three supported
+=back
+
+The module will auto-detect which, if any, of the supported
compression formats is being used.
+
+
+
=head1 Functional Interface
A top-level function, C<anyinflate>, is provided to carry out
-
-
-
=head1 AUTHOR
-The I<IO::Uncompress::AnyInflate> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
$GunzipError = '';
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
sub new
{
=head1 NAME
-IO::Uncompress::Gunzip - Perl interface to read RFC 1952 files/buffers
+
+IO::Uncompress::Gunzip - Read RFC 1952 files/buffers
+
=head1 SYNOPSIS
+
+
+
=head1 Functional Interface
A top-level function, C<gunzip>, is provided to carry out
-
-
-
=head1 AUTHOR
-The I<IO::Uncompress::Gunzip> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $InflateError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$InflateError = '';
@ISA = qw( Exporter IO::Uncompress::RawInflate );
=head1 NAME
-IO::Uncompress::Inflate - Perl interface to read RFC 1950 files/buffers
+
+IO::Uncompress::Inflate - Read RFC 1950 files/buffers
+
=head1 SYNOPSIS
+
+
+
=head1 Functional Interface
A top-level function, C<inflate>, is provided to carry out
-
-
-
=head1 AUTHOR
-The I<IO::Uncompress::Inflate> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$RawInflateError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
=head1 NAME
-IO::Uncompress::RawInflate - Perl interface to read RFC 1951 files/buffers
+
+IO::Uncompress::RawInflate - Read RFC 1951 files/buffers
+
=head1 SYNOPSIS
+
+
+
=head1 Functional Interface
A top-level function, C<rawinflate>, is provided to carry out
-
-
-
=head1 AUTHOR
-The I<IO::Uncompress::RawInflate> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $UnzipError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$UnzipError = '';
@ISA = qw(Exporter IO::Uncompress::RawInflate);
=head1 NAME
-IO::Uncompress::Unzip - Perl interface to read zip files/buffers
+
+IO::Uncompress::Unzip - Read zip files/buffers
+
=head1 SYNOPSIS
+
+
+
=head1 Functional Interface
A top-level function, C<unzip>, is provided to carry out
-
-
-
=head1 AUTHOR
-The I<IO::Uncompress::Unzip> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
my $Inc = join " ", map qq["-I$_"] => @INC;
-#$Inc = '"-MExtUtils::testlib"'
-# if ! $ENV{PERL_CORE} && eval " require ExtUtils::testlib; " ;
+$Inc = '"-MExtUtils::testlib"'
+ if ! $ENV{PERL_CORE} && eval " require ExtUtils::testlib; " ;
my $Perl = ($ENV{'FULLPERL'} or $^X or 'perl') ;
$Perl = qq["$Perl"] if $^O eq 'MSWin32' ;
# Check external gzip is available
my $name = 'gzip';
- for my $dir (split ":", $ENV{PATH})
+ for my $dir (reverse split ":", $ENV{PATH})
{
$GZIP = "$dir/$name"
if -x "$dir/$name" ;
{
my $file = shift ;
+ my $lex = new LexFile my $outfile;
+
my $comp = "$GZIP -dc" ;
- open F, "$comp $file |";
- local $/;
- $_[0] = <F>;
- close F;
+ #diag "$comp $file >$outfile" ;
+
+ system("$comp $file >$outfile") == 0
+ or die "'$comp' failed: $?";
+
+ $_[0] = readFile($outfile);
- return $? ;
+ return 1 ;
}
sub getGzipInfo
my $content = shift ;
my $options = shift || '';
+ my $lex = new LexFile my $infile;
+ writeFile($infile, $content);
+
unlink $file ;
- my $gzip = "$GZIP -c $options >$file" ;
+ my $gzip = "$GZIP -c $options $infile >$file" ;
- open F, "| $gzip" ;
- print F $content ;
- close F ;
+ system($gzip) == 0
+ or die "'$gzip' failed: $?";
- return $? ;
+ return 1 ;
}
my $content = "hello world\n" ;
my $got;
- is writeWithGzip($file, $content), 0, "writeWithGzip ok";
+ is writeWithGzip($file, $content), 1, "writeWithGzip ok";
gunzip $file => \$got ;
- is $got, $content;
+ is $got, $content, "got content";
gzip \$content => $file1;
$got = '';
- is readWithGzip($file1, $got), 0, "readWithGzip returns 0";
+ is readWithGzip($file1, $got), 1, "readWithGzip ok";
is $got, $content, "got content";
}
-my @GZIP_OS_Names ;
-my %OSnames ;
+use vars qw ( @GZIP_OS_Names %OSnames) ;
BEGIN
{
Compress::Raw::Zlib
- Version 2.000_08
+ Version 2.000_10
- 27 Feb 2006
+ 13 Mar 2006
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
-
Controlling the version of zlib used by Compress::Raw::Zlib
----------------------------------------------------------
#ifndef MAGIC_APPEND
croak("resetLastBlockByte needs zlib 1.2.1 or better");
#else
- *byte = *byte ^ (1 << ((8 - s->window_lastbit) & 7));
+ if (byte != NULL)
+ *byte = *byte ^ (1 << ((8 - s->window_lastbit) & 7));
#endif
use bytes ;
our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
-
-
-
=head1 AUTHOR
-The I<Compress::Raw::Zlib> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
my $count = 0 ;
if ($] < 5.005) {
- $count = 188 ;
+ $count = 189 ;
}
elsif ($] >= 5.006) {
- $count = 242 ;
+ $count = 243 ;
}
else {
- $count = 200 ;
+ $count = 201 ;
}
plan tests => $count + $extra;
}
+{
+ # regression - check that resetLastBlockByte can cope with a NULL
+ # pointer.
+ Compress::Raw::Zlib::InflateScan->new->resetLastBlockByte(undef);
+ ok 1, "resetLastBlockByte(undef) is ok" ;
+}
+
exit if $] < 5.006 ;
title 'Looping Append test with substr output - substr the end of the string';
CHANGES
-------
- 2.000_08 2 March 2006
+ 2.000_10 13 March 2006
+
+ * Changed gzread so that its behaviour matches C::Z::gzread 1.x if it
+ is called after eof. In this case it will write an empty string
+ into the output parameter. This change is solely for backward
+ compatability reasons.
- * Moved the IO::* modules out into their own distributions.
+ 2.000_09 3 March 2006
- 2.000_08 9 January 2006
+ * Posted to CPAN
+
+ 2.000_08 2 March 2006
* Breakout zlib specific code into separate modules.
(
$ENV{SKIP_FOR_CORE}
? (MAN3PODS => {})
- : (PREREQ_PM => { 'Compress::Raw::Zlib' => 0,
- 'IO::Compress::Base' => 0,
- 'IO::Compress::Zlib' => 0,
- 'Scalar::Util' => 0,
+ : (PREREQ_PM => { 'Compress::Raw::Zlib' => 0,
+ 'IO::Compress::Base' => 0,
+ 'IO::Compress::Base::Common' => 0,
+ 'IO::Uncompress::Base' => 0,
+ 'IO::Compress::Gzip' => 0,
+ 'IO::Compress::Gzip::Constants' => 0,
+ 'IO::Uncompress::Gunzip' => 0,
+ 'Scalar::Util' => 0,
}
)
),
Compress::Zlib
- Version 2.000_08
+ Version 2.000_10
- 27 Feb 2006
+ 13 Mar 2006
Copyright (c) 1995-2006 Paul Marquess. All rights reserved.
foreach my $filename (@ARGV) {
my $buffer ;
- my $file = $filename ;
- $file = \*STDIN if $file eq '-' ;
-
- my $gz = gzopen($file, "rb")
- or die "Cannot open $file: $gzerrno\n" ;
+ my $gz = gzopen($filename, "rb")
+ or die "Cannot open $filename: $gzerrno\n" ;
print $buffer while $gz->gzread($buffer) > 0 ;
binmode STDOUT; # gzopen only sets it on the fd
-my $gz = gzopen(\*STDOUT, "wb")
+#my $gz = gzopen(\*STDOUT, "wb")
+my $gz = gzopen('-', "wb")
or die "Cannot open stdout: $gzerrno\n" ;
while (<>) {
use bytes ;
our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
return _set_gzerr(Z_STREAM_ERROR())
if $self->[1] ne 'inflate';
- return 0 if $self->gzeof();
+ if ($self->gzeof()) {
+ # Zap the output buffer to match ver 1 behaviour.
+ $_[0] = "" ;
+ return 0 ;
+ }
my $gz = $self->[0] ;
my $status = $gz->read($_[0], defined $_[1] ? $_[1] : 4096) ;
- $_[0] = "" if ! defined $_[0] ;
_save_gzerr($gz, 1);
return $status ;
}
-
-
-
=head1 AUTHOR
-The I<Compress::Zlib> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 1995-2006 Paul Marquess. All rights reserved.
$extra = 1
if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
- plan tests => 208 + $extra ;
+ plan tests => 210 + $extra ;
use_ok('Compress::Zlib', 2) ;
use_ok('IO::Compress::Gzip::Constants') ;
is $fil->gztell(), $len;
ok $fil->gzeof() ;
+
+# gzread after eof bahavior
+
+my $xyz = "123" ;
+is $fil->gzread($xyz), 0, "gzread returns 0 on eof" ;
+is $xyz, "", "gzread on eof zaps the output buffer [Match 1,x behavior]" ;
+
ok ! $fil->gzclose ;
ok $fil->gzeof() ;
+
1 while unlink $name ;
ok $hello eq $uncomp ;
$extra = 1
if $st ;
- plan(tests => 597 + $extra) ;
+ plan(tests => 601 + $extra) ;
}
sub myGZreadFile
is $u->read($buff, 1), 0;
ok $u->eof() ;
+ # getc returns undef on eof
+ is $u->getc(), undef;
$u->close();
}
$BadPerl = ($] >= 5.006 and $] <= 5.008) ;
if ($BadPerl) {
- $tests = 242 ;
+ $tests = 241 ;
}
else {
- $tests = 250 ;
+ $tests = 249 ;
}
plan tests => $tests + $extra ;
- use_ok('Compress::Raw::Zlib') ;
-
}