line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package IO::Uncompress::Adapter::UnLzma; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
440817
|
use strict; |
|
9
|
|
|
|
|
12
|
|
|
9
|
|
|
|
|
208
|
|
4
|
9
|
|
|
9
|
|
28
|
use warnings; |
|
9
|
|
|
|
|
11
|
|
|
9
|
|
|
|
|
167
|
|
5
|
9
|
|
|
9
|
|
28
|
use bytes; |
|
9
|
|
|
|
|
11
|
|
|
9
|
|
|
|
|
29
|
|
6
|
|
|
|
|
|
|
|
7
|
9
|
|
|
9
|
|
193
|
use IO::Compress::Base::Common 2.072 qw(:Status); |
|
9
|
|
|
|
|
133
|
|
|
9
|
|
|
|
|
882
|
|
8
|
|
|
|
|
|
|
|
9
|
9
|
|
|
9
|
|
1390
|
use Compress::Raw::Lzma 2.072 ; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our ($VERSION, @ISA); |
12
|
|
|
|
|
|
|
$VERSION = '2.072'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
#@ISA = qw( Compress::Raw::UnLzma ); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub mkUncompObject |
18
|
|
|
|
|
|
|
{ |
19
|
|
|
|
|
|
|
#my $CompressedLength = shift; |
20
|
|
|
|
|
|
|
#my $UncompressedLength = shift; |
21
|
|
|
|
|
|
|
#my $small = shift || 0; |
22
|
|
|
|
|
|
|
#my $verbosity = shift || 0; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my ($inflate, $status) = Compress::Raw::Lzma::AloneDecoder->new(AppendOutput => 1, |
25
|
|
|
|
|
|
|
ConsumeInput => 1, |
26
|
|
|
|
|
|
|
LimitOutput => 1); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
return (undef, "Could not create AloneDecoder object: $status", $status) |
29
|
|
|
|
|
|
|
if $status != LZMA_OK ; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
return bless {'Inf' => $inflate, |
32
|
|
|
|
|
|
|
'CompSize' => 0, |
33
|
|
|
|
|
|
|
'UnCompSize' => 0, |
34
|
|
|
|
|
|
|
'Error' => '', |
35
|
|
|
|
|
|
|
'ConsumesInput' => 1, |
36
|
|
|
|
|
|
|
#'CompressedLen' => $CompressedLength || 0, |
37
|
|
|
|
|
|
|
#'UncompressedLen' => $UncompressedLength || 0, |
38
|
|
|
|
|
|
|
} ; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub mkUncompZipObject |
43
|
|
|
|
|
|
|
{ |
44
|
|
|
|
|
|
|
my $properties = shift ; |
45
|
|
|
|
|
|
|
#my $CompressedLength = shift; |
46
|
|
|
|
|
|
|
#my $UncompressedLength = shift; |
47
|
|
|
|
|
|
|
#my $small = shift || 0; |
48
|
|
|
|
|
|
|
#my $verbosity = shift || 0; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
my ($inflate, $status) = Compress::Raw::Lzma::RawDecoder->new(AppendOutput => 1, |
51
|
|
|
|
|
|
|
Properties => $properties, |
52
|
|
|
|
|
|
|
ConsumeInput => 1, |
53
|
|
|
|
|
|
|
LimitOutput => 1); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
return (undef, "Could not create RawDecoder object: $status", $status) |
56
|
|
|
|
|
|
|
if $status != LZMA_OK ; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
return bless {'Inf' => $inflate, |
59
|
|
|
|
|
|
|
'CompSize' => 0, |
60
|
|
|
|
|
|
|
'UnCompSize' => 0, |
61
|
|
|
|
|
|
|
'Error' => '', |
62
|
|
|
|
|
|
|
'ConsumesInput' => 1, |
63
|
|
|
|
|
|
|
#'CompressedLen' => $CompressedLength || 0, |
64
|
|
|
|
|
|
|
#'UncompressedLen' => $UncompressedLength || 0, |
65
|
|
|
|
|
|
|
} ; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub uncompr |
70
|
|
|
|
|
|
|
{ |
71
|
|
|
|
|
|
|
my $self = shift ; |
72
|
|
|
|
|
|
|
my $from = shift ; |
73
|
|
|
|
|
|
|
my $to = shift ; |
74
|
|
|
|
|
|
|
my $eof = shift ; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
my $inf = $self->{Inf}; |
77
|
|
|
|
|
|
|
my $status = $inf->code($from, $to); |
78
|
|
|
|
|
|
|
$self->{ErrorNo} = $status; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
if ($status != LZMA_OK && $status != LZMA_STREAM_END ) |
81
|
|
|
|
|
|
|
{ |
82
|
|
|
|
|
|
|
$self->{Error} = "Uncompression Error: $status"; |
83
|
|
|
|
|
|
|
return STATUS_ERROR; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
return STATUS_ENDSTREAM if $status == LZMA_STREAM_END || |
87
|
|
|
|
|
|
|
($eof && length $$from == 0); |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
return STATUS_OK if $status == LZMA_OK ; |
90
|
|
|
|
|
|
|
return STATUS_ERROR ; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub reset |
95
|
|
|
|
|
|
|
{ |
96
|
|
|
|
|
|
|
my $self = shift ; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
my ($inf, $status) = Compress::Raw::Lzma::AloneDecoder->new(AppendOutput => 1, |
99
|
|
|
|
|
|
|
ConsumeInput => 1, |
100
|
|
|
|
|
|
|
LimitOutput => 1); |
101
|
|
|
|
|
|
|
$self->{ErrorNo} = ($status == LZMA_OK) ? 0 : $status ; |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
if ($status != LZMA_OK) |
104
|
|
|
|
|
|
|
{ |
105
|
|
|
|
|
|
|
$self->{Error} = "Cannot create UnLzma object: $status"; |
106
|
|
|
|
|
|
|
return STATUS_ERROR; |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
$self->{Inf} = $inf; |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
return STATUS_OK ; |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
#sub count |
115
|
|
|
|
|
|
|
#{ |
116
|
|
|
|
|
|
|
# my $self = shift ; |
117
|
|
|
|
|
|
|
# $self->{Inf}->inflateCount(); |
118
|
|
|
|
|
|
|
#} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
sub compressedBytes |
121
|
|
|
|
|
|
|
{ |
122
|
|
|
|
|
|
|
my $self = shift ; |
123
|
|
|
|
|
|
|
$self->{Inf}->compressedBytes(); |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
sub uncompressedBytes |
127
|
|
|
|
|
|
|
{ |
128
|
|
|
|
|
|
|
my $self = shift ; |
129
|
|
|
|
|
|
|
$self->{Inf}->uncompressedBytes(); |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
sub crc32 |
133
|
|
|
|
|
|
|
{ |
134
|
|
|
|
|
|
|
my $self = shift ; |
135
|
|
|
|
|
|
|
#$self->{Inf}->crc32(); |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub adler32 |
139
|
|
|
|
|
|
|
{ |
140
|
|
|
|
|
|
|
my $self = shift ; |
141
|
|
|
|
|
|
|
#$self->{Inf}->adler32(); |
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
sub sync |
145
|
|
|
|
|
|
|
{ |
146
|
|
|
|
|
|
|
my $self = shift ; |
147
|
|
|
|
|
|
|
#( $self->{Inf}->inflateSync(@_) == LZMA_OK) |
148
|
|
|
|
|
|
|
# ? STATUS_OK |
149
|
|
|
|
|
|
|
# : STATUS_ERROR ; |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
1; |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
__END__ |