X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=reentr.pl;h=b90c61dcfc4479523ba1bdab0c3472788e9d746d;hb=14ae36e97ba8d6550ac6e83fc3fd01cef28b74ad;hp=8bed03c7aba29192772c0ee484fe9ac8d2b52aaa;hpb=7918f24d20384771923d344a382e1d16d9552018;p=p5sagit%2Fp5-mst-13.2.git diff --git a/reentr.pl b/reentr.pl index 8bed03c..b90c61d 100644 --- a/reentr.pl +++ b/reentr.pl @@ -1,9 +1,20 @@ #!/usr/bin/perl -w - -# -# Generate the reentr.c and reentr.h, -# and optionally also the relevant metaconfig units (-U option). # +# Regenerate (overwriting only if changed): +# +# reentr.h +# reentr.c +# +# from information stored in the DATA section of this file. +# +# With the -U option, it also unconditionally regenerates the relevant +# metaconfig units: +# +# d_${func}_r.U +# +# Also accepts the standard regen_lib -q and -v args. +# +# This script is normally invoked from regen.pl. BEGIN { # Get function prototypes @@ -13,7 +24,7 @@ BEGIN { use strict; use Getopt::Std; my %opts; -getopts('U', \%opts); +getopts('Uv', \%opts); my %map = ( V => "void", @@ -40,10 +51,9 @@ my %map = ( # Example #3: S_CBI means type func_r(const char*, char*, int) -safer_unlink 'reentr.h'; -die "reentr.h: $!" unless open(H, ">reentr.h"); -binmode H; -select H; +# safer_unlink 'reentr.h'; +my $h = safer_open("reentr.h-new"); +select $h; print <reentr.c"); -binmode C; -select C; +# safer_unlink 'reentr.c'; +my $c = safer_open("reentr.c-new"); +select $c; print <