line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package IO::Compress::Bzip2 ; |
2
|
|
|
|
|
|
|
|
3
|
30
|
|
|
30
|
|
21891
|
use strict ; |
|
30
|
|
|
|
|
99
|
|
|
30
|
|
|
|
|
810
|
|
4
|
30
|
|
|
30
|
|
138
|
use warnings; |
|
30
|
|
|
|
|
54
|
|
|
30
|
|
|
|
|
644
|
|
5
|
30
|
|
|
30
|
|
4601
|
use bytes; |
|
30
|
|
|
|
|
138
|
|
|
30
|
|
|
|
|
122
|
|
6
|
|
|
|
|
|
|
require Exporter ; |
7
|
|
|
|
|
|
|
|
8
|
30
|
|
|
30
|
|
6147
|
use IO::Compress::Base 2.204 ; |
|
30
|
|
|
|
|
511
|
|
|
30
|
|
|
|
|
1308
|
|
9
|
|
|
|
|
|
|
|
10
|
30
|
|
|
30
|
|
172
|
use IO::Compress::Base::Common 2.204 qw(); |
|
30
|
|
|
|
|
375
|
|
|
30
|
|
|
|
|
729
|
|
11
|
30
|
|
|
30
|
|
4967
|
use IO::Compress::Adapter::Bzip2 2.204 ; |
|
30
|
|
|
|
|
489
|
|
|
30
|
|
|
|
|
7259
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bzip2Error); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
$VERSION = '2.204'; |
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
|
|
|
|
|
|
|
push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; |
24
|
|
|
|
|
|
|
Exporter::export_ok_tags('all'); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub new |
29
|
|
|
|
|
|
|
{ |
30
|
401
|
|
|
401
|
1
|
218598
|
my $class = shift ; |
31
|
|
|
|
|
|
|
|
32
|
401
|
|
|
|
|
1296
|
my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$Bzip2Error); |
33
|
401
|
|
|
|
|
1392
|
return $obj->_create(undef, @_); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub bzip2 |
37
|
|
|
|
|
|
|
{ |
38
|
138
|
|
|
138
|
1
|
134786
|
my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$Bzip2Error); |
39
|
138
|
|
|
|
|
473
|
$obj->_def(@_); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub mkHeader |
44
|
|
|
|
|
|
|
{ |
45
|
525
|
|
|
525
|
0
|
814
|
my $self = shift ; |
46
|
525
|
|
|
|
|
1351
|
return ''; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub getExtraParams |
51
|
|
|
|
|
|
|
{ |
52
|
557
|
|
|
557
|
0
|
898
|
my $self = shift ; |
53
|
|
|
|
|
|
|
|
54
|
30
|
|
|
30
|
|
219
|
use IO::Compress::Base::Common 2.204 qw(:Parse); |
|
30
|
|
|
|
|
399
|
|
|
30
|
|
|
|
|
12967
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
return ( |
57
|
557
|
|
|
|
|
4930
|
'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
|
918
|
|
|
918
|
0
|
1438
|
my $self = shift ; |
68
|
918
|
|
|
|
|
1287
|
my $got = shift; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# check that BlockSize100K is a number between 1 & 9 |
71
|
918
|
100
|
|
|
|
1941
|
if ($got->parsed('blocksize100k')) { |
72
|
12
|
|
|
|
|
23
|
my $value = $got->getValue('blocksize100k'); |
73
|
12
|
100
|
66
|
|
|
77
|
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
|
915
|
100
|
|
|
|
2042
|
if ($got->parsed('workfactor')) { |
80
|
253
|
|
|
|
|
480
|
my $value = $got->getValue('workfactor'); |
81
|
253
|
100
|
66
|
|
|
992
|
return $self->saveErrorString(undef, "Parameter 'WorkFactor' not between 0 and 250, got $value") |
82
|
|
|
|
|
|
|
unless $value >= 0 && $value <= 250; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
913
|
|
|
|
|
3469
|
return 1 ; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub mkComp |
90
|
|
|
|
|
|
|
{ |
91
|
526
|
|
|
526
|
0
|
769
|
my $self = shift ; |
92
|
526
|
|
|
|
|
725
|
my $got = shift ; |
93
|
|
|
|
|
|
|
|
94
|
526
|
|
|
|
|
1020
|
my $BlockSize100K = $got->getValue('blocksize100k'); |
95
|
526
|
|
|
|
|
1050
|
my $WorkFactor = $got->getValue('workfactor'); |
96
|
526
|
|
|
|
|
977
|
my $Verbosity = $got->getValue('verbosity'); |
97
|
|
|
|
|
|
|
|
98
|
526
|
|
|
|
|
1395
|
my ($obj, $errstr, $errno) = IO::Compress::Adapter::Bzip2::mkCompObject( |
99
|
|
|
|
|
|
|
$BlockSize100K, $WorkFactor, |
100
|
|
|
|
|
|
|
$Verbosity); |
101
|
|
|
|
|
|
|
|
102
|
526
|
50
|
|
|
|
1165
|
return $self->saveErrorString(undef, $errstr, $errno) |
103
|
|
|
|
|
|
|
if ! defined $obj; |
104
|
|
|
|
|
|
|
|
105
|
526
|
|
|
|
|
2736
|
return $obj; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub mkTrailer |
110
|
|
|
|
|
|
|
{ |
111
|
525
|
|
|
525
|
0
|
810
|
my $self = shift ; |
112
|
525
|
|
|
|
|
1213
|
return ''; |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub mkFinalTrailer |
116
|
|
|
|
|
|
|
{ |
117
|
498
|
|
|
498
|
0
|
1101
|
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
|
150
|
my $self = shift ; |
134
|
90
|
|
|
|
|
121
|
my $params = shift; |
135
|
90
|
|
|
|
|
168
|
my $file = shift ; |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
1; |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
__END__ |