# implicit interpreter context argument.
#
+sub do_not_edit ($)
+{
+ my $file = shift;
+ my $warning = <<EOW;
+
+ $file
+
+ Copyright (c) 1997-2002, Larry Wall
+
+ 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 embed.pl from data in embed.fnc, embed.pl,
+pp.sym, intrpvar.h, perlvars.h and thrdvar.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;
+} # do_not_edit
+
open IN, "embed.fnc" or die $!;
# walk table providing an array of components in each line to
sub walk_table (&@) {
my $function = shift;
my $filename = shift || '-';
- my $leader = shift;
+ my $leader = shift || do_not_edit ($filename);
my $trailer = shift;
my $F;
local *F;
$ret;
}
-
-walk_table(\&write_protos, 'proto.h', <<'EOT');
-/*
- * proto.h
- *
- * Copyright (c) 1997-2002, Larry Wall
- *
- * 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 autogenerated from data in embed.pl. Edit that file
- * and run 'make regen_headers' to effect changes.
- */
-
-EOT
-
-walk_table(\&write_global_sym, 'global.sym', <<'EOT');
-#
-# global.sym
-#
-# Copyright (c) 1997-2002, Larry Wall
-#
-# 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 autogenerated from data in embed.pl. Edit that file
-# and run 'make regen_headers' to effect changes.
-#
-
-EOT
+walk_table(\&write_protos, "proto.h");
+walk_table(\&write_global_sym, "global.sym");
# XXX others that may need adding
# warnhook
unlink 'embed.h';
open(EM, '> embed.h') or die "Can't create embed.h: $!\n";
-print EM <<'END';
-/*
- * embed.h
- *
- * Copyright (c) 1997-2002, Larry Wall
- *
- * 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 embed.pl from data in embed.pl, pp.sym, intrpvar.h,
- * perlvars.h and thrdvar.h. Any changes made here will be lost!
- */
+print EM do_not_edit ("embed.h"), <<'END';
/* (Doing namespace management portably in C is really gross.) */
open(EM, '> embedvar.h')
or die "Can't create embedvar.h: $!\n";
-print EM <<'END';
-/*
- * embedvar.h
- *
- * Copyright (c) 1997-2002, Larry Wall
- *
- * 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 embed.pl from data in embed.pl, pp.sym, intrpvar.h,
- * perlvars.h and thrdvar.h. Any changes made here will be lost!
- */
+print EM do_not_edit ("embedvar.h"), <<'END';
/* (Doing namespace management portably in C is really gross.) */
open(CAPI, '> perlapi.c') or die "Can't create perlapi.c: $!\n";
open(CAPIH, '> perlapi.h') or die "Can't create perlapi.h: $!\n";
-print CAPIH <<'EOT';
-/*
- * perlapi.h
- *
- * Copyright (c) 1997-2002, Larry Wall
- *
- * 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 embed.pl from data in embed.pl, pp.sym, intrpvar.h,
- * perlvars.h and thrdvar.h. Any changes made here will be lost!
- */
+print CAPIH do_not_edit ("perlapi.h"), <<'EOT';
/* declare accessor functions for Perl variables */
#ifndef __perlapi_h__
EOT
close CAPIH;
-print CAPI <<'EOT';
-/*
- * perlapi.c
- *
- * Copyright (c) 1997-2002, Larry Wall
- *
- * 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 embed.pl from data in embed.pl, pp.sym, intrpvar.h,
- * perlvars.h and thrdvar.h. Any changes made here will be lost!
- */
+print CAPI do_not_edit ("perlapi.c"), <<'EOT';
#include "EXTERN.h"
#include "perl.h"