Debian Codegraph @

Symbols.PL

raw symbols SCIP
1 # This script is automatically executed after 2008.xs has been compiled. It
2 # takes all symbol names from constants.txt and functions.txt that we would
3 # like to provide, checks which of them we actually provide, and makes these
4 # available through @_constants and @_functions in symbols.pl which is loaded
5 # by 2008.pm via "require" to populate @EXPORT_OK. This is to make sure that
6 # "use POSIX::2008 'non_existent_name';" croaks at compile time.
7
8 use File::Specscip-perl cpan POSIX-2008 0.28 File/Spec/;
9
10 requirescip-perl cpan POSIX-2008 0.28 main/require(). XSLoader;
11 XSLoader::loadscip-perl cpan POSIX-2008 0.28 XSLoader/load().('POSIX::2008', '0.28');
12
13 my %names;
14
15 foreach my $type (qw(constants functions)) {
16 $names{$type} = do {
17 local $/scip-perl cpan POSIX-2008 0.28 main/`$/`.;
18 my $file = "${type}.txt";
19 openscip-perl cpan POSIX-2008 0.28 main/open(). my $fh, '<', $file or diescip-perl cpan POSIX-2008 0.28 main/die(). "Can't open $file: $!";
20 [sortscip-perl cpan POSIX-2008 0.28 main/sort(). splitscip-perl cpan POSIX-2008 0.28 main/split(). ' ', <$fh>];
21 };
22 }
23
24 my $file = File::Spec->catfilescip-perl cpan POSIX-2008 0.28 File/Spec/catfile().(
25 File::Spec->curdirscip-perl cpan POSIX-2008 0.28 File/Spec/curdir().(), qw(blib lib POSIX 2008 symbols.pl)
26 );
27
28 openscip-perl cpan POSIX-2008 0.28 main/open(). my $fh, '>', $file or diescip-perl cpan POSIX-2008 0.28 main/die(). "Can't open $file: $!";
29
30 foreach my $type (sortscip-perl cpan POSIX-2008 0.28 main/sort(). keysscip-perl cpan POSIX-2008 0.28 main/keys(). %names) {
31 print $fh "our \@_${type} = qw(\n";
32 foreach my $name (@{$names{$type}}) {
33 print $fh "$name\n" if definedscip-perl cpan POSIX-2008 0.28 main/defined(). &{"POSIX::2008::$name"};
34 }
35 print $fh ");\n\n";
36 }
37
38 print $fh "1;\n";
39 closescip-perl cpan POSIX-2008 0.28 main/close(). $fh or diescip-perl cpan POSIX-2008 0.28 main/die(). "Can't write $file: $!";