| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package IO::Compress::Bzip2 ; |
|
2
|
|
|
|
|
|
|
|
|
3
|
59
|
|
|
59
|
|
67142
|
use strict ; |
|
|
59
|
|
|
|
|
125
|
|
|
|
59
|
|
|
|
|
2217
|
|
|
4
|
59
|
|
|
59
|
|
291
|
use warnings; |
|
|
59
|
|
|
|
|
103
|
|
|
|
59
|
|
|
|
|
2611
|
|
|
5
|
59
|
|
|
59
|
|
5171
|
use bytes; |
|
|
59
|
|
|
|
|
4514
|
|
|
|
59
|
|
|
|
|
351
|
|
|
6
|
|
|
|
|
|
|
require Exporter ; |
|
7
|
|
|
|
|
|
|
|
|
8
|
59
|
|
|
59
|
|
10298
|
use IO::Compress::Base 2.220 ; |
|
|
59
|
|
|
|
|
1892
|
|
|
|
59
|
|
|
|
|
3720
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
59
|
|
|
59
|
|
349
|
use IO::Compress::Base::Common 2.220 qw(); |
|
|
59
|
|
|
|
|
904
|
|
|
|
59
|
|
|
|
|
2013
|
|
|
11
|
59
|
|
|
59
|
|
8080
|
use IO::Compress::Adapter::Bzip2 2.220 ; |
|
|
59
|
|
|
|
|
1014
|
|
|
|
59
|
|
|
|
|
19164
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bzip2Error); |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
$VERSION = '2.220'; |
|
18
|
|
|
|
|
|
|
$Bzip2Error = ''; |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
@ISA = qw(IO::Compress::Base Exporter); |
|
21
|
|
|
|
|
|
|
@EXPORT_OK = qw( $Bzip2Error bzip2 ) ; |
|
22
|
|
|
|
|
|
|
%EXPORT_TAGS = %IO::Compress::Base::EXPORT_TAGS ; |
|
23
|
|
|
|
|
|
|
$EXPORT_TAGS{all} = [ defined $EXPORT_TAGS{all} ? @{ $EXPORT_TAGS{all} } : (), @EXPORT_OK ] ; |
|
24
|
|
|
|
|
|
|
Exporter::export_ok_tags('all'); |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub new |
|
29
|
|
|
|
|
|
|
{ |
|
30
|
401
|
|
|
401
|
1
|
711635
|
my $class = shift ; |
|
31
|
|
|
|
|
|
|
|
|
32
|
401
|
|
|
|
|
1824
|
my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$Bzip2Error); |
|
33
|
401
|
|
|
|
|
1923
|
return $obj->_create(undef, @_); |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub bzip2 |
|
37
|
|
|
|
|
|
|
{ |
|
38
|
139
|
|
|
139
|
1
|
365099
|
my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$Bzip2Error); |
|
39
|
139
|
|
|
|
|
572
|
$obj->_def(@_); |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub mkHeader |
|
44
|
|
|
|
|
|
|
{ |
|
45
|
526
|
|
|
526
|
0
|
945
|
my $self = shift ; |
|
46
|
526
|
|
|
|
|
1671
|
return ''; |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub getExtraParams |
|
51
|
|
|
|
|
|
|
{ |
|
52
|
586
|
|
|
586
|
0
|
2434
|
my $self = shift ; |
|
53
|
|
|
|
|
|
|
|
|
54
|
59
|
|
|
59
|
|
479
|
use IO::Compress::Base::Common 2.220 qw(:Parse); |
|
|
59
|
|
|
|
|
1002
|
|
|
|
59
|
|
|
|
|
33053
|
|
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
return ( |
|
57
|
586
|
|
|
|
|
9610
|
'blocksize100k' => [IO::Compress::Base::Common::Parse_unsigned, 1], |
|
58
|
|
|
|
|
|
|
'workfactor' => [IO::Compress::Base::Common::Parse_unsigned, 0], |
|
59
|
|
|
|
|
|
|
'verbosity' => [IO::Compress::Base::Common::Parse_boolean, 0], |
|
60
|
|
|
|
|
|
|
); |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub ckParams |
|
66
|
|
|
|
|
|
|
{ |
|
67
|
947
|
|
|
947
|
0
|
1814
|
my $self = shift ; |
|
68
|
947
|
|
|
|
|
1741
|
my $got = shift; |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# check that BlockSize100K is a number between 1 & 9 |
|
71
|
947
|
100
|
|
|
|
3142
|
if ($got->parsed('blocksize100k')) { |
|
72
|
12
|
|
|
|
|
34
|
my $value = $got->getValue('blocksize100k'); |
|
73
|
12
|
100
|
66
|
|
|
108
|
return $self->saveErrorString(undef, "Parameter 'BlockSize100K' not between 1 and 9, got $value") |
|
|
|
|
100
|
|
|
|
|
|
74
|
|
|
|
|
|
|
unless defined $value && $value >= 1 && $value <= 9; |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# check that WorkFactor between 0 & 250 |
|
79
|
944
|
100
|
|
|
|
2517
|
if ($got->parsed('workfactor')) { |
|
80
|
253
|
|
|
|
|
708
|
my $value = $got->getValue('workfactor'); |
|
81
|
253
|
100
|
66
|
|
|
1278
|
return $self->saveErrorString(undef, "Parameter 'WorkFactor' not between 0 and 250, got $value") |
|
82
|
|
|
|
|
|
|
unless $value >= 0 && $value <= 250; |
|
83
|
|
|
|
|
|
|
} |
|
84
|
|
|
|
|
|
|
|
|
85
|
942
|
|
|
|
|
3523
|
return 1 ; |
|
86
|
|
|
|
|
|
|
} |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub mkComp |
|
90
|
|
|
|
|
|
|
{ |
|
91
|
527
|
|
|
527
|
0
|
863
|
my $self = shift ; |
|
92
|
527
|
|
|
|
|
822
|
my $got = shift ; |
|
93
|
|
|
|
|
|
|
|
|
94
|
527
|
|
|
|
|
1223
|
my $BlockSize100K = $got->getValue('blocksize100k'); |
|
95
|
527
|
|
|
|
|
1169
|
my $WorkFactor = $got->getValue('workfactor'); |
|
96
|
527
|
|
|
|
|
1425
|
my $Verbosity = $got->getValue('verbosity'); |
|
97
|
|
|
|
|
|
|
|
|
98
|
527
|
|
|
|
|
2029
|
my ($obj, $errstr, $errno) = IO::Compress::Adapter::Bzip2::mkCompObject( |
|
99
|
|
|
|
|
|
|
$BlockSize100K, $WorkFactor, |
|
100
|
|
|
|
|
|
|
$Verbosity); |
|
101
|
|
|
|
|
|
|
|
|
102
|
527
|
50
|
|
|
|
1355
|
return $self->saveErrorString(undef, $errstr, $errno) |
|
103
|
|
|
|
|
|
|
if ! defined $obj; |
|
104
|
|
|
|
|
|
|
|
|
105
|
527
|
|
|
|
|
3172
|
return $obj; |
|
106
|
|
|
|
|
|
|
} |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub mkTrailer |
|
110
|
|
|
|
|
|
|
{ |
|
111
|
526
|
|
|
526
|
0
|
931
|
my $self = shift ; |
|
112
|
526
|
|
|
|
|
1403
|
return ''; |
|
113
|
|
|
|
|
|
|
} |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub mkFinalTrailer |
|
116
|
|
|
|
|
|
|
{ |
|
117
|
499
|
|
|
499
|
0
|
1797
|
return ''; |
|
118
|
|
|
|
|
|
|
} |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
#sub newHeader |
|
121
|
|
|
|
|
|
|
#{ |
|
122
|
|
|
|
|
|
|
# my $self = shift ; |
|
123
|
|
|
|
|
|
|
# return ''; |
|
124
|
|
|
|
|
|
|
#} |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
sub getInverseClass |
|
127
|
|
|
|
|
|
|
{ |
|
128
|
0
|
|
|
0
|
0
|
0
|
return ('IO::Uncompress::Bunzip2'); |
|
129
|
|
|
|
|
|
|
} |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
sub getFileInfo |
|
132
|
|
|
|
|
|
|
{ |
|
133
|
90
|
|
|
90
|
0
|
151
|
my $self = shift ; |
|
134
|
90
|
|
|
|
|
140
|
my $params = shift; |
|
135
|
90
|
|
|
|
|
260
|
my $file = shift ; |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
} |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
1; |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
__END__ |