annotate fft/fftw/fftw-3.3.4/doc/FAQ/m-post.pl @ 40:223f770b5341 kissfft-double tip

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