Debian Codegraph @

lib/POSIX/2008.pm

raw symbols SCIP
1 package POSIX::scip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/2008;
2
3 use strictscip-perl cpan POSIX-2008 0.28 strict/;
4 use warningsscip-perl cpan POSIX-2008 0.28 warnings/;
5 use Carpscip-perl cpan POSIX-2008 0.28 Carp/ ();
6 use IO::Dirscip-perl cpan POSIX-2008 0.28 IO/Dir/ ();
7 use IO::Filescip-perl cpan POSIX-2008 0.28 IO/File/ ();
8
9 requirescip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/require(). Exporter;
10 requirescip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/require(). 'POSIX/2008/symbols.pl'; # Defines @_constants and @_functions.
11
12 our @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.;
13 our @_functionsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_functions`.;
14
15 our $VERSIONscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/$VERSION. = '0.28';
16 our $XS_VERSIONscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/$XS_VERSION. = $VERSIONscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/$VERSION.;
17 $VERSIONscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/$VERSION. = eval $VERSIONscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/$VERSION.; # so "use Module 0.002" won't warn on underscore
18
19 our @ISAscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@ISA`. = qw(Exporter);
20 our @EXPORTscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@EXPORT`. = ();
21 our @EXPORT_OKscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@EXPORT_OK`. = (@_functionsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_functions`., @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.);
22
23 our %EXPORT_TAGSscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`%EXPORT_TAGS`. = (
24 # at: Older Perls don't have variable length lookbehind, thus two regexen
25 # for functions.
26 'at' => [
27 grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep().(/^(?:AT|RENAME|RESOLVE)_/, @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.),
28 grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep().(/at2?$/ && !/^(?:creat|l?stat)$/, @_functionsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_functions`.),
29 ],
30 'id' => [grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep(). /^[gs]et.+id$/, @_functionsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_functions`.],
31 'is' => [grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep(). /^is/, @_functionsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_functions`.],
32 'rw' => [qw(read write readv writev)],
33 'prw' => [qw(pread preadv preadv2 pwrite pwritev pwritev2)],
34 'clock' => [
35 grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep().(/^(?:CLOCK_|TIMER_ABSTIME)/, @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.),
36 grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep().(/^clock/, @_functionsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_functions`.),
37 ],
38 'errno_h'=> [grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep(). /^E(?!MPTY)[A-Z]+$/, @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.],
39 'fcntl' => [grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep(). /^(?:[FORWX]|FD|POSIX_FADV|SEEK)_/, @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.],
40 'fenv_h' => [grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep().(/^FE_/, @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.), grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep(). (/^fe/, @_functionsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_functions`.)],
41 'fnm' => [grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep().(/^FNM_/, @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.), 'fnmatch'],
42 'poll' => ['poll', 'ppoll', grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep(). /^(?:POLL|INFTIM)/, @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.],
43 'socket_h' => [
44 qw(SCM_RIGHTS SOL_SOCKET SOMAXCONN),
45 grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep().(/^(?:AF|MSG|SHUT|SO|SOCK)_/, @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.),
46 ],
47 'stat_h' => [grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep(). /^(?:S_I|UTIME_)/, @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.],
48 'time_h' => [grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep(). /^(?:CLOCK|TIMER)_/, @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.],
49 'timer' => [grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep().(/^TIMER_/, @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.), grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep().(/^timer_/, @_functionsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_functions`.)],
50 'utmpx_h' => [
51 grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep().(/_(?:TIME|PROCESS)$/, @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.),
52 grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep().(/^(?:ACCOUNTING|EMPTY|RUN_LVL|UT_UNKNOWN)$/, @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.),
53 grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep().(/utx/, @_functionsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_functions`.),
54 ],
55 'confstr' => ['confstr', grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep(). /^_CS_/, @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.],
56 'pathconf' => ['pathconf', grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep(). /^_PC_/, @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.],
57 'sysconf' => ['sysconf', grepscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/grep(). /^_SC_/, @_constantsscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_constants`.],
58 );
59
60 my %deprecated = (
61 atol => 'atoi',
62 atoll => 'atoi',
63 ldiv => 'div',
64 lldiv => 'div',
65 fchdir => 'chdir',
66 fchmod => 'chmod',
67 fchown => 'chown',
68 ftruncate => 'truncate',
69 );
70 my %deprecated_warned;
71
72 pushscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/push(). @EXPORT_OKscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@EXPORT_OK`., keysscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/keys(). %deprecated;
73
74 our $AUTOLOADscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/$AUTOLOAD.;
75 sub AUTOLOADscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/AUTOLOAD(). {
76 my ($func) = ($AUTOLOADscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/$AUTOLOAD. =~ /.*::(.*)/);
77 diescip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/die(). "POSIX::2008.xs has failed to load\n" if $func eq 'constant';
78 constantscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/constant().($func);
79 }
80
81 sub importscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/import(). {
82 my $this = shiftscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/shift().;
83
84 requirescip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/require(). XSLoader;
85 XSLoader::loadscip-perl cpan POSIX-2008 0.28 XSLoader/load().('POSIX::2008', $XS_VERSIONscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/$XS_VERSION.);
86
87 while (my ($func, $repl) = eachscip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/each(). %deprecated) {
88 my $package_func = __PACKAGE__scip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/__PACKAGE__().."::${func}";
89 my $package_repl = __PACKAGE__scip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/__PACKAGE__().."::${repl}";
90 no strict 'refs';
91 *{$package_func} = sub {
92 Carp::carpscip-perl cpan POSIX-2008 0.28 Carp/carp().(
93 "${package_func}() is deprecated, use ${package_repl}() instead"
94 ) unless $deprecated_warned{$func}++;
95 &{*{$package_repl}};
96 }
97 }
98
99 __PACKAGE__->export_to_levelscip-perl cpan POSIX-2008 0.28 __PACKAGE__/export_to_level().(1, $this, @_scip-perl cpan POSIX-2008 0.28 POSIX/` 2008`/`@_`.);
100 }
101
102 1;