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