Mercurial > hg > octave-lyh
annotate src/mkgendoc @ 14487:a467f3e04b7a
Fix incorrect call to getarchprefix.
* scripts/pkg/private/create_pkgadddel: Fix incorrect call to getarchprefix.
author | Carnë Draug <carandraug+dev@gmail.com> |
---|---|
date | Mon, 19 Mar 2012 01:33:31 +0000 |
parents | 72c96de7a403 |
children |
rev | line source |
---|---|
3295 | 1 #! /bin/sh |
7019 | 2 # |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
11550
diff
changeset
|
3 # Copyright (C) 1999-2012 John W. Eaton |
7019 | 4 # |
5 # This file is part of Octave. | |
6 # | |
7 # Octave is free software; you can redistribute it and/or modify it | |
8 # under the terms of the GNU General Public License as published by the | |
9 # Free Software Foundation; either version 3 of the License, or (at | |
10 # your option) any later version. | |
11 # | |
12 # Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 # for more details. | |
16 # | |
17 # You should have received a copy of the GNU General Public License | |
18 # along with Octave; see the file COPYING. If not, see | |
19 # <http://www.gnu.org/licenses/>. | |
3295 | 20 |
4299 | 21 SED=${SED:-'sed'} |
22 | |
3295 | 23 if test $# -ne 1; then |
24 echo "usage: mkgendoc f1" 1>&2 | |
25 exit 1 | |
26 fi | |
27 | |
28 DOC_FILES=`cat $1` | |
29 | |
30 if test -z "$DOC_FILES"; then | |
31 echo "mkgendoc: DOC_FILES is empty!" 1>&2 | |
32 exit 1 | |
33 fi | |
34 | |
35 cat << \EOF | |
3364 | 36 // DO NOT EDIT! Generated automatically by mkgendoc |
3295 | 37 |
4279 | 38 #if defined (__DECCXX) |
39 #define __USE_STD_IOSTREAM | |
40 #endif | |
41 | |
3543 | 42 #include <iostream> |
3295 | 43 #include <string> |
44 | |
9014
71fca0fc2436
save source file names for functions as comments in .texi files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
45 #define XDEFUN_FILE_NAME(name) \ |
71fca0fc2436
save source file names for functions as comments in .texi files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
46 std::string file_name = name; |
71fca0fc2436
save source file names for functions as comments in .texi files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
47 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
48 #define XDEFUN_DLD_INTERNAL(name, args_name, nargout_name, doc) \ |
9014
71fca0fc2436
save source file names for functions as comments in .texi files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
49 print_doc_string (#name, file_name, doc); |
3364 | 50 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
51 #define XDEFUNX_DLD_INTERNAL(name, fname, args_name, nargout_name, doc) \ |
9014
71fca0fc2436
save source file names for functions as comments in .texi files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
52 print_doc_string (name, file_name, doc); |
5796 | 53 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
54 #define XDEFUN_INTERNAL(name, args_name, nargout_name, doc) \ |
9014
71fca0fc2436
save source file names for functions as comments in .texi files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
55 print_doc_string (#name, file_name, doc); |
3295 | 56 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
57 #define XDEFCONSTFUN_INTERNAL(name, args_name, nargout_name, doc) \ |
9014
71fca0fc2436
save source file names for functions as comments in .texi files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
58 print_doc_string (#name, file_name, doc); |
4234 | 59 |
8746
5dd06f19e9be
handle commands in the lexer
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
60 #define XDEFUNX_INTERNAL(name, fname, args_name, nargout_name, doc) \ |
9014
71fca0fc2436
save source file names for functions as comments in .texi files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
61 print_doc_string (name, file_name, doc); |
3746 | 62 |
3295 | 63 #define XDEFALIAS_INTERNAL(alias, name) |
64 | |
65 #define XDEFVAR_INTERNAL(name, sname, defn, protect, chg_fcn, doc) \ | |
9014
71fca0fc2436
save source file names for functions as comments in .texi files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
66 print_doc_string (#name, file_name, doc); |
3295 | 67 |
3321 | 68 #define XDEFCONST_INTERNAL(name, defn, doc) \ |
9014
71fca0fc2436
save source file names for functions as comments in .texi files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
69 print_doc_string (#name, file_name, doc); |
3295 | 70 |
71 static void | |
9014
71fca0fc2436
save source file names for functions as comments in .texi files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
72 print_doc_string (const std::string& name, const std::string& file_name, |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
9794
diff
changeset
|
73 const std::string& doc) |
3295 | 74 { |
3553 | 75 std::cout << ""; |
3321 | 76 |
77 size_t len = name.length (); | |
78 | |
79 if (name[0] == '"' && name[len-1] == '"') | |
9014
71fca0fc2436
save source file names for functions as comments in .texi files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
80 std::cout << name.substr (1, len-2) << "\n"; |
3321 | 81 else |
9014
71fca0fc2436
save source file names for functions as comments in .texi files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
82 std::cout << name << "\n"; |
3321 | 83 |
11550
a9be431c1595
write function name along with filename in docstring comments
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
84 std::cout << "@c " << name << " " << file_name << "\n" << doc << "\n"; |
3295 | 85 } |
86 | |
87 EOF | |
88 | |
89 for file in $DOC_FILES; do | |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9014
diff
changeset
|
90 fcn=`echo $file | $SED 's,.*/,,; s/\.df//; s/-/_/g;'` |
3295 | 91 echo "static void" |
92 echo "print_${fcn}_doc_strings (void)" | |
93 echo "{" | |
94 cat $file | |
95 echo "}" | |
96 echo "" | |
97 done | |
98 | |
99 cat << \EOF | |
100 | |
101 int | |
102 main (void) | |
103 { | |
5333 | 104 std::cout |
105 << "### DO NOT EDIT!\n" | |
106 << "###\n" | |
107 << "### This file is generated automatically from the Octave sources.\n" | |
108 << "### Edit those files instead and run make to update this file.\n" | |
109 << std::endl; | |
110 | |
3295 | 111 EOF |
112 | |
113 for file in $DOC_FILES; do | |
9794
0d4613a736e9
convert build system to use automake and libtool
John W. Eaton <jwe@octave.org>
parents:
9014
diff
changeset
|
114 fcn=`echo $file | $SED 's,.*/,,; s/\.df//; s/-/_/g;'` |
3295 | 115 echo " print_${fcn}_doc_strings ();" |
116 done | |
117 | |
118 cat << \EOF | |
119 | |
120 return 0; | |
121 } | |
122 EOF | |
123 | |
124 exit 0 |