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
|
|
14547
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
71
|
|
6
|
3
|
|
|
3
|
|
10
|
use strict; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
75
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package POSIX::1003::Pathconf; |
9
|
3
|
|
|
3
|
|
9
|
use vars '$VERSION'; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
113
|
|
10
|
|
|
|
|
|
|
$VERSION = '0.99_07'; |
11
|
|
|
|
|
|
|
|
12
|
3
|
|
|
3
|
|
14
|
use base 'POSIX::1003::Module'; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
346
|
|
13
|
|
|
|
|
|
|
|
14
|
3
|
|
|
3
|
|
11
|
use Carp 'croak'; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
301
|
|
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
|
|
64
|
$pathconf = pathconf_table; |
30
|
3
|
|
|
|
|
16
|
push @constants, keys %$pathconf; |
31
|
3
|
|
|
|
|
12
|
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
|
8
|
{ my ($fd, $key) = @_; |
47
|
1
|
50
|
|
|
|
9
|
$key =~ /^_PC_/ |
48
|
|
|
|
|
|
|
or croak "pass the constant name as string"; |
49
|
1
|
|
50
|
|
|
10
|
my $id = $pathconf{$key} // return; |
50
|
1
|
|
|
|
|
15
|
my $v = POSIX::fpathconf($fd, $id); |
51
|
1
|
50
|
33
|
|
|
11
|
defined $v && $v eq '0 but true' ? 0 : $v; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub pathconf($$) |
55
|
22
|
|
|
22
|
1
|
416
|
{ my ($fn, $key) = @_; |
56
|
22
|
50
|
|
|
|
60
|
$key =~ /^_PC_/ |
57
|
|
|
|
|
|
|
or croak "pass the constant name as string"; |
58
|
22
|
|
50
|
|
|
61
|
my $id = $pathconf{$key} // return; |
59
|
22
|
|
|
|
|
121
|
my $v = POSIX::pathconf($fn, $id); |
60
|
22
|
100
|
|
|
|
53
|
defined $v ? $v+0 : undef; # remove 'but true' from '0' |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub _create_constant($) |
64
|
1
|
|
|
1
|
|
5
|
{ my ($class, $name) = @_; |
65
|
1
|
|
50
|
0
|
|
3
|
my $id = $pathconf->{$name} // return sub($) {undef}; |
|
0
|
|
|
|
|
0
|
|
66
|
2
|
|
|
2
|
|
646
|
sub($) { my $f = shift; |
67
|
2
|
100
|
|
|
|
28
|
$f =~ m/\D/ |
68
|
|
|
|
|
|
|
? POSIX::pathconf($f, $id) |
69
|
|
|
|
|
|
|
: POSIX::fpathconf($f, $id) |
70
|
1
|
|
|
|
|
4
|
}; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
1
|
|
|
1
|
1
|
614
|
sub pathconf_names() { keys %$pathconf } |
75
|
|
|
|
|
|
|
|