line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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::Confstr; |
10
|
3
|
|
|
3
|
|
74909
|
use vars '$VERSION'; |
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
184
|
|
11
|
|
|
|
|
|
|
$VERSION = '1.02'; |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
19
|
use base 'POSIX::1003::Module'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
698
|
|
14
|
|
|
|
|
|
|
|
15
|
3
|
|
|
3
|
|
21
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
102
|
|
16
|
3
|
|
|
3
|
|
15
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
92
|
|
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
3
|
|
15
|
use Carp 'croak'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
483
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my @constants; |
21
|
|
|
|
|
|
|
my @functions = qw/confstr confstr_names/; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our %EXPORT_TAGS = |
24
|
|
|
|
|
|
|
( constants => \@constants |
25
|
|
|
|
|
|
|
, functions => \@functions |
26
|
|
|
|
|
|
|
, tables => [ '%confstr' ] |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub confstr($); |
30
|
|
|
|
|
|
|
my $confstr; |
31
|
|
|
|
|
|
|
our %confstr; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
BEGIN { |
34
|
3
|
|
|
3
|
|
241
|
$confstr = confstr_table; |
35
|
3
|
|
|
|
|
73
|
push @constants, keys %$confstr; |
36
|
3
|
|
|
|
|
28
|
tie %confstr, 'POSIX::1003::ReadOnlyTable', $confstr; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub exampleValue($) |
41
|
0
|
|
|
0
|
1
|
0
|
{ my ($class, $name) = @_; |
42
|
0
|
0
|
|
|
|
0
|
$name =~ m/^_CS_/ or return; |
43
|
0
|
|
|
|
|
0
|
my $val = confstr $name; |
44
|
0
|
0
|
|
|
|
0
|
defined $val ? "'$val'" : 'undef'; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
#----------------------- |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub confstr($) |
50
|
68
|
|
50
|
68
|
1
|
1383
|
{ my $key = shift // return; |
51
|
68
|
100
|
|
|
|
540
|
$key =~ /^_CS_/ |
52
|
|
|
|
|
|
|
or croak "pass the constant name as string"; |
53
|
|
|
|
|
|
|
|
54
|
66
|
|
50
|
|
|
140
|
my $id = $confstr->{$key} // return; |
55
|
66
|
|
|
|
|
433
|
_confstr($id); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub _create_constant($) |
59
|
1
|
|
|
1
|
|
3
|
{ my ($class, $name) = @_; |
60
|
1
|
|
50
|
|
|
9
|
my $id = $confstr->{$name} // return sub() {undef}; |
61
|
1
|
|
|
2
|
|
7
|
sub() {_confstr($id)}; |
|
2
|
|
|
|
|
1427
|
|
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
#-------------------------- |
65
|
|
|
|
|
|
|
|
66
|
1
|
|
|
1
|
1
|
935
|
sub confstr_names() { keys %$confstr } |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
#-------------------------- |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |