blib/lib/Unblock/HTTP3/NativeABI.pm

filter: Statementstmt 97.7% 44 / 45 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 93.3% 14 / 15 Podpod 0.0% 0 / 4 totaltotal 88.2% 60 / 68 CC 3 SCAR 3.5
CC
3
Cov
94%
c_header
3.1
native_include_dir
2.0
BEGIN
1.0
CRAP 1.4
« blib/lib/Unblock/HTTP3/_Bytes.pm ↑ Summary HTTP3.xs »
1 package Unblock::HTTP3::NativeABI;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use File::Basename qw(dirname);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use File::Spec ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 ▶use Unblock::HTTP3 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use Unblock::HTTP3::_Native ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 3 our $VERSION = '0.14';
13  
14 3 ▶use constant ABI_VERSION => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 3 ▶use constant TX_ACTIVE => 0;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 3 ▶use constant TX_COMPLETE => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 3 ▶use constant TX_CANCELLED => 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 3 ▶use constant TX_ERROR => 3;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 3 my $include_dir = File::Spec->catdir(
21 dirname(__FILE__),
22 'NativeABI',
23 );
24  
25 0 ▶sub native_include_dir {
Subroutine native_include_dir: not called CC=1 SCAR=6.9
Pod undocumented
26 0 return $include_dir;
27 }
28  
29 5 ▶sub header_path {
Subroutine header_path: called CC=1 SCAR=0.0
Pod undocumented
30 5 return File::Spec->catfile(
31 $include_dir,
32 'unblock_http3_consumer.h',
33 );
34 }
35  
36 4 ▶sub c_header {
Subroutine c_header: called CC=3 SCAR=11.2
Pod undocumented
37 4 my $path = header_path();
38  
39 4 ▶ open my $fh, '<', $path
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, "<", $path or die "could not read ${path}: $!" 4 0 4
40 or die "could not read $path: $!";
41  
42 4 local $/;
43 4 my $header = <$fh>;
44  
45 4 ▶ close $fh
Branch: 1 branch
BranchTrueFalseTotal
close $fh or die "could not close ${path}: $!" 4 0 4
46 or die "could not close $path: $!";
47  
48 4 return $header;
49 }
50  
51 2 ▶sub definition {
Subroutine definition: called CC=1 SCAR=0.0
Pod undocumented
52 return {
53 2 provider => \&Unblock::HTTP3::_Native::_consumer_operations_address,
54 abi_version => ABI_VERSION,
55 struct_size =>
56 Unblock::HTTP3::_Native::_consumer_operations_size(),
57 operations_address =>
58 Unblock::HTTP3::_Native::_consumer_operations_address(),
59 };
60 }
61  
62 3 1;
63  
64 __END__
« blib/lib/Unblock/HTTP3/_Bytes.pm ↑ Summary HTTP3.xs »