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
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
package IO::Uncompress::Brotli;
|
|
2
|
+
|
|
3
|
+
use 5.014000;
|
|
4
|
+
use strict;
|
|
5
|
+
use warnings;
|
|
6
|
+
use parent qw/Exporter/;
|
|
7
|
+
|
|
8
|
+
our @EXPORT = qw/unbro/;
|
|
9
|
+
our @EXPORT_OK = @EXPORT;
|
|
10
|
+
|
|
11
|
+
our $VERSION = '0.004001';
|
|
12
|
+
|
|
13
|
+
require XSLoader;
|
|
14
|
+
XSLoader::load('IO::Compress::Brotli', $VERSION);
|
|
15
|
+
|
|
16
|
+
1;
|
|
17
|
+
__END__
|
|
18
|
+
|
|
19
|
+
=encoding utf-8
|
|
20
|
+
|
|
21
|
+
=head1 NAME
|
|
22
|
+
|
|
23
|
+
IO::Uncompress::Brotli - Read Brotli buffers/streams
|
|
24
|
+
|
|
25
|
+
=head1 SYNOPSIS
|
|
26
|
+
|
|
27
|
+
use IO::Uncompress::Brotli;
|
|
28
|
+
|
|
29
|
+
# uncompress a buffer (yielding at most 10MB)
|
|
30
|
+
my $decoded = unbro $encoded, 10_000_000;
|
|
31
|
+
|
|
32
|
+
# uncompress a stream
|
|
33
|
+
my $bro = IO::Uncompress::Brotli->create;
|
|
34
|
+
while(have_input()) {
|
|
35
|
+
my $block = get_input_block();
|
|
36
|
+
my $decoded_block = $bro->decompress($block);
|
|
37
|
+
handle_output_block($decoded_block);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
=head1 DESCRIPTION
|
|
41
|
+
|
|
42
|
+
IO::Uncompress::Brotli is a module that decompresses Brotli buffers
|
|
43
|
+
and streams. Despite its name, it is not a subclass of
|
|
44
|
+
L<IO::Uncompress::Base> and does not implement its interface. This
|
|
45
|
+
will be rectified in a future release.
|
|
46
|
+
|
|
47
|
+
=head2 One-shot interface
|
|
48
|
+
|
|
49
|
+
If you have the whole buffer in a Perl scalar use the B<unbro>
|
|
50
|
+
function.
|
|
51
|
+
|
|
52
|
+
=over
|
|
53
|
+
|
|
54
|
+
=item B<unbro>(I<$input>, I<$maximum_decoded_size>)
|
|
55
|
+
|
|
56
|
+
Takes a whole compressed buffer as input and returns the decompressed
|
|
57
|
+
data. It allocates a buffer of size I<$maximum_decoded_size> to store
|
|
58
|
+
the decompressed data, if this is not sufficient (or there is another
|
|
59
|
+
error) this function will croak.
|
|
60
|
+
|
|
61
|
+
Exported by default.
|
|
62
|
+
|
|
63
|
+
=back
|
|
64
|
+
|
|
65
|
+
=head2 Streaming interface
|
|
66
|
+
|
|
67
|
+
If you want to process the data in blocks use the object oriented
|
|
68
|
+
interface. The available methods are:
|
|
69
|
+
|
|
70
|
+
=over
|
|
71
|
+
|
|
72
|
+
=item IO::Uncompress::Brotli->B<create>
|
|
73
|
+
|
|
74
|
+
Returns a IO::Uncompress::Brotli instance. Please note that a single
|
|
75
|
+
instance cannot be used to decompress multiple streams.
|
|
76
|
+
|
|
77
|
+
=item $bro->B<decompress>(I<$block>)
|
|
78
|
+
|
|
79
|
+
Takes the a block of compressed data and returns a block of
|
|
80
|
+
uncompressed data. Dies on error.
|
|
81
|
+
|
|
82
|
+
=back
|
|
83
|
+
|
|
84
|
+
=head1 SEE ALSO
|
|
85
|
+
|
|
86
|
+
Brotli Compressed Data Format Internet-Draft:
|
|
87
|
+
L<https://www.ietf.org/id/draft-alakuijala-brotli-08.txt>
|
|
88
|
+
|
|
89
|
+
Brotli source code: L<https://github.com/google/brotli/>
|
|
90
|
+
|
|
91
|
+
=head1 AUTHOR
|
|
92
|
+
|
|
93
|
+
Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
|
|
94
|
+
|
|
95
|
+
The encoder bindings, modernisation of the decoder bindings and a
|
|
96
|
+
clean up of the overall project were contributed by:
|
|
97
|
+
|
|
98
|
+
=over
|
|
99
|
+
|
|
100
|
+
=item Quim Rovira, E<lt>quim@rovira.catE<gt>
|
|
101
|
+
|
|
102
|
+
=item Ævar Arnfjörð Bjarmason, E<lt>avarab@gmail.comE<gt>
|
|
103
|
+
|
|
104
|
+
=item Marcell Szathmári
|
|
105
|
+
|
|
106
|
+
=item Mattia Barbon, E<lt>mattia@barbon.orgE<gt>
|
|
107
|
+
|
|
108
|
+
=back
|
|
109
|
+
|
|
110
|
+
=head1 COPYRIGHT AND LICENSE
|
|
111
|
+
|
|
112
|
+
Copyright (C) 2015-2018 by Marius Gavrilescu
|
|
113
|
+
|
|
114
|
+
This library is free software; you can redistribute it and/or modify
|
|
115
|
+
it under the same terms as Perl itself, either Perl version 5.20.2 or,
|
|
116
|
+
at your option, any later version of Perl 5 you may have available.
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
=cut
|
|
@@ -9,12 +9,12 @@ use strict ;
|
|
|
9
9
|
use warnings;
|
|
10
10
|
use bytes;
|
|
11
11
|
|
|
12
|
-
use IO::Uncompress::RawInflate 2.
|
|
12
|
+
use IO::Uncompress::RawInflate 2.100 ;
|
|
13
13
|
|
|
14
|
-
use Compress::Raw::Zlib 2.
|
|
15
|
-
use IO::Compress::Base::Common 2.
|
|
16
|
-
use IO::Compress::Gzip::Constants 2.
|
|
17
|
-
use IO::Compress::Zlib::Extra 2.
|
|
14
|
+
use Compress::Raw::Zlib 2.100 () ;
|
|
15
|
+
use IO::Compress::Base::Common 2.100 qw(:Status );
|
|
16
|
+
use IO::Compress::Gzip::Constants 2.100 ;
|
|
17
|
+
use IO::Compress::Zlib::Extra 2.100 ;
|
|
18
18
|
|
|
19
19
|
require Exporter ;
|
|
20
20
|
|
|
@@ -28,7 +28,7 @@ Exporter::export_ok_tags('all');
|
|
|
28
28
|
|
|
29
29
|
$GunzipError = '';
|
|
30
30
|
|
|
31
|
-
$VERSION = '2.
|
|
31
|
+
$VERSION = '2.100';
|
|
32
32
|
|
|
33
33
|
sub new
|
|
34
34
|
{
|
|
@@ -70,9 +70,9 @@ sub ckMagic
|
|
|
70
70
|
|
|
71
71
|
*$self->{HeaderPending} = $magic ;
|
|
72
72
|
|
|
73
|
-
return $self->HeaderError("Minimum header size is " .
|
|
74
|
-
GZIP_MIN_HEADER_SIZE . " bytes")
|
|
75
|
-
if length $magic != GZIP_ID_SIZE ;
|
|
73
|
+
return $self->HeaderError("Minimum header size is " .
|
|
74
|
+
GZIP_MIN_HEADER_SIZE . " bytes")
|
|
75
|
+
if length $magic != GZIP_ID_SIZE ;
|
|
76
76
|
|
|
77
77
|
return $self->HeaderError("Bad Magic")
|
|
78
78
|
if ! isGzipMagic($magic) ;
|
|
@@ -95,10 +95,10 @@ sub chkTrailer
|
|
|
95
95
|
my $self = shift;
|
|
96
96
|
my $trailer = shift;
|
|
97
97
|
|
|
98
|
-
# Check CRC & ISIZE
|
|
98
|
+
# Check CRC & ISIZE
|
|
99
99
|
my ($CRC32, $ISIZE) = unpack("V V", $trailer) ;
|
|
100
|
-
*$self->{Info}{CRC32} = $CRC32;
|
|
101
|
-
*$self->{Info}{ISIZE} = $ISIZE;
|
|
100
|
+
*$self->{Info}{CRC32} = $CRC32;
|
|
101
|
+
*$self->{Info}{ISIZE} = $ISIZE;
|
|
102
102
|
|
|
103
103
|
if (*$self->{Strict}) {
|
|
104
104
|
return $self->TrailerError("CRC mismatch")
|
|
@@ -130,9 +130,9 @@ sub _readFullGzipHeader($)
|
|
|
130
130
|
|
|
131
131
|
*$self->{HeaderPending} = $magic ;
|
|
132
132
|
|
|
133
|
-
return $self->HeaderError("Minimum header size is " .
|
|
134
|
-
GZIP_MIN_HEADER_SIZE . " bytes")
|
|
135
|
-
if length $magic != GZIP_ID_SIZE ;
|
|
133
|
+
return $self->HeaderError("Minimum header size is " .
|
|
134
|
+
GZIP_MIN_HEADER_SIZE . " bytes")
|
|
135
|
+
if length $magic != GZIP_ID_SIZE ;
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
return $self->HeaderError("Bad Magic")
|
|
@@ -150,7 +150,7 @@ sub _readGzipHeader($)
|
|
|
150
150
|
my ($buffer) = '' ;
|
|
151
151
|
|
|
152
152
|
$self->smartReadExact(\$buffer, GZIP_MIN_HEADER_SIZE - GZIP_ID_SIZE)
|
|
153
|
-
or return $self->HeaderError("Minimum header size is " .
|
|
153
|
+
or return $self->HeaderError("Minimum header size is " .
|
|
154
154
|
GZIP_MIN_HEADER_SIZE . " bytes") ;
|
|
155
155
|
|
|
156
156
|
my $keep = $magic . $buffer ;
|
|
@@ -159,22 +159,22 @@ sub _readGzipHeader($)
|
|
|
159
159
|
# now split out the various parts
|
|
160
160
|
my ($cm, $flag, $mtime, $xfl, $os) = unpack("C C V C C", $buffer) ;
|
|
161
161
|
|
|
162
|
-
$cm == GZIP_CM_DEFLATED
|
|
162
|
+
$cm == GZIP_CM_DEFLATED
|
|
163
163
|
or return $self->HeaderError("Not Deflate (CM is $cm)") ;
|
|
164
164
|
|
|
165
165
|
# check for use of reserved bits
|
|
166
166
|
return $self->HeaderError("Use of Reserved Bits in FLG field.")
|
|
167
|
-
if $flag & GZIP_FLG_RESERVED ;
|
|
167
|
+
if $flag & GZIP_FLG_RESERVED ;
|
|
168
168
|
|
|
169
169
|
my $EXTRA ;
|
|
170
170
|
my @EXTRA = () ;
|
|
171
171
|
if ($flag & GZIP_FLG_FEXTRA) {
|
|
172
172
|
$EXTRA = "" ;
|
|
173
|
-
$self->smartReadExact(\$buffer, GZIP_FEXTRA_HEADER_SIZE)
|
|
173
|
+
$self->smartReadExact(\$buffer, GZIP_FEXTRA_HEADER_SIZE)
|
|
174
174
|
or return $self->TruncatedHeader("FEXTRA Length") ;
|
|
175
175
|
|
|
176
176
|
my ($XLEN) = unpack("v", $buffer) ;
|
|
177
|
-
$self->smartReadExact(\$EXTRA, $XLEN)
|
|
177
|
+
$self->smartReadExact(\$EXTRA, $XLEN)
|
|
178
178
|
or return $self->TruncatedHeader("FEXTRA Body");
|
|
179
179
|
$keep .= $buffer . $EXTRA ;
|
|
180
180
|
|
|
@@ -190,10 +190,10 @@ sub _readGzipHeader($)
|
|
|
190
190
|
if ($flag & GZIP_FLG_FNAME) {
|
|
191
191
|
$origname = "" ;
|
|
192
192
|
while (1) {
|
|
193
|
-
$self->smartReadExact(\$buffer, 1)
|
|
193
|
+
$self->smartReadExact(\$buffer, 1)
|
|
194
194
|
or return $self->TruncatedHeader("FNAME");
|
|
195
195
|
last if $buffer eq GZIP_NULL_BYTE ;
|
|
196
|
-
$origname .= $buffer
|
|
196
|
+
$origname .= $buffer
|
|
197
197
|
}
|
|
198
198
|
$keep .= $origname . GZIP_NULL_BYTE ;
|
|
199
199
|
|
|
@@ -205,10 +205,10 @@ sub _readGzipHeader($)
|
|
|
205
205
|
if ($flag & GZIP_FLG_FCOMMENT) {
|
|
206
206
|
$comment = "";
|
|
207
207
|
while (1) {
|
|
208
|
-
$self->smartReadExact(\$buffer, 1)
|
|
208
|
+
$self->smartReadExact(\$buffer, 1)
|
|
209
209
|
or return $self->TruncatedHeader("FCOMMENT");
|
|
210
210
|
last if $buffer eq GZIP_NULL_BYTE ;
|
|
211
|
-
$comment .= $buffer
|
|
211
|
+
$comment .= $buffer
|
|
212
212
|
}
|
|
213
213
|
$keep .= $comment . GZIP_NULL_BYTE ;
|
|
214
214
|
|
|
@@ -217,7 +217,7 @@ sub _readGzipHeader($)
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
if ($flag & GZIP_FLG_FHCRC) {
|
|
220
|
-
$self->smartReadExact(\$buffer, GZIP_FHCRC_SIZE)
|
|
220
|
+
$self->smartReadExact(\$buffer, GZIP_FHCRC_SIZE)
|
|
221
221
|
or return $self->TruncatedHeader("FHCRC");
|
|
222
222
|
|
|
223
223
|
$HeaderCRC = unpack("v", $buffer) ;
|
|
@@ -254,7 +254,7 @@ sub _readGzipHeader($)
|
|
|
254
254
|
'Comment' => $comment,
|
|
255
255
|
'Time' => $mtime,
|
|
256
256
|
'OsID' => $os,
|
|
257
|
-
'OsName' => defined $GZIP_OS_Names{$os}
|
|
257
|
+
'OsName' => defined $GZIP_OS_Names{$os}
|
|
258
258
|
? $GZIP_OS_Names{$os} : "Unknown",
|
|
259
259
|
'HeaderCRC' => $HeaderCRC,
|
|
260
260
|
'Flags' => $flag,
|
|
@@ -286,7 +286,7 @@ IO::Uncompress::Gunzip - Read RFC 1952 files/buffers
|
|
|
286
286
|
my $status = gunzip $input => $output [,OPTS]
|
|
287
287
|
or die "gunzip failed: $GunzipError\n";
|
|
288
288
|
|
|
289
|
-
my $z =
|
|
289
|
+
my $z = IO::Uncompress::Gunzip->new( $input [OPTS] )
|
|
290
290
|
or die "gunzip failed: $GunzipError\n";
|
|
291
291
|
|
|
292
292
|
$status = $z->read($buffer)
|
|
@@ -348,7 +348,8 @@ The functional interface needs Perl5.005 or better.
|
|
|
348
348
|
=head2 gunzip $input_filename_or_reference => $output_filename_or_reference [, OPTS]
|
|
349
349
|
|
|
350
350
|
C<gunzip> expects at least two parameters,
|
|
351
|
-
C<$input_filename_or_reference> and C<$output_filename_or_reference
|
|
351
|
+
C<$input_filename_or_reference> and C<$output_filename_or_reference>
|
|
352
|
+
and zero or more optional parameters (see L</Optional Parameters>)
|
|
352
353
|
|
|
353
354
|
=head3 The C<$input_filename_or_reference> parameter
|
|
354
355
|
|
|
@@ -361,7 +362,7 @@ It can take one of the following forms:
|
|
|
361
362
|
|
|
362
363
|
=item A filename
|
|
363
364
|
|
|
364
|
-
If the <$input_filename_or_reference> parameter is a simple scalar, it is
|
|
365
|
+
If the C<$input_filename_or_reference> parameter is a simple scalar, it is
|
|
365
366
|
assumed to be a filename. This file will be opened for reading and the
|
|
366
367
|
input data will be read from it.
|
|
367
368
|
|
|
@@ -458,9 +459,9 @@ files/buffers.
|
|
|
458
459
|
|
|
459
460
|
=head2 Optional Parameters
|
|
460
461
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
L</"Constructor Options"> section below
|
|
462
|
+
The optional parameters for the one-shot function C<gunzip>
|
|
463
|
+
are (for the most part) identical to those used with the OO interface defined in the
|
|
464
|
+
L</"Constructor Options"> section. The exceptions are listed below
|
|
464
465
|
|
|
465
466
|
=over 5
|
|
466
467
|
|
|
@@ -578,7 +579,7 @@ uncompressed data to a buffer, C<$buffer>.
|
|
|
578
579
|
use IO::Uncompress::Gunzip qw(gunzip $GunzipError) ;
|
|
579
580
|
use IO::File ;
|
|
580
581
|
|
|
581
|
-
my $input =
|
|
582
|
+
my $input = IO::File->new( "<file1.txt.gz" )
|
|
582
583
|
or die "Cannot open 'file1.txt.gz': $!\n" ;
|
|
583
584
|
my $buffer ;
|
|
584
585
|
gunzip $input => \$buffer
|
|
@@ -613,7 +614,7 @@ and if you want to compress each file one at a time, this will do the trick
|
|
|
613
614
|
|
|
614
615
|
The format of the constructor for IO::Uncompress::Gunzip is shown below
|
|
615
616
|
|
|
616
|
-
my $z =
|
|
617
|
+
my $z = IO::Uncompress::Gunzip->new( $input [OPTS] )
|
|
617
618
|
or die "IO::Uncompress::Gunzip failed: $GunzipError\n";
|
|
618
619
|
|
|
619
620
|
Returns an C<IO::Uncompress::Gunzip> object on success and undef on failure.
|
|
@@ -1063,7 +1064,7 @@ C<InputLength> option in the constructor.
|
|
|
1063
1064
|
|
|
1064
1065
|
=head1 Importing
|
|
1065
1066
|
|
|
1066
|
-
No symbolic constants are required by
|
|
1067
|
+
No symbolic constants are required by IO::Uncompress::Gunzip at present.
|
|
1067
1068
|
|
|
1068
1069
|
=over 5
|
|
1069
1070
|
|
|
@@ -1082,6 +1083,12 @@ Same as doing this
|
|
|
1082
1083
|
|
|
1083
1084
|
See L<IO::Compress::FAQ|IO::Compress::FAQ/"Compressed files and Net::FTP">
|
|
1084
1085
|
|
|
1086
|
+
=head1 SUPPORT
|
|
1087
|
+
|
|
1088
|
+
General feedback/questions/bug reports should be sent to
|
|
1089
|
+
L<https://github.com/pmqs/IO-Compress/issues> (preferred) or
|
|
1090
|
+
L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>.
|
|
1091
|
+
|
|
1085
1092
|
=head1 SEE ALSO
|
|
1086
1093
|
|
|
1087
1094
|
L<Compress::Zlib>, L<IO::Compress::Gzip>, 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>
|
|
@@ -1115,8 +1122,7 @@ See the Changes file.
|
|
|
1115
1122
|
|
|
1116
1123
|
=head1 COPYRIGHT AND LICENSE
|
|
1117
1124
|
|
|
1118
|
-
Copyright (c) 2005-
|
|
1125
|
+
Copyright (c) 2005-2021 Paul Marquess. All rights reserved.
|
|
1119
1126
|
|
|
1120
1127
|
This program is free software; you can redistribute it and/or
|
|
1121
1128
|
modify it under the same terms as Perl itself.
|
|
1122
|
-
|
|
@@ -5,16 +5,16 @@ use strict ;
|
|
|
5
5
|
use warnings;
|
|
6
6
|
use bytes;
|
|
7
7
|
|
|
8
|
-
use Compress::Raw::Zlib 2.
|
|
9
|
-
use IO::Compress::Base::Common 2.
|
|
8
|
+
use Compress::Raw::Zlib 2.100 ;
|
|
9
|
+
use IO::Compress::Base::Common 2.100 qw(:Status );
|
|
10
10
|
|
|
11
|
-
use IO::Uncompress::Base 2.
|
|
12
|
-
use IO::Uncompress::Adapter::Inflate 2.
|
|
11
|
+
use IO::Uncompress::Base 2.100 ;
|
|
12
|
+
use IO::Uncompress::Adapter::Inflate 2.100 ;
|
|
13
13
|
|
|
14
14
|
require Exporter ;
|
|
15
15
|
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError);
|
|
16
16
|
|
|
17
|
-
$VERSION = '2.
|
|
17
|
+
$VERSION = '2.100';
|
|
18
18
|
$RawInflateError = '';
|
|
19
19
|
|
|
20
20
|
@ISA = qw(IO::Uncompress::Base Exporter);
|
|
@@ -25,16 +25,16 @@ push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ;
|
|
|
25
25
|
Exporter::export_ok_tags('all');
|
|
26
26
|
|
|
27
27
|
#{
|
|
28
|
-
# # Execute at runtime
|
|
28
|
+
# # Execute at runtime
|
|
29
29
|
# my %bad;
|
|
30
30
|
# for my $module (qw(Compress::Raw::Zlib IO::Compress::Base::Common IO::Uncompress::Base IO::Uncompress::Adapter::Inflate))
|
|
31
31
|
# {
|
|
32
32
|
# my $ver = ${ $module . "::VERSION"} ;
|
|
33
|
-
#
|
|
33
|
+
#
|
|
34
34
|
# $bad{$module} = $ver
|
|
35
35
|
# if $ver ne $VERSION;
|
|
36
36
|
# }
|
|
37
|
-
#
|
|
37
|
+
#
|
|
38
38
|
# if (keys %bad)
|
|
39
39
|
# {
|
|
40
40
|
# my $string = join "\n", map { "$_ $bad{$_}" } keys %bad;
|
|
@@ -148,14 +148,14 @@ sub _isRawx
|
|
|
148
148
|
|
|
149
149
|
my $buffer = '';
|
|
150
150
|
|
|
151
|
-
$self->smartRead(\$buffer, *$self->{BlockSize}) >= 0
|
|
151
|
+
$self->smartRead(\$buffer, *$self->{BlockSize}) >= 0
|
|
152
152
|
or return $self->saveErrorString(undef, "No data to read");
|
|
153
153
|
|
|
154
154
|
my $temp_buf = $magic . $buffer ;
|
|
155
|
-
*$self->{HeaderPending} = $temp_buf ;
|
|
155
|
+
*$self->{HeaderPending} = $temp_buf ;
|
|
156
156
|
$buffer = '';
|
|
157
157
|
my $status = *$self->{Uncomp}->uncompr(\$temp_buf, \$buffer, $self->smartEof()) ;
|
|
158
|
-
|
|
158
|
+
|
|
159
159
|
return $self->saveErrorString(undef, *$self->{Uncomp}{Error}, STATUS_ERROR)
|
|
160
160
|
if $status == STATUS_ERROR;
|
|
161
161
|
|
|
@@ -163,12 +163,12 @@ sub _isRawx
|
|
|
163
163
|
|
|
164
164
|
return $self->saveErrorString(undef, "unexpected end of file", STATUS_ERROR)
|
|
165
165
|
if $self->smartEof() && $status != STATUS_ENDSTREAM;
|
|
166
|
-
|
|
166
|
+
|
|
167
167
|
#my $buf_len = *$self->{Uncomp}->uncompressedBytes();
|
|
168
168
|
my $buf_len = length $buffer;
|
|
169
169
|
|
|
170
170
|
if ($status == STATUS_ENDSTREAM) {
|
|
171
|
-
if (*$self->{MultiStream}
|
|
171
|
+
if (*$self->{MultiStream}
|
|
172
172
|
&& (length $temp_buf || ! $self->smartEof())){
|
|
173
173
|
*$self->{NewStream} = 1 ;
|
|
174
174
|
*$self->{EndStream} = 0 ;
|
|
@@ -177,9 +177,9 @@ sub _isRawx
|
|
|
177
177
|
*$self->{EndStream} = 1 ;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
*$self->{HeaderPending} = $buffer ;
|
|
181
|
-
*$self->{InflatedBytesRead} = $buf_len ;
|
|
182
|
-
*$self->{TotalInflatedBytesRead} += $buf_len ;
|
|
180
|
+
*$self->{HeaderPending} = $buffer ;
|
|
181
|
+
*$self->{InflatedBytesRead} = $buf_len ;
|
|
182
|
+
*$self->{TotalInflatedBytesRead} += $buf_len ;
|
|
183
183
|
*$self->{Type} = 'rfc1951';
|
|
184
184
|
|
|
185
185
|
$self->saveStatus(STATUS_OK);
|
|
@@ -229,7 +229,7 @@ sub inflateSync
|
|
|
229
229
|
return $self->saveErrorString(0, "unexpected end of file", STATUS_ERROR);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
|
|
232
|
+
|
|
233
233
|
$status = *$self->{Uncomp}->sync($temp_buf) ;
|
|
234
234
|
|
|
235
235
|
if ($status == STATUS_OK)
|
|
@@ -251,23 +251,23 @@ sub inflateSync
|
|
|
251
251
|
# my $status ;
|
|
252
252
|
# my $end_offset = 0;
|
|
253
253
|
#
|
|
254
|
-
# $status = $self->scan()
|
|
254
|
+
# $status = $self->scan()
|
|
255
255
|
# #or return $self->saveErrorString(undef, "Error Scanning: $$error_ref", $self->errorNo) ;
|
|
256
256
|
# or return $self->saveErrorString(G_ERR, "Error Scanning: $status")
|
|
257
257
|
#
|
|
258
|
-
# $status = $self->zap($end_offset)
|
|
258
|
+
# $status = $self->zap($end_offset)
|
|
259
259
|
# or return $self->saveErrorString(G_ERR, "Error Zapping: $status");
|
|
260
260
|
# #or return $self->saveErrorString(undef, "Error Zapping: $$error_ref", $self->errorNo) ;
|
|
261
261
|
#
|
|
262
262
|
# #(*$obj->{Deflate}, $status) = $inf->createDeflate();
|
|
263
263
|
#
|
|
264
264
|
## *$obj->{Header} = *$inf->{Info}{Header};
|
|
265
|
-
## *$obj->{UnCompSize_32bit} =
|
|
265
|
+
## *$obj->{UnCompSize_32bit} =
|
|
266
266
|
## *$obj->{BytesWritten} = *$inf->{UnCompSize_32bit} ;
|
|
267
267
|
## *$obj->{CompSize_32bit} = *$inf->{CompSize_32bit} ;
|
|
268
268
|
#
|
|
269
269
|
#
|
|
270
|
-
## if ( $outType eq 'buffer')
|
|
270
|
+
## if ( $outType eq 'buffer')
|
|
271
271
|
## { substr( ${ *$self->{Buffer} }, $end_offset) = '' }
|
|
272
272
|
## elsif ($outType eq 'handle' || $outType eq 'filename') {
|
|
273
273
|
## *$self->{FH} = *$inf->{FH} ;
|
|
@@ -275,11 +275,11 @@ sub inflateSync
|
|
|
275
275
|
## *$obj->{FH}->flush() ;
|
|
276
276
|
## *$obj->{Handle} = 1 if $outType eq 'handle';
|
|
277
277
|
##
|
|
278
|
-
## #seek(*$obj->{FH}, $end_offset, SEEK_SET)
|
|
279
|
-
## *$obj->{FH}->seek($end_offset, SEEK_SET)
|
|
278
|
+
## #seek(*$obj->{FH}, $end_offset, SEEK_SET)
|
|
279
|
+
## *$obj->{FH}->seek($end_offset, SEEK_SET)
|
|
280
280
|
## or return $obj->saveErrorString(undef, $!, $!) ;
|
|
281
281
|
## }
|
|
282
|
-
#
|
|
282
|
+
#
|
|
283
283
|
#}
|
|
284
284
|
|
|
285
285
|
sub scan
|
|
@@ -292,7 +292,7 @@ sub scan
|
|
|
292
292
|
my $buffer = '' ;
|
|
293
293
|
my $len = 0;
|
|
294
294
|
|
|
295
|
-
$len = $self->_raw_read(\$buffer, 1)
|
|
295
|
+
$len = $self->_raw_read(\$buffer, 1)
|
|
296
296
|
while ! *$self->{EndStream} && $len >= 0 ;
|
|
297
297
|
|
|
298
298
|
#return $len if $len < 0 ? $len : 0 ;
|
|
@@ -310,16 +310,16 @@ sub zap
|
|
|
310
310
|
#printf "# block_offset $block_offset %x\n", $block_offset;
|
|
311
311
|
my $byte ;
|
|
312
312
|
( $self->smartSeek($block_offset) &&
|
|
313
|
-
$self->smartRead(\$byte, 1) )
|
|
314
|
-
or return $self->saveErrorString(0, $!, $!);
|
|
313
|
+
$self->smartRead(\$byte, 1) )
|
|
314
|
+
or return $self->saveErrorString(0, $!, $!);
|
|
315
315
|
|
|
316
316
|
#printf "#byte is %x\n", unpack('C*',$byte);
|
|
317
317
|
*$self->{Uncomp}->resetLastBlockByte($byte);
|
|
318
318
|
#printf "#to byte is %x\n", unpack('C*',$byte);
|
|
319
319
|
|
|
320
|
-
( $self->smartSeek($block_offset) &&
|
|
320
|
+
( $self->smartSeek($block_offset) &&
|
|
321
321
|
$self->smartWrite($byte) )
|
|
322
|
-
or return $self->saveErrorString(0, $!, $!);
|
|
322
|
+
or return $self->saveErrorString(0, $!, $!);
|
|
323
323
|
|
|
324
324
|
#$self->smartSeek($end_offset, 1);
|
|
325
325
|
|
|
@@ -335,12 +335,12 @@ sub createDeflate
|
|
|
335
335
|
-CRC32 => *$self->{Params}->getValue('crc32'),
|
|
336
336
|
-ADLER32 => *$self->{Params}->getValue('adler32'),
|
|
337
337
|
);
|
|
338
|
-
|
|
339
|
-
return wantarray ? ($status, $def) : $def ;
|
|
338
|
+
|
|
339
|
+
return wantarray ? ($status, $def) : $def ;
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
|
|
343
|
-
1;
|
|
343
|
+
1;
|
|
344
344
|
|
|
345
345
|
__END__
|
|
346
346
|
|
|
@@ -356,7 +356,7 @@ IO::Uncompress::RawInflate - Read RFC 1951 files/buffers
|
|
|
356
356
|
my $status = rawinflate $input => $output [,OPTS]
|
|
357
357
|
or die "rawinflate failed: $RawInflateError\n";
|
|
358
358
|
|
|
359
|
-
my $z =
|
|
359
|
+
my $z = IO::Uncompress::RawInflate->new( $input [OPTS] )
|
|
360
360
|
or die "rawinflate failed: $RawInflateError\n";
|
|
361
361
|
|
|
362
362
|
$status = $z->read($buffer)
|
|
@@ -418,7 +418,8 @@ The functional interface needs Perl5.005 or better.
|
|
|
418
418
|
=head2 rawinflate $input_filename_or_reference => $output_filename_or_reference [, OPTS]
|
|
419
419
|
|
|
420
420
|
C<rawinflate> expects at least two parameters,
|
|
421
|
-
C<$input_filename_or_reference> and C<$output_filename_or_reference
|
|
421
|
+
C<$input_filename_or_reference> and C<$output_filename_or_reference>
|
|
422
|
+
and zero or more optional parameters (see L</Optional Parameters>)
|
|
422
423
|
|
|
423
424
|
=head3 The C<$input_filename_or_reference> parameter
|
|
424
425
|
|
|
@@ -431,7 +432,7 @@ It can take one of the following forms:
|
|
|
431
432
|
|
|
432
433
|
=item A filename
|
|
433
434
|
|
|
434
|
-
If the <$input_filename_or_reference> parameter is a simple scalar, it is
|
|
435
|
+
If the C<$input_filename_or_reference> parameter is a simple scalar, it is
|
|
435
436
|
assumed to be a filename. This file will be opened for reading and the
|
|
436
437
|
input data will be read from it.
|
|
437
438
|
|
|
@@ -528,9 +529,9 @@ files/buffers.
|
|
|
528
529
|
|
|
529
530
|
=head2 Optional Parameters
|
|
530
531
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
L</"Constructor Options"> section below
|
|
532
|
+
The optional parameters for the one-shot function C<rawinflate>
|
|
533
|
+
are (for the most part) identical to those used with the OO interface defined in the
|
|
534
|
+
L</"Constructor Options"> section. The exceptions are listed below
|
|
534
535
|
|
|
535
536
|
=over 5
|
|
536
537
|
|
|
@@ -645,7 +646,7 @@ uncompressed data to a buffer, C<$buffer>.
|
|
|
645
646
|
use IO::Uncompress::RawInflate qw(rawinflate $RawInflateError) ;
|
|
646
647
|
use IO::File ;
|
|
647
648
|
|
|
648
|
-
my $input =
|
|
649
|
+
my $input = IO::File->new( "<file1.txt.1951" )
|
|
649
650
|
or die "Cannot open 'file1.txt.1951': $!\n" ;
|
|
650
651
|
my $buffer ;
|
|
651
652
|
rawinflate $input => \$buffer
|
|
@@ -680,7 +681,7 @@ and if you want to compress each file one at a time, this will do the trick
|
|
|
680
681
|
|
|
681
682
|
The format of the constructor for IO::Uncompress::RawInflate is shown below
|
|
682
683
|
|
|
683
|
-
my $z =
|
|
684
|
+
my $z = IO::Uncompress::RawInflate->new( $input [OPTS] )
|
|
684
685
|
or die "IO::Uncompress::RawInflate failed: $RawInflateError\n";
|
|
685
686
|
|
|
686
687
|
Returns an C<IO::Uncompress::RawInflate> object on success and undef on failure.
|
|
@@ -1063,7 +1064,7 @@ C<InputLength> option in the constructor.
|
|
|
1063
1064
|
|
|
1064
1065
|
=head1 Importing
|
|
1065
1066
|
|
|
1066
|
-
No symbolic constants are required by
|
|
1067
|
+
No symbolic constants are required by IO::Uncompress::RawInflate at present.
|
|
1067
1068
|
|
|
1068
1069
|
=over 5
|
|
1069
1070
|
|
|
@@ -1082,6 +1083,12 @@ Same as doing this
|
|
|
1082
1083
|
|
|
1083
1084
|
See L<IO::Compress::FAQ|IO::Compress::FAQ/"Compressed files and Net::FTP">
|
|
1084
1085
|
|
|
1086
|
+
=head1 SUPPORT
|
|
1087
|
+
|
|
1088
|
+
General feedback/questions/bug reports should be sent to
|
|
1089
|
+
L<https://github.com/pmqs/IO-Compress/issues> (preferred) or
|
|
1090
|
+
L<https://rt.cpan.org/Public/Dist/Display.html?Name=IO-Compress>.
|
|
1091
|
+
|
|
1085
1092
|
=head1 SEE ALSO
|
|
1086
1093
|
|
|
1087
1094
|
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::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>
|
|
@@ -1115,8 +1122,7 @@ See the Changes file.
|
|
|
1115
1122
|
|
|
1116
1123
|
=head1 COPYRIGHT AND LICENSE
|
|
1117
1124
|
|
|
1118
|
-
Copyright (c) 2005-
|
|
1125
|
+
Copyright (c) 2005-2021 Paul Marquess. All rights reserved.
|
|
1119
1126
|
|
|
1120
1127
|
This program is free software; you can redistribute it and/or
|
|
1121
1128
|
modify it under the same terms as Perl itself.
|
|
1122
|
-
|
|
@@ -7,7 +7,7 @@ use Carp;
|
|
|
7
7
|
use strict;
|
|
8
8
|
use warnings;
|
|
9
9
|
|
|
10
|
-
our $VERSION = "1.
|
|
10
|
+
our $VERSION = "1.45";
|
|
11
11
|
XSLoader::load 'IO', $VERSION;
|
|
12
12
|
|
|
13
13
|
sub import {
|
|
@@ -53,7 +53,7 @@ in one go. The IO modules belonging to the core are:
|
|
|
53
53
|
|
|
54
54
|
Some other IO modules don't belong to the perl core but can be loaded
|
|
55
55
|
as well if they have been installed from CPAN. You can discover which
|
|
56
|
-
ones exist by searching for "^IO::" on http://search.cpan.org
|
|
56
|
+
ones exist by searching for "^IO::" on L<http://search.cpan.org>.
|
|
57
57
|
|
|
58
58
|
For more information on any of these modules, please see its respective
|
|
59
59
|
documentation.
|