print <<END;
#ifndef DOINIT
-EXT char *op_name[];
+EXT char *PL_op_name[];
#else
-EXT char *op_name[] = {
+EXT char *PL_op_name[] = {
END
for (@ops) {
print <<END;
#ifndef DOINIT
-EXT char *op_desc[];
+EXT char *PL_op_desc[];
#else
-EXT char *op_desc[] = {
+EXT char *PL_op_desc[] = {
END
for (@ops) {
#ifndef PERL_OBJECT
START_EXTERN_C
-END
+#undef PERL_CKDEF
+#undef PERL_PPDEF
+#define PERL_CKDEF(s) OP *s _((OP *o));
+#define PERL_PPDEF(s) OP *s _((ARGSproto));
-# Emit function declarations.
+#include "pp_proto.h"
-for (sort keys %ckname) {
- print "OP *\t", &tab(3,$_),"_((OP* o));\n";
-}
+END
-print "\n";
+# Emit function declarations.
-for (@ops) {
- print "OP *\t", &tab(3, "pp_$_"), "_((ARGSproto));\n";
-}
+#for (sort keys %ckname) {
+# print "OP *\t", &tab(3,$_),"_((OP* o));\n";
+#}
+#
+#print "\n";
+#
+#for (@ops) {
+# print "OP *\t", &tab(3, "pp_$_"), "_((ARGSproto));\n";
+#}
# Emit ppcode switch array.
#endif /* PERL_OBJECT */
#ifndef DOINIT
-EXT OP * (CPERLscope(*ppaddr)[])(ARGSproto);
+EXT OP * (CPERLscope(*PL_ppaddr)[])(ARGSproto);
#else
-#ifndef PERL_OBJECT
-EXT OP * (CPERLscope(*ppaddr)[])(ARGSproto) = {
+EXT OP * (CPERLscope(*PL_ppaddr)[])(ARGSproto) = {
END
for (@ops) {
print <<END;
};
-#endif /* PERL_OBJECT */
#endif
END
print <<END;
#ifndef DOINIT
-EXT OP * (CPERLscope(*check)[]) _((OP *op));
+EXT OP * (CPERLscope(*PL_check)[]) _((OP *op));
#else
-#ifndef PERL_OBJECT
-EXT OP * (CPERLscope(*check)[]) _((OP *op)) = {
+EXT OP * (CPERLscope(*PL_check)[]) _((OP *op)) = {
END
for (@ops) {
print <<END;
};
-#endif /* PERL_OBJECT */
#endif
END
print <<END;
#ifndef DOINIT
-EXT U32 opargs[];
+EXT U32 PL_opargs[];
#else
-EXT U32 opargs[] = {
+EXT U32 PL_opargs[] = {
END
%argnum = (
close OC or die "Error closing opcode.h: $!";
unlink "pp_proto.h";
+unlink "pp.sym";
open PP, '>pp_proto.h' or die "Error creating pp_proto.h: $!";
+open PPSYM, '>pp.sym' or die "Error creating pp.sym: $!";
+
+for (sort keys %ckname) {
+ print PP "PERL_CKDEF($_)\n";
+#OP *\t", &tab(3,$_),"_((OP* o));\n";
+}
+
+print PP "\n\n";
+
for (@ops) {
next if /^i_(pre|post)(inc|dec)$/;
- print PP "PPDEF(pp_$_)\n";
+ print PP "PERL_PPDEF(pp_$_)\n";
+ print PPSYM "pp_$_\n";
}
close PP or die "Error closing pp_proto.h: $!";
+close PPSYM or die "Error closing pp.sym: $!";
###########################################################################
sub tab {