annotate src/fftw-3.3.3/doc/FAQ/m-post.pl @ 95:89f5e221ed7b

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