| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# Copyrights 2011-2015 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
|
|
|
3
|
|
16165
|
use warnings; |
|
|
3
|
|
|
|
|
4
|
|
|
|
3
|
|
|
|
|
75
|
|
|
6
|
3
|
|
|
3
|
|
11
|
use strict; |
|
|
3
|
|
|
|
|
3
|
|
|
|
3
|
|
|
|
|
105
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package POSIX::1003::Pathconf; |
|
9
|
3
|
|
|
3
|
|
13
|
use vars '$VERSION'; |
|
|
3
|
|
|
|
|
5
|
|
|
|
3
|
|
|
|
|
129
|
|
|
10
|
|
|
|
|
|
|
$VERSION = '0.99_06'; |
|
11
|
|
|
|
|
|
|
|
|
12
|
3
|
|
|
3
|
|
17
|
use base 'POSIX::1003::Module'; |
|
|
3
|
|
|
|
|
3
|
|
|
|
3
|
|
|
|
|
358
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
3
|
|
|
3
|
|
14
|
use Carp 'croak'; |
|
|
3
|
|
|
|
|
3
|
|
|
|
3
|
|
|
|
|
376
|
|
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my @constants; |
|
17
|
|
|
|
|
|
|
my @functions = qw/pathconf fpathconf pathconf_names/; |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our %EXPORT_TAGS = |
|
20
|
|
|
|
|
|
|
( constants => \@constants |
|
21
|
|
|
|
|
|
|
, functions => \@functions |
|
22
|
|
|
|
|
|
|
, tables => [ '%pathconf' ] |
|
23
|
|
|
|
|
|
|
); |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $pathconf; |
|
26
|
|
|
|
|
|
|
our %pathconf; |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
BEGIN { |
|
29
|
3
|
|
|
3
|
|
56
|
$pathconf = pathconf_table; |
|
30
|
3
|
|
|
|
|
30
|
push @constants, keys %$pathconf; |
|
31
|
3
|
|
|
|
|
16
|
tie %pathconf, 'POSIX::1003::ReadOnlyTable', $pathconf; |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub pathconf($$); |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub exampleValue($) |
|
38
|
0
|
|
|
0
|
1
|
0
|
{ my ($class, $name) = @_; |
|
39
|
0
|
0
|
|
|
|
0
|
$name =~ m/^_PC_/ or return; |
|
40
|
0
|
|
|
|
|
0
|
my $val = pathconf __FILE__, $name; |
|
41
|
0
|
0
|
|
|
|
0
|
defined $val ? $val : 'undef'; |
|
42
|
|
|
|
|
|
|
} |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub fpathconf($$) |
|
46
|
1
|
|
|
1
|
1
|
6
|
{ my ($fd, $key) = @_; |
|
47
|
1
|
50
|
|
|
|
6
|
$key =~ /^_PC_/ |
|
48
|
|
|
|
|
|
|
or croak "pass the constant name as string"; |
|
49
|
1
|
|
50
|
|
|
8
|
my $id = $pathconf{$key} // return; |
|
50
|
1
|
|
|
|
|
12
|
my $v = POSIX::fpathconf($fd, $id); |
|
51
|
1
|
50
|
33
|
|
|
8
|
defined $v && $v eq '0 but true' ? 0 : $v; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub pathconf($$) |
|
55
|
22
|
|
|
22
|
1
|
560
|
{ my ($fn, $key) = @_; |
|
56
|
22
|
50
|
|
|
|
81
|
$key =~ /^_PC_/ |
|
57
|
|
|
|
|
|
|
or croak "pass the constant name as string"; |
|
58
|
22
|
|
50
|
|
|
80
|
my $id = $pathconf{$key} // return; |
|
59
|
22
|
|
|
|
|
152
|
my $v = POSIX::pathconf($fn, $id); |
|
60
|
22
|
100
|
|
|
|
64
|
defined $v ? $v+0 : undef; # remove 'but true' from '0' |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub _create_constant($) |
|
64
|
1
|
|
|
1
|
|
1
|
{ my ($class, $name) = @_; |
|
65
|
1
|
|
50
|
0
|
|
7
|
my $id = $pathconf->{$name} // return sub($) {undef}; |
|
|
0
|
|
|
|
|
0
|
|
|
66
|
2
|
|
|
2
|
|
596
|
sub($) { my $f = shift; |
|
67
|
2
|
100
|
|
|
|
24
|
$f =~ m/\D/ |
|
68
|
|
|
|
|
|
|
? POSIX::pathconf($f, $id) |
|
69
|
|
|
|
|
|
|
: POSIX::fpathconf($f, $id) |
|
70
|
1
|
|
|
|
|
6
|
}; |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
|
74
|
1
|
|
|
1
|
1
|
639
|
sub pathconf_names() { keys %$pathconf } |
|
75
|
|
|
|
|
|
|
|