| 1 | # Copyrights 2011-2013 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.01. | ||||||||||||
| 5 | 3 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | package POSIX::1003::Errno; | ||||||||||||
| 9 | 3 | ▶ | use vars '$VERSION'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | 1 | $VERSION = '0.98'; | |||||||||||
| 11 | |||||||||||||
| 12 | 3 | ▶ | use base 'POSIX::1003::Module'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 13 | |||||||||||||
| 14 | 1 | ▶ | use Carp 'croak'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 15 | |||||||||||||
| 16 | 1 | my @constants; | |||||||||||
| 17 | 1 | my @functions = qw/strerror errno errno_names/; | |||||||||||
| 18 | |||||||||||||
| 19 | 1 | our %EXPORT_TAGS = | |||||||||||
| 20 | ( constants => \@constants | ||||||||||||
| 21 | , functions => \@functions | ||||||||||||
| 22 | , tables => [ '%errno' ] | ||||||||||||
| 23 | ); | ||||||||||||
| 24 | |||||||||||||
| 25 | 1 | my $errno; | |||||||||||
| 26 | 1 | our %errno; | |||||||||||
| 27 | |||||||||||||
| 28 | BEGIN { | ||||||||||||
| 29 | # initialize the :constants export tag | ||||||||||||
| 30 | 1 | ▶ | $errno = errno_table; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 31 | 1 | push @constants, keys %$errno; | |||||||||||
| 32 | 1 | tie %errno, 'POSIX::1003::ReadOnlyTable', $errno; | |||||||||||
| 33 | } | ||||||||||||
| 34 | |||||||||||||
| 35 | sub errno($); | ||||||||||||
| 36 | |||||||||||||
| 37 | |||||||||||||
| 38 | sub exampleValue($) | ||||||||||||
| 39 | 0 | ▶ | { my ($class, $name) = @_; | ||||||||||
|
Subroutine
exampleValue: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 40 | 0 | ▶ | $name =~ m/^(?:WSA)?E/ or return; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 41 | 0 | ▶ | errno($name) // 'undef'; | ||||||||||
|
Condition0%0/2
&errno($name) // "undef"
MC/DC0%0/1
&errno($name) // "undef"
&errno($name)
Truth table0%0/2
A
A= &errno($name)
| |||||||||||||
| 42 | } | ||||||||||||
| 43 | |||||||||||||
| 44 | |||||||||||||
| 45 | 0 | ▶ | sub strerror($) { _strerror($_[0]) || "Unknown error $_[0]" } | ||||||||||
|
Subroutine
strerror: not called CC=2 SCAR=17.9
Pod
documented
Branch: 1 branch
| |||||||||||||
| 46 | |||||||||||||
| 47 | |||||||||||||
| 48 | sub errno($) | ||||||||||||
| 49 | 0 | ▶ | { my $key = shift // return; | ||||||||||
|
Subroutine
errno: not called CC=3 SCAR=24.8
Pod
documented
Condition0%0/2
shift() // (return)
MC/DC0%0/1
shift() // (return)
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||
| 50 | 0 | ▶ | $key =~ /^(?:WSA)?E/ | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 51 | or croak "pass the constant name $key as string"; | ||||||||||||
| 52 | |||||||||||||
| 53 | 0 | $errno->{$key}; | |||||||||||
| 54 | } | ||||||||||||
| 55 | |||||||||||||
| 56 | sub _create_constant($) | ||||||||||||
| 57 | 1 | ▶ | { my ($class, $name) = @_; | ||||||||||
|
Subroutine
_create_constant: called CC=2 SCAR=7.6
| |||||||||||||
| 58 | 1 | ▶ | my $nr = $errno->{$name} // return sub() {undef}; | ||||||||||
|
Condition50%1/2
$errno->{$name} // (return sub () { undef }
)
MC/DC0%0/1
$errno->{$name} // (return sub () { undef }
)
$errno->{$name}
Truth table50%1/2
A
A= $errno->{$name}
| |||||||||||||
| 59 | 1 | ▶ | sub() {$nr}; | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||
| 60 | } | ||||||||||||
| 61 | |||||||||||||
| 62 | |||||||||||||
| 63 | 0 | ▶ | sub errno_names() { keys %$errno } | ||||||||||
|
Subroutine
errno_names: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 64 | |||||||||||||
| 65 | |||||||||||||
| 66 | 1 | 1; | |||||||||||