| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package IO::Compress::Bzip2 ; |
|
2
|
|
|
|
|
|
|
|
|
3
|
59
|
|
|
59
|
|
50962
|
use strict ; |
|
|
59
|
|
|
|
|
104
|
|
|
|
59
|
|
|
|
|
1819
|
|
|
4
|
59
|
|
|
59
|
|
224
|
use warnings; |
|
|
59
|
|
|
|
|
72
|
|
|
|
59
|
|
|
|
|
2047
|
|
|
5
|
59
|
|
|
59
|
|
3673
|
use bytes; |
|
|
59
|
|
|
|
|
3433
|
|
|
|
59
|
|
|
|
|
252
|
|
|
6
|
|
|
|
|
|
|
require Exporter ; |
|
7
|
|
|
|
|
|
|
|
|
8
|
59
|
|
|
59
|
|
8036
|
use IO::Compress::Base 2.222 ; |
|
|
59
|
|
|
|
|
909
|
|
|
|
59
|
|
|
|
|
2768
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
59
|
|
|
59
|
|
261
|
use IO::Compress::Base::Common 2.222 qw(); |
|
|
59
|
|
|
|
|
1093
|
|
|
|
59
|
|
|
|
|
1624
|
|
|
11
|
59
|
|
|
59
|
|
5515
|
use IO::Compress::Adapter::Bzip2 2.222 ; |
|
|
59
|
|
|
|
|
712
|
|
|
|
59
|
|
|
|
|
14345
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bzip2Error); |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
$VERSION = '2.222'; |
|
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
|
480900
|
my $class = shift ; |
|
31
|
|
|
|
|
|
|
|
|
32
|
401
|
|
|
|
|
1341
|
my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$Bzip2Error); |
|
33
|
401
|
|
|
|
|
1263
|
return $obj->_create(undef, @_); |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub bzip2 |
|
37
|
|
|
|
|
|
|
{ |
|
38
|
139
|
|
|
139
|
1
|
255647
|
my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$Bzip2Error); |
|
39
|
139
|
|
|
|
|
447
|
$obj->_def(@_); |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub mkHeader |
|
44
|
|
|
|
|
|
|
{ |
|
45
|
526
|
|
|
526
|
0
|
616
|
my $self = shift ; |
|
46
|
526
|
|
|
|
|
1570
|
return ''; |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub getExtraParams |
|
51
|
|
|
|
|
|
|
{ |
|
52
|
586
|
|
|
586
|
0
|
779
|
my $self = shift ; |
|
53
|
|
|
|
|
|
|
|
|
54
|
59
|
|
|
59
|
|
345
|
use IO::Compress::Base::Common 2.222 qw(:Parse); |
|
|
59
|
|
|
|
|
803
|
|
|
|
59
|
|
|
|
|
25296
|
|
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
return ( |
|
57
|
586
|
|
|
|
|
6022
|
'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
|
1186
|
my $self = shift ; |
|
68
|
947
|
|
|
|
|
1022
|
my $got = shift; |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# check that BlockSize100K is a number between 1 & 9 |
|
71
|
947
|
100
|
|
|
|
1507
|
if ($got->parsed('blocksize100k')) { |
|
72
|
12
|
|
|
|
|
18
|
my $value = $got->getValue('blocksize100k'); |
|
73
|
12
|
100
|
66
|
|
|
54
|
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
|
|
|
|
1620
|
if ($got->parsed('workfactor')) { |
|
80
|
253
|
|
|
|
|
409
|
my $value = $got->getValue('workfactor'); |
|
81
|
253
|
100
|
66
|
|
|
776
|
return $self->saveErrorString(undef, "Parameter 'WorkFactor' not between 0 and 250, got $value") |
|
82
|
|
|
|
|
|
|
unless $value >= 0 && $value <= 250; |
|
83
|
|
|
|
|
|
|
} |
|
84
|
|
|
|
|
|
|
|
|
85
|
942
|
|
|
|
|
2078
|
return 1 ; |
|
86
|
|
|
|
|
|
|
} |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub mkComp |
|
90
|
|
|
|
|
|
|
{ |
|
91
|
527
|
|
|
527
|
0
|
545
|
my $self = shift ; |
|
92
|
527
|
|
|
|
|
1006
|
my $got = shift ; |
|
93
|
|
|
|
|
|
|
|
|
94
|
527
|
|
|
|
|
862
|
my $BlockSize100K = $got->getValue('blocksize100k'); |
|
95
|
527
|
|
|
|
|
777
|
my $WorkFactor = $got->getValue('workfactor'); |
|
96
|
527
|
|
|
|
|
800
|
my $Verbosity = $got->getValue('verbosity'); |
|
97
|
|
|
|
|
|
|
|
|
98
|
527
|
|
|
|
|
1339
|
my ($obj, $errstr, $errno) = IO::Compress::Adapter::Bzip2::mkCompObject( |
|
99
|
|
|
|
|
|
|
$BlockSize100K, $WorkFactor, |
|
100
|
|
|
|
|
|
|
$Verbosity); |
|
101
|
|
|
|
|
|
|
|
|
102
|
527
|
50
|
|
|
|
889
|
return $self->saveErrorString(undef, $errstr, $errno) |
|
103
|
|
|
|
|
|
|
if ! defined $obj; |
|
104
|
|
|
|
|
|
|
|
|
105
|
527
|
|
|
|
|
2165
|
return $obj; |
|
106
|
|
|
|
|
|
|
} |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub mkTrailer |
|
110
|
|
|
|
|
|
|
{ |
|
111
|
526
|
|
|
526
|
0
|
538
|
my $self = shift ; |
|
112
|
526
|
|
|
|
|
929
|
return ''; |
|
113
|
|
|
|
|
|
|
} |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub mkFinalTrailer |
|
116
|
|
|
|
|
|
|
{ |
|
117
|
499
|
|
|
499
|
0
|
870
|
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
|
98
|
my $self = shift ; |
|
134
|
90
|
|
|
|
|
102
|
my $params = shift; |
|
135
|
90
|
|
|
|
|
144
|
my $file = shift ; |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
} |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
1; |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
__END__ |