2 package IO::Uncompress::Base ;
8 our (@ISA, $VERSION, @EXPORT_OK, %EXPORT_TAGS);
9 #@ISA = qw(Exporter IO::File);
13 $VERSION = '2.000_08';
15 use constant G_EOF => 0 ;
16 use constant G_ERR => -1 ;
18 use IO::Compress::Base::Common;
19 #use Parse::Parameters ;
23 use Scalar::Util qw(readonly);
24 use List::Util qw(min);
28 push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ;
29 #Exporter::export_ok_tags('all') ;
42 if ( length *$self->{Prime} ) {
43 #$$out = substr(*$self->{Prime}, 0, $size, '') ;
44 $$out = substr(*$self->{Prime}, 0, $size) ;
45 substr(*$self->{Prime}, 0, $size) = '' ;
46 if (length $$out == $size) {
47 #*$self->{InputLengthRemaining} -= length $$out;
50 $offset = length $$out ;
53 my $get_size = $size - $offset ;
55 if ( defined *$self->{InputLength} ) {
56 #*$self->{InputLengthRemaining} += length *$self->{Prime} ;
57 #*$self->{InputLengthRemaining} = *$self->{InputLength}
58 # if *$self->{InputLengthRemaining} > *$self->{InputLength};
59 $get_size = min($get_size, *$self->{InputLengthRemaining});
62 if (defined *$self->{FH})
63 { *$self->{FH}->read($$out, $get_size, $offset) }
64 elsif (defined *$self->{InputEvent}) {
66 while (length $$out < $size) {
68 if ($got = *$self->{InputEvent}->($$out, $get_size)) <= 0;
71 if (length $$out > $size ) {
72 #*$self->{Prime} = substr($$out, $size, length($$out), '');
73 *$self->{Prime} = substr($$out, $size, length($$out));
74 substr($$out, $size, length($$out)) = '';
77 *$self->{EventEof} = 1 if $got <= 0 ;
80 no warnings 'uninitialized';
81 my $buf = *$self->{Buffer} ;
82 $$buf = '' unless defined $$buf ;
83 #$$out = '' unless defined $$out ;
84 substr($$out, $offset) = substr($$buf, *$self->{BufferOffset}, $get_size);
85 *$self->{BufferOffset} += length($$out) - $offset ;
88 *$self->{InputLengthRemaining} -= length $$out;
90 $self->saveStatus(length $$out < 0 ? STATUS_ERROR : STATUS_OK) ;
99 return if ! defined $_[0] || length $_[0] == 0 ;
101 if (defined *$self->{FH} || defined *$self->{InputEvent} ) {
102 *$self->{Prime} = $_[0] . *$self->{Prime} ;
105 my $len = length $_[0];
107 if($len > *$self->{BufferOffset}) {
108 *$self->{Prime} = substr($_[0], 0, $len - *$self->{BufferOffset}) . *$self->{Prime} ;
109 *$self->{InputLengthRemaining} = *$self->{InputLength};
110 *$self->{BufferOffset} = 0
113 *$self->{InputLengthRemaining} += length($_[0]);
114 *$self->{BufferOffset} -= length($_[0]) ;
123 my $truncate = shift;
124 #print "smartSeek to $offset\n";
126 # TODO -- need to take prime into account
127 if (defined *$self->{FH})
128 { *$self->{FH}->seek($offset, SEEK_SET) }
130 *$self->{BufferOffset} = $offset ;
131 substr(${ *$self->{Buffer} }, *$self->{BufferOffset}) = ''
140 my $out_data = shift ;
142 if (defined *$self->{FH}) {
143 # flush needed for 5.8.0
144 defined *$self->{FH}->write($out_data, length $out_data) &&
145 defined *$self->{FH}->flush() ;
148 my $buf = *$self->{Buffer} ;
149 substr($$buf, *$self->{BufferOffset}, length $out_data) = $out_data ;
150 *$self->{BufferOffset} += length($out_data) ;
157 return $_[0]->smartRead($_[1], $_[2]) == $_[2];
165 return 0 if length *$self->{Prime};
167 if (defined *$self->{FH})
168 { *$self->{FH}->eof() }
169 elsif (defined *$self->{InputEvent})
170 { *$self->{EventEof} }
172 { *$self->{BufferOffset} >= length(${ *$self->{Buffer} }) }
179 *$self->{ErrorNo} = 0 ;
180 ${ *$self->{Error} } = '' ;
186 my $errno = shift() + 0 ;
187 #return $errno unless $errno || ! defined *$self->{ErrorNo};
188 #return $errno unless $errno ;
190 *$self->{ErrorNo} = $errno;
191 ${ *$self->{Error} } = '' ;
193 return *$self->{ErrorNo} ;
202 #return $retval if ${ *$self->{Error} };
204 ${ *$self->{Error} } = shift ;
205 *$self->{ErrorNo} = shift() + 0 if @_ ;
207 #warn "saveErrorString: " . ${ *$self->{Error} } . " " . *$self->{Error} . "\n" ;
214 $self->saveErrorString(0, $_[0]);
224 my $errno = *$self->{ErrorNo};
225 my $error = ${ *$self->{Error} };
229 *$self->{ErrorNo} = $errno ;
230 ${ *$self->{Error} } = $error ;
238 return ${ *$self->{Error} } ;
244 return *$self->{ErrorNo};
250 return $self->saveErrorString(undef, "Header Error: $_[0]", STATUS_ERROR);
256 return $self->saveErrorString(G_ERR, "Trailer Error: $_[0]", STATUS_ERROR);
262 return $self->HeaderError("Truncated in $_[0] Section");
270 my $got = shift || IO::Compress::Base::Parameters::new();
273 'BlockSize' => [1, 1, Parse_unsigned, 16 * 1024],
274 'AutoClose' => [1, 1, Parse_boolean, 0],
275 'Strict' => [1, 1, Parse_boolean, 0],
276 #'Lax' => [1, 1, Parse_boolean, 1],
277 'Append' => [1, 1, Parse_boolean, 0],
278 'Prime' => [1, 1, Parse_any, undef],
279 'MultiStream' => [1, 1, Parse_boolean, 0],
280 'Transparent' => [1, 1, Parse_any, 1],
281 'Scan' => [1, 1, Parse_boolean, 0],
282 'InputLength' => [1, 1, Parse_unsigned, undef],
283 'BinModeOut' => [1, 1, Parse_boolean, 0],
285 $self->getExtraParams(),
288 #'Todo - Revert to ordinary file on end Z_STREAM_END'=> 0,
293 $got->parse($Valid, @_ )
294 or $self->croakError("${class}: $got->{Error}") ;
304 my $append_mode = shift ;
306 my $class = ref $obj;
307 $obj->croakError("$class: Missing Input parameter")
310 my $inValue = shift ;
314 $got = $obj->checkParams($class, undef, @_)
318 my $inType = whatIsInput($inValue, 1);
320 $obj->ckInputParam($class, $inValue, 1)
326 or $obj->croakError("${class}: $obj->{Error}");
328 if ($inType eq 'buffer' || $inType eq 'code') {
329 *$obj->{Buffer} = $inValue ;
330 *$obj->{InputEvent} = $inValue
331 if $inType eq 'code' ;
334 if ($inType eq 'handle') {
335 *$obj->{FH} = $inValue ;
336 *$obj->{Handle} = 1 ;
337 # Need to rewind for Scan
338 #seek(*$obj->{FH}, 0, SEEK_SET) if $got->value('Scan');
339 *$obj->{FH}->seek(0, SEEK_SET) if $got->value('Scan');
343 $mode = '+<' if $got->value('Scan');
344 *$obj->{StdIO} = ($inValue eq '-');
345 *$obj->{FH} = new IO::File "$mode $inValue"
346 or return $obj->saveErrorString(undef, "cannot open file '$inValue': $!", $!) ;
349 *$obj->{LineNo} = $. = 0;
350 setBinModeInput(*$obj->{FH}) ;
353 *$obj->{Buffer} = \$buff ;
357 *$obj->{InputLength} = $got->parsed('InputLength')
358 ? $got->value('InputLength')
360 *$obj->{InputLengthRemaining} = $got->value('InputLength');
361 *$obj->{BufferOffset} = 0 ;
362 *$obj->{AutoClose} = $got->value('AutoClose');
363 *$obj->{Strict} = $got->value('Strict');
364 #*$obj->{Strict} = ! $got->value('Lax');
365 *$obj->{BlockSize} = $got->value('BlockSize');
366 *$obj->{Append} = $got->value('Append');
367 *$obj->{AppendOutput} = $append_mode || $got->value('Append');
368 *$obj->{Transparent} = $got->value('Transparent');
369 *$obj->{MultiStream} = $got->value('MultiStream');
371 # TODO - move these two into RawDeflate
372 *$obj->{Scan} = $got->value('Scan');
373 *$obj->{ParseExtra} = $got->value('ParseExtra')
374 || $got->value('Strict') ;
375 #|| ! $got->value('Lax') ;
377 *$obj->{Prime} = $got->value('Prime') || '' ;
378 *$obj->{Pending} = '';
380 *$obj->{PlainBytesRead} = 0;
381 *$obj->{InflatedBytesRead} = 0;
382 *$obj->{UnCompSize_32bit} = 0;
383 *$obj->{TotalInflatedBytesRead} = 0;
384 *$obj->{NewStream} = 0 ;
385 *$obj->{EventEof} = 0 ;
386 *$obj->{ClassName} = $class ;
387 *$obj->{Params} = $got ;
389 my $status = $obj->mkUncomp($class, $got);
392 unless defined $status;
396 unless *$obj->{Transparent};
399 *$obj->{Type} = 'plain';
401 #$status = $obj->mkIdentityUncomp($class, $got);
402 $obj->pushBack(*$obj->{HeaderPending}) ;
405 push @{ *$obj->{InfoList} }, *$obj->{Info} ;
407 $obj->saveStatus(STATUS_OK) ;
418 my $inType = whatIsInput($_[0], $_[1]);
420 $self->croakError("$from: input parameter not a filename, filehandle, array ref or scalar ref")
423 if ($inType eq 'filename' )
425 $self->croakError("$from: input filename is undef or null string")
426 if ! defined $_[0] || $_[0] eq '' ;
428 if ($_[0] ne '-' && ! -e $_[0] )
430 return $self->saveErrorString(undef,
431 "input file '$_[0]' does not exist", STATUS_ERROR);
443 my $class = (caller)[0] ;
444 my $name = (caller(1))[3] ;
446 $obj->croakError("$name: expected at least 1 parameters\n")
454 my $x = new Validator($class, *$obj->{Error}, $name, $input, $output)
457 push @_, $output if $haveOut && $x->{Hash};
459 my $got = $obj->checkParams($name, undef, @_)
466 while (my($k, $v) = each %$input)
471 $obj->_singleTarget($x, 1, $k, $v, @_)
475 return keys %$input ;
481 foreach my $pair (@{ $x->{Pairs} })
483 my ($from, $to) = @$pair ;
484 $obj->_singleTarget($x, 1, $from, $to, @_)
488 return scalar @{ $x->{Pairs} } ;
491 #if ($x->{outType} eq 'array' || $x->{outType} eq 'hash')
492 if (! $x->{oneOutput} )
494 my $inFile = ($x->{inType} eq 'filenames'
495 || $x->{inType} eq 'filename');
497 $x->{inType} = $inFile ? 'filename' : 'buffer';
498 my $ot = $x->{outType} ;
499 $x->{outType} = 'buffer';
501 foreach my $in ($x->{oneInput} ? $input : @$input)
506 $obj->_singleTarget($x, $inFile, $in, \$out, @_)
510 { push @$output, \$out }
512 { $output->{$in} = \$out }
518 # finally the 1 to 1 and n to 1
519 return $obj->_singleTarget($x, 1, $input, $output, @_);
521 croak "should not be here" ;
529 ${ $x->{Error} } = $string ;
538 my $inputIsFilename = shift;
545 if ($x->{outType} eq 'filename') {
548 if $x->{Got}->value('Append') ;
549 $x->{fh} = new IO::File "$mode $output"
550 or return retErr($x, "cannot open file '$output': $!") ;
551 binmode $x->{fh} if $x->{Got}->valueOrDefault('BinModeOut');
555 elsif ($x->{outType} eq 'handle') {
557 binmode $x->{fh} if $x->{Got}->valueOrDefault('BinModeOut');
558 if ($x->{Got}->value('Append')) {
559 seek($x->{fh}, 0, SEEK_END)
560 or return retErr($x, "Cannot seek to end of output filehandle: $!") ;
565 elsif ($x->{outType} eq 'buffer' )
568 unless $x->{Got}->value('Append');
569 $x->{buff} = $output ;
574 defined $self->_rd2($x, $input, $inputIsFilename)
579 my $inputIsFilename = ($x->{inType} ne 'array');
581 for my $element ( ($x->{inType} eq 'hash') ? keys %$input : @$input)
583 defined $self->_rd2($x, $element, $inputIsFilename)
589 if ( ($x->{outType} eq 'filename' && $output ne '-') ||
590 ($x->{outType} eq 'handle' && $x->{Got}->value('AutoClose'))) {
592 or return retErr($x, $!);
593 #or return $gunzip->saveErrorString(undef, $!, $!);
605 my $inputIsFilename = shift;
607 my $z = createSelfTiedObject($x->{Class}, *$self->{Error});
609 $z->_create($x->{Got}, 1, $input, @_)
615 while (($status = $z->read($x->{buff})) > 0) {
618 or return $z->saveErrorString(undef, "Error writing to output file: $!", $!);
623 return $z->closeError(undef)
634 return $_[0] if ref($_[0]);
648 wantarray ? @{ *$self->{InfoList} } : *$self->{Info};
657 if (defined *$self->{CompressedInputLength}) {
658 if (*$self->{CompressedInputLengthRemaining} == 0) {
659 delete *$self->{CompressedInputLength};
660 *$self->{CompressedInputLengthDone} = 1;
663 $size = min($size, *$self->{CompressedInputLengthRemaining} );
664 *$self->{CompressedInputLengthRemaining} -= $size ;
667 my $status = $self->smartRead($buff, $size) ;
668 return $self->saveErrorString(STATUS_ERROR, "Error Reading Data")
672 *$self->{Closed} = 1 ;
673 *$self->{EndStream} = 1 ;
674 return $self->saveErrorString(STATUS_ERROR, "unexpected end of file", STATUS_ERROR);
689 # >0 - ok, number of bytes read
695 return G_EOF if *$self->{Closed} ;
696 #return G_EOF if !length *$self->{Pending} && *$self->{EndStream} ;
697 return G_EOF if *$self->{EndStream} ;
700 my $scan_mode = shift ;
702 if (*$self->{Plain}) {
704 my $len = $self->smartRead(\$tmp_buff, *$self->{BlockSize}) ;
706 return $self->saveErrorString(G_ERR, "Error reading data: $!", $!)
710 *$self->{EndStream} = 1 ;
713 *$self->{PlainBytesRead} += $len ;
714 $$buffer .= $tmp_buff;
720 if (*$self->{NewStream}) {
722 *$self->{NewStream} = 0 ;
723 *$self->{EndStream} = 0 ;
724 *$self->{Uncomp}->reset();
727 unless my $magic = $self->ckMagic();
728 *$self->{Info} = $self->readHeader($magic);
730 return G_ERR unless defined *$self->{Info} ;
732 push @{ *$self->{InfoList} }, *$self->{Info} ;
734 # For the headers that actually uncompressed data, put the
735 # uncompressed data into the output buffer.
736 $$buffer .= *$self->{Pending} ;
737 my $len = length *$self->{Pending} ;
738 *$self->{Pending} = '';
744 my $status = $self->readBlock(\$temp_buf, *$self->{BlockSize}, $outSize) ;
746 if $status == STATUS_ERROR ;
749 if ($status == STATUS_OK) {
750 my $before_len = defined $$buffer ? length $$buffer : 0 ;
751 $status = *$self->{Uncomp}->uncompr(\$temp_buf, $buffer,
752 defined *$self->{CompressedInputLengthDone} ||
753 $self->smartEof(), $outSize);
754 # (defined *$self->{CompressedInputLength} &&
755 # *$self->{CompressedInputLengthRemaining} < 0) ||
756 # $self->smartEof(), $outSize);
758 return $self->saveErrorString(G_ERR, *$self->{Uncomp}{Error}, *$self->{Uncomp}{ErrorNo})
759 if $self->saveStatus($status) == STATUS_ERROR;
761 $self->postBlockChk($buffer) == STATUS_OK
764 #$buf_len = *$self->{Uncomp}->count();
765 $buf_len = length($$buffer) - $before_len;
768 *$self->{InflatedBytesRead} += $buf_len ;
769 *$self->{TotalInflatedBytesRead} += $buf_len ;
770 my $rest = 0xFFFFFFFF - *$self->{UnCompSize_32bit} ;
771 if ($buf_len > $rest) {
772 *$self->{UnCompSize_32bit} = $buf_len - $rest - 1;
775 *$self->{UnCompSize_32bit} += $buf_len ;
779 if ($status == STATUS_ENDSTREAM) {
781 *$self->{EndStream} = 1 ;
782 $self->pushBack($temp_buf) ;
786 my $trailer_size = *$self->{Info}{TrailerLength} ;
788 if (*$self->{Info}{TrailerLength})
790 $got = $self->smartRead(\$trailer, $trailer_size) ;
793 if ($got == $trailer_size) {
794 $self->chkTrailer($trailer) == STATUS_OK
798 return $self->TrailerError("trailer truncated. Expected " .
799 "$trailer_size bytes, got $got")
801 $self->pushBack($trailer) ;
804 if (*$self->{MultiStream} && ! $self->smartEof()) {
805 #&& (length $temp_buf || ! $self->smartEof())){
806 *$self->{NewStream} = 1 ;
807 *$self->{EndStream} = 0 ;
814 # return the number of uncompressed bytes read
821 # return *$self->{NewStream} ||
822 # *$self->{EndStream} ;
828 return 1 if ! defined *$self->{InfoList};
829 return scalar @{ *$self->{InfoList} } ;
835 # >0 - ok, number of bytes read
841 return G_EOF if *$self->{Closed} ;
842 return G_EOF if !length *$self->{Pending} && *$self->{EndStream} ;
846 #$self->croakError(*$self->{ClassName} .
847 # "::read: buffer parameter is read-only")
848 # if Compress::Raw::Zlib::_readonly_ref($_[0]);
851 $self->croakError(*$self->{ClassName} . "::read: buffer parameter is read-only")
852 if readonly(${ $_[0] });
854 $self->croakError(*$self->{ClassName} . "::read: not a scalar reference $_[0]" )
855 unless ref $_[0] eq 'SCALAR' ;
859 $self->croakError(*$self->{ClassName} . "::read: buffer parameter is read-only")
866 my $offset = $_[2] || 0;
868 # the core read will return 0 if asked for 0 bytes
869 return 0 if defined $length && $length == 0 ;
871 $length = $length || 0;
873 $self->croakError(*$self->{ClassName} . "::read: length parameter is negative")
876 $$buffer = '' unless *$self->{AppendOutput} || $offset ;
878 # Short-circuit if this is a simple read, with no length
879 # or offset specified.
880 unless ( $length || $offset) {
881 if (length *$self->{Pending}) {
882 $$buffer .= *$self->{Pending} ;
883 my $len = length *$self->{Pending};
884 *$self->{Pending} = '' ;
889 $len = $self->_raw_read($buffer)
890 while ! *$self->{EndStream} && $len == 0 ;
895 # Need to jump through more hoops - either length or offset
896 # or both are specified.
897 my $out_buffer = \*$self->{Pending} ;
899 while (! *$self->{EndStream} && length($$out_buffer) < $length)
901 my $buf_len = $self->_raw_read($out_buffer);
906 $length = length $$out_buffer
907 if length($$out_buffer) < $length ;
910 $$buffer .= "\x00" x ($offset - length($$buffer))
911 if $offset > length($$buffer) ;
912 #substr($$buffer, $offset) = substr($$out_buffer, 0, $length, '') ;
913 substr($$buffer, $offset) = substr($$out_buffer, 0, $length) ;
914 substr($$out_buffer, 0, $length) = '' ;
917 #$$buffer .= substr($$out_buffer, 0, $length, '') ;
918 $$buffer .= substr($$out_buffer, 0, $length) ;
919 substr($$out_buffer, 0, $length) = '' ;
930 if ( ! defined $/ ) {
932 1 while $self->read($data) > 0 ;
933 $. = ++ *$self->{LineNo} if defined($data);
940 while ($self->read($paragraph) > 0 ) {
941 if ($paragraph =~ s/^(.*?\n\n+)//s) {
942 *$self->{Pending} = $paragraph ;
944 $. = ++ *$self->{LineNo} ;
948 $. = ++ *$self->{LineNo} if defined($paragraph);
955 my $endl = quotemeta($/); # quote in case $/ contains RE meta chars
956 while ($self->read($line) > 0 ) {
957 if ($line =~ s/^(.*?$endl)//s) {
958 *$self->{Pending} = $line ;
959 $. = ++ *$self->{LineNo} ;
964 $. = ++ *$self->{LineNo} if defined($line);
972 my $current_append = *$self->{AppendOutput} ;
973 *$self->{AppendOutput} = 1;
974 my $lineref = $self->_getline();
975 *$self->{AppendOutput} = $current_append;
982 $self->croakError(*$self->{ClassName} .
983 "::getlines: called in scalar context\n") unless wantarray;
985 push(@lines, $line) while defined($line = $self->getline);
991 goto &getlines if wantarray;
999 return $buf if $self->read($buf, 1);
1006 *$self->{Pending} = "" unless defined *$self->{Pending} ;
1007 *$self->{Pending} = $_[0] . *$self->{Pending} ;
1014 #return \"" if ! defined *$self->{Trailing} ;
1015 #return \*$self->{Trailing} ;
1017 if (defined *$self->{FH} || defined *$self->{InputEvent} ) {
1018 return *$self->{Prime} ;
1021 my $buf = *$self->{Buffer} ;
1022 my $offset = *$self->{BufferOffset} ;
1023 return substr($$buf, $offset, -1) ;
1032 return (*$self->{Closed} ||
1033 (!length *$self->{Pending}
1034 && ( $self->smartEof() || *$self->{EndStream}))) ;
1042 if (*$self->{Plain}) {
1043 $in = *$self->{PlainBytesRead} ;
1046 $in = *$self->{TotalInflatedBytesRead} ;
1049 my $pending = length *$self->{Pending} ;
1051 return 0 if $pending > $in ;
1052 return $in - $pending ;
1057 # todo - what to do if close is called before the end of the gzip file
1058 # do we remember any trailing data?
1061 return 1 if *$self->{Closed} ;
1068 if (defined *$self->{FH}) {
1069 if ((! *$self->{Handle} || *$self->{AutoClose}) && ! *$self->{StdIO}) {
1070 #if ( *$self->{AutoClose}) {
1073 $status = *$self->{FH}->close();
1074 return $self->saveErrorString(0, $!, $!)
1075 if !*$self->{InNew} && $self->saveStatus($!) != 0 ;
1077 delete *$self->{FH} ;
1080 *$self->{Closed} = 1 ;
1094 my $position = shift;
1095 my $whence = shift ;
1097 my $here = $self->tell() ;
1101 if ($whence == SEEK_SET) {
1102 $target = $position ;
1104 elsif ($whence == SEEK_CUR) {
1105 $target = $here + $position ;
1107 elsif ($whence == SEEK_END) {
1108 $target = $position ;
1109 $self->croakError(*$self->{ClassName} . "::seek: SEEK_END not allowed") ;
1112 $self->croakError(*$self->{ClassName} ."::seek: unknown value, $whence, for whence parameter");
1115 # short circuit if seeking to current offset
1116 return 1 if $target == $here ;
1118 # Outlaw any attempt to seek backwards
1119 $self->croakError( *$self->{ClassName} ."::seek: cannot seek backwards")
1120 if $target < $here ;
1122 # Walk the file to the new offset
1123 my $offset = $target - $here ;
1126 $self->read($buffer, $offset) == $offset
1135 return defined *$self->{FH}
1136 ? fileno *$self->{FH}
1143 # my $self = shift ;
1144 # return defined *$self->{FH}
1145 # ? binmode *$self->{FH}
1152 return ! *$self->{Closed} ;
1158 return defined *$self->{FH}
1159 ? *$self->{FH}->autoflush(@_)
1163 sub input_line_number
1166 my $last = *$self->{LineNo};
1167 $. = *$self->{LineNo} = $_[1] if @_ ;
1172 *BINMODE = \&binmode;
1185 #return sub { croak "$name Not Available" ; } ;
1186 return sub { croak "$name Not Available: File opened only for intput" ; } ;
1190 *print = _notAvailable('print');
1191 *PRINT = _notAvailable('print');
1192 *printf = _notAvailable('printf');
1193 *PRINTF = _notAvailable('printf');
1194 *write = _notAvailable('write');
1195 *WRITE = _notAvailable('write');
1198 #*syswrite = \&_notAvailable;
1200 #package IO::_infScan ;
1202 #*_raw_read = \&IO::Uncompress::Base::_raw_read ;
1203 #*smartRead = \&IO::Uncompress::Base::smartRead ;
1204 #*smartWrite = \&IO::Uncompress::Base::smartWrite ;
1205 #*smartSeek = \&IO::Uncompress::Base::smartSeek ;
1207 #sub mkIdentityUncomp
1209 # my $self = shift ;
1210 # my $class = shift ;
1213 # *$self->{Uncomp} = UncompressPlugin::Identity::mkUncompObject($self, $class, $got)
1221 #package UncompressPlugin::Identity;
1226 #our ($VERSION, @ISA, @EXPORT);
1228 #$VERSION = '2.000_05';
1230 #use constant STATUS_OK => 0;
1231 #use constant STATUS_ENDSTREAM => 1;
1232 #use constant STATUS_ERROR => 2;
1236 # my $class = shift ;
1238 # bless { 'CompSize' => 0,
1239 # 'UnCompSize' => 0,
1247 # my $self = shift ;
1248 # my $from = shift ;
1253 # $self->{CompSize} += length $$from ;
1254 # $self->{UnCompSize} = $self->{CompSize} ;
1258 # return STATUS_ENDSTREAM if $eof;
1259 # return STATUS_OK ;
1264 # my $self = shift ;
1265 # return $self->{UnCompSize} ;
1270 # return STATUS_OK ;
1276 # return STATUS_OK ;
1280 package IO::Uncompress::Base ;
1289 IO::Uncompress::Base - Base Class for IO::Uncompress modules
1294 use IO::Uncompress::Base ;
1299 This module is not intended for direct use in application code. Its sole
1300 purpose if to to be sub-classed by IO::Unompress modules.
1307 L<Compress::Zlib>, L<IO::Compress::Gzip>, L<IO::Uncompress::Gunzip>, L<IO::Compress::Deflate>, L<IO::Uncompress::Inflate>, L<IO::Compress::RawDeflate>, L<IO::Uncompress::RawInflate>, L<IO::Compress::Bzip2>, L<IO::Uncompress::Bunzip2>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Uncompress::AnyInflate>, L<IO::Uncompress::AnyUncompress>
1309 L<Compress::Zlib::FAQ|Compress::Zlib::FAQ>
1311 L<File::GlobMapper|File::GlobMapper>, L<Archive::Zip|Archive::Zip>,
1312 L<Archive::Tar|Archive::Tar>,
1313 L<IO::Zlib|IO::Zlib>
1324 The I<IO::Uncompress::Base> module was written by Paul Marquess,
1329 =head1 MODIFICATION HISTORY
1331 See the Changes file.
1333 =head1 COPYRIGHT AND LICENSE
1336 Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
1338 This program is free software; you can redistribute it and/or
1339 modify it under the same terms as Perl itself.