exiftool-vendored.exe 12.82.0 → 12.82.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/bin/exiftool.exe +0 -0
- package/bin/exiftool_files/Licenses_Strawberry_Perl.zip +0 -0
- package/bin/exiftool_files/lib/Archive/Zip/Archive.pm +399 -65
- package/bin/exiftool_files/lib/Archive/Zip/DirectoryMember.pm +1 -1
- package/bin/exiftool_files/lib/Archive/Zip/FileMember.pm +1 -1
- package/bin/exiftool_files/lib/Archive/Zip/Member.pm +499 -195
- package/bin/exiftool_files/lib/Archive/Zip/NewFileMember.pm +1 -1
- package/bin/exiftool_files/lib/Archive/Zip/StringMember.pm +2 -2
- package/bin/exiftool_files/lib/Archive/Zip/ZipFileMember.pm +79 -20
- package/bin/exiftool_files/lib/Archive/Zip.pm +179 -29
- package/bin/exiftool_files/lib/AutoLoader.pm +453 -0
- package/bin/exiftool_files/lib/B/Deparse.pm +209 -137
- package/bin/exiftool_files/lib/B.pm +1 -1
- package/bin/exiftool_files/lib/Benchmark.pm +1123 -0
- package/bin/exiftool_files/lib/Class/Struct.pm +2 -2
- package/bin/exiftool_files/lib/Compress/Raw/Bzip2.pm +14 -9
- package/bin/exiftool_files/lib/Compress/Raw/Lzma.pm +982 -0
- package/bin/exiftool_files/lib/Compress/Raw/Zlib.pm +91 -86
- package/bin/exiftool_files/lib/Compress/Zlib.pm +105 -100
- package/bin/exiftool_files/lib/Config.pm +9 -9
- package/bin/exiftool_files/lib/Config_heavy.pl +36 -33
- package/bin/exiftool_files/lib/CryptX.pm +2 -82
- package/bin/exiftool_files/lib/Data/Dumper.pm +2 -2
- package/bin/exiftool_files/lib/Digest/MD5.pm +12 -9
- package/bin/exiftool_files/lib/Digest/Perl/MD5.pm +1 -191
- package/bin/exiftool_files/lib/Digest/base.pm +26 -20
- package/bin/exiftool_files/lib/DynaLoader.pm +7 -4
- package/bin/exiftool_files/lib/Encode.pm +3 -3
- package/bin/exiftool_files/lib/Errno.pm +13 -13
- package/bin/exiftool_files/lib/Exporter/Heavy.pm +2 -2
- package/bin/exiftool_files/lib/Exporter.pm +1 -1
- package/bin/exiftool_files/lib/ExtUtils/Command/MM.pm +323 -0
- package/bin/exiftool_files/lib/ExtUtils/Command.pm +382 -0
- package/bin/exiftool_files/lib/File/Find.pm +1 -1
- package/bin/exiftool_files/lib/File/Glob.pm +1 -8
- package/bin/exiftool_files/lib/File/GlobMapper.pm +2 -2
- package/bin/exiftool_files/lib/File/HomeDir/Darwin/Carbon.pm +2 -40
- package/bin/exiftool_files/lib/File/HomeDir/Darwin/Cocoa.pm +2 -34
- package/bin/exiftool_files/lib/File/HomeDir/Darwin.pm +2 -28
- package/bin/exiftool_files/lib/File/HomeDir/Driver.pm +2 -35
- package/bin/exiftool_files/lib/File/HomeDir/FreeDesktop.pm +2 -62
- package/bin/exiftool_files/lib/File/HomeDir/MacOS9.pm +2 -53
- package/bin/exiftool_files/lib/File/HomeDir/Test.pm +2 -43
- package/bin/exiftool_files/lib/File/HomeDir/Unix.pm +2 -53
- package/bin/exiftool_files/lib/File/HomeDir/Windows.pm +2 -69
- package/bin/exiftool_files/lib/File/HomeDir.pm +5 -416
- package/bin/exiftool_files/lib/File/Path.pm +3 -3
- package/bin/exiftool_files/lib/File/Spec/Win32.pm +2 -2
- package/bin/exiftool_files/lib/File/Temp.pm +70 -35
- package/bin/exiftool_files/lib/File/Which.pm +1 -240
- package/bin/exiftool_files/lib/File/stat.pm +3 -2
- package/bin/exiftool_files/lib/IO/Compress/Adapter/Bzip2.pm +16 -17
- package/bin/exiftool_files/lib/IO/Compress/Adapter/Deflate.pm +19 -20
- package/bin/exiftool_files/lib/IO/Compress/Base/Common.pm +5 -5
- package/bin/exiftool_files/lib/IO/Compress/Base.pm +35 -26
- package/bin/exiftool_files/lib/IO/Compress/Brotli.pm +159 -0
- package/bin/exiftool_files/lib/IO/Compress/Bzip2.pm +50 -25
- package/bin/exiftool_files/lib/IO/Compress/Gzip/Constants.pm +6 -6
- package/bin/exiftool_files/lib/IO/Compress/Gzip.pm +58 -32
- package/bin/exiftool_files/lib/IO/Compress/RawDeflate.pm +63 -38
- package/bin/exiftool_files/lib/IO/Compress/Zlib/Extra.pm +20 -20
- package/bin/exiftool_files/lib/IO/Dir.pm +1 -1
- package/bin/exiftool_files/lib/IO/File.pm +1 -1
- package/bin/exiftool_files/lib/IO/Handle.pm +1 -21
- package/bin/exiftool_files/lib/IO/Pipe.pm +1 -1
- package/bin/exiftool_files/lib/IO/Seekable.pm +1 -1
- package/bin/exiftool_files/lib/IO/Select.pm +16 -2
- package/bin/exiftool_files/lib/IO/Socket/INET.pm +14 -9
- package/bin/exiftool_files/lib/IO/Socket/UNIX.pm +17 -1
- package/bin/exiftool_files/lib/IO/Socket.pm +474 -126
- package/bin/exiftool_files/lib/IO/String.pm +425 -0
- package/bin/exiftool_files/lib/IO/Uncompress/Adapter/Inflate.pm +13 -14
- package/bin/exiftool_files/lib/IO/Uncompress/Base.pm +142 -132
- package/bin/exiftool_files/lib/IO/Uncompress/Brotli.pm +119 -0
- package/bin/exiftool_files/lib/IO/Uncompress/Gunzip.pm +43 -37
- package/bin/exiftool_files/lib/IO/Uncompress/RawInflate.pm +49 -43
- package/bin/exiftool_files/lib/IO.pm +2 -2
- package/bin/exiftool_files/lib/List/Util.pm +97 -8
- package/bin/exiftool_files/lib/MIME/Base64.pm +5 -5
- package/bin/exiftool_files/lib/MIME/Charset/_Compat.pm +106 -0
- package/bin/exiftool_files/lib/MIME/Charset.pm +1303 -0
- package/bin/exiftool_files/lib/Math/BigFloat.pm +444 -27
- package/bin/exiftool_files/lib/Math/BigInt/Calc.pm +296 -313
- package/bin/exiftool_files/lib/Math/BigInt/FastCalc.pm +1 -1
- package/bin/exiftool_files/lib/Math/BigInt/GMP.pm +2 -115
- package/bin/exiftool_files/lib/Math/BigInt/LTM.pm +2 -24
- package/bin/exiftool_files/lib/Math/BigInt/Lib.pm +61 -32
- package/bin/exiftool_files/lib/Math/BigInt.pm +292 -107
- package/bin/exiftool_files/lib/POSIX.pm +1 -1
- package/bin/exiftool_files/lib/PerlIO/scalar.pm +41 -0
- package/bin/exiftool_files/lib/PerlIO.pm +397 -0
- package/bin/exiftool_files/lib/Portable/CPAN.pm +94 -94
- package/bin/exiftool_files/lib/Portable/Config.pm +94 -94
- package/bin/exiftool_files/lib/Portable/FileSpec.pm +180 -180
- package/bin/exiftool_files/lib/Portable/HomeDir.pm +110 -110
- package/bin/exiftool_files/lib/Portable/LoadYaml.pm +430 -430
- package/bin/exiftool_files/lib/Portable/minicpan.pm +55 -55
- package/bin/exiftool_files/lib/Portable.pm +246 -320
- package/bin/exiftool_files/lib/Scalar/Util.pm +9 -4
- package/bin/exiftool_files/lib/Socket.pm +16 -12
- package/bin/exiftool_files/lib/Storable.pm +1444 -1441
- package/bin/exiftool_files/lib/TAP/Base.pm +133 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Base.pm +467 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Color.pm +116 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Console/ParallelSession.pm +201 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Console/Session.pm +205 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Console.pm +100 -0
- package/bin/exiftool_files/lib/TAP/Formatter/File/Session.pm +95 -0
- package/bin/exiftool_files/lib/TAP/Formatter/File.pm +56 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Session.pm +220 -0
- package/bin/exiftool_files/lib/TAP/Harness/Beyond.pod +426 -0
- package/bin/exiftool_files/lib/TAP/Harness/Env.pm +215 -0
- package/bin/exiftool_files/lib/TAP/Harness.pm +1054 -0
- package/bin/exiftool_files/lib/TAP/Object.pm +155 -0
- package/bin/exiftool_files/lib/TAP/Parser/Aggregator.pm +414 -0
- package/bin/exiftool_files/lib/TAP/Parser/Grammar.pm +584 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator/Array.pm +100 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator/Process.pm +378 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator/Stream.pm +116 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator.pm +162 -0
- package/bin/exiftool_files/lib/TAP/Parser/IteratorFactory.pm +339 -0
- package/bin/exiftool_files/lib/TAP/Parser/Multiplexer.pm +194 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Bailout.pm +62 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Comment.pm +60 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Plan.pm +119 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Pragma.pm +62 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Test.pm +271 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Unknown.pm +48 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Version.pm +62 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/YAML.pm +61 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result.pm +297 -0
- package/bin/exiftool_files/lib/TAP/Parser/ResultFactory.pm +183 -0
- package/bin/exiftool_files/lib/TAP/Parser/Scheduler/Job.pm +127 -0
- package/bin/exiftool_files/lib/TAP/Parser/Scheduler/Spinner.pm +61 -0
- package/bin/exiftool_files/lib/TAP/Parser/Scheduler.pm +448 -0
- package/bin/exiftool_files/lib/TAP/Parser/Source.pm +381 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Executable.pm +184 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/File.pm +136 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Handle.pm +124 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Perl.pm +370 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/RawTAP.pm +130 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler.pm +191 -0
- package/bin/exiftool_files/lib/TAP/Parser/YAMLish/Reader.pm +332 -0
- package/bin/exiftool_files/lib/TAP/Parser/YAMLish/Writer.pm +254 -0
- package/bin/exiftool_files/lib/TAP/Parser.pm +1931 -0
- package/bin/exiftool_files/lib/Test/Builder/Formatter.pm +107 -0
- package/bin/exiftool_files/lib/Test/Builder/IO/Scalar.pm +659 -0
- package/bin/exiftool_files/lib/Test/Builder/Module.pm +182 -0
- package/bin/exiftool_files/lib/Test/Builder/Tester/Color.pm +51 -0
- package/bin/exiftool_files/lib/Test/Builder/Tester.pm +675 -0
- package/bin/exiftool_files/lib/Test/Builder/TodoDiag.pm +68 -0
- package/bin/exiftool_files/lib/Test/Builder.pm +2653 -0
- package/bin/exiftool_files/lib/Test/Harness.pm +618 -0
- package/bin/exiftool_files/lib/Test/More.pm +1997 -0
- package/bin/exiftool_files/lib/Test/Simple.pm +220 -0
- package/bin/exiftool_files/lib/Test/Tester/Capture.pm +241 -0
- package/bin/exiftool_files/lib/Test/Tester/CaptureRunner.pm +79 -0
- package/bin/exiftool_files/lib/Test/Tester/Delegate.pm +45 -0
- package/bin/exiftool_files/lib/Test/Tester.pm +695 -0
- package/bin/exiftool_files/lib/Test/Tutorial.pod +618 -0
- package/bin/exiftool_files/lib/Test/use/ok.pm +64 -0
- package/bin/exiftool_files/lib/Text/ParseWords.pm +303 -0
- package/bin/exiftool_files/lib/Tie/StdHandle.pm +2 -2
- package/bin/exiftool_files/lib/Time/HiRes.pm +73 -68
- package/bin/exiftool_files/lib/Time/Local.pm +82 -35
- package/bin/exiftool_files/lib/Time/Piece.pm +19 -4
- package/bin/exiftool_files/lib/Time/Seconds.pm +1 -1
- package/bin/exiftool_files/lib/UNIVERSAL.pm +203 -0
- package/bin/exiftool_files/lib/Unicode/GCString.pm +60 -0
- package/bin/exiftool_files/lib/Unicode/LineBreak/Constants.pm +68 -0
- package/bin/exiftool_files/lib/Unicode/LineBreak.pm +248 -0
- package/bin/exiftool_files/lib/Win32/API/Struct.pm +1 -177
- package/bin/exiftool_files/lib/Win32/API/Type.pm +1 -100
- package/bin/exiftool_files/lib/Win32/API.pm +1 -830
- package/bin/exiftool_files/lib/Win32/FindFile.pm +2 -123
- package/bin/exiftool_files/lib/Win32.pm +213 -89
- package/bin/exiftool_files/lib/Win32API/File.pm +1 -1
- package/bin/exiftool_files/lib/auto/B/B.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Bzip2/Bzip2.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Lzma/Lzma.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Lzma/autosplit.ix +3 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Zlib/Zlib.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/CryptX/CryptX.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Cwd/Cwd.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Data/Dumper/Dumper.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Digest/MD5/MD5.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Digest/SHA/SHA.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Encode/Encode.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Fcntl/Fcntl.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/File/Glob/Glob.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/IO/Compress/Brotli/Brotli.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/IO/IO.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/List/Util/Util.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/MIME/Base64/Base64.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Math/BigInt/FastCalc/FastCalc.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Math/BigInt/GMP/GMP.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/POSIX/POSIX.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/PerlIO/scalar/scalar.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Socket/Socket.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Storable/Storable.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Time/HiRes/HiRes.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Time/Piece/Piece.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Unicode/LineBreak/LineBreak.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32/API/API.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32/FindFile/FindFile.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32/Win32.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32API/File/File.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/mro/mro.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/re/re.xs.dll +0 -0
- package/bin/exiftool_files/lib/feature.pm +49 -17
- package/bin/exiftool_files/lib/mro.pm +4 -20
- package/bin/exiftool_files/lib/overload.pm +15 -15
- package/bin/exiftool_files/lib/parent.pm +10 -2
- package/bin/exiftool_files/lib/re.pm +91 -33
- package/bin/exiftool_files/lib/warnings.pm +17 -6
- package/bin/exiftool_files/libgcc_s_seh-1.dll +0 -0
- package/bin/exiftool_files/liblzma-5__.dll +0 -0
- package/bin/exiftool_files/libstdc++-6.dll +0 -0
- package/bin/exiftool_files/libwinpthread-1.dll +0 -0
- package/bin/exiftool_files/perl.exe +0 -0
- package/bin/exiftool_files/perl532.dll +0 -0
- package/package.json +5 -3
- package/bin/exiftool_files/libgcc_s_dw2-1.dll +0 -0
- package/bin/exiftool_files/perl530.dll +0 -0
|
@@ -9,12 +9,12 @@ our (@ISA, $VERSION, @EXPORT_OK, %EXPORT_TAGS);
|
|
|
9
9
|
@ISA = qw(IO::File Exporter);
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
$VERSION = '2.
|
|
12
|
+
$VERSION = '2.100';
|
|
13
13
|
|
|
14
14
|
use constant G_EOF => 0 ;
|
|
15
15
|
use constant G_ERR => -1 ;
|
|
16
16
|
|
|
17
|
-
use IO::Compress::Base::Common 2.
|
|
17
|
+
use IO::Compress::Base::Common 2.100 ;
|
|
18
18
|
|
|
19
19
|
use IO::File ;
|
|
20
20
|
use Symbol;
|
|
@@ -58,7 +58,7 @@ sub smartRead
|
|
|
58
58
|
|
|
59
59
|
if (defined *$self->{FH}) {
|
|
60
60
|
if ($offset) {
|
|
61
|
-
# Not using this
|
|
61
|
+
# Not using this
|
|
62
62
|
#
|
|
63
63
|
# *$self->{FH}->read($$out, $get_size, $offset);
|
|
64
64
|
#
|
|
@@ -75,7 +75,7 @@ sub smartRead
|
|
|
75
75
|
elsif (defined *$self->{InputEvent}) {
|
|
76
76
|
my $got = 1 ;
|
|
77
77
|
while (length $$out < $size) {
|
|
78
|
-
last
|
|
78
|
+
last
|
|
79
79
|
if ($got = *$self->{InputEvent}->($$out, $get_size)) <= 0;
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -93,13 +93,13 @@ sub smartRead
|
|
|
93
93
|
substr($$out, $offset) = substr($$buf, *$self->{BufferOffset}, $get_size);
|
|
94
94
|
if (*$self->{ConsumeInput})
|
|
95
95
|
{ substr($$buf, 0, $get_size) = '' }
|
|
96
|
-
else
|
|
96
|
+
else
|
|
97
97
|
{ *$self->{BufferOffset} += length($$out) - $offset }
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
*$self->{InputLengthRemaining} -= length($$out) #- $offset
|
|
100
|
+
*$self->{InputLengthRemaining} -= length($$out) #- $offset
|
|
101
101
|
if defined *$self->{InputLength};
|
|
102
|
-
|
|
102
|
+
|
|
103
103
|
if (! defined $status) {
|
|
104
104
|
$self->saveStatus($!) ;
|
|
105
105
|
return STATUS_ERROR;
|
|
@@ -169,7 +169,7 @@ sub smartTell
|
|
|
169
169
|
|
|
170
170
|
if (defined *$self->{FH})
|
|
171
171
|
{ return *$self->{FH}->tell() }
|
|
172
|
-
else
|
|
172
|
+
else
|
|
173
173
|
{ return *$self->{BufferOffset} }
|
|
174
174
|
}
|
|
175
175
|
|
|
@@ -179,7 +179,7 @@ sub smartWrite
|
|
|
179
179
|
my $out_data = shift ;
|
|
180
180
|
|
|
181
181
|
if (defined *$self->{FH}) {
|
|
182
|
-
# flush needed for 5.8.0
|
|
182
|
+
# flush needed for 5.8.0
|
|
183
183
|
defined *$self->{FH}->write($out_data, length $out_data) &&
|
|
184
184
|
defined *$self->{FH}->flush() ;
|
|
185
185
|
}
|
|
@@ -199,7 +199,7 @@ sub smartReadExact
|
|
|
199
199
|
sub smartEof
|
|
200
200
|
{
|
|
201
201
|
my ($self) = $_[0];
|
|
202
|
-
local $.;
|
|
202
|
+
local $.;
|
|
203
203
|
|
|
204
204
|
return 0 if length *$self->{Prime} || *$self->{PushMode};
|
|
205
205
|
|
|
@@ -207,15 +207,15 @@ sub smartEof
|
|
|
207
207
|
{
|
|
208
208
|
# Could use
|
|
209
209
|
#
|
|
210
|
-
# *$self->{FH}->eof()
|
|
210
|
+
# *$self->{FH}->eof()
|
|
211
211
|
#
|
|
212
212
|
# here, but this can cause trouble if
|
|
213
213
|
# the filehandle is itself a tied handle, but it uses sysread.
|
|
214
|
-
# Then we get into mixing buffered & non-buffered IO,
|
|
214
|
+
# Then we get into mixing buffered & non-buffered IO,
|
|
215
215
|
# which will cause trouble
|
|
216
216
|
|
|
217
217
|
my $info = $self->getErrInfo();
|
|
218
|
-
|
|
218
|
+
|
|
219
219
|
my $buffer = '';
|
|
220
220
|
my $status = $self->smartRead(\$buffer, 1);
|
|
221
221
|
$self->pushBack($buffer) if length $buffer;
|
|
@@ -225,7 +225,7 @@ sub smartEof
|
|
|
225
225
|
}
|
|
226
226
|
elsif (defined *$self->{InputEvent})
|
|
227
227
|
{ *$self->{EventEof} }
|
|
228
|
-
else
|
|
228
|
+
else
|
|
229
229
|
{ *$self->{BufferOffset} >= length(${ *$self->{Buffer} }) }
|
|
230
230
|
}
|
|
231
231
|
|
|
@@ -347,7 +347,7 @@ sub checkParams
|
|
|
347
347
|
my $class = shift ;
|
|
348
348
|
|
|
349
349
|
my $got = shift || IO::Compress::Base::Parameters::new();
|
|
350
|
-
|
|
350
|
+
|
|
351
351
|
my $Valid = {
|
|
352
352
|
'blocksize' => [IO::Compress::Base::Common::Parse_unsigned, 16 * 1024],
|
|
353
353
|
'autoclose' => [IO::Compress::Base::Common::Parse_boolean, 0],
|
|
@@ -362,7 +362,7 @@ sub checkParams
|
|
|
362
362
|
#'decode' => [IO::Compress::Base::Common::Parse_any, undef],
|
|
363
363
|
|
|
364
364
|
#'consumeinput' => [IO::Compress::Base::Common::Parse_boolean, 0],
|
|
365
|
-
|
|
365
|
+
|
|
366
366
|
$self->getExtraParams(),
|
|
367
367
|
|
|
368
368
|
#'Todo - Revert to ordinary file on end Z_STREAM_END'=> 0,
|
|
@@ -371,11 +371,11 @@ sub checkParams
|
|
|
371
371
|
|
|
372
372
|
$Valid->{trailingdata} = [IO::Compress::Base::Common::Parse_writable_scalar, undef]
|
|
373
373
|
if *$self->{OneShot} ;
|
|
374
|
-
|
|
375
|
-
$got->parse($Valid, @_ )
|
|
374
|
+
|
|
375
|
+
$got->parse($Valid, @_ )
|
|
376
376
|
or $self->croakError("${class}: " . $got->getError()) ;
|
|
377
377
|
|
|
378
|
-
$self->postCheckParams($got)
|
|
378
|
+
$self->postCheckParams($got)
|
|
379
379
|
or $self->croakError("${class}: " . $self->error()) ;
|
|
380
380
|
|
|
381
381
|
return $got;
|
|
@@ -403,7 +403,7 @@ sub _create
|
|
|
403
403
|
|
|
404
404
|
my $inType = whatIsInput($inValue, 1);
|
|
405
405
|
|
|
406
|
-
$obj->ckInputParam($class, $inValue, 1)
|
|
406
|
+
$obj->ckInputParam($class, $inValue, 1)
|
|
407
407
|
or return undef ;
|
|
408
408
|
|
|
409
409
|
*$obj->{InNew} = 1;
|
|
@@ -412,8 +412,8 @@ sub _create
|
|
|
412
412
|
or $obj->croakError("${class}: " . *$obj->{Error});
|
|
413
413
|
|
|
414
414
|
if ($inType eq 'buffer' || $inType eq 'code') {
|
|
415
|
-
*$obj->{Buffer} = $inValue ;
|
|
416
|
-
*$obj->{InputEvent} = $inValue
|
|
415
|
+
*$obj->{Buffer} = $inValue ;
|
|
416
|
+
*$obj->{InputEvent} = $inValue
|
|
417
417
|
if $inType eq 'code' ;
|
|
418
418
|
}
|
|
419
419
|
else {
|
|
@@ -422,18 +422,18 @@ sub _create
|
|
|
422
422
|
*$obj->{Handle} = 1 ;
|
|
423
423
|
|
|
424
424
|
# Need to rewind for Scan
|
|
425
|
-
*$obj->{FH}->seek(0, SEEK_SET)
|
|
425
|
+
*$obj->{FH}->seek(0, SEEK_SET)
|
|
426
426
|
if $got->getValue('scan');
|
|
427
|
-
}
|
|
428
|
-
else {
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
429
|
no warnings ;
|
|
430
430
|
my $mode = '<';
|
|
431
431
|
$mode = '+<' if $got->getValue('scan');
|
|
432
432
|
*$obj->{StdIO} = ($inValue eq '-');
|
|
433
|
-
*$obj->{FH} =
|
|
433
|
+
*$obj->{FH} = IO::File->new( "$mode $inValue" )
|
|
434
434
|
or return $obj->saveErrorString(undef, "cannot open file '$inValue': $!", $!) ;
|
|
435
435
|
}
|
|
436
|
-
|
|
436
|
+
|
|
437
437
|
*$obj->{LineNo} = $. = 0;
|
|
438
438
|
setBinModeInput(*$obj->{FH}) ;
|
|
439
439
|
|
|
@@ -441,7 +441,7 @@ sub _create
|
|
|
441
441
|
*$obj->{Buffer} = \$buff ;
|
|
442
442
|
}
|
|
443
443
|
|
|
444
|
-
# if ($got->getValue('decode')) {
|
|
444
|
+
# if ($got->getValue('decode')) {
|
|
445
445
|
# my $want_encoding = $got->getValue('decode');
|
|
446
446
|
# *$obj->{Encoding} = IO::Compress::Base::Common::getEncoding($obj, $class, $want_encoding);
|
|
447
447
|
# }
|
|
@@ -449,7 +449,7 @@ sub _create
|
|
|
449
449
|
# *$obj->{Encoding} = undef;
|
|
450
450
|
# }
|
|
451
451
|
|
|
452
|
-
*$obj->{InputLength} = $got->parsed('inputlength')
|
|
452
|
+
*$obj->{InputLength} = $got->parsed('inputlength')
|
|
453
453
|
? $got->getValue('inputlength')
|
|
454
454
|
: undef ;
|
|
455
455
|
*$obj->{InputLengthRemaining} = $got->getValue('inputlength');
|
|
@@ -465,7 +465,7 @@ sub _create
|
|
|
465
465
|
|
|
466
466
|
# TODO - move these two into RawDeflate
|
|
467
467
|
*$obj->{Scan} = $got->getValue('scan');
|
|
468
|
-
*$obj->{ParseExtra} = $got->getValue('parseextra')
|
|
468
|
+
*$obj->{ParseExtra} = $got->getValue('parseextra')
|
|
469
469
|
|| $got->getValue('strict') ;
|
|
470
470
|
*$obj->{Type} = '';
|
|
471
471
|
*$obj->{Prime} = $got->getValue('prime') || '' ;
|
|
@@ -473,8 +473,8 @@ sub _create
|
|
|
473
473
|
*$obj->{Plain} = 0;
|
|
474
474
|
*$obj->{PlainBytesRead} = 0;
|
|
475
475
|
*$obj->{InflatedBytesRead} = 0;
|
|
476
|
-
*$obj->{UnCompSize} = new
|
|
477
|
-
*$obj->{CompSize} = new
|
|
476
|
+
*$obj->{UnCompSize} = U64->new;
|
|
477
|
+
*$obj->{CompSize} = U64->new;
|
|
478
478
|
*$obj->{TotalInflatedBytesRead} = 0;
|
|
479
479
|
*$obj->{NewStream} = 0 ;
|
|
480
480
|
*$obj->{EventEof} = 0 ;
|
|
@@ -494,19 +494,19 @@ sub _create
|
|
|
494
494
|
|
|
495
495
|
*$obj->{InNew} = 0;
|
|
496
496
|
*$obj->{Closed} = 0;
|
|
497
|
-
|
|
498
|
-
return $obj
|
|
497
|
+
|
|
498
|
+
return $obj
|
|
499
499
|
if *$obj->{Pause} ;
|
|
500
500
|
|
|
501
501
|
if ($status) {
|
|
502
502
|
# Need to try uncompressing to catch the case
|
|
503
503
|
# where the compressed file uncompresses to an
|
|
504
504
|
# empty string - so eof is set immediately.
|
|
505
|
-
|
|
505
|
+
|
|
506
506
|
my $out_buffer = '';
|
|
507
507
|
|
|
508
508
|
$status = $obj->read(\$out_buffer);
|
|
509
|
-
|
|
509
|
+
|
|
510
510
|
if ($status < 0) {
|
|
511
511
|
*$obj->{ReadStatus} = [ $status, $obj->error(), $obj->errorNo() ];
|
|
512
512
|
}
|
|
@@ -515,7 +515,7 @@ sub _create
|
|
|
515
515
|
if length $out_buffer;
|
|
516
516
|
}
|
|
517
517
|
else {
|
|
518
|
-
return undef
|
|
518
|
+
return undef
|
|
519
519
|
unless *$obj->{Transparent};
|
|
520
520
|
|
|
521
521
|
$obj->clearError();
|
|
@@ -549,7 +549,7 @@ sub ckInputParam
|
|
|
549
549
|
#
|
|
550
550
|
# if ($_[0] ne '-' && ! -e $_[0] )
|
|
551
551
|
# {
|
|
552
|
-
# return $self->saveErrorString(1,
|
|
552
|
+
# return $self->saveErrorString(1,
|
|
553
553
|
# "input file '$_[0]' does not exist", STATUS_ERROR);
|
|
554
554
|
# }
|
|
555
555
|
# }
|
|
@@ -573,13 +573,13 @@ sub _inf
|
|
|
573
573
|
my $output = shift ;
|
|
574
574
|
|
|
575
575
|
|
|
576
|
-
my $x =
|
|
576
|
+
my $x = IO::Compress::Base::Validator->new($class, *$obj->{Error}, $name, $input, $output)
|
|
577
577
|
or return undef ;
|
|
578
|
-
|
|
578
|
+
|
|
579
579
|
push @_, $output if $haveOut && $x->{Hash};
|
|
580
580
|
|
|
581
581
|
*$obj->{OneShot} = 1 ;
|
|
582
|
-
|
|
582
|
+
|
|
583
583
|
my $got = $obj->checkParams($name, undef, @_)
|
|
584
584
|
or return undef ;
|
|
585
585
|
|
|
@@ -589,25 +589,25 @@ sub _inf
|
|
|
589
589
|
# warn "TD $value ";
|
|
590
590
|
# #$value = $$value;
|
|
591
591
|
## warn "TD $value $$value ";
|
|
592
|
-
#
|
|
592
|
+
#
|
|
593
593
|
# return retErr($obj, "Parameter 'TrailingData' not writable")
|
|
594
|
-
# if readonly $$value ;
|
|
594
|
+
# if readonly $$value ;
|
|
595
595
|
#
|
|
596
|
-
# if (ref $$value)
|
|
596
|
+
# if (ref $$value)
|
|
597
597
|
# {
|
|
598
598
|
# return retErr($obj,"Parameter 'TrailingData' not a scalar reference")
|
|
599
599
|
# if ref $$value ne 'SCALAR' ;
|
|
600
|
-
#
|
|
600
|
+
#
|
|
601
601
|
# *$obj->{TrailingData} = $$value ;
|
|
602
602
|
# }
|
|
603
|
-
# else
|
|
603
|
+
# else
|
|
604
604
|
# {
|
|
605
605
|
# return retErr($obj,"Parameter 'TrailingData' not a scalar")
|
|
606
|
-
# if ref $value ne 'SCALAR' ;
|
|
606
|
+
# if ref $value ne 'SCALAR' ;
|
|
607
607
|
#
|
|
608
608
|
# *$obj->{TrailingData} = $value ;
|
|
609
609
|
# }
|
|
610
|
-
|
|
610
|
+
|
|
611
611
|
*$obj->{TrailingData} = $got->getValue('trailingdata');
|
|
612
612
|
}
|
|
613
613
|
|
|
@@ -620,7 +620,7 @@ sub _inf
|
|
|
620
620
|
# {
|
|
621
621
|
# while (my($k, $v) = each %$input)
|
|
622
622
|
# {
|
|
623
|
-
# $v = \$input->{$k}
|
|
623
|
+
# $v = \$input->{$k}
|
|
624
624
|
# unless defined $v ;
|
|
625
625
|
#
|
|
626
626
|
# $obj->_singleTarget($x, $k, $v, @_)
|
|
@@ -629,7 +629,7 @@ sub _inf
|
|
|
629
629
|
#
|
|
630
630
|
# return keys %$input ;
|
|
631
631
|
# }
|
|
632
|
-
|
|
632
|
+
|
|
633
633
|
if ($x->{GlobMap})
|
|
634
634
|
{
|
|
635
635
|
$x->{oneInput} = 1 ;
|
|
@@ -645,11 +645,11 @@ sub _inf
|
|
|
645
645
|
|
|
646
646
|
if (! $x->{oneOutput} )
|
|
647
647
|
{
|
|
648
|
-
my $inFile = ($x->{inType} eq 'filenames'
|
|
648
|
+
my $inFile = ($x->{inType} eq 'filenames'
|
|
649
649
|
|| $x->{inType} eq 'filename');
|
|
650
650
|
|
|
651
651
|
$x->{inType} = $inFile ? 'filename' : 'buffer';
|
|
652
|
-
|
|
652
|
+
|
|
653
653
|
foreach my $in ($x->{oneInput} ? $input : @$input)
|
|
654
654
|
{
|
|
655
655
|
my $out ;
|
|
@@ -684,7 +684,7 @@ sub _singleTarget
|
|
|
684
684
|
my $x = shift ;
|
|
685
685
|
my $input = shift;
|
|
686
686
|
my $output = shift;
|
|
687
|
-
|
|
687
|
+
|
|
688
688
|
my $buff = '';
|
|
689
689
|
$x->{buff} = \$buff ;
|
|
690
690
|
|
|
@@ -693,7 +693,7 @@ sub _singleTarget
|
|
|
693
693
|
my $mode = '>' ;
|
|
694
694
|
$mode = '>>'
|
|
695
695
|
if $x->{Got}->getValue('append') ;
|
|
696
|
-
$x->{fh} =
|
|
696
|
+
$x->{fh} = IO::File->new( "$mode $output" )
|
|
697
697
|
or return retErr($x, "cannot open file '$output': $!") ;
|
|
698
698
|
binmode $x->{fh} ;
|
|
699
699
|
|
|
@@ -708,10 +708,10 @@ sub _singleTarget
|
|
|
708
708
|
}
|
|
709
709
|
}
|
|
710
710
|
|
|
711
|
-
|
|
711
|
+
|
|
712
712
|
elsif ($x->{outType} eq 'buffer' )
|
|
713
713
|
{
|
|
714
|
-
$$output = ''
|
|
714
|
+
$$output = ''
|
|
715
715
|
unless $x->{Got}->getValue('append');
|
|
716
716
|
$x->{buff} = $output ;
|
|
717
717
|
}
|
|
@@ -719,22 +719,22 @@ sub _singleTarget
|
|
|
719
719
|
if ($x->{oneInput})
|
|
720
720
|
{
|
|
721
721
|
defined $self->_rd2($x, $input, $output)
|
|
722
|
-
or return undef;
|
|
722
|
+
or return undef;
|
|
723
723
|
}
|
|
724
724
|
else
|
|
725
725
|
{
|
|
726
726
|
for my $element ( ($x->{inType} eq 'hash') ? keys %$input : @$input)
|
|
727
727
|
{
|
|
728
|
-
defined $self->_rd2($x, $element, $output)
|
|
728
|
+
defined $self->_rd2($x, $element, $output)
|
|
729
729
|
or return undef ;
|
|
730
730
|
}
|
|
731
731
|
}
|
|
732
732
|
|
|
733
733
|
|
|
734
|
-
if ( ($x->{outType} eq 'filename' && $output ne '-') ||
|
|
734
|
+
if ( ($x->{outType} eq 'filename' && $output ne '-') ||
|
|
735
735
|
($x->{outType} eq 'handle' && $x->{Got}->getValue('autoclose'))) {
|
|
736
|
-
$x->{fh}->close()
|
|
737
|
-
or return retErr($x, $!);
|
|
736
|
+
$x->{fh}->close()
|
|
737
|
+
or return retErr($x, $!);
|
|
738
738
|
delete $x->{fh};
|
|
739
739
|
}
|
|
740
740
|
|
|
@@ -747,15 +747,15 @@ sub _rd2
|
|
|
747
747
|
my $x = shift ;
|
|
748
748
|
my $input = shift;
|
|
749
749
|
my $output = shift;
|
|
750
|
-
|
|
750
|
+
|
|
751
751
|
my $z = IO::Compress::Base::Common::createSelfTiedObject($x->{Class}, *$self->{Error});
|
|
752
|
-
|
|
752
|
+
|
|
753
753
|
$z->_create($x->{Got}, 1, $input, @_)
|
|
754
754
|
or return undef ;
|
|
755
755
|
|
|
756
756
|
my $status ;
|
|
757
757
|
my $fh = $x->{fh};
|
|
758
|
-
|
|
758
|
+
|
|
759
759
|
while (1) {
|
|
760
760
|
|
|
761
761
|
while (($status = $z->read($x->{buff})) > 0) {
|
|
@@ -770,9 +770,9 @@ sub _rd2
|
|
|
770
770
|
if (! $x->{oneOutput} ) {
|
|
771
771
|
my $ot = $x->{outType} ;
|
|
772
772
|
|
|
773
|
-
if ($ot eq 'array')
|
|
773
|
+
if ($ot eq 'array')
|
|
774
774
|
{ push @$output, $x->{buff} }
|
|
775
|
-
elsif ($ot eq 'hash')
|
|
775
|
+
elsif ($ot eq 'hash')
|
|
776
776
|
{ $output->{$input} = $x->{buff} }
|
|
777
777
|
|
|
778
778
|
my $buff = '';
|
|
@@ -781,12 +781,12 @@ sub _rd2
|
|
|
781
781
|
|
|
782
782
|
last if $status < 0 || $z->smartEof();
|
|
783
783
|
|
|
784
|
-
last
|
|
784
|
+
last
|
|
785
785
|
unless *$self->{MultiStream};
|
|
786
786
|
|
|
787
787
|
$status = $z->nextStream();
|
|
788
788
|
|
|
789
|
-
last
|
|
789
|
+
last
|
|
790
790
|
unless $status == 1 ;
|
|
791
791
|
}
|
|
792
792
|
|
|
@@ -796,7 +796,7 @@ sub _rd2
|
|
|
796
796
|
${ *$self->{TrailingData} } = $z->trailingData()
|
|
797
797
|
if defined *$self->{TrailingData} ;
|
|
798
798
|
|
|
799
|
-
$z->close()
|
|
799
|
+
$z->close()
|
|
800
800
|
or return undef ;
|
|
801
801
|
|
|
802
802
|
return 1 ;
|
|
@@ -808,7 +808,7 @@ sub TIEHANDLE
|
|
|
808
808
|
die "OOPS\n" ;
|
|
809
809
|
|
|
810
810
|
}
|
|
811
|
-
|
|
811
|
+
|
|
812
812
|
sub UNTIE
|
|
813
813
|
{
|
|
814
814
|
my $self = shift ;
|
|
@@ -836,7 +836,7 @@ sub readBlock
|
|
|
836
836
|
$size = List::Util::min($size, *$self->{CompressedInputLengthRemaining} );
|
|
837
837
|
*$self->{CompressedInputLengthRemaining} -= $size ;
|
|
838
838
|
}
|
|
839
|
-
|
|
839
|
+
|
|
840
840
|
my $status = $self->smartRead($buff, $size) ;
|
|
841
841
|
return $self->saveErrorString(STATUS_ERROR, "Error Reading Data: $!", $!)
|
|
842
842
|
if $status == STATUS_ERROR ;
|
|
@@ -861,7 +861,7 @@ sub _raw_read
|
|
|
861
861
|
# >0 - ok, number of bytes read
|
|
862
862
|
# =0 - ok, eof
|
|
863
863
|
# <0 - not ok
|
|
864
|
-
|
|
864
|
+
|
|
865
865
|
my $self = shift ;
|
|
866
866
|
|
|
867
867
|
return G_EOF if *$self->{Closed} ;
|
|
@@ -873,8 +873,8 @@ sub _raw_read
|
|
|
873
873
|
if (*$self->{Plain}) {
|
|
874
874
|
my $tmp_buff ;
|
|
875
875
|
my $len = $self->smartRead(\$tmp_buff, *$self->{BlockSize}) ;
|
|
876
|
-
|
|
877
|
-
return $self->saveErrorString(G_ERR, "Error reading data: $!", $!)
|
|
876
|
+
|
|
877
|
+
return $self->saveErrorString(G_ERR, "Error reading data: $!", $!)
|
|
878
878
|
if $len == STATUS_ERROR ;
|
|
879
879
|
|
|
880
880
|
if ($len == 0 ) {
|
|
@@ -898,13 +898,13 @@ sub _raw_read
|
|
|
898
898
|
$$buffer .= *$self->{Pending} ;
|
|
899
899
|
my $len = length *$self->{Pending} ;
|
|
900
900
|
*$self->{Pending} = '';
|
|
901
|
-
return $len;
|
|
901
|
+
return $len;
|
|
902
902
|
}
|
|
903
903
|
|
|
904
904
|
my $temp_buf = '';
|
|
905
905
|
my $outSize = 0;
|
|
906
906
|
my $status = $self->readBlock(\$temp_buf, *$self->{BlockSize}, $outSize) ;
|
|
907
|
-
|
|
907
|
+
|
|
908
908
|
return G_ERR
|
|
909
909
|
if $status == STATUS_ERROR ;
|
|
910
910
|
|
|
@@ -915,18 +915,18 @@ sub _raw_read
|
|
|
915
915
|
$status = *$self->{Uncomp}->uncompr(\$temp_buf, $buffer,
|
|
916
916
|
defined *$self->{CompressedInputLengthDone} ||
|
|
917
917
|
$self->smartEof(), $outSize);
|
|
918
|
-
|
|
918
|
+
|
|
919
919
|
# Remember the input buffer if it wasn't consumed completely
|
|
920
920
|
$self->pushBack($temp_buf) if *$self->{Uncomp}{ConsumesInput};
|
|
921
921
|
|
|
922
922
|
return $self->saveErrorString(G_ERR, *$self->{Uncomp}{Error}, *$self->{Uncomp}{ErrorNo})
|
|
923
|
-
if $self->saveStatus($status) == STATUS_ERROR;
|
|
923
|
+
if $self->saveStatus($status) == STATUS_ERROR;
|
|
924
924
|
|
|
925
925
|
$self->postBlockChk($buffer, $before_len) == STATUS_OK
|
|
926
926
|
or return G_ERR;
|
|
927
927
|
|
|
928
928
|
$buf_len = defined $$buffer ? length($$buffer) - $before_len : 0;
|
|
929
|
-
|
|
929
|
+
|
|
930
930
|
*$self->{CompSize}->add($beforeC_len - length $temp_buf) ;
|
|
931
931
|
|
|
932
932
|
*$self->{InflatedBytesRead} += $buf_len ;
|
|
@@ -960,7 +960,7 @@ sub _raw_read
|
|
|
960
960
|
or return G_ERR;
|
|
961
961
|
}
|
|
962
962
|
else {
|
|
963
|
-
return $self->TrailerError("trailer truncated. Expected " .
|
|
963
|
+
return $self->TrailerError("trailer truncated. Expected " .
|
|
964
964
|
"$trailer_size bytes, got $got")
|
|
965
965
|
if *$self->{Strict};
|
|
966
966
|
$self->pushBack($trailer) ;
|
|
@@ -978,7 +978,7 @@ sub _raw_read
|
|
|
978
978
|
}
|
|
979
979
|
|
|
980
980
|
}
|
|
981
|
-
|
|
981
|
+
|
|
982
982
|
|
|
983
983
|
# return the number of uncompressed bytes read
|
|
984
984
|
return $buf_len ;
|
|
@@ -1010,6 +1010,9 @@ sub nextStream
|
|
|
1010
1010
|
$status == 1
|
|
1011
1011
|
or return $status ;
|
|
1012
1012
|
|
|
1013
|
+
*$self->{Pending} = ''
|
|
1014
|
+
if $self !~ /IO::Uncompress::RawInflate/ && ! *$self->{MultiStream};
|
|
1015
|
+
|
|
1013
1016
|
*$self->{TotalInflatedBytesRead} = 0 ;
|
|
1014
1017
|
*$self->{LineNo} = $. = 0;
|
|
1015
1018
|
|
|
@@ -1026,7 +1029,7 @@ sub gotoNextStream
|
|
|
1026
1029
|
|
|
1027
1030
|
# TODO - make this more efficient if know the offset for the end of
|
|
1028
1031
|
# the stream and seekable
|
|
1029
|
-
$status = $self->read($buffer)
|
|
1032
|
+
$status = $self->read($buffer)
|
|
1030
1033
|
while $status > 0 ;
|
|
1031
1034
|
|
|
1032
1035
|
return $status
|
|
@@ -1071,7 +1074,7 @@ sub gotoNextStream
|
|
|
1071
1074
|
|
|
1072
1075
|
push @{ *$self->{InfoList} }, *$self->{Info} ;
|
|
1073
1076
|
|
|
1074
|
-
return 1;
|
|
1077
|
+
return 1;
|
|
1075
1078
|
}
|
|
1076
1079
|
|
|
1077
1080
|
sub streamCount
|
|
@@ -1087,7 +1090,7 @@ sub read
|
|
|
1087
1090
|
# >0 - ok, number of bytes read
|
|
1088
1091
|
# =0 - ok, eof
|
|
1089
1092
|
# <0 - not ok
|
|
1090
|
-
|
|
1093
|
+
|
|
1091
1094
|
my $self = shift ;
|
|
1092
1095
|
|
|
1093
1096
|
if (defined *$self->{ReadStatus} ) {
|
|
@@ -1120,7 +1123,7 @@ sub read
|
|
|
1120
1123
|
my $offset = $_[2] || 0;
|
|
1121
1124
|
|
|
1122
1125
|
if (! *$self->{AppendOutput}) {
|
|
1123
|
-
if (! $offset) {
|
|
1126
|
+
if (! $offset) {
|
|
1124
1127
|
|
|
1125
1128
|
$$buffer = '' ;
|
|
1126
1129
|
}
|
|
@@ -1158,13 +1161,13 @@ sub read
|
|
|
1158
1161
|
}
|
|
1159
1162
|
else {
|
|
1160
1163
|
my $len = 0;
|
|
1161
|
-
$len = $self->_raw_read($buffer)
|
|
1164
|
+
$len = $self->_raw_read($buffer)
|
|
1162
1165
|
while ! *$self->{EndStream} && $len == 0 ;
|
|
1163
1166
|
return $len ;
|
|
1164
1167
|
}
|
|
1165
1168
|
}
|
|
1166
1169
|
|
|
1167
|
-
# Need to jump through more hoops - either length or offset
|
|
1170
|
+
# Need to jump through more hoops - either length or offset
|
|
1168
1171
|
# or both are specified.
|
|
1169
1172
|
my $out_buffer = *$self->{Pending} ;
|
|
1170
1173
|
*$self->{Pending} = '';
|
|
@@ -1173,17 +1176,17 @@ sub read
|
|
|
1173
1176
|
while (! *$self->{EndStream} && length($out_buffer) < $length)
|
|
1174
1177
|
{
|
|
1175
1178
|
my $buf_len = $self->_raw_read(\$out_buffer);
|
|
1176
|
-
return $buf_len
|
|
1179
|
+
return $buf_len
|
|
1177
1180
|
if $buf_len < 0 ;
|
|
1178
1181
|
}
|
|
1179
1182
|
|
|
1180
|
-
$length = length $out_buffer
|
|
1183
|
+
$length = length $out_buffer
|
|
1181
1184
|
if length($out_buffer) < $length ;
|
|
1182
1185
|
|
|
1183
|
-
return 0
|
|
1186
|
+
return 0
|
|
1184
1187
|
if $length == 0 ;
|
|
1185
1188
|
|
|
1186
|
-
$$buffer = ''
|
|
1189
|
+
$$buffer = ''
|
|
1187
1190
|
if ! defined $$buffer;
|
|
1188
1191
|
|
|
1189
1192
|
$offset = length $$buffer
|
|
@@ -1220,7 +1223,7 @@ sub _getline
|
|
|
1220
1223
|
|
|
1221
1224
|
# Paragraph Mode
|
|
1222
1225
|
if ( ! length $/ ) {
|
|
1223
|
-
my $paragraph ;
|
|
1226
|
+
my $paragraph ;
|
|
1224
1227
|
while (($status = $self->read($paragraph)) > 0 ) {
|
|
1225
1228
|
if ($paragraph =~ s/^(.*?\n\n+)//s) {
|
|
1226
1229
|
*$self->{Pending} = $paragraph ;
|
|
@@ -1233,13 +1236,13 @@ sub _getline
|
|
|
1233
1236
|
|
|
1234
1237
|
# $/ isn't empty, or a reference, so it's Line Mode.
|
|
1235
1238
|
{
|
|
1236
|
-
my $line ;
|
|
1239
|
+
my $line ;
|
|
1237
1240
|
my $p = \*$self->{Pending} ;
|
|
1238
1241
|
while (($status = $self->read($line)) > 0 ) {
|
|
1239
1242
|
my $offset = index($line, $/);
|
|
1240
1243
|
if ($offset >= 0) {
|
|
1241
1244
|
my $l = substr($line, 0, $offset + length $/ );
|
|
1242
|
-
substr($line, 0, $offset + length $/) = '';
|
|
1245
|
+
substr($line, 0, $offset + length $/) = '';
|
|
1243
1246
|
$$p = $line;
|
|
1244
1247
|
return (1, \$l);
|
|
1245
1248
|
}
|
|
@@ -1259,7 +1262,7 @@ sub getline
|
|
|
1259
1262
|
return undef;
|
|
1260
1263
|
}
|
|
1261
1264
|
|
|
1262
|
-
return undef
|
|
1265
|
+
return undef
|
|
1263
1266
|
if *$self->{Closed} || (!length *$self->{Pending} && *$self->{EndStream}) ;
|
|
1264
1267
|
|
|
1265
1268
|
my $current_append = *$self->{AppendOutput} ;
|
|
@@ -1268,7 +1271,7 @@ sub getline
|
|
|
1268
1271
|
my ($status, $lineref) = $self->_getline();
|
|
1269
1272
|
*$self->{AppendOutput} = $current_append;
|
|
1270
1273
|
|
|
1271
|
-
return undef
|
|
1274
|
+
return undef
|
|
1272
1275
|
if $status < 0 || length $$lineref == 0 ;
|
|
1273
1276
|
|
|
1274
1277
|
$. = ++ *$self->{LineNo} ;
|
|
@@ -1279,10 +1282,10 @@ sub getline
|
|
|
1279
1282
|
sub getlines
|
|
1280
1283
|
{
|
|
1281
1284
|
my $self = shift;
|
|
1282
|
-
$self->croakError(*$self->{ClassName} .
|
|
1285
|
+
$self->croakError(*$self->{ClassName} .
|
|
1283
1286
|
"::getlines: called in scalar context\n") unless wantarray;
|
|
1284
1287
|
my($line, @lines);
|
|
1285
|
-
push(@lines, $line)
|
|
1288
|
+
push(@lines, $line)
|
|
1286
1289
|
while defined($line = $self->getline);
|
|
1287
1290
|
return @lines;
|
|
1288
1291
|
}
|
|
@@ -1304,8 +1307,8 @@ sub getc
|
|
|
1304
1307
|
sub ungetc
|
|
1305
1308
|
{
|
|
1306
1309
|
my $self = shift;
|
|
1307
|
-
*$self->{Pending} = "" unless defined *$self->{Pending} ;
|
|
1308
|
-
*$self->{Pending} = $_[0] . *$self->{Pending} ;
|
|
1310
|
+
*$self->{Pending} = "" unless defined *$self->{Pending} ;
|
|
1311
|
+
*$self->{Pending} = $_[0] . *$self->{Pending} ;
|
|
1309
1312
|
}
|
|
1310
1313
|
|
|
1311
1314
|
|
|
@@ -1329,7 +1332,7 @@ sub eof
|
|
|
1329
1332
|
my $self = shift ;
|
|
1330
1333
|
|
|
1331
1334
|
return (*$self->{Closed} ||
|
|
1332
|
-
(!length *$self->{Pending}
|
|
1335
|
+
(!length *$self->{Pending}
|
|
1333
1336
|
&& ( $self->smartEof() || *$self->{EndStream}))) ;
|
|
1334
1337
|
}
|
|
1335
1338
|
|
|
@@ -1359,14 +1362,14 @@ sub close
|
|
|
1359
1362
|
|
|
1360
1363
|
return 1 if *$self->{Closed} ;
|
|
1361
1364
|
|
|
1362
|
-
untie *$self
|
|
1365
|
+
untie *$self
|
|
1363
1366
|
if $] >= 5.008 ;
|
|
1364
1367
|
|
|
1365
1368
|
my $status = 1 ;
|
|
1366
1369
|
|
|
1367
1370
|
if (defined *$self->{FH}) {
|
|
1368
1371
|
if ((! *$self->{Handle} || *$self->{AutoClose}) && ! *$self->{StdIO}) {
|
|
1369
|
-
local $.;
|
|
1372
|
+
local $.;
|
|
1370
1373
|
$! = 0 ;
|
|
1371
1374
|
$status = *$self->{FH}->close();
|
|
1372
1375
|
return $self->saveErrorString(0, $!, $!)
|
|
@@ -1446,8 +1449,8 @@ sub seek
|
|
|
1446
1449
|
sub fileno
|
|
1447
1450
|
{
|
|
1448
1451
|
my $self = shift ;
|
|
1449
|
-
return defined *$self->{FH}
|
|
1450
|
-
? fileno *$self->{FH}
|
|
1452
|
+
return defined *$self->{FH}
|
|
1453
|
+
? fileno *$self->{FH}
|
|
1451
1454
|
: undef ;
|
|
1452
1455
|
}
|
|
1453
1456
|
|
|
@@ -1455,8 +1458,8 @@ sub binmode
|
|
|
1455
1458
|
{
|
|
1456
1459
|
1;
|
|
1457
1460
|
# my $self = shift ;
|
|
1458
|
-
# return defined *$self->{FH}
|
|
1459
|
-
# ? binmode *$self->{FH}
|
|
1461
|
+
# return defined *$self->{FH}
|
|
1462
|
+
# ? binmode *$self->{FH}
|
|
1460
1463
|
# : 1 ;
|
|
1461
1464
|
}
|
|
1462
1465
|
|
|
@@ -1469,8 +1472,8 @@ sub opened
|
|
|
1469
1472
|
sub autoflush
|
|
1470
1473
|
{
|
|
1471
1474
|
my $self = shift ;
|
|
1472
|
-
return defined *$self->{FH}
|
|
1473
|
-
? *$self->{FH}->autoflush(@_)
|
|
1475
|
+
return defined *$self->{FH}
|
|
1476
|
+
? *$self->{FH}->autoflush(@_)
|
|
1474
1477
|
: undef ;
|
|
1475
1478
|
}
|
|
1476
1479
|
|
|
@@ -1482,33 +1485,35 @@ sub input_line_number
|
|
|
1482
1485
|
return $last;
|
|
1483
1486
|
}
|
|
1484
1487
|
|
|
1485
|
-
|
|
1486
|
-
*BINMODE = \&binmode;
|
|
1487
|
-
*SEEK = \&seek;
|
|
1488
|
-
*READ = \&read;
|
|
1489
|
-
*sysread = \&read;
|
|
1490
|
-
*TELL = \&tell;
|
|
1491
|
-
*EOF = \&eof;
|
|
1492
|
-
|
|
1493
|
-
*FILENO = \&fileno;
|
|
1494
|
-
*CLOSE = \&close;
|
|
1495
|
-
|
|
1496
1488
|
sub _notAvailable
|
|
1497
1489
|
{
|
|
1498
1490
|
my $name = shift ;
|
|
1499
1491
|
return sub { croak "$name Not Available: File opened only for intput" ; } ;
|
|
1500
1492
|
}
|
|
1501
1493
|
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
*
|
|
1506
|
-
*
|
|
1507
|
-
*
|
|
1508
|
-
*
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1494
|
+
{
|
|
1495
|
+
no warnings 'once';
|
|
1496
|
+
|
|
1497
|
+
*BINMODE = \&binmode;
|
|
1498
|
+
*SEEK = \&seek;
|
|
1499
|
+
*READ = \&read;
|
|
1500
|
+
*sysread = \&read;
|
|
1501
|
+
*TELL = \&tell;
|
|
1502
|
+
*EOF = \&eof;
|
|
1503
|
+
|
|
1504
|
+
*FILENO = \&fileno;
|
|
1505
|
+
*CLOSE = \&close;
|
|
1506
|
+
|
|
1507
|
+
*print = _notAvailable('print');
|
|
1508
|
+
*PRINT = _notAvailable('print');
|
|
1509
|
+
*printf = _notAvailable('printf');
|
|
1510
|
+
*PRINTF = _notAvailable('printf');
|
|
1511
|
+
*write = _notAvailable('write');
|
|
1512
|
+
*WRITE = _notAvailable('write');
|
|
1513
|
+
|
|
1514
|
+
#*sysread = \&read;
|
|
1515
|
+
#*syswrite = \&_notAvailable;
|
|
1516
|
+
}
|
|
1512
1517
|
|
|
1513
1518
|
|
|
1514
1519
|
|
|
@@ -1531,6 +1536,12 @@ IO::Uncompress::Base - Base Class for IO::Uncompress modules
|
|
|
1531
1536
|
This module is not intended for direct use in application code. Its sole
|
|
1532
1537
|
purpose is to be sub-classed by IO::Uncompress modules.
|
|
1533
1538
|
|
|
1539
|
+
=head1 SUPPORT
|
|
1540
|
+
|
|
1541
|
+
General feedback/questions/bug reports should be sent to
|
|
1542
|
+
L<https://github.com/pmqs/IO-Compress/issues> (preferred) or
|
|
1543
|
+
L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>.
|
|
1544
|
+
|
|
1534
1545
|
=head1 SEE ALSO
|
|
1535
1546
|
|
|
1536
1547
|
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::Lzma>, L<IO::Uncompress::UnLzma>, L<IO::Compress::Xz>, L<IO::Uncompress::UnXz>, L<IO::Compress::Lzip>, L<IO::Uncompress::UnLzip>, L<IO::Compress::Lzop>, L<IO::Uncompress::UnLzop>, L<IO::Compress::Lzf>, L<IO::Uncompress::UnLzf>, L<IO::Compress::Zstd>, L<IO::Uncompress::UnZstd>, L<IO::Uncompress::AnyInflate>, L<IO::Uncompress::AnyUncompress>
|
|
@@ -1551,8 +1562,7 @@ See the Changes file.
|
|
|
1551
1562
|
|
|
1552
1563
|
=head1 COPYRIGHT AND LICENSE
|
|
1553
1564
|
|
|
1554
|
-
Copyright (c) 2005-
|
|
1565
|
+
Copyright (c) 2005-2021 Paul Marquess. All rights reserved.
|
|
1555
1566
|
|
|
1556
1567
|
This program is free software; you can redistribute it and/or
|
|
1557
1568
|
modify it under the same terms as Perl itself.
|
|
1558
|
-
|