summaryrefslogtreecommitdiff
path: root/regen/opcode.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-05-14 21:59:38 +0100
committerNicholas Clark <nick@ccl4.org>2011-05-19 10:18:15 +0100
commitcc49830d6031e8e74c0426f77e2b3589e5774765 (patch)
tree903934cbbab497476834e5c4c83473324fc0a3ac /regen/opcode.pl
parent515c3fe0106d244307cd4e79b0a9b86dd95973e4 (diff)
downloadperl-cc49830d6031e8e74c0426f77e2b3589e5774765.tar.gz
Add an optional third argument to open_new(), to invoke read_only_top() with.
Merge together many calls to open_new() and read_only_top().
Diffstat (limited to 'regen/opcode.pl')
-rwxr-xr-xregen/opcode.pl25
1 files changed, 12 insertions, 13 deletions
diff --git a/regen/opcode.pl b/regen/opcode.pl
index c52506a2a3..ed3875e678 100755
--- a/regen/opcode.pl
+++ b/regen/opcode.pl
@@ -20,8 +20,14 @@ BEGIN {
require 'regen/regen_lib.pl';
}
-my $oc = open_new('opcode.h');
-my $on = open_new('opnames.h');
+my $oc = open_new('opcode.h', '>',
+ {by => 'regen/opcode.pl', from => 'its data',
+ file => 'opcode.h', style => '*',
+ copyright => [1993 .. 2007]});
+
+my $on = open_new('opnames.h', '>',
+ { by => 'regen/opcode.pl', from => 'its data', style => '*',
+ file => 'opnames.h', copyright => [1999 .. 2008] });
# Read data.
@@ -138,10 +144,7 @@ foreach my $sock_func (qw(socket bind listen accept shutdown
# Emit defines.
-print $oc read_only_top(lang => 'C', by => 'regen/opcode.pl', from => 'its data',
- file => 'opcode.h', style => '*',
- copyright => [1993 .. 2007]),
- "#ifndef PERL_GLOBAL_STRUCT_INIT\n\n";
+print $oc "#ifndef PERL_GLOBAL_STRUCT_INIT\n\n";
{
my $last_cond = '';
@@ -178,10 +181,7 @@ print $oc read_only_top(lang => 'C', by => 'regen/opcode.pl', from => 'its data'
unimplemented();
}
-print $on read_only_top(lang => 'C', by => 'regen/opcode.pl',
- from => 'its data', style => '*',
- file => 'opnames.h', copyright => [1999 .. 2008]),
- "typedef enum opcode {\n";
+print $on "typedef enum opcode {\n";
my $i = 0;
for (@ops) {
@@ -441,9 +441,8 @@ sub gen_op_is_macro {
}
}
-my $pp = open_new('pp_proto.h');
-
-print $pp read_only_top(lang => 'C', by => 'opcode.pl', from => 'its data');
+my $pp = open_new('pp_proto.h', '>',
+ { by => 'opcode.pl', from => 'its data' });
{
my %funcs;