blib/lib/POSIX/1003/Socket.pm

filter: Statementstmt 79.4% 27 / 34 Branchbran n/a Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 55.5% 5 / 9 Podpod 100% 2 / 2 totaltotal 66.6% 34 / 51 CC 3 SCAR 11.0
CC
3
Cov
71%
exampleValue
6.0
_create_constant
6.0
__ANON__
2.0
CRAP 3.0
« blib/lib/POSIX/1003/Events.pm ↑ Summary blib/lib/POSIX/1003/Math.pm »
1 # Copyrights 2011-2020 by [Mark Overmeer].
2 # For other contributors see ChangeLog.
3 # See the manual pages for details on the licensing terms.
4 # Pod stripped from pm file by OODoc 2.02.
5 # This code is part of distribution POSIX-1003. Meta-POD processed with
6 # OODoc into POD and HTML manual-pages. See README.md
7 # Copyright Mark Overmeer. Licensed under the same terms as Perl itself.
8  
9 package POSIX::1003::Socket;
10 4 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 $VERSION = '1.02';
12  
13 4 ▶use base 'POSIX::1003::Module';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 4 my (@sock, @sol, @so, @af, @pf, @constants);
19 4 my @functions = qw/socket_names/;
20 4 our @IN_CORE = qw//; # to be added
21  
22 4 our %EXPORT_TAGS =
23 ( sock => \@sock
24 , so => \@so
25 , sol => \@sol
26 , af => \@af
27 , pf => \@pf
28 , constants => \@constants
29 , functions => \@functions
30 , tables => [ qw/%sockets/ ]
31 );
32  
33 4 my ($socket, %socket);
34 4 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
35 4 $socket = socket_table;
36 4 @constants = sort keys %$socket;
37 4 tie %socket, 'POSIX::1003::ReadOnlyTable', $socket;
38  
39 4 @sock = grep /^SOCK/, @constants;
40 4 @so = grep /^SO_/, @constants;
41 4 @sol = grep /^SOL_/, @constants;
42 4 @af = grep /^AF_/, @constants;
43 4 @pf = grep /^PF_/, @constants;
44 }
45  
46  
47 sub exampleValue($)
48 0 ▶{ my ($class, $name) = @_;
Subroutine exampleValue: not called CC=2 SCAR=17.9
Pod documented
49 0 ▶ $socket{$name} // 'undef';
Condition0%0/2
$socket{$name} // "undef"
l!l
00
MC/DC0%0/1
$socket{$name} // "undef"
$socket{$name}
Truth table0%0/2
A
A= $socket{$name}
Aresult
11
00
50 }
51  
52 sub _create_constant($)
53 0 ▶{ my ($class, $name) = @_;
Subroutine _create_constant: not called CC=2 SCAR=17.9
54 0 ▶ my $nr = $socket->{$name} // return sub() {undef};
Condition0%0/2
$socket->{$name} // (return sub () { undef } )
l!l
00
MC/DC0%0/1
$socket->{$name} // (return sub () { undef } )
$socket->{$name}
Truth table0%0/2
A
A= $socket->{$name}
Aresult
11
00
55 0 ▶ sub() {$nr};
Subroutine __ANON__: not called CC=1 SCAR=6.9
56 }
57  
58 #-------------
59  
60 # get/setsockopt in XS
61  
62 #------------
63  
64 0 ▶sub socket_names() { keys %$socket }
Subroutine socket_names: not called CC=1 SCAR=6.9
Pod documented
65  
66 #------------
67  
68 4 1;
« blib/lib/POSIX/1003/Events.pm ↑ Summary blib/lib/POSIX/1003/Math.pm »