Commit | Line | Data |
4c1f658f |
1 | #!perl |
2 | my ($out) = __FILE__ =~ /(^.*)\.PL/; |
3 | open(OUT,">$out") || die "Cannot open $file:$!"; |
4 | foreach my $const (qw(AVf_REAL |
b874ff32 |
5 | HEf_SVKEY |
4c1f658f |
6 | SVf_IOK SVf_NOK SVf_POK SVf_ROK SVp_IOK SVp_POK )) |
7 | { |
8 | doconst($const); |
9 | } |
10 | foreach my $file (qw(op.h cop.h)) |
11 | { |
12 | open(OPH,"../../$file") || die "Cannot open ../../$file:$!"; |
13 | while (<OPH>) |
14 | { |
15 | doconst($1) if (/#define\s+(\w+)\s+([\(\)\|\dx]+)\s*(?:$|\/\*)/); |
16 | } |
17 | close(OPH); |
18 | } |
19 | close(OUT); |
20 | |
21 | sub doconst |
22 | { |
23 | my $sym = shift; |
24 | my $l = length($sym); |
25 | print OUT <<"END"; |
26 | newCONSTSUB(stash,"$sym",newSViv($sym)); |
27 | av_push(export_ok,newSVpv("$sym",$l)); |
28 | END |
29 | } |