| 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::Events; | ||||||||||||
| 10 | 3 | ▶ | use vars '$VERSION'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | 3 | $VERSION = '1.02'; | |||||||||||
| 12 | |||||||||||||
| 13 | 3 | ▶ | use base 'POSIX::1003::Module'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 14 | |||||||||||||
| 15 | 3 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 16 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 17 | |||||||||||||
| 18 | 3 | my (@constants, @poll); | |||||||||||
| 19 | |||||||||||||
| 20 | 3 | my @functions = qw/ | |||||||||||
| 21 | FD_CLR FD_ISSET FD_SET FD_ZERO select | ||||||||||||
| 22 | poll events_names | ||||||||||||
| 23 | /; | ||||||||||||
| 24 | |||||||||||||
| 25 | 3 | our %EXPORT_TAGS = | |||||||||||
| 26 | ( constants => \@constants | ||||||||||||
| 27 | , poll => \@poll | ||||||||||||
| 28 | , functions => \@functions | ||||||||||||
| 29 | ); | ||||||||||||
| 30 | |||||||||||||
| 31 | 3 | my $events; | |||||||||||
| 32 | |||||||||||||
| 33 | 3 | ▶ | BEGIN { | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 34 | 3 | $events = events_table; | |||||||||||
| 35 | 3 | push @constants, keys %$events; | |||||||||||
| 36 | |||||||||||||
| 37 | 3 | @poll = qw(poll events_names); | |||||||||||
| 38 | 3 | push @poll, grep /^POLL/, keys %$events; | |||||||||||
| 39 | } | ||||||||||||
| 40 | |||||||||||||
| 41 | |||||||||||||
| 42 | sub select($$$;$) | ||||||||||||
| 43 | 0 | ▶ | { push @_, undef if @_==3; | ||||||||||
|
Subroutine
select: not called CC=2 SCAR=17.9
Pod
documented
Branch: 1 branch
| |||||||||||||
| 44 | 0 | goto &select; | |||||||||||
| 45 | } | ||||||||||||
| 46 | |||||||||||||
| 47 | |||||||||||||
| 48 | 0 | ▶ | sub FD_CLR($$) {vec($_[1],$_[0],1) = 0} | ||||||||||
|
Subroutine
FD_CLR: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 49 | 0 | ▶ | sub FD_ISSET($$) {vec($_[1],$_[0],1) ==1} | ||||||||||
|
Subroutine
FD_ISSET: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 50 | 0 | ▶ | sub FD_SET($$) {vec($_[1],$_[0],1) = 1} | ||||||||||
|
Subroutine
FD_SET: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 51 | 0 | ▶ | sub FD_ZERO($) {$_[0] = 0} | ||||||||||
|
Subroutine
FD_ZERO: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 52 | |||||||||||||
| 53 | |||||||||||||
| 54 | sub poll($;$) | ||||||||||||
| 55 | 0 | ▶ | { my ($data, $timeout) = @_; | ||||||||||
|
Subroutine
poll: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 56 | 0 | ▶ | defined $timeout or $timeout = -1; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 57 | 0 | _poll($data, $timeout); | |||||||||||
| 58 | } | ||||||||||||
| 59 | |||||||||||||
| 60 | #---------------------- | ||||||||||||
| 61 | |||||||||||||
| 62 | 0 | ▶ | sub events_names() { keys %$events } | ||||||||||
|
Subroutine
events_names: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 63 | |||||||||||||
| 64 | sub _create_constant($) | ||||||||||||
| 65 | 0 | ▶ | { my ($class, $name) = @_; | ||||||||||
|
Subroutine
_create_constant: not called CC=2 SCAR=17.9
| |||||||||||||
| 66 | 0 | ▶ | my $val = $events->{$name} // return sub() {undef}; | ||||||||||
|
Condition0%0/2
$events->{$name} // (return sub () { undef }
)
MC/DC0%0/1
$events->{$name} // (return sub () { undef }
)
$events->{$name}
Truth table0%0/2
A
A= $events->{$name}
| |||||||||||||
| 67 | 0 | ▶ | sub() {$val}; | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||
| 68 | |||||||||||||
| 69 | } | ||||||||||||
| 70 | #---------------------- | ||||||||||||
| 71 | |||||||||||||
| 72 | 3 | 1; | |||||||||||