summaryrefslogtreecommitdiff
path: root/doc/rdsrc.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-06-11 18:32:33 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-11 18:32:33 -0700
commit773a513a1d90e98ced3615f1047d4fee1dce8d92 (patch)
tree19cf966ecee7a2e8b586c2c90dffca7e928125c8 /doc/rdsrc.pl
parent62332b2373565a6e577d4aacc5957c98047e69de (diff)
downloadnasm-773a513a1d90e98ced3615f1047d4fee1dce8d92.tar.gz
doc: another case of the RTF backend corrupting state
Another case of the RTF backend corrupting global state. "Fix" it by only outputting one format at a time; this also makes it possible to run in parallel.
Diffstat (limited to 'doc/rdsrc.pl')
-rw-r--r--doc/rdsrc.pl42
1 files changed, 26 insertions, 16 deletions
diff --git a/doc/rdsrc.pl b/doc/rdsrc.pl
index f27381a5..c4069b1e 100644
--- a/doc/rdsrc.pl
+++ b/doc/rdsrc.pl
@@ -88,6 +88,8 @@ use IO::File;
$diag = 1, shift @ARGV if $ARGV[0] eq "-d";
+($out_format) = @ARGV;
+
$| = 1;
$tstruct_previtem = $node = "Top";
@@ -101,7 +103,7 @@ print "Reading input...";
$pname = "para000000";
@pnames = @pflags = ();
$para = undef;
-while (<>) {
+while (defined($_ = <STDIN>)) {
&check_include($_);
}
&got_para($para);
@@ -125,21 +127,29 @@ if ($diag) {
}
# OK. Write out the various output files.
-print "Producing text output: ";
-&write_txt;
-print "done.\n";
-print "Producing HTML output: ";
-&write_html;
-print "done.\n";
-print "Producing Texinfo output: ";
-&write_texi;
-print "done.\n";
-print "Producing WinHelp output: ";
-&write_hlp;
-print "done.\n";
-print "Producing Documentation Intermediate Paragraphs: ";
-&write_dip;
-print "done.\n";
+if ($out_format eq 'txt') {
+ print "Producing text output: ";
+ &write_txt;
+ print "done.\n";
+} elsif ($out_format eq 'html') {
+ print "Producing HTML output: ";
+ &write_html;
+ print "done.\n";
+} elsif ($out_format eq 'texi') {
+ print "Producing Texinfo output: ";
+ &write_texi;
+ print "done.\n";
+} elsif ($out_format eq 'hlp') {
+ print "Producing WinHelp output: ";
+ &write_hlp;
+ print "done.\n";
+} elsif ($out_format eq 'dip') {
+ print "Producing Documentation Intermediate Paragraphs: ";
+ &write_dip;
+ print "done.\n";
+} else {
+ die "$0: unknown output format: $out_format\n";
+}
sub check_include {
local $_ = shift;