diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-05-14 22:28:58 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-05-19 10:18:16 +0100 |
commit | d91994bbc0e42c43e68faecbd97f62eb6c6a12c7 (patch) | |
tree | 3634c1ede7eabf383610b4808a59d7e7fdccfa8b | |
parent | 5f8dc0737d315bf7d9ba977258a20d8512927c0d (diff) | |
download | perl-d91994bbc0e42c43e68faecbd97f62eb6c6a12c7.tar.gz |
Create open_print_header() to avoid duplicate parameters to open_new().
-rw-r--r-- | regen/reentr.pl | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/regen/reentr.pl b/regen/reentr.pl index 4eedee26a4..49d7efa167 100644 --- a/regen/reentr.pl +++ b/regen/reentr.pl @@ -50,13 +50,17 @@ my %map = ( # Example #2: S_SBIE means type func_r(type, char*, int, int*) # Example #3: S_CBI means type func_r(const char*, char*, int) +sub open_print_header { + my ($file, $quote) = @_; + return open_new($file, '>', + { by => 'regen/reentr.pl', + from => 'data in regen/reentr.pl', + file => $file, style => '*', + copyright => [2002, 2003, 2005 .. 2007], + quote => $quote }); +} -my $h = open_new('reentr.h', '>', - { by => 'regen/reentr.pl', - from => 'data in regen/reentr.pl', - file => 'reentr.h', style => '*', - copyright => [2002, 2003, 2005 .. 2007]}); - +my $h = open_print_header('reentr.h'); print $h <<EOF; #ifndef REENTR_H #define REENTR_H @@ -782,11 +786,7 @@ read_only_bottom_close_and_rename($h); # Prepare to write the reentr.c. -my $c = open_new('reentr.c', '>', - {by => 'regen/reentr.pl', from => 'data in regen/reentr.pl', - file => 'reentr.c', style => '*', - copyright => [2002, 2003, 2005 .. 2007], - quote => <<'EOQ'}); +my $c = open_print_header('reentr.c', <<'EOQ'); * * "Saruman," I said, standing away from him, "only one hand at a time can * wield the One, and you know that well, so do not trouble to say we!" |