2
# Copyright (C) 1993-1995 Ian Jackson.
4
# This file is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2, or (at your option)
9
# It is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with GNU Emacs; see the file COPYING. If not, write to
16
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
# Boston, MA 02111-1307, USA.
19
# (Note: I do not consider works produced using these BFNN processing
20
# tools to be derivative works of the tools, so they are NOT covered
21
# by the GPL. However, I would appreciate it if you credited me if
22
# appropriate in any documents you format using BFNN.)
24
%saniarray= ('<','lt', '>','gt', '&','amp', '"','quot');
27
$html_prefix = './'.$prefix;
28
$html_prefix =~ s:^\.//:/:;
29
system('rm','-r',"$html_prefix.html");
30
system('mkdir',"$html_prefix.html");
31
open(HTML,">$html_prefix.html/index.html");
32
print HTML "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n";
33
print HTML "<html>\n";
36
chop($html_date=`date '+%d %B %Y'`);
37
chop($html_year=`date '+%Y'`);
45
<link rev="made" href="mailto:$user_authormail">
46
<link rel="Contents" href="index.html">
47
<link rel="Start" href="index.html">
48
<META name="description"
49
content="Frequently asked questions and answers (FAQ) for FFTW.">
50
<link rel="Bookmark" title="FFTW FAQ" href="index.html">
51
<LINK rel="Bookmark" title="FFTW Home Page"
52
href="http://www.fftw.org">
53
<LINK rel="Bookmark" title="FFTW Manual"
54
href="http://www.fftw.org/doc/">
55
</head><body text="#000000" bgcolor="#FFFFFF"><h1>
59
&html_readrefs($_[0]);
60
if (length($user_copyrightref)) {
61
local ($refn) = $qrefn{$user_copyrightref};
63
warn "unknown question (copyright) `$user_copyrightref'";
65
$refn =~ m/(\d+)\.(\d+)/;
66
local ($s,$n) = ($1,$2);
67
$html_copyrighthref= ($s == $html_sectionn)?'':"section$s.html";
68
$html_copyrighthref.= "#$qn2ref{$s,$n}";
73
print HTML $html_end,"<address>\n$user_author\n";
74
print HTML "- $html_date\n</address><br>\n";
75
print HTML "Extracted from $user_title,\n";
76
print HTML "<A href=\"$html_copyrighthref\">" if length($html_copyrighthref);
77
print HTML "Copyright © $html_year $user_copyholder.";
78
print HTML "</A>" if length($html_copyrighthref);
79
print HTML "\n</body></html>\n";
83
sub html_startmajorheading {
84
local ($ref, $this,$next,$back) = @_;
85
local ($nextt,$backt);
86
$this =~ s/^Section /section/; $html_sectionn= $ref;
87
$next =~ s/^Section /section/ && ($nextt= $sn2title{$'});
88
$back =~ s/^Section /section/ ? ($backt= $sn2title{$'}) : ($back='');
91
open(HTML,">$html_prefix.html/$this.html");
92
print HTML "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n";
93
print HTML "<html>\n";
95
$html_end.= "Next: <a href=\"$next.html\" rel=precedes>$nextt</a>.<br>\n"
97
$html_end.= "Back: <a href=\"$back.html\" rev=precedes>$backt</a>.<br>\n"
99
$html_end.= "<a href=\"index.html\" rev=subdocument>";
100
$html_end.= "Return to contents</a>.<p>\n";
103
$user_brieftitle - Section $html_sectionn
105
<link rev="made" href="mailto:$user_authormail">
106
<link rel="Contents" href="index.html">
107
<link rel="Start" href="index.html">
109
print HTML "<link rel=\"Next\" href=\"$next.html\">" if $next;
110
print HTML "<link rel=\"Previous\" href=\"$back.html\">" if $back;
112
<link rel="Bookmark" title="FFTW FAQ" href="index.html">
113
</head><body text="#000000" bgcolor="#FFFFFF"><h1>
114
$user_brieftitle - Section $html_sectionn <br>
119
print HTML "\n<h1>\n";
124
sub html_endmajorheading {
125
print HTML "\n</h1>\n\n";
129
sub html_startminorheading {
130
local ($ref, $this) = @_;
132
$this =~ m/^Question (\d+)\.(\d+)/;
133
local ($s,$n) = ($1,$2);
134
print HTML "\n<h2><A name=\"$qn2ref{$s,$n}\">\n";
137
sub html_endminorheading {
138
print HTML "\n</A></h2>\n\n";
142
sub html_newsgroup { &arg('newsgroup'); }
143
sub html_endnewsgroup { &endarg('newsgroup'); }
144
sub html_do_newsgroup {
145
print HTML "<A href=\"news:$_[0]\"><code>$_[0]</code></A>";
148
sub html_email { &arg('email'); }
149
sub html_endemail { &endarg('email'); }
151
print HTML "<A href=\"mailto:$_[0]\"><code>$_[0]</code></A>";
154
sub html_courier { print HTML "<code>" ; }
155
sub html_endcourier { print HTML "</code>"; }
156
sub html_italic { print HTML "<i>" ; }
157
sub html_enditalic { print HTML "</i>" ; }
159
sub html_docref { &arg('docref'); }
160
sub html_enddocref { &endarg('docref'); }
162
if (!defined($html_refval{$_[0]})) {
163
warn "undefined HTML reference $_[0]";
164
$html_refval{$n}='UNDEFINED';
166
print HTML "<A href=\"$html_refval{$_[0]}\">";
173
open(HTMLREFS,"<$_[0]") || (warn("failed to open HTML refs $_[0]: $!"),return);
177
if (s/^\\prefix\s*//) {
179
} elsif (s/^\s*(\S.*\S)\s*\\\s*//) {
182
$html_refval{$_}= $p.$v;
184
warn("ununderstood line in HTML refs >$_<");
190
sub html_ftpsilent { &arg('ftpsilent'); }
191
sub html_endftpsilent { &endarg('ftpsilent'); }
192
sub html_do_ftpsilent {
195
$html_ftpdir= $'.'/';
197
$html_ftpsite= $_[0];
202
sub html_ftpon { &arg('ftpon'); }
203
sub html_endftpon { &endarg('ftpon'); }
205
#print STDERR "ftpon($_[0])\n";
206
$html_ftpsite= $_[0]; $html_ftpdir= '';
209
print HTML "</code>";
212
sub html_ftpin { &arg('ftpin'); }
213
sub html_endftpin { &endarg('ftpin'); }
215
#print STDERR "ftpin($_[0])\n";
216
print HTML "<A href=\"ftp://$html_ftpsite$html_ftpdir$_[0]\"><code>";
218
print HTML "</code></A>";
222
print HTML "\n<p>\n" if $html_needpara > 0;
224
$html_stuff= &html_sanitise($_[0]);
225
while ($html_stuff =~ s/^(.{40,70}) //) {
228
print HTML $html_stuff;
232
$htmltabignore++ || warn "html tab ignored";
235
sub html_newline { print HTML "<br>\n" ; }
236
sub html_startverbatim { print HTML "<pre>\n" ; }
237
sub html_verbatim { print HTML &html_sanitise($_[0]),"\n"; }
238
sub html_endverbatim { print HTML "</pre>\n" ; $html_needpara= -1; }
241
$html_needpara || $html_needpara++;
248
sub html_startindex {
253
print HTML "</ul><hr>\n";
256
sub html_startindexitem {
257
local ($ref,$qval) = @_;
258
$qval =~ m/Q(\d+)\.(\d+)/;
259
local ($s,$n) = ($1,$2);
260
print HTML "<li><a href=\"";
261
print HTML ($s == $html_sectionn)?'':"section$s.html";
262
print HTML "#$qn2ref{$s,$n}\" rel=subdocument>Q$s.$n. ";
263
$html_indexunhead='';
266
sub html_startindexmainitem {
267
local ($ref,$s) = @_;
268
$s =~ m/\d+/; $s= $&;
269
print HTML "<br><br>" if ($s > 1);
270
print HTML "<li><b><font size=\"+2\"><a href=\"section$s.html\" rel=subdocument>Section $s. ";
271
$html_indexunhead='</font></b>';
274
sub html_endindexitem {
275
print HTML "</a>$html_indexunhead\n";
280
$html_itemend="<ul>";
284
print HTML "$html_itemend\n</ul>\n";
289
print HTML "$html_itemend\n<li>";
294
sub html_startpackedlist {
296
$html_itemend="<dir>";
299
sub html_endpackedlist {
300
print HTML "$html_itemend\n</dir>\n";
304
sub html_packeditem {
305
print HTML "$html_itemend\n<li>";
310
sub html_startindent { print HTML "<blockquote>\n"; }
311
sub html_endindent { print HTML "</blockquote>\n"; }
314
local ($ref,$sq) = @_;
315
$sq =~ m/(\d+)\.(\d+)/;
316
local ($s,$n) = ($1,$2);
317
print HTML "<A href=\"";
318
print HTML ($s == $html_sectionn)?'':"section$s.html";
319
print HTML "#$qn2ref{$s,$n}\">Q$sq \`";
322
sub html_endpageref {
329
while ($in =~ m/[<>&"]/) {
330
$out.= $`. '&'. $saniarray{$&}. ';';