fix bugs in do_sv_dump() from Devel::Peek integration
[p5sagit/p5-mst-13.2.git] / ext / B / defsubs.h.PL
CommitLineData
4c1f658f 1#!perl
2my ($out) = __FILE__ =~ /(^.*)\.PL/;
3open(OUT,">$out") || die "Cannot open $file:$!";
4foreach 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 }
10foreach 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 }
19close(OUT);
20
21sub 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));
28END
29}