annotate src/fftw-3.3.5/doc/FAQ/m-post.pl @ 168:ceec0dd9ec9c

Replace these with versions built using an older toolset (so as to avoid ABI compatibilities when linking on Ubuntu 14.04 for packaging purposes)
author Chris Cannam <cannam@all-day-breakfast.com>
date Fri, 07 Feb 2020 11:51:13 +0000
parents 7867fa7e1b6b
children
rev   line source
cannam@127 1 ## POST output
cannam@127 2 # Copyright (C) 1993-1995 Ian Jackson.
cannam@127 3
cannam@127 4 # This file is free software; you can redistribute it and/or modify
cannam@127 5 # it under the terms of the GNU General Public License as published by
cannam@127 6 # the Free Software Foundation; either version 2, or (at your option)
cannam@127 7 # any later version.
cannam@127 8
cannam@127 9 # It is distributed in the hope that it will be useful,
cannam@127 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
cannam@127 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cannam@127 12 # GNU General Public License for more details.
cannam@127 13
cannam@127 14 # You should have received a copy of the GNU General Public License
cannam@127 15 # along with GNU Emacs; see the file COPYING. If not, write to
cannam@127 16 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
cannam@127 17 # Boston, MA 02111-1307, USA.
cannam@127 18
cannam@127 19 # (Note: I do not consider works produced using these BFNN processing
cannam@127 20 # tools to be derivative works of the tools, so they are NOT covered
cannam@127 21 # by the GPL. However, I would appreciate it if you credited me if
cannam@127 22 # appropriate in any documents you format using BFNN.)
cannam@127 23
cannam@127 24 sub post_init {
cannam@127 25 open(POST,">$prefix.post");
cannam@127 26 }
cannam@127 27
cannam@127 28 sub post_startmajorheading {
cannam@127 29 print POST '='x79,"\n\n";
cannam@127 30 $post_status= 'h';
cannam@127 31 &post_text($_[0] ? "Section $_[0]. " : '');
cannam@127 32 }
cannam@127 33
cannam@127 34 sub post_startminorheading {
cannam@127 35 print POST '-'x77,"\n\n";
cannam@127 36 $post_status= 'h';
cannam@127 37 }
cannam@127 38
cannam@127 39 sub post_italic { &post_text('*'); }
cannam@127 40 sub post_enditalic { $post_para .= '*'; }
cannam@127 41
cannam@127 42 sub post_email { &post_text('<'); } sub post_endemail { &post_text('>'); }
cannam@127 43
cannam@127 44 sub post_ftpon { } sub post_endftpon { }
cannam@127 45 sub post_ftpin { } sub post_endftpin { }
cannam@127 46 sub post_docref { } sub post_enddocref { }
cannam@127 47 sub post_courier { } sub post_endcourier { }
cannam@127 48 sub post_newsgroup { } sub post_endnewsgroup { }
cannam@127 49 sub post_ftpsilent { $post_ignore++; }
cannam@127 50 sub post_endftpsilent { $post_ignore--; }
cannam@127 51
cannam@127 52 sub post_text {
cannam@127 53 return if $post_ignore;
cannam@127 54 if ($post_status eq '') {
cannam@127 55 $post_status= 'p';
cannam@127 56 }
cannam@127 57 $post_para .= $_[0];
cannam@127 58 }
cannam@127 59
cannam@127 60 sub post_tab {
cannam@127 61 local ($n) = $_[0]-length($post_para);
cannam@127 62 $post_para .= ' 'x$n if $n>0;
cannam@127 63 }
cannam@127 64
cannam@127 65 sub post_newline {
cannam@127 66 return unless $post_status eq 'p';
cannam@127 67 &post_writepara;
cannam@127 68 }
cannam@127 69
cannam@127 70 sub post_writepara {
cannam@127 71 local ($thisline, $thisword, $rest);
cannam@127 72 for (;;) {
cannam@127 73 last unless $post_para =~ m/\S/;
cannam@127 74 $thisline= $post_indentstring;
cannam@127 75 for (;;) {
cannam@127 76 last unless $post_para =~ m/^(\s*\S+)/;
cannam@127 77 unless (length($1) + length($thisline) < 75 ||
cannam@127 78 length($thisline) == length($post_indentstring)) {
cannam@127 79 last;
cannam@127 80 }
cannam@127 81 $thisline .= $1;
cannam@127 82 $post_para= $';
cannam@127 83 }
cannam@127 84 $post_para =~ s/^\s*//;
cannam@127 85 print POST $thisline,"\n";
cannam@127 86 $post_indentstring= $post_nextindent;
cannam@127 87 last unless length($post_para);
cannam@127 88 }
cannam@127 89 $post_status= ''; $post_para= '';
cannam@127 90 }
cannam@127 91
cannam@127 92 sub post_endpara {
cannam@127 93 return unless $post_status eq 'p';
cannam@127 94 &post_writepara;
cannam@127 95 print POST "\n";
cannam@127 96 }
cannam@127 97
cannam@127 98 sub post_endheading {
cannam@127 99 $post_para =~ s/\s*$//;
cannam@127 100 print POST "$post_para\n\n";
cannam@127 101 $post_status= '';
cannam@127 102 $post_para= '';
cannam@127 103 }
cannam@127 104
cannam@127 105 sub post_endmajorheading { &post_endheading(@_); }
cannam@127 106 sub post_endminorheading { &post_endheading(@_); }
cannam@127 107
cannam@127 108 sub post_startverbatim {
cannam@127 109 $post_vstatus= $post_status;
cannam@127 110 &post_writepara;
cannam@127 111 }
cannam@127 112
cannam@127 113 sub post_verbatim {
cannam@127 114 print POST $_[0],"\n";
cannam@127 115 }
cannam@127 116
cannam@127 117 sub post_endverbatim {
cannam@127 118 $post_status= $post_vstatus;
cannam@127 119 }
cannam@127 120
cannam@127 121 sub post_finish {
cannam@127 122 close(POST);
cannam@127 123 }
cannam@127 124
cannam@127 125 sub post_startindex { $post_status= ''; }
cannam@127 126 sub post_endindex { $post_status= 'p'; }
cannam@127 127
cannam@127 128 sub post_endindexitem {
cannam@127 129 printf POST " %-11s %-.66s\n",$post_left,$post_para;
cannam@127 130 $post_status= 'p';
cannam@127 131 $post_para= '';
cannam@127 132 }
cannam@127 133
cannam@127 134 sub post_startindexitem {
cannam@127 135 $post_left= $_[1];
cannam@127 136 }
cannam@127 137
cannam@127 138 sub post_startindexmainitem {
cannam@127 139 $post_left= $_[1];
cannam@127 140 print POST "\n" if $post_status eq 'p';
cannam@127 141 }
cannam@127 142
cannam@127 143 sub post_startindent {
cannam@127 144 $post_istatus= $post_status;
cannam@127 145 &post_writepara;
cannam@127 146 $post_indentstring= " $post_indentstring";
cannam@127 147 $post_nextindent= " $post_nextindent";
cannam@127 148 }
cannam@127 149
cannam@127 150 sub post_endindent {
cannam@127 151 $post_indentstring =~ s/^ //;
cannam@127 152 $post_nextindent =~ s/^ //;
cannam@127 153 $post_status= $post_istatus;
cannam@127 154 }
cannam@127 155
cannam@127 156 sub post_startpackedlist { $post_plc=0; }
cannam@127 157 sub post_endpackedlist { &post_newline if !$post_plc; }
cannam@127 158 sub post_packeditem {
cannam@127 159 &post_newline if !$post_plc;
cannam@127 160 &post_tab($post_plc*40+5);
cannam@127 161 $post_plc= !$post_plc;
cannam@127 162 }
cannam@127 163
cannam@127 164 sub post_startlist {
cannam@127 165 &post_endpara;
cannam@127 166 $post_indentstring= " $post_indentstring";
cannam@127 167 $post_nextindent= " $post_nextindent";
cannam@127 168 }
cannam@127 169
cannam@127 170 sub post_endlist {
cannam@127 171 &post_endpara;
cannam@127 172 $post_indentstring =~ s/^ //;
cannam@127 173 $post_nextindent =~ s/^ //;
cannam@127 174 }
cannam@127 175
cannam@127 176 sub post_item {
cannam@127 177 &post_newline;
cannam@127 178 $post_indentstring =~ s/ $/* /;
cannam@127 179 }
cannam@127 180
cannam@127 181 sub post_pageref {
cannam@127 182 &post_text("Q$_[1] \`");
cannam@127 183 }
cannam@127 184
cannam@127 185 sub post_endpageref {
cannam@127 186 &post_text("'");
cannam@127 187 }
cannam@127 188
cannam@127 189 1;