annotate admin/mktexi @ 12669:1c92b4b26ced octave-forge

releasePKG.m: exclude .hg* files of export as of bug #45669
author jpicarbajal
date Fri, 31 Jul 2015 19:49:28 +0000
parents d79300686065
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1098
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
1 #!/usr/bin/env perl
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
2 #
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
3 # David Bateman Feb 02 2003
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
4 #
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
5 # Extracts the help in texinfo format for particular function for use
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
6 # in documentation. Based on make_index script from octave_forge.
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
7
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
8 use strict;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
9 use File::Find;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
10 use File::Basename;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
11 use Text::Wrap;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
12 use FileHandle;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
13 use IPC::Open3;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
14 use POSIX ":sys_wait_h";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
15
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
16 my $file = shift @ARGV;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
17 my $docfile = shift @ARGV;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
18 my $indexfile = shift @ARGV;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
19 my $line;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
20
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
21 if ( open(IN,$file) ) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
22 $line = <IN>;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
23 my $tex = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
24 while ($line) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
25 if ($line =~ /^\@DOCSTRING/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
26 my $found = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
27 my $func = $line;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
28 $func =~ s/\@DOCSTRING\(//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
29 $func =~ s/\)[\n\r]+//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
30 my $func0 = $func;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
31 my $func1 = $func;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
32 $func0 =~ s/,.*$//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
33 $func1 =~ s/^.*,//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
34 if ( open(DOC,$docfile) ) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
35 while (<DOC>) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
36 next unless /\037/;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
37 my $function = $_;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
38 $function =~ s/\037//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
39 $function =~ s/[\n\r]+//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
40 if ($function =~ /^$func0$/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
41 my $desc = "";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
42 my $docline;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
43 my $doctex = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
44 while (($docline = <DOC>) && ($docline !~ /^\037/)) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
45 $docline =~ s/^\s*-[*]- texinfo -[*]-\s*//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
46 if ($docline =~ /\@tex/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
47 $doctex = 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
48 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
49 if ($doctex) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
50 $docline =~ s/\\\\/\\/g;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
51 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
52 if ($docline =~ /\@end tex/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
53 $doctex = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
54 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
55 $desc .= $docline;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
56 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
57 $desc =~ s/$func0/$func1/g;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
58 $desc =~ s/\@seealso\{(.*[^}])\}/See also: \1/g;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
59 print "$desc", "\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
60 $found = 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
61 last;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
62 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
63 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
64 close (DOC);
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
65 if (! $found) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
66 print "\@emph{Not implemented}\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
67 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
68 } else {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
69 print STDERR "Could not open file $docfile\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
70 exit 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
71 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
72 } elsif ($line =~ /^\@REFERENCE_SECTION/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
73 my $secfound = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
74 my $sec = $line;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
75 $sec =~ s/\@REFERENCE_SECTION\(//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
76 $sec =~ s/\)[\n\r]+//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
77 my @listfunc = ();
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
78 my $nfunc = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
79 my $seccat = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
80
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
81 if ( open(IND,$indexfile) ) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
82 while (<IND>) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
83 next unless /^[^ ]/;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
84 my $section = $_;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
85 $section =~ s/[\n\r]+//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
86 if ($section =~ /^(.*?)\s*>>\s*(.*?)$/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
87 $section =~ s/.*>>(.*)/\1/;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
88 $seccat = 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
89 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
90 $section =~ s/^ *//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
91 $section =~ s/ *$//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
92 if ($section =~ /^$sec$/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
93 if ($seccat) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
94 print "\@iftex\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
95 print "\@section Functions by Category\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
96 # Get the list of categories to index
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
97 my $firstcat = 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
98 my $category;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
99 while (<IND>) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
100 last if />>/;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
101 if (/^[^ ]/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
102 if (! $firstcat) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
103 print "\@end table\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
104 } else {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
105 $firstcat = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
106 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
107 $category = $_;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
108 $category =~ s/[\n\r]+//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
109 print "\@subsection $category\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
110 print "\@table \@asis\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
111 } elsif (/^\s+(\S.*\S)\s*=\s*(\S.*\S)\s*$/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
112 my $func = $1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
113 my $desc = $2;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
114 print "\@item $func\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
115 print "$desc\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
116 print "\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
117 } else {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
118 if ($firstcat) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
119 print STDERR "Error parsing index file\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
120 exit 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
121 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
122 s/^\s+//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
123 my @funcs = split /\s+/;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
124 while ($#funcs >= 0) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
125 my $func = shift @funcs;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
126 $func =~ s/^ *//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
127 $func =~ s/[\n\r]+//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
128 push @listfunc, $func;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
129 $nfunc = $nfunc + 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
130 print "\@item $func\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
131 print func_summary($func, $docfile);
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
132 print "\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
133 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
134 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
135 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
136 if (! $firstcat) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
137 print "\@end table\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
138 }
11758
d79300686065 doc: fix compatibility with new makeinfo versions (Bug #39178)
carandraug
parents: 4773
diff changeset
139 print "\@end iftex\n\n";
1098
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
140 print "\n\@section Functions Alphabetically\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
141 } else {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
142 # Get the list of functions to index
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
143 my $indline;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
144 while (($indline = <IND>) && ($indline =~ /^ /)) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
145 if ($indline =~ /^\s+(\S.*\S)\s*=\s*(\S.*\S)\s*$/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
146 next;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
147 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
148 $indline =~ s/^\s+//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
149 my @funcs = split(/\s+/,$indline);
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
150 while ($#funcs >= 0) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
151 my $func = shift @funcs;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
152 $func =~ s/^ *//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
153 $func =~ s/[\n\r]+//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
154 push @listfunc, $func;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
155 $nfunc = $nfunc + 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
156 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
157 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
158 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
159 $secfound = 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
160 last;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
161 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
162 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
163 close (IND);
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
164 if (! $secfound) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
165 print STDERR "Did not find section $sec\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
166 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
167 } else {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
168 print STDERR "Could not open file $indexfile\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
169 exit 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
170 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
171
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
172 @listfunc = sort(@listfunc);
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
173 my @listfunc2 = ();
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
174 my $indent = 16 - 3;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
175 print "\@menu\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
176 foreach my $func (@listfunc) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
177 if ( open(DOC,$docfile) ) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
178 my $found = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
179 while (<DOC>) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
180 next unless /\037/;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
181 my $function = $_;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
182 $function =~ s/\037//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
183 $function =~ s/[\n\r]+//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
184 if ($function =~ /^$func$/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
185 $found = 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
186 last;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
187 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
188 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
189 close (DOC);
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
190 if ($found) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
191 push @listfunc2, $func;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
192 my $func0 = "${func}::";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
193 my $entry = sprintf("* %-*s %s",$indent,$func0,func_summary($func,$docfile));
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
194 print wrap("","\t\t","$entry"), "\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
195 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
196 } else {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
197 print STDERR "Could not open file $indexfile\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
198 exit 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
199 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
200 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
201 print "\@end menu\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
202
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
203 my $up = "Function Reference";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
204 my $next;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
205 my $prev;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
206 my $mfunc = 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
207 foreach my $func (@listfunc2) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
208 if ($mfunc == $nfunc) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
209 $next = "";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
210 } else {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
211 $next = @listfunc2[$mfunc];
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
212 $mfunc = $mfunc + 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
213 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
214 print "\n\@node $func, $next, $prev, $up\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
215 if ($seccat) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
216 print "\@subsection $func\n\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
217 } else {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
218 print "\@section $func\n\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
219 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
220 $prev = $func;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
221 my $found = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
222 my $desc = "";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
223 if ( open(DOC,$docfile) ) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
224 while (<DOC>) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
225 next unless /\037/;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
226 my $function = $_;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
227 $function =~ s/\037//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
228 $function =~ s/[\n\r]+//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
229 if ($function =~ /^$func$/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
230 my $docline;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
231 my $doctex = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
232 while (($docline = <DOC>) && ($docline !~ /^\037/)) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
233 $docline =~ s/^\s*-[*]- texinfo -[*]-\s*//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
234 if ($docline =~ /\@tex/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
235 $doctex = 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
236 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
237 if ($doctex) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
238 $docline =~ s/\\\\/\\/g;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
239 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
240 if ($docline =~ /\@end tex/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
241 $doctex = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
242 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
243 $desc .= $docline;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
244 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
245 $desc =~ s/\@seealso\{(.*[^}])\}/See also: \1/g;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
246 print "$desc", "\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
247 $found = 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
248 last;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
249 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
250 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
251 close (DOC);
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
252 if (! $found) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
253 print "\@emph{Not implemented}\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
254 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
255 } else {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
256 print STDERR "Could not open file $docfile\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
257 exit 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
258 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
259 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
260 } else {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
261 if ($line =~ /\@tex/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
262 $tex = 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
263 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
264 if ($tex) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
265 $line =~ s/\\\\/\\/g;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
266 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
267 print "$line";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
268 if ($line =~ /\@end tex/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
269 $tex = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
270 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
271 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
272 $line = <IN>;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
273 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
274 } else {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
275 print STDERR "Could not open file $file\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
276 exit 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
277 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
278
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
279 sub func_summary { # {{{1
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
280 my ($func, # in function name
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
281 $docfile # in DOCSTRINGS
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
282 ) = @_;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
283
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
284 my $desc = "";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
285 my $found = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
286 if ( open(DOC,$docfile) ) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
287 while (<DOC>) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
288 next unless /\037/;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
289 my $function = $_;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
290 $function =~ s/\037//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
291 $function =~ s/[\n\r]+//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
292 if ($function =~ /^$func$/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
293 my $docline;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
294 my $doctex = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
295 while (($docline = <DOC>) && ($docline !~ /^\037/)) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
296 if ($docline =~ /\@tex/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
297 $doctex = 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
298 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
299 if ($doctex) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
300 $docline =~ s/\\\\/\\/g;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
301 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
302 if ($docline =~ /\@end tex/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
303 $doctex = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
304 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
305 $desc .= $docline;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
306 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
307 $desc =~ s/\@seealso\{(.*[^}])\}/See also: \1/g;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
308 $found = 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
309 last;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
310 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
311 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
312 close (DOC);
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
313 if (! $found) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
314 $desc = "\@emph{Not implemented}";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
315 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
316 } else {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
317 print STDERR "Could not open file $docfile\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
318 exit 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
319 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
320 return first_sentence($desc);
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
321 } # 1}}}
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
322
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
323
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
324 sub first_sentence { # {{{1
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
325 # grab the first real sentence from the function documentation
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
326 my ($desc) = @_;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
327 my $retval = '';
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
328 my $line;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
329 my $next;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
330 my @lines;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
331
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
332 my $trace = 0;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
333 # $trace = 1 if $desc =~ /Levenberg/;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
334 return "" unless defined $desc;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
335 if ($desc =~ /^\s*-[*]- texinfo -[*]-/) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
336 # help text contains texinfo. Strip the indicator and run it
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
337 # through makeinfo. (XXX FIXME XXX this needs to be a function)
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
338 $desc =~ s/^\s*-[*]- texinfo -[*]-\s*//;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
339 my $cmd = "makeinfo --fill-column 1600 --no-warn --no-validate --no-headers --force --ifinfo";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
340 open3(*Writer, *Reader, *Errer, $cmd) or die "Could not run info";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
341 print Writer "\@macro seealso {args}\n\n\@noindent\nSee also: \\args\\.\n\@end macro\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
342 print Writer "$desc"; close(Writer);
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
343 @lines = <Reader>; close(Reader);
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
344 my @err = <Errer>; close(Errer);
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
345 waitpid(-1,&WNOHANG);
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
346
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
347 # Display source and errors, if any
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
348 if (@err) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
349 my $n = 1;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
350 foreach $line ( split(/\n/,$desc) ) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
351 printf "%2d: %s\n",$n++,$line;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
352 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
353 print ">>> @err";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
354 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
355
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
356 # Print trace showing formatted output
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
357 # print "<texinfo--------------------------------\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
358 # print @lines;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
359 # print "--------------------------------texinfo>\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
360
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
361 # Skip prototype and blank lines
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
362 while (1) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
363 return "" unless @lines;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
364 $line = shift @lines;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
365 next if $line =~ /^\s*-/;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
366 next if $line =~ /^\s*$/;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
367 last;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
368 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
369
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
370 } else {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
371
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
372 # print "<plain--------------------------------\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
373 # print $desc;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
374 # print "--------------------------------plain>\n";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
375
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
376 # Skip prototype and blank lines
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
377 @lines = split(/\n/,$desc);
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
378 while (1) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
379 return "" if ($#lines < 0);
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
380 $line = shift @lines;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
381 next if $line =~ /^\s*[Uu][Ss][Aa][Gg][Ee]/; # skip " usage "
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
382
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
383 $line =~ s/^\s*\w+\s*://; # chop " blah : "
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
384 print "strip blah: $line\n" if $trace;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
385 $line =~ s/^\s*[Ff]unction\s+//; # chop " function "
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
386 print "strip function $line\n" if $trace;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
387 $line =~ s/^\s*\[.*\]\s*=\s*//; # chop " [a,b] = "
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
388 print "strip []= $line\n" if $trace;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
389 $line =~ s/^\s*\w+\s*=\s*//; # chop " a = "
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
390 print "strip a= $line\n" if $trace;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
391 $line =~ s/^\s*\w+\s*\([^\)]*\)\s*//; # chop " f(x) "
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
392 print "strip f(x) $line\n" if $trace;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
393 $line =~ s/^\s*[;:]\s*//; # chop " ; "
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
394 print "strip ; $line\n" if $trace;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
395
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
396 $line =~ s/^\s*[[:upper:]][[:upper:]0-9_]+//; # chop " BLAH"
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
397 print "strip BLAH $line\n" if $trace;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
398 $line =~ s/^\s*\w*\s*[-]+\s+//; # chop " blah --- "
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
399 print "strip blah --- $line\n" if $trace;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
400 $line =~ s/^\s*\w+ *\t\s*//; # chop " blah <TAB> "
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
401 print "strip blah <TAB> $line\n" if $trace;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
402 $line =~ s/^\s*\w+\s\s+//; # chop " blah "
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
403 print "strip blah <NL> $line\n" if $trace;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
404
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
405 # next if $line =~ /^\s*\[/; # skip [a,b] = f(x)
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
406 # next if $line =~ /^\s*\w+\s*(=|\()/; # skip a = f(x) OR f(x)
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
407 next if $line =~ /^\s*or\s*$/; # skip blah \n or \n blah
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
408 next if $line =~ /^\s*$/; # skip blank line
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
409 next if $line =~ /^\s?!\//; # skip # !/usr/bin/octave
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
410 # XXX FIXME XXX should be testing for unmatched () in proto
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
411 # before going to the next line!
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
412 last;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
413 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
414 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
415
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
416 # Try to make a complete sentence, including the '.'
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
417 if ( "$line " !~ /[^.][.]\s/ && $#lines >= 0) {
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
418 my $next = $lines[0];
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
419 $line =~ s/\s*$//; # trim trailing blanks on last
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
420 $next =~ s/^\s*//; # trim leading blanks on next
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
421 $line .= " $next" if "$next " =~ /[^.][.]\s/; # ends the sentence
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
422 }
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
423
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
424 # Tidy up the sentence.
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
425 chomp $line; # trim trailing newline, if there is one
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
426 $line =~ s/^\s*//; # trim leading blanks on line
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
427 $line =~ s/([^.][.])\s.*$/$1/; # trim everything after the sentence
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
428 print "Skipping:\n$desc---\n" if $line eq "";
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
429
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
430 # And return it.
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
431 return $line;
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
432
96a954e137da Re-add mktexi/mkdoc with the right execute flagscvs add mktexi mkdoc
adb014
parents:
diff changeset
433 } # 1}}}
4773
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
434
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
435 __END__
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
436 This program is free software; you can redistribute it and/or modify
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
437 it under the terms of the GNU General Public License as published by
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
438 the Free Software Foundation; either version 2 of the License, or
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
439 (at your option) any later version.
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
440 This program is distributed in the hope that it will be useful,
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
441 but WITHOUT ANY WARRANTY; without even the implied warranty of
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
442 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
443 GNU General Public License for more details.
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
444 You should have received a copy of the GNU General Public License
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
445 along with this program; if not, see <http://www.gnu.org/licenses/>.
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
446 This program is granted to the public domain.
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
447 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
448 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
449 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
450 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
451 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
452 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
453 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
454 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
455 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
456 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
c16f98afec98 Make sure scripts derived from make_index have a GPL license included
adb014
parents: 1098
diff changeset
457 SUCH DAMAGE.