annotate src/fftw-3.3.5/doc/FAQ/m-post.pl @ 83:ae30d91d2ffe

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