os2/perl2cmd.pl Corrects installed binaries under OS/2
os2/perlrexx.c Support perl interpreter embedded in REXX
os2/perlrexx.cmd Test perl interpreter embedded in REXX
-overload.h generated overload enum and name table
+overload.c generated overload enum (public)
+overload.h generated overload name table (implementation)
overload.pl generate overload.h
pad.c Scratchpad functions
pad.h Scratchpad headers
# *** Only structures/arrays with constant initializers should go here.
# *** Usual globals initialized at runtime should be added in *var*.h.
-AMG_names
block_type
check
fold
#include "EXTERN.h"
#define PERL_IN_GV_C
#include "perl.h"
+#include "overload.c"
static const char S_autoload[] = "AUTOLOAD";
static const STRLEN S_autolen = sizeof(S_autoload)-1;
--- /dev/null
+/* -*- buffer-read-only: t -*-
+ *
+ * overload.c
+ *
+ * Copyright (C) 1997, 1998, 2000, 2001, 2005, 2006, 2007 by Larry Wall
+ * and others
+ *
+ * You may distribute under the terms of either the GNU General Public
+ * License or the Artistic License, as specified in the README file.
+ *
+ * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+ * This file is built by overload.pl
+ */
+
+#define AMG_id2name(id) (PL_AMG_names[id]+1)
+
+char * const PL_AMG_names[NofAMmeth] = {
+ /* Names kept in the symbol table. fallback => "()", the rest has
+ "(" prepended. The only other place in perl which knows about
+ this convention is AMG_id2name (used for debugging output and
+ 'nomethod' only), the only other place which has it hardwired is
+ overload.pm. */
+ "()",
+ "(${}",
+ "(@{}",
+ "(%{}",
+ "(*{}",
+ "(&{}",
+ "(++",
+ "(--",
+ "(bool",
+ "(0+",
+ "(\"\"",
+ "(!",
+ "(=",
+ "(abs",
+ "(neg",
+ "(<>",
+ "(int",
+ "(<",
+ "(<=",
+ "(>",
+ "(>=",
+ "(==",
+ "(!=",
+ "(lt",
+ "(le",
+ "(gt",
+ "(ge",
+ "(eq",
+ "(ne",
+ "(nomethod",
+ "(+",
+ "(+=",
+ "(-",
+ "(-=",
+ "(*",
+ "(*=",
+ "(/",
+ "(/=",
+ "(%",
+ "(%=",
+ "(**",
+ "(**=",
+ "(<<",
+ "(<<=",
+ "(>>",
+ "(>>=",
+ "(&",
+ "(&=",
+ "(|",
+ "(|=",
+ "(^",
+ "(^=",
+ "(<=>",
+ "(cmp",
+ "(~",
+ "(atan2",
+ "(cos",
+ "(sin",
+ "(exp",
+ "(log",
+ "(sqrt",
+ "(x",
+ "(x=",
+ "(.",
+ "(.=",
+ "(~~",
+ "DESTROY"
+};
*
* overload.h
*
- * Copyright (C) 1997, 1998, 2000, 2001, 2005 and 2006 by Larry Wall and
- * others
+ * Copyright (C) 1997, 1998, 2000, 2001, 2005, 2006, 2007 by Larry Wall
+ * and others
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
/* Do not leave a trailing comma here. C9X allows it, C89 doesn't. */
};
-
#define NofAMmeth max_amg_code
-#define AMG_id2name(id) (PL_AMG_names[id]+1)
-#ifdef DOINIT
-EXTCONST char * const PL_AMG_names[NofAMmeth] = {
- /* Names kept in the symbol table. fallback => "()", the rest has
- "(" prepended. The only other place in perl which knows about
- this convention is AMG_id2name (used for debugging output and
- 'nomethod' only), the only other place which has it hardwired is
- overload.pm. */
- "()",
- "(${}",
- "(@{}",
- "(%{}",
- "(*{}",
- "(&{}",
- "(++",
- "(--",
- "(bool",
- "(0+",
- "(\"\"",
- "(!",
- "(=",
- "(abs",
- "(neg",
- "(<>",
- "(int",
- "(<",
- "(<=",
- "(>",
- "(>=",
- "(==",
- "(!=",
- "(lt",
- "(le",
- "(gt",
- "(ge",
- "(eq",
- "(ne",
- "(nomethod",
- "(+",
- "(+=",
- "(-",
- "(-=",
- "(*",
- "(*=",
- "(/",
- "(/=",
- "(%",
- "(%=",
- "(**",
- "(**=",
- "(<<",
- "(<<=",
- "(>>",
- "(>>=",
- "(&",
- "(&=",
- "(|",
- "(|=",
- "(^",
- "(^=",
- "(<=>",
- "(cmp",
- "(~",
- "(atan2",
- "(cos",
- "(sin",
- "(exp",
- "(log",
- "(sqrt",
- "(x",
- "(x=",
- "(.",
- "(.=",
- "(~~",
- "DESTROY"
-};
-#else
-EXTCONST char * PL_AMG_names[NofAMmeth];
-#endif /* def INITAMAGIC */
push @names, $name;
}
-safer_unlink 'overload.h';
+safer_unlink ('overload.h', 'overload.c');
+die "overload.h: $!" unless open(C, ">overload.c");
+binmode C;
die "overload.h: $!" unless open(H, ">overload.h");
binmode H;
-select H;
-print <<'EOF';
+
+sub print_header {
+ my $file = shift;
+ print <<"EOF";
/* -*- buffer-read-only: t -*-
*
- * overload.h
+ * $file
*
* Copyright (C) 1997, 1998, 2000, 2001, 2005, 2006, 2007 by Larry Wall
* and others
* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
* This file is built by overload.pl
*/
+EOF
+}
+
+select C;
+print_header('overload.c');
+
+select H;
+print_header('overload.h');
+print <<'EOF';
enum {
EOF
/* Do not leave a trailing comma here. C9X allows it, C89 doesn't. */
};
-
#define NofAMmeth max_amg_code
+
+EOF
+
+print C <<'EOF';
+
#define AMG_id2name(id) (PL_AMG_names[id]+1)
-#ifdef DOINIT
-EXTCONST char * const PL_AMG_names[NofAMmeth] = {
+char * const PL_AMG_names[NofAMmeth] = {
/* Names kept in the symbol table. fallback => "()", the rest has
"(" prepended. The only other place in perl which knows about
this convention is AMG_id2name (used for debugging output and
EOF
my $last = pop @names;
-print " \"$_\",\n" foreach map { s/(["\\"])/\\$1/g; $_ } @names;
+print C " \"$_\",\n" foreach map { s/(["\\"])/\\$1/g; $_ } @names;
-print <<"EOT";
+print C <<"EOT";
"$last"
};
-#else
-EXTCONST char * PL_AMG_names[NofAMmeth];
-#endif /* def INITAMAGIC */
EOT
close H or die $!;