| 1 | # Copyright 2010, 2011, 2013, 2014, 2019 Kevin Ryde | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | # This file is part of Filter-gunzip. | ||||||||||||||||||||||||||||
| 4 | # | ||||||||||||||||||||||||||||
| 5 | # Filter-gunzip is free software; you can redistribute it and/or modify it | ||||||||||||||||||||||||||||
| 6 | # under the terms of the GNU General Public License as published by the Free | ||||||||||||||||||||||||||||
| 7 | # Software Foundation; either version 3, or (at your option) any later | ||||||||||||||||||||||||||||
| 8 | # version. | ||||||||||||||||||||||||||||
| 9 | # | ||||||||||||||||||||||||||||
| 10 | # Filter-gunzip is distributed in the hope that it will be useful, but | ||||||||||||||||||||||||||||
| 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||||||||||||||||||||||||||||
| 12 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||||||||||||||||||||||||||||
| 13 | # for more details. | ||||||||||||||||||||||||||||
| 14 | # | ||||||||||||||||||||||||||||
| 15 | # You should have received a copy of the GNU General Public License along | ||||||||||||||||||||||||||||
| 16 | # with Filter-gunzip. If not, see <http://www.gnu.org/licenses/>. | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | package Filter::gunzip; | ||||||||||||||||||||||||||||
| 19 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | 2 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 21 | 2 | ▶ | use DynaLoader; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 2 | ▶ | use vars qw($VERSION @ISA); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 24 | 2 | $VERSION = 8; | |||||||||||||||||||||||||||
| 25 | 2 | @ISA = ('DynaLoader'); | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | # uncomment this to run the ### lines | ||||||||||||||||||||||||||||
| 28 | # use Smart::Comments; | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 2 | my $use_xs = 1; | |||||||||||||||||||||||||||
| 31 | 2 | ▶ | if (! eval { __PACKAGE__->bootstrap($VERSION) }) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 32 | ### filter gunzip no XS: $@ | ||||||||||||||||||||||||||||
| 33 | 0 | $use_xs = 0; | |||||||||||||||||||||||||||
| 34 | 2 | } elsif (! eval { require PerlIO::gzip; 1 }) { | |||||||||||||||||||||||||||
| 35 | ### filter gunzip have XS but no have PerlIO gzip: $@ | ||||||||||||||||||||||||||||
| 36 | 0 | $use_xs = 0; | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 1 | ▶ | sub import { | ||||||||||||||||||||||||||
|
Subroutine
import: called CC=3 SCAR=15.1
| |||||||||||||||||||||||||||||
| 40 | 1 | my ($class) = @_; | |||||||||||||||||||||||||||
| 41 | 1 | ▶ | if ($use_xs && _filter_by_layer()) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$use_xs and _filter_by_layer()
MC/DC0%0/2
$use_xs and _filter_by_layer()
$use_xs
_filter_by_layer()
Truth table33%1/3
A and B
A= $use_xsB= _filter_by_layer()
| |||||||||||||||||||||||||||||
| 42 | ### applied gzip layer ... | ||||||||||||||||||||||||||||
| 43 | } else { | ||||||||||||||||||||||||||||
| 44 | ### use Filter gunzip Filter ... | ||||||||||||||||||||||||||||
| 45 | 0 | require Filter::gunzip::Filter; | |||||||||||||||||||||||||||
| 46 | 0 | Filter::gunzip::Filter->import; | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 2 | 1; | |||||||||||||||||||||||||||
| 51 | __END__ | ||||||||||||||||||||||||||||