blib/lib/Unblock/HTTP2/NativeABI.pm

filter: Statementstmt 100% 57 / 57 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 19 / 19 Podpod 0.0% 0 / 4 totaltotal 92.8% 78 / 84 CC 3 SCAR 2.6
CC
3
Cov
97%
c_header
3.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« blib/lib/Unblock/HTTP2.pm ↑ Summary nghttp2.xs »
1 package Unblock::HTTP2::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::HTTP2 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use Unblock::HTTP2::_nghttp2 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 3 our $VERSION = $Unblock::HTTP2::VERSION;
13  
14 3 ▶use constant ABI_VERSION => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 3 ▶use constant INPUT_OK => 0;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 3 ▶use constant INPUT_MORE => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 3 ▶use constant INPUT_CLOSED => 3;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 3 ▶use constant OUTPUT_OK => 0;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 3 ▶use constant OUTPUT_CLOSED => 3;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 3 ▶use constant OUTPUT_CONTINUE => 0;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 3 ▶use constant OUTPUT_PAUSE => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 3 ▶use constant OUTPUT_ERROR => -1;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 3 my $include_dir = File::Spec->catdir(
25 dirname(__FILE__),
26 'NativeABI',
27 );
28  
29 1 ▶sub native_include_dir {
Subroutine native_include_dir: called CC=1 SCAR=0.0
Pod undocumented
30 1 return $include_dir;
31 }
32  
33 2 ▶sub header_path {
Subroutine header_path: called CC=1 SCAR=0.0
Pod undocumented
34 2 return File::Spec->catfile(
35 $include_dir,
36 'unblock_http2_native_abi.h',
37 );
38 }
39  
40 1 ▶sub c_header {
Subroutine c_header: called CC=3 SCAR=11.2
Pod undocumented
41 1 my $path = header_path();
42  
43 1 ▶ open my $fh, '<', $path
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, "<", $path or die "could not read ${path}: $!" 1 0 1
44 or die "could not read $path: $!";
45  
46 1 local $/;
47 1 my $header = <$fh>;
48  
49 1 ▶ close $fh
Branch: 1 branch
BranchTrueFalseTotal
close $fh or die "could not close ${path}: $!" 1 0 1
50 or die "could not close $path: $!";
51  
52 1 return $header;
53 }
54  
55 1 ▶sub definition {
Subroutine definition: called CC=1 SCAR=0.0
Pod undocumented
56 return {
57 1 provider => \&Unblock::HTTP2::_nghttp2::_native_transport_operations_address,
58 abi_version => ABI_VERSION,
59 struct_size =>
60 Unblock::HTTP2::_nghttp2::_native_transport_operations_size(),
61 operations_address =>
62 Unblock::HTTP2::_nghttp2::_native_transport_operations_address(),
63 };
64 }
65  
66 3 1;
67  
68 __END__
« blib/lib/Unblock/HTTP2.pm ↑ Summary nghttp2.xs »