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.)
25
open(POST,">$prefix.post");
28
sub post_startmajorheading {
29
print POST '='x79,"\n\n";
31
&post_text($_[0] ? "Section $_[0]. " : '');
34
sub post_startminorheading {
35
print POST '-'x77,"\n\n";
39
sub post_italic { &post_text('*'); }
40
sub post_enditalic { $post_para .= '*'; }
42
sub post_email { &post_text('<'); } sub post_endemail { &post_text('>'); }
44
sub post_ftpon { } sub post_endftpon { }
45
sub post_ftpin { } sub post_endftpin { }
46
sub post_docref { } sub post_enddocref { }
47
sub post_courier { } sub post_endcourier { }
48
sub post_newsgroup { } sub post_endnewsgroup { }
49
sub post_ftpsilent { $post_ignore++; }
50
sub post_endftpsilent { $post_ignore--; }
53
return if $post_ignore;
54
if ($post_status eq '') {
61
local ($n) = $_[0]-length($post_para);
62
$post_para .= ' 'x$n if $n>0;
66
return unless $post_status eq 'p';
71
local ($thisline, $thisword, $rest);
73
last unless $post_para =~ m/\S/;
74
$thisline= $post_indentstring;
76
last unless $post_para =~ m/^(\s*\S+)/;
77
unless (length($1) + length($thisline) < 75 ||
78
length($thisline) == length($post_indentstring)) {
84
$post_para =~ s/^\s*//;
85
print POST $thisline,"\n";
86
$post_indentstring= $post_nextindent;
87
last unless length($post_para);
89
$post_status= ''; $post_para= '';
93
return unless $post_status eq 'p';
99
$post_para =~ s/\s*$//;
100
print POST "$post_para\n\n";
105
sub post_endmajorheading { &post_endheading(@_); }
106
sub post_endminorheading { &post_endheading(@_); }
108
sub post_startverbatim {
109
$post_vstatus= $post_status;
114
print POST $_[0],"\n";
117
sub post_endverbatim {
118
$post_status= $post_vstatus;
125
sub post_startindex { $post_status= ''; }
126
sub post_endindex { $post_status= 'p'; }
128
sub post_endindexitem {
129
printf POST " %-11s %-.66s\n",$post_left,$post_para;
134
sub post_startindexitem {
138
sub post_startindexmainitem {
140
print POST "\n" if $post_status eq 'p';
143
sub post_startindent {
144
$post_istatus= $post_status;
146
$post_indentstring= " $post_indentstring";
147
$post_nextindent= " $post_nextindent";
151
$post_indentstring =~ s/^ //;
152
$post_nextindent =~ s/^ //;
153
$post_status= $post_istatus;
156
sub post_startpackedlist { $post_plc=0; }
157
sub post_endpackedlist { &post_newline if !$post_plc; }
158
sub post_packeditem {
159
&post_newline if !$post_plc;
160
&post_tab($post_plc*40+5);
161
$post_plc= !$post_plc;
166
$post_indentstring= " $post_indentstring";
167
$post_nextindent= " $post_nextindent";
172
$post_indentstring =~ s/^ //;
173
$post_nextindent =~ s/^ //;
178
$post_indentstring =~ s/ $/* /;
182
&post_text("Q$_[1] \`");
185
sub post_endpageref {