Permalink
Browse files

Move all the generated file header printing into read_only_top()

Previously all the scripts in regen/ had code to generate header comments
(buffer-read-only, "do not edit this file", and optionally regeneration
script, regeneration data, copyright years and filename).

This change results in some minor reformatting of header blocks, and
standardises the copyright line as "Larry Wall and others".
  • Loading branch information...
1 parent 03f96b7 commit 78102347e0341b1cd4795accd0ca5ff1f2621bb2 Nicholas Clark committed Jan 23, 2011
Showing with 163 additions and 249 deletions.
  1. +4 −4 embed.h
  2. +4 −4 embedvar.h
  3. +5 −5 global.sym
  4. +4 −3 keywords.h
  5. +6 −6 lib/overload/numbers.pm
  6. +3 −4 lib/warnings.pm
  7. +4 −4 opcode.h
  8. +4 −5 opnames.h
  9. +3 −2 overload.c
  10. +3 −2 overload.h
  11. +4 −4 perlapi.c
  12. +4 −4 perlapi.h
  13. +3 −3 pp_proto.h
  14. +4 −4 proto.h
  15. +3 −2 reentr.c
  16. +3 −2 reentr.h
  17. +7 −39 regen/embed.pl
  18. +3 −16 regen/keywords.pl
  19. +9 −46 regen/opcode.pl
  20. +10 −40 regen/overload.pl
  21. +14 −27 regen/reentr.pl
  22. +2 −6 regen/regcomp.pl
  23. +51 −0 regen/regen_lib.pl
  24. +3 −14 regen/warnings.pl
  25. +1 −1 regnodes.h
  26. +2 −2 warnings.h
View
@@ -1,16 +1,16 @@
-/* -*- buffer-read-only: t -*-
+/* -*- buffer-read-only: t -*-
*
* embed.h
*
- * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- * 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, by Larry Wall and others
+ * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ * 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 regen/embed.pl from data in embed.fnc,
- * regen/embed.pl, regen/opcodes intrpvar.h, and perlvars.h.
+ * regen/embed.pl, regen/opcodes, intrpvar.h and perlvars.h.
* Any changes made here will be lost!
*
* Edit those files and run 'make regen_headers' to effect changes.
View
@@ -1,16 +1,16 @@
-/* -*- buffer-read-only: t -*-
+/* -*- buffer-read-only: t -*-
*
* embedvar.h
*
- * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- * 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, by Larry Wall and others
+ * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ * 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 regen/embed.pl from data in embed.fnc,
- * regen/embed.pl, regen/opcodes intrpvar.h, and perlvars.h.
+ * regen/embed.pl, regen/opcodes, intrpvar.h and perlvars.h.
* Any changes made here will be lost!
*
* Edit those files and run 'make regen_headers' to effect changes.
View
@@ -1,20 +1,20 @@
-# -*- buffer-read-only: t -*-
+# -*- buffer-read-only: t -*-
#
# global.sym
#
-# Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, by Larry Wall and others
+# Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 regen/embed.pl from data in embed.fnc,
-# regen/embed.pl, regen/opcodes intrpvar.h, and perlvars.h.
+# regen/embed.pl, regen/opcodes, intrpvar.h and perlvars.h.
# Any changes made here will be lost!
#
# Edit those files and run 'make regen_headers' to effect changes.
-#
+
Perl_Gv_AMupdate
Perl_PerlIO_context_layers
Perl__swash_inversion_hash
View
@@ -3,15 +3,16 @@
* keywords.h
*
* Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2005,
- * 2006, 2007, by Larry Wall and others
+ * 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 regen/keywords.pl from its data. Any changes
- * made here will be lost!
+ * This file is built by regen/keywords.pl from its data.
+ * Any changes made here will be lost!
*/
+
#define KEY_NULL 0
#define KEY___FILE__ 1
#define KEY___LINE__ 2
View
@@ -1,15 +1,15 @@
# -*- buffer-read-only: t -*-
#
-# lib/overload/numbers.pm
+# lib/overload/numbers.pm
#
-# Copyright (C) 2008 by Larry Wall and others
+# Copyright (C) 2008 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.
+# 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 regen/overload.pl
-#
+# This file is built by regen/overload.pl.
+# Any changes made here will be lost!
package overload::numbers;
View
@@ -1,12 +1,11 @@
# -*- buffer-read-only: t -*-
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
-# This file was created by regen/warnings.pl
-# Any changes made here will be lost.
-#
+# This file is built by regen/warnings.pl.
+# Any changes made here will be lost!
package warnings;
-our $VERSION = '1.11';
+our $VERSION = '1.12';
# Verify that we're called correctly so that warnings will work.
# see also strict.pm.
View
@@ -2,15 +2,15 @@
*
* opcode.h
*
- * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- * 2001, 2002, 2003, 2004, 2005, 2006, 2007 by Larry Wall and others
+ * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ * 2002, 2003, 2004, 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 regen/opcode.pl from its data. Any changes made
- * here will be lost!
+ * This file is built by regen/opcode.pl from its data.
+ * Any changes made here will be lost!
*/
#ifndef PERL_GLOBAL_STRUCT_INIT
View
@@ -2,16 +2,15 @@
*
* opnames.h
*
- * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- * 2007, 2008 by Larry Wall and others
+ * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ * 2008 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 regen/opcode.pl from its data. Any changes made
- * here will be lost!
+ * This file is built by regen/opcode.pl from its data.
+ * Any changes made here will be lost!
*/
typedef enum opcode {
View
@@ -8,8 +8,9 @@
* 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 regen/overload.pl
+ * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+ * This file is built by regen/overload.pl.
+ * Any changes made here will be lost!
*/
#define AMG_id2name(id) (PL_AMG_names[id]+1)
View
@@ -8,8 +8,9 @@
* 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 regen/overload.pl
+ * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+ * This file is built by regen/overload.pl.
+ * Any changes made here will be lost!
*/
enum {
View
@@ -1,16 +1,16 @@
-/* -*- buffer-read-only: t -*-
+/* -*- buffer-read-only: t -*-
*
* perlapi.c
*
- * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- * 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, by Larry Wall and others
+ * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ * 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 regen/embed.pl from data in embed.fnc,
- * regen/embed.pl, regen/opcodes intrpvar.h, and perlvars.h.
+ * regen/embed.pl, regen/opcodes, intrpvar.h and perlvars.h.
* Any changes made here will be lost!
*
* Edit those files and run 'make regen_headers' to effect changes.
View
@@ -1,16 +1,16 @@
-/* -*- buffer-read-only: t -*-
+/* -*- buffer-read-only: t -*-
*
* perlapi.h
*
- * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- * 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, by Larry Wall and others
+ * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ * 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 regen/embed.pl from data in embed.fnc,
- * regen/embed.pl, regen/opcodes intrpvar.h, and perlvars.h.
+ * regen/embed.pl, regen/opcodes, intrpvar.h and perlvars.h.
* Any changes made here will be lost!
*
* Edit those files and run 'make regen_headers' to effect changes.
View
@@ -1,8 +1,8 @@
/* -*- buffer-read-only: t -*-
!!!!!!! DO NOT EDIT THIS FILE !!!!!!!
- This file is built by opcode.pl from its data. Any changes made here
- will be lost!
-*/
+ This file is built by opcode.pl from its data.
+ Any changes made here will be lost!
+ */
PERL_CALLCONV OP *Perl_do_kv(pTHX);
PERL_CALLCONV OP *Perl_pp_aassign(pTHX);
View
@@ -1,16 +1,16 @@
-/* -*- buffer-read-only: t -*-
+/* -*- buffer-read-only: t -*-
*
* proto.h
*
- * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- * 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, by Larry Wall and others
+ * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ * 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 regen/embed.pl from data in embed.fnc,
- * regen/embed.pl, regen/opcodes intrpvar.h, and perlvars.h.
+ * regen/embed.pl, regen/opcodes, intrpvar.h and perlvars.h.
* Any changes made here will be lost!
*
* Edit those files and run 'make regen_headers' to effect changes.
View
@@ -7,8 +7,9 @@
* 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 regen/reentr.pl from data in regen/reentr.pl.
+ * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+ * This file is built by regen/reentr.pl from data in regen/reentr.pl.
+ * Any changes made here will be lost!
*
* "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!"
View
@@ -7,8 +7,9 @@
* 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 regen/reentr.pl from data in regen/reentr.pl.
+ * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+ * This file is built by regen/reentr.pl from data in regen/reentr.pl.
+ * Any changes made here will be lost!
*/
#ifndef REENTR_H
View
@@ -44,40 +44,12 @@ ($)
{
my $file = shift;
- my $years = '1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009';
-
- $years =~ s/1999,/1999,\n / if length $years > 40;
-
- my $warning = <<EOW;
- -*- buffer-read-only: t -*-
-
- $file
-
- Copyright (C) $years, 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 regen/embed.pl from data in embed.fnc,
-regen/embed.pl, regen/opcodes intrpvar.h, and perlvars.h.
-Any changes made here will be lost!
-
-Edit those files and run 'make regen_headers' to effect changes.
-
-EOW
-
- if ($file =~ m:\.[ch]$:) {
- $warning =~ s:^: * :gm;
- $warning =~ s: +$::gm;
- $warning =~ s: :/:;
- $warning =~ s:$:/:;
- }
- else {
- $warning =~ s:^:# :gm;
- $warning =~ s: +$::gm;
- }
- $warning;
+ return read_only_top(lang => ($file =~ /\.[ch]$/ ? 'C' : 'Perl'),
+ file => $file, style => '*', by => 'regen/embed.pl',
+ from => ['data in embed.fnc', 'regen/embed.pl',
+ 'regen/opcodes', 'intrpvar.h', 'perlvars.h'],
+ final => "\nEdit those files and run 'make regen_headers' to effect changes.\n",
+ copyright => [1993 .. 2009]);
} # do_not_edit
open IN, "embed.fnc" or die $!;
@@ -233,7 +205,7 @@ (&@)
# generate proto.h
{
my $pr = safer_open('proto.h-new');
- print $pr do_not_edit ("proto.h"), "\nSTART_EXTERN_C\n";
+ print $pr do_not_edit ("proto.h"), "START_EXTERN_C\n";
my $ret;
foreach (@embed) {
@@ -448,7 +420,6 @@ ($$)
my $em = safer_open('embed.h-new');
print $em do_not_edit ("embed.h"), <<'END';
-
/* (Doing namespace management portably in C is really gross.) */
/* By defining PERL_NO_SHORT_NAMES (not done by default) the short forms
@@ -611,7 +582,6 @@ END
$em = safer_open('embedvar.h-new');
print $em do_not_edit ("embedvar.h"), <<'END';
-
/* (Doing namespace management portably in C is really gross.) */
/*
@@ -695,7 +665,6 @@ END
my $capih = safer_open('perlapi.h-new');
print $capih do_not_edit ("perlapi.h"), <<'EOT';
-
/* declare accessor functions for Perl variables */
#ifndef __perlapi_h__
#define __perlapi_h__
@@ -816,7 +785,6 @@ END
!;
print $capi $warning, <<'EOT';
-
#include "EXTERN.h"
#include "perl.h"
#include "perlapi.h"
Oops, something went wrong.

0 comments on commit 7810234

Please sign in to comment.