Filename | /usr/local/perls/perl-5.26.1/lib/5.26.1/IO/Uncompress/Bunzip2.pm |
Statements | Executed 22 statements in 1.82ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 1.30ms | 8.90ms | BEGIN@10 | IO::Uncompress::Bunzip2::
1 | 1 | 1 | 46µs | 51µs | BEGIN@3 | IO::Uncompress::Bunzip2::
1 | 1 | 1 | 29µs | 61µs | BEGIN@9 | IO::Uncompress::Bunzip2::
1 | 1 | 1 | 22µs | 258µs | BEGIN@7 | IO::Uncompress::Bunzip2::
1 | 1 | 1 | 16µs | 24µs | BEGIN@5 | IO::Uncompress::Bunzip2::
1 | 1 | 1 | 12µs | 24µs | BEGIN@4 | IO::Uncompress::Bunzip2::
0 | 0 | 0 | 0s | 0s | bunzip2 | IO::Uncompress::Bunzip2::
0 | 0 | 0 | 0s | 0s | chkTrailer | IO::Uncompress::Bunzip2::
0 | 0 | 0 | 0s | 0s | ckMagic | IO::Uncompress::Bunzip2::
0 | 0 | 0 | 0s | 0s | ckParams | IO::Uncompress::Bunzip2::
0 | 0 | 0 | 0s | 0s | getExtraParams | IO::Uncompress::Bunzip2::
0 | 0 | 0 | 0s | 0s | isBzip2Magic | IO::Uncompress::Bunzip2::
0 | 0 | 0 | 0s | 0s | mkUncomp | IO::Uncompress::Bunzip2::
0 | 0 | 0 | 0s | 0s | new | IO::Uncompress::Bunzip2::
0 | 0 | 0 | 0s | 0s | readHeader | IO::Uncompress::Bunzip2::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package IO::Uncompress::Bunzip2 ; | ||||
2 | |||||
3 | 2 | 42µs | 2 | 56µs | # spent 51µs (46+5) within IO::Uncompress::Bunzip2::BEGIN@3 which was called:
# once (46µs+5µs) by Archive::Tar::Constant::BEGIN@74 at line 3 # spent 51µs making 1 call to IO::Uncompress::Bunzip2::BEGIN@3
# spent 5µs making 1 call to strict::import |
4 | 2 | 35µs | 2 | 36µs | # spent 24µs (12+12) within IO::Uncompress::Bunzip2::BEGIN@4 which was called:
# once (12µs+12µs) by Archive::Tar::Constant::BEGIN@74 at line 4 # spent 24µs making 1 call to IO::Uncompress::Bunzip2::BEGIN@4
# spent 12µs making 1 call to warnings::import |
5 | 2 | 53µs | 2 | 32µs | # spent 24µs (16+8) within IO::Uncompress::Bunzip2::BEGIN@5 which was called:
# once (16µs+8µs) by Archive::Tar::Constant::BEGIN@74 at line 5 # spent 24µs making 1 call to IO::Uncompress::Bunzip2::BEGIN@5
# spent 8µs making 1 call to bytes::import |
6 | |||||
7 | 3 | 73µs | 3 | 494µs | # spent 258µs (22+236) within IO::Uncompress::Bunzip2::BEGIN@7 which was called:
# once (22µs+236µs) by Archive::Tar::Constant::BEGIN@74 at line 7 # spent 258µs making 1 call to IO::Uncompress::Bunzip2::BEGIN@7
# spent 220µs making 1 call to Exporter::import
# spent 16µs making 1 call to version::_VERSION |
8 | |||||
9 | 3 | 84µs | 3 | 93µs | # spent 61µs (29+32) within IO::Uncompress::Bunzip2::BEGIN@9 which was called:
# once (29µs+32µs) by Archive::Tar::Constant::BEGIN@74 at line 9 # spent 61µs making 1 call to IO::Uncompress::Bunzip2::BEGIN@9
# spent 22µs making 1 call to Exporter::import
# spent 10µs making 1 call to version::_VERSION |
10 | 3 | 1.49ms | 2 | 8.91ms | # spent 8.90ms (1.30+7.60) within IO::Uncompress::Bunzip2::BEGIN@10 which was called:
# once (1.30ms+7.60ms) by Archive::Tar::Constant::BEGIN@74 at line 10 # spent 8.90ms making 1 call to IO::Uncompress::Bunzip2::BEGIN@10
# spent 12µs making 1 call to version::_VERSION |
11 | |||||
12 | 1 | 1µs | require Exporter ; | ||
13 | our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bunzip2Error); | ||||
14 | |||||
15 | 1 | 1µs | $VERSION = '2.074'; | ||
16 | 1 | 0s | $Bunzip2Error = ''; | ||
17 | |||||
18 | 1 | 29µs | @ISA = qw(IO::Uncompress::Base Exporter); | ||
19 | 1 | 1µs | @EXPORT_OK = qw( $Bunzip2Error bunzip2 ) ; | ||
20 | #%EXPORT_TAGS = %IO::Uncompress::Base::EXPORT_TAGS ; | ||||
21 | 1 | 2µs | push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; | ||
22 | #Exporter::export_ok_tags('all'); | ||||
23 | |||||
24 | |||||
25 | sub new | ||||
26 | { | ||||
27 | my $class = shift ; | ||||
28 | my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$Bunzip2Error); | ||||
29 | |||||
30 | $obj->_create(undef, 0, @_); | ||||
31 | } | ||||
32 | |||||
33 | sub bunzip2 | ||||
34 | { | ||||
35 | my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$Bunzip2Error); | ||||
36 | return $obj->_inf(@_); | ||||
37 | } | ||||
38 | |||||
39 | sub getExtraParams | ||||
40 | { | ||||
41 | return ( | ||||
42 | 'verbosity' => [IO::Compress::Base::Common::Parse_boolean, 0], | ||||
43 | 'small' => [IO::Compress::Base::Common::Parse_boolean, 0], | ||||
44 | ); | ||||
45 | } | ||||
46 | |||||
47 | |||||
48 | sub ckParams | ||||
49 | { | ||||
50 | my $self = shift ; | ||||
51 | my $got = shift ; | ||||
52 | |||||
53 | return 1; | ||||
54 | } | ||||
55 | |||||
56 | sub mkUncomp | ||||
57 | { | ||||
58 | my $self = shift ; | ||||
59 | my $got = shift ; | ||||
60 | |||||
61 | my $magic = $self->ckMagic() | ||||
62 | or return 0; | ||||
63 | |||||
64 | *$self->{Info} = $self->readHeader($magic) | ||||
65 | or return undef ; | ||||
66 | |||||
67 | my $Small = $got->getValue('small'); | ||||
68 | my $Verbosity = $got->getValue('verbosity'); | ||||
69 | |||||
70 | my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Bunzip2::mkUncompObject( | ||||
71 | $Small, $Verbosity); | ||||
72 | |||||
73 | return $self->saveErrorString(undef, $errstr, $errno) | ||||
74 | if ! defined $obj; | ||||
75 | |||||
76 | *$self->{Uncomp} = $obj; | ||||
77 | |||||
78 | return 1; | ||||
79 | |||||
80 | } | ||||
81 | |||||
82 | |||||
83 | sub ckMagic | ||||
84 | { | ||||
85 | my $self = shift; | ||||
86 | |||||
87 | my $magic ; | ||||
88 | $self->smartReadExact(\$magic, 4); | ||||
89 | |||||
90 | *$self->{HeaderPending} = $magic ; | ||||
91 | |||||
92 | return $self->HeaderError("Header size is " . | ||||
93 | 4 . " bytes") | ||||
94 | if length $magic != 4; | ||||
95 | |||||
96 | return $self->HeaderError("Bad Magic.") | ||||
97 | if ! isBzip2Magic($magic) ; | ||||
98 | |||||
99 | |||||
100 | *$self->{Type} = 'bzip2'; | ||||
101 | return $magic; | ||||
102 | } | ||||
103 | |||||
104 | sub readHeader | ||||
105 | { | ||||
106 | my $self = shift; | ||||
107 | my $magic = shift ; | ||||
108 | |||||
109 | $self->pushBack($magic); | ||||
110 | *$self->{HeaderPending} = ''; | ||||
111 | |||||
112 | |||||
113 | return { | ||||
114 | 'Type' => 'bzip2', | ||||
115 | 'FingerprintLength' => 4, | ||||
116 | 'HeaderLength' => 4, | ||||
117 | 'TrailerLength' => 0, | ||||
118 | 'Header' => '$magic' | ||||
119 | }; | ||||
120 | |||||
121 | } | ||||
122 | |||||
123 | sub chkTrailer | ||||
124 | { | ||||
125 | return STATUS_OK; | ||||
126 | } | ||||
127 | |||||
- - | |||||
130 | sub isBzip2Magic | ||||
131 | { | ||||
132 | my $buffer = shift ; | ||||
133 | return $buffer =~ /^BZh\d$/; | ||||
134 | } | ||||
135 | |||||
136 | 1 | 11µs | 1 ; | ||
137 | |||||
138 | __END__ |