summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-08-21 17:50:26 +0200
committerNicholas Clark <nick@ccl4.org>2011-08-25 11:34:38 +0200
commit3a54c8e7c7d0987480043de667a1b5afee4bcd54 (patch)
tree946960c916888c8a49b0aa4f3bdbae30d47eaff5 /regen
parentd500e60df9f652d9d80c9a5f4324d49e51e7f990 (diff)
downloadperl-3a54c8e7c7d0987480043de667a1b5afee4bcd54.tar.gz
In embed.pl, inline walk_table() into its only caller.
Diffstat (limited to 'regen')
-rwxr-xr-xregen/embed.pl33
1 files changed, 6 insertions, 27 deletions
diff --git a/regen/embed.pl b/regen/embed.pl
index 5a75009627..d339016a52 100755
--- a/regen/embed.pl
+++ b/regen/embed.pl
@@ -53,27 +53,6 @@ sub open_print_header {
my ($embed, $core, $ext, $api) = setup_embed();
-# walk table providing an array of components in each line to
-# subroutine, printing the result
-sub walk_table (&@) {
- my ($function, $filename) = @_;
- my $F;
- if (ref $filename) { # filehandle
- $F = $filename;
- }
- else {
- $F = open_print_header($filename);
- }
- foreach (@$embed) {
- my @outs = &{$function}(@$_);
- # $function->(@args) is not 5.003
- print $F @outs;
- }
- unless (ref $filename) {
- read_only_bottom_close_and_rename($F);
- }
-}
-
# generate proto.h
{
my $pr = open_print_header("proto.h");
@@ -358,17 +337,17 @@ print $em <<'END';
# define perl_atexit(a,b) call_atexit(a,b)
END
-walk_table {
- my ($flags,$retval,$func,@args) = @_;
- return unless $func;
- return unless $flags =~ /O/;
+foreach (@$embed) {
+ my ($flags, $retval, $func, @args) = @$_;
+ next unless $func;
+ next unless $flags =~ /O/;
my $alist = join ",", @az[0..$#args];
my $ret = "# define perl_$func($alist)";
my $t = (length $ret) >> 3;
$ret .= "\t" x ($t < 5 ? 5 - $t : 1);
- "$ret$func($alist)\n";
-} $em;
+ print $em "$ret$func($alist)\n";
+}
my @nocontext;
{