my $c_header = <<'EOT';
/*
- * Copyright (c) 1996, 1997 Malcolm Beattie
+ * Copyright (c) 1996-1998 Malcolm Beattie
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
my $perl_header;
($perl_header = $c_header) =~ s{[/ ]?\*/?}{#}g;
-if (-f "byterun.c") {
- rename("byterun.c", "byterun.c.old");
-}
-if (-f "byterun.h") {
- rename("byterun.h", "byterun.h.old");
-}
-if (-f "Asmdata.pm") {
- rename("Asmdata.pm", "Asmdata.pm.old");
-}
+unlink "byterun.c", "byterun.h", "ext/B/Asmdata.pm";
#
# Start with boilerplate for Asmdata.pm
#
-open(ASMDATA_PM, ">Asmdata.pm") or die "Asmdata.pm: $!";
+open(ASMDATA_PM, ">ext/B/Asmdata.pm") or die "Asmdata.pm: $!";
print ASMDATA_PM $perl_header, <<'EOT';
package B::Asmdata;
use Exporter;
EOT
printf BYTERUN_H <<'EOT', scalar(@specialsv);
-EXT SV * specialsv_list[%d]
-#ifdef DOINIT
+EXT SV * specialsv_list[%d];
+#define INIT_SPECIALSV_LIST STMT_START { \
EOT
-print BYTERUN_H "= { ", join(", ", @specialsv), " }\n";
+for ($i = 0; $i < @specialsv; $i++) {
+ print BYTERUN_H "specialsv_list[$i] = $specialsv[$i]; \\\n";
+}
print BYTERUN_H <<'EOT';
-#endif /* DOINIT */
-;
+} STMT_END
EOT
#
xcv_flags CvFLAGS(sv) U8
av_extend sv SSize_t x
av_push sv svindex x
-xav_fill AvFILL(sv) SSize_t
+xav_fill AvFILLp(sv) SSize_t
xav_max AvMAX(sv) SSize_t
xav_flags AvFLAGS(sv) U8
xhv_riter HvRITER(sv) I32
op_pmreplstart cPMOP->op_pmreplstart opindex
op_pmnext *(OP**)&cPMOP->op_pmnext opindex
pregcomp op pvcontents x
-op_pmshort cPMOP->op_pmshort svindex
op_pmflags cPMOP->op_pmflags U16
op_pmpermflags cPMOP->op_pmpermflags U16
-op_pmslen cPMOP->op_pmslen char
op_sv cSVOP->op_sv svindex
op_gv *(SV**)&cGVOP->op_gv svindex
op_pv cPVOP->op_pv pvcontents