From d91994bbc0e42c43e68faecbd97f62eb6c6a12c7 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sat, 14 May 2011 22:28:58 +0100 Subject: [PATCH] Create open_print_header() to avoid duplicate parameters to open_new(). --- regen/reentr.pl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/regen/reentr.pl b/regen/reentr.pl index 4eedee2..49d7efa 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 <', - {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!" -- 2.7.4