annotate libinterp/corefcn/help.cc @ 22198:f6181638f6c5

search docstrings file for built-in and dld function help text (bug #48554) Load help text as needed from the built-in docstrings file for built-in and dynamically loaded .oct file functions. * help.h, help.cc (install_built_in_docstrings): Delete. (raw_help_from_docstrings_file): New static function. (raw_help): Call raw_help_from_docstrings_file if help text is not found or if it is marked as external. * mk-builtins.sh: Don't emit call to install_built_in_docstrings.
author John W. Eaton <jwe@octave.org>
date Tue, 02 Aug 2016 03:10:51 -0400
parents ed8a0c39e14c
children af0dca907fae
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
2
19697
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 19403
diff changeset
3 Copyright (C) 1993-2015 John W. Eaton
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
4
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
6
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7001
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7001
diff changeset
10 option) any later version.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
11
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
15 for more details.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
16
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7001
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7001
diff changeset
19 <http://www.gnu.org/licenses/>.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
20
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
21 */
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
22
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
23 #if defined (HAVE_CONFIG_H)
21301
40de9f8f23a6 Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents: 21200
diff changeset
24 # include "config.h"
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
25 #endif
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
26
1343
94bedeb289e5 [project @ 1995-09-04 00:29:21 by jwe]
jwe
parents: 1315
diff changeset
27 #include <cstdlib>
94bedeb289e5 [project @ 1995-09-04 00:29:21 by jwe]
jwe
parents: 1315
diff changeset
28 #include <cstring>
94bedeb289e5 [project @ 1995-09-04 00:29:21 by jwe]
jwe
parents: 1315
diff changeset
29
5769
2b9a5ce46678 [project @ 2006-04-18 15:57:06 by jwe]
jwe
parents: 5768
diff changeset
30 #include <algorithm>
22198
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
31 #include <fstream>
3503
d14c483b3c12 [project @ 2000-02-01 04:06:07 by jwe]
jwe
parents: 3408
diff changeset
32 #include <iostream>
22198
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
33 #include <map>
5765
7ba9ad1fec11 [project @ 2006-04-17 05:05:15 by jwe]
jwe
parents: 5738
diff changeset
34 #include <sstream>
1755
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1742
diff changeset
35 #include <string>
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1742
diff changeset
36
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
37 #include "cmd-edit.h"
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
38 #include "file-ops.h"
6253
f1676652d808 [project @ 2007-01-24 20:43:36 by jwe]
jwe
parents: 6243
diff changeset
39 #include "file-stat.h"
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2900
diff changeset
40 #include "oct-env.h"
19269
65554f5847ac don't include oct-locbuf.h in header files unnecessarily
John W. Eaton <jwe@octave.org>
parents: 19152
diff changeset
41 #include "oct-locbuf.h"
1755
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1742
diff changeset
42 #include "str-vec.h"
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1742
diff changeset
43
22091
0f6fc2ec3b1a move call_stack class to a separate file
John W. Eaton <jwe@octave.org>
parents: 22022
diff changeset
44 #include "call-stack.h"
2492
06595bc7f2d0 [project @ 1996-11-09 00:13:50 by jwe]
jwe
parents: 2470
diff changeset
45 #include <defaults.h>
21765
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
46 #include "Cell.h"
1352
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1350
diff changeset
47 #include "defun.h"
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1350
diff changeset
48 #include "dirfns.h"
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1350
diff changeset
49 #include "error.h"
21100
e39e05d90788 Switch gripe_XXX to either err_XXX or warn_XXX naming scheme.
Rik <rik@octave.org>
parents: 21017
diff changeset
50 #include "errwarn.h"
1352
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1350
diff changeset
51 #include "help.h"
2177
0bddc913621b [project @ 1996-05-13 16:36:11 by jwe]
jwe
parents: 2124
diff changeset
52 #include "input.h"
5832
5e41e06f6a78 [project @ 2006-05-26 21:41:32 by jwe]
jwe
parents: 5823
diff changeset
53 #include "load-path.h"
20940
48b2ad5ee801 maint: Rename oct-obj.[cc|h] to ovl.[cc|h] for clarity.
Rik <rik@octave.org>
parents: 20939
diff changeset
54 #include "ovl.h"
2976
641689f67673 [project @ 1997-05-15 20:27:04 by jwe]
jwe
parents: 2962
diff changeset
55 #include "ov-usr-fcn.h"
21765
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
56 #include "ov-fcn-handle.h"
1352
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1350
diff changeset
57 #include "pager.h"
3018
5708b8bb4f06 [project @ 1997-06-03 21:48:05 by jwe]
jwe
parents: 3016
diff changeset
58 #include "parse.h"
1466
2f85a175308f [project @ 1995-09-22 07:48:59 by jwe]
jwe
parents: 1443
diff changeset
59 #include "pathsearch.h"
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
60 #include "procstream.h"
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
61 #include "pt-pr-code.h"
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
62 #include "sighandlers.h"
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
63 #include "symtab.h"
22094
9203833cab7d move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents: 22091
diff changeset
64 #include "interpreter.h"
8672
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
65 #include "unwind-prot.h"
242
742c4795aea9 [project @ 1993-11-30 21:26:43 by jwe]
jwe
parents: 240
diff changeset
66 #include "utils.h"
1352
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1350
diff changeset
67 #include "variables.h"
3301
02866242d3ae [project @ 1999-10-20 04:10:46 by jwe]
jwe
parents: 3296
diff changeset
68 #include "version.h"
5447
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
69 #include "quit.h"
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
70
8861
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
71 // Name of the doc cache file specified on the command line.
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
72 // (--doc-cache-file file)
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
73 std::string Vdoc_cache_file;
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
74
14614
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14360
diff changeset
75 // Name of the file containing local Texinfo macros that are prepended
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14360
diff changeset
76 // to doc strings before processing.
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14360
diff changeset
77 // (--texi-macros-file)
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14360
diff changeset
78 std::string Vtexi_macros_file;
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14360
diff changeset
79
2202
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
80 // Name of the info file specified on command line.
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
81 // (--info-file file)
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
82 std::string Vinfo_file;
2202
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
83
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
84 // Name of the info reader we'd like to use.
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
85 // (--info-program program)
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
86 std::string Vinfo_program;
2202
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
87
3686
9507d6de9bbd [project @ 2000-06-29 16:30:44 by jwe]
jwe
parents: 3584
diff changeset
88 // Name of the makeinfo program to run.
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
89 static std::string Vmakeinfo_program = "makeinfo";
3686
9507d6de9bbd [project @ 2000-06-29 16:30:44 by jwe]
jwe
parents: 3584
diff changeset
90
2189
d01936305d99 [project @ 1996-05-14 03:31:57 by jwe]
jwe
parents: 2177
diff changeset
91 // If TRUE, don't print additional help message in help and usage
d01936305d99 [project @ 1996-05-14 03:31:57 by jwe]
jwe
parents: 2177
diff changeset
92 // functions.
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
93 static bool Vsuppress_verbose_help_message = false;
2189
d01936305d99 [project @ 1996-05-14 03:31:57 by jwe]
jwe
parents: 2177
diff changeset
94
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
95 #include <map>
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
96
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
97 typedef std::map<std::string, std::string> map_type;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
98 typedef map_type::value_type pair_type;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
99 typedef map_type::const_iterator map_iter;
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
100
21139
538b57866b90 consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents: 21127
diff changeset
101 template <typename T, size_t z>
19872
d575cd1e0da7 Replace std::size_t with bare size_t for conformity to rest of code.
Rik <rik@octave.org>
parents: 19861
diff changeset
102 size_t
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
103 size (T const (&)[z])
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
104 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
105 return z;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
106 }
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
107
22156
187b6727c75e build doc-cache without running Octave (bug #48508)
John W. Eaton <jwe@octave.org>
parents: 22094
diff changeset
108 // FIXME: the doc strings for operators and keywords is currently
187b6727c75e build doc-cache without running Octave (bug #48508)
John W. Eaton <jwe@octave.org>
parents: 22094
diff changeset
109 // duplicated in op-kw-docs. We should arrange for Octave to read the
187b6727c75e build doc-cache without running Octave (bug #48508)
John W. Eaton <jwe@octave.org>
parents: 22094
diff changeset
110 // info from that file (or the generated DOCSTRINGS file) at startup
187b6727c75e build doc-cache without running Octave (bug #48508)
John W. Eaton <jwe@octave.org>
parents: 22094
diff changeset
111 // instead and remove the data from this file.
187b6727c75e build doc-cache without running Octave (bug #48508)
John W. Eaton <jwe@octave.org>
parents: 22094
diff changeset
112
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
113 const static pair_type operators[] =
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
114 {
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
115 pair_type ("!",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
116 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
117 @deftypefn {} {} !\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
118 Logical 'not' operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
119 @seealso{~, not}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
120 @end deftypefn"),
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
121
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
122 pair_type ("~",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
123 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
124 @deftypefn {} {} ~\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
125 Logical 'not' operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
126 @seealso{!, not}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
127 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
128
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
129 pair_type ("!=",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
130 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
131 @deftypefn {} {} !=\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
132 Logical 'not equals' operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
133 @seealso{~=, ne}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
134 @end deftypefn"),
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
135
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
136 pair_type ("~=",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
137 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
138 @deftypefn {} {} ~=\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
139 Logical 'not equals' operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
140 @seealso{!=, ne}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
141 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
142
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
143 pair_type ("\"",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
144 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
145 @deftypefn {} {} \"\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
146 String delimiter.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
147 @end deftypefn"),
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
148
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
149 pair_type ("#",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
150 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
151 @deftypefn {} {} #\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
152 Begin comment character.\n\
14766
877263efaacc doc: Fix bug with Texinfo special characters within Seealso macro.
Rik <octave@nomad.inbox5.com>
parents: 14618
diff changeset
153 @seealso{%, #@\\{}\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
154 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
155
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
156 pair_type ("%",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
157 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
158 @deftypefn {} {} %\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
159 Begin comment character.\n\
14766
877263efaacc doc: Fix bug with Texinfo special characters within Seealso macro.
Rik <octave@nomad.inbox5.com>
parents: 14618
diff changeset
160 @seealso{#, %@\\{}\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
161 @end deftypefn"),
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
162
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
163 pair_type ("#{",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
164 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
165 @deftypefn {} {} #@{\n\
13773
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
166 Begin block comment. There must be nothing else, other than\n\
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
167 whitespace, in the line both before and after @code{#@{}.\n\
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
168 It is possible to nest block comments.\n\
14766
877263efaacc doc: Fix bug with Texinfo special characters within Seealso macro.
Rik <octave@nomad.inbox5.com>
parents: 14618
diff changeset
169 @seealso{%@\\{, #@\\}, #}\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
170 @end deftypefn"),
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
171
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
172 pair_type ("%{",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
173 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
174 @deftypefn {} {} %@{\n\
13773
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
175 Begin block comment. There must be nothing else, other than\n\
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
176 whitespace, in the line both before and after @code{%@{}.\n\
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
177 It is possible to nest block comments.\n\
14766
877263efaacc doc: Fix bug with Texinfo special characters within Seealso macro.
Rik <octave@nomad.inbox5.com>
parents: 14618
diff changeset
178 @seealso{#@\\{, %@\\}, %}\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
179 @end deftypefn"),
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
180
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
181 pair_type ("#}",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
182 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
183 @deftypefn {} {} #@}\n\
13773
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
184 Close block comment. There must be nothing else, other than\n\
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
185 whitespace, in the line both before and after @code{#@}}.\n\
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
186 It is possible to nest block comments.\n\
14766
877263efaacc doc: Fix bug with Texinfo special characters within Seealso macro.
Rik <octave@nomad.inbox5.com>
parents: 14618
diff changeset
187 @seealso{%@\\}, #@\\{, #}\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
188 @end deftypefn"),
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
189
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
190 pair_type ("%}",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
191 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
192 @deftypefn {} {} %@}\n\
13773
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
193 Close block comment. There must be nothing else, other than\n\
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
194 whitespace, in the line both before and after @code{%@}}.\n\
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
195 It is possible to nest block comments.\n\
14766
877263efaacc doc: Fix bug with Texinfo special characters within Seealso macro.
Rik <octave@nomad.inbox5.com>
parents: 14618
diff changeset
196 @seealso{#@\\}, %@\\{, %}\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
197 @end deftypefn"),
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
198
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
199 pair_type ("...",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
200 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
201 @deftypefn {} {} ...\n\
13773
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
202 Continuation marker. Joins current line with following line.\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
203 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
204
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
205 pair_type ("&",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
206 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
207 @deftypefn {} {} &\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
208 Element by element logical 'and' operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
209 @seealso{&&, and}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
210 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
211
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
212 pair_type ("&&",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
213 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
214 @deftypefn {} {} &&\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
215 Logical 'and' operator (with short-circuit evaluation).\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
216 @seealso{&, and}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
217 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
218
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
219 pair_type ("'",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
220 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
221 @deftypefn {} {} '\n\
13773
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
222 Matrix transpose operator. For complex matrices, computes the\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
223 complex conjugate (Hermitian) transpose.\n\
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
224 \n\
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
225 The single quote character may also be used to delimit strings, but\n\
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
226 it is better to use the double quote character, since that is never\n\
13773
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
227 ambiguous.\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
228 @seealso{.', transpose}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
229 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
230
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
231 pair_type ("(",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
232 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
233 @deftypefn {} {} (\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
234 Array index or function argument delimiter.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
235 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
236
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
237 pair_type (")",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
238 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
239 @deftypefn {} {})\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
240 Array index or function argument delimiter.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
241 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
242
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
243 pair_type ("*",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
244 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
245 @deftypefn {} {} *\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
246 Multiplication operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
247 @seealso{.*, times}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
248 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
249
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
250 pair_type ("**",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
251 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
252 @deftypefn {} {} **\n\
14171
2ced2f59f523 doc: miscellaneous documentation improvements
Rik <octave@nomad.inbox5.com>
parents: 14169
diff changeset
253 Power operator. This may return complex results for real inputs. Use\n\
14169
c0ca47ab7641 doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14138
diff changeset
254 @code{realsqrt}, @code{cbrt}, @code{nthroot}, or @code{realroot} to obtain\n\
c0ca47ab7641 doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14138
diff changeset
255 real results when possible.\n\
c0ca47ab7641 doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14138
diff changeset
256 @seealso{power, ^, .**, .^, realpow, realsqrt, cbrt, nthroot}\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
257 @end deftypefn"),
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
258
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
259 pair_type ("^",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
260 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
261 @deftypefn {} {} ^\n\
14171
2ced2f59f523 doc: miscellaneous documentation improvements
Rik <octave@nomad.inbox5.com>
parents: 14169
diff changeset
262 Power operator. This may return complex results for real inputs. Use\n\
14169
c0ca47ab7641 doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14138
diff changeset
263 @code{realsqrt}, @code{cbrt}, @code{nthroot}, or @code{realroot} to obtain\n\
c0ca47ab7641 doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14138
diff changeset
264 real results when possible.\n\
c0ca47ab7641 doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14138
diff changeset
265 @seealso{power, **, .^, .**, realpow, realsqrt, cbrt, nthroot}\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
266 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
267
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
268 pair_type ("+",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
269 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
270 @deftypefn {} {} +\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
271 Addition operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
272 @seealso{plus}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
273 @end deftypefn"),
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
274
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
275 pair_type ("++",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
276 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
277 @deftypefn {} {} ++\n\
13773
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
278 Increment operator. As in C, may be applied as a prefix or postfix\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
279 operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
280 @seealso{--}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
281 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
282
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
283 pair_type (",",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
284 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
285 @deftypefn {} {} ,\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
286 Array index, function argument, or command separator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
287 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
288
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
289 pair_type ("-",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
290 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
291 @deftypefn {} {} -\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
292 Subtraction or unary negation operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
293 @seealso{minus}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
294 @end deftypefn"),
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
295
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
296 pair_type ("--",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
297 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
298 @deftypefn {} {} --\n\
13773
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
299 Decrement operator. As in C, may be applied as a prefix or postfix\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
300 operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
301 @seealso{++}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
302 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
303
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
304 pair_type (".'",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
305 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
306 @deftypefn {} {} .'\n\
13773
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
307 Matrix transpose operator. For complex matrices, computes the\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
308 transpose, @emph{not} the complex conjugate transpose.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
309 @seealso{', transpose}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
310 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
311
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
312 pair_type (".*",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
313 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
314 @deftypefn {} {} .*\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
315 Element by element multiplication operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
316 @seealso{*, times}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
317 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
318
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
319 pair_type (".**",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
320 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
321 @deftypefn {} {} .*\n\
14171
2ced2f59f523 doc: miscellaneous documentation improvements
Rik <octave@nomad.inbox5.com>
parents: 14169
diff changeset
322 Element by element power operator. If several complex results are possible,\n\
2ced2f59f523 doc: miscellaneous documentation improvements
Rik <octave@nomad.inbox5.com>
parents: 14169
diff changeset
323 returns the one with smallest non-negative argument (angle). Use\n\
14169
c0ca47ab7641 doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14138
diff changeset
324 @code{realpow}, @code{realsqrt}, @code{cbrt}, or @code{nthroot} if a\n\
c0ca47ab7641 doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14138
diff changeset
325 real result is preferred.\n\
c0ca47ab7641 doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14138
diff changeset
326 @seealso{**, ^, .^, power, realpow, realsqrt, cbrt, nthroot}\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
327 @end deftypefn"),
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
328
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
329 pair_type (".^",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
330 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
331 @deftypefn {} {} .^\n\
14171
2ced2f59f523 doc: miscellaneous documentation improvements
Rik <octave@nomad.inbox5.com>
parents: 14169
diff changeset
332 Element by element power operator. If several complex results are possible,\n\
2ced2f59f523 doc: miscellaneous documentation improvements
Rik <octave@nomad.inbox5.com>
parents: 14169
diff changeset
333 returns the one with smallest non-negative argument (angle). Use\n\
14169
c0ca47ab7641 doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14138
diff changeset
334 @code{realpow}, @code{realsqrt}, @code{cbrt}, or @code{nthroot} if a\n\
c0ca47ab7641 doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14138
diff changeset
335 real result is preferred.\n\
c0ca47ab7641 doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14138
diff changeset
336 @seealso{.**, ^, **, power, realpow, realsqrt, cbrt, nthroot}\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
337 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
338
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
339 pair_type ("./",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
340 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
341 @deftypefn {} {} ./\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
342 Element by element right division operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
343 @seealso{/, .\\, rdivide, mrdivide}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
344 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
345
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
346 pair_type ("/",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
347 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
348 @deftypefn {} {} /\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
349 Right division operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
350 @seealso{./, \\, rdivide, mrdivide}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
351 @end deftypefn"),
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
352
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
353 pair_type (".\\",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
354 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
355 @deftypefn {} {} .\\\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
356 Element by element left division operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
357 @seealso{\\, ./, rdivide, mrdivide}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
358 @end deftypefn"),
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
359
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
360 pair_type ("\\",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
361 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
362 @deftypefn {} {} \\\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
363 Left division operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
364 @seealso{.\\, /, ldivide, mldivide}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
365 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
366
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
367 pair_type (":",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
368 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
369 @deftypefn {} {} :\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
370 Select entire rows or columns of matrices.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
371 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
372
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
373 pair_type (";",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
374 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
375 @deftypefn {} {} ;\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
376 Array row or command separator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
377 @seealso{,}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
378 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
379
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
380 pair_type ("<",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
381 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
382 @deftypefn {} {} <\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
383 'Less than' operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
384 @seealso{lt}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
385 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
386
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
387 pair_type ("<=",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
388 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
389 @deftypefn {} {} <=\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
390 'Less than' or 'equals' operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
391 @seealso{le}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
392 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
393
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
394 pair_type ("=",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
395 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
396 @deftypefn {} {} =\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
397 Assignment operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
398 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
399
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
400 pair_type ("==",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
401 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
402 @deftypefn {} {} ==\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
403 Equality test operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
404 @seealso{eq}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
405 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
406
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
407 pair_type (">",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
408 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
409 @deftypefn {} {} >\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
410 'Greater than' operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
411 @seealso{gt}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
412 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
413
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
414 pair_type (">=",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
415 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
416 @deftypefn {} {} >=\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
417 'Greater than' or 'equals' operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
418 @seealso{ge}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
419 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
420
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
421 pair_type ("[",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
422 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
423 @deftypefn {} {} [\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
424 Return list delimiter.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
425 @seealso{]}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
426 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
427
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
428 pair_type ("]",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
429 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
430 @deftypefn {} {} ]\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
431 Return list delimiter.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
432 @seealso{[}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
433 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
434
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
435 pair_type ("|",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
436 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
437 @deftypefn {} {} |\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
438 Element by element logical 'or' operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
439 @seealso{||, or}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
440 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
441
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
442 pair_type ("||",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
443 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
444 @deftypefn {} {} ||\n\
12670
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
445 Logical 'or' (with short-circuit evaluation) operator.\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
446 @seealso{|, or}\n\
f83ec5ab90ad doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents: 12605
diff changeset
447 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
448 };
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
449
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
450 const static pair_type keywords[] =
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
451 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
452 pair_type ("break",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
453 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
454 @deftypefn {} {} break\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
455 Exit the innermost enclosing do, while or for loop.\n\
13246
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
456 @seealso{do, while, for, parfor, continue}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
457 @end deftypefn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
458
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
459 pair_type ("case",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
460 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
461 @deftypefn {} {} case @var{value}\n\
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
462 @deftypefnx {} {} case @{@var{value}, @dots{}@}\n\
18228
64f178d8e1e0 doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents: 17829
diff changeset
463 A case statement in a switch. Octave cases are exclusive and do not\n\
9064
7c02ec148a3c Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
464 fall-through as do C-language cases. A switch statement must have at least\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
465 one case. See @code{switch} for an example.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
466 @seealso{switch}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
467 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
468
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
469 pair_type ("catch",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
470 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
471 @deftypefn {} {} catch\n\
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
472 @deftypefnx {} {} catch @var{value}\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
473 Begin the cleanup part of a try-catch block.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
474 @seealso{try}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
475 @end deftypefn"),
1489
3e705c864019 [project @ 1995-09-28 05:38:26 by jwe]
jwe
parents: 1488
diff changeset
476
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
477 pair_type ("continue",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
478 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
479 @deftypefn {} {} continue\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
480 Jump to the end of the innermost enclosing do, while or for loop.\n\
13246
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
481 @seealso{do, while, for, parfor, break}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
482 @end deftypefn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
483
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
484 pair_type ("do",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
485 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
486 @deftypefn {} {} do\n\
9064
7c02ec148a3c Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
487 Begin a do-until loop. This differs from a do-while loop in that the\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
488 body of the loop is executed at least once.\n\
15908
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
489 \n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
490 @example\n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
491 @group\n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
492 i = 0;\n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
493 do\n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
494 i++\n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
495 until (i == 10)\n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
496 @end group\n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
497 @end example\n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
498 @seealso{for, until, while}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
499 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
500
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
501 pair_type ("else",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
502 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
503 @deftypefn {} {} else\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
504 Alternate action for an if block. See @code{if} for an example.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
505 @seealso{if}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
506 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
507
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
508 pair_type ("elseif",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
509 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
510 @deftypefn {} {} elseif (@var{condition})\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
511 Alternate conditional test for an if block. See @code{if} for an example.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
512 @seealso{if}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
513 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
514
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
515 pair_type ("end",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
516 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
517 @deftypefn {} {} end\n\
18228
64f178d8e1e0 doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents: 17829
diff changeset
518 Mark the end of any @code{for}, @code{parfor}, @code{if}, @code{do},\n\
64f178d8e1e0 doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents: 17829
diff changeset
519 @code{while}, @code{function}, @code{switch}, @code{try}, or\n\
64f178d8e1e0 doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents: 17829
diff changeset
520 @code{unwind_protect} block.\n\
64f178d8e1e0 doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents: 17829
diff changeset
521 @seealso{for, parfor, if, do, while, function, switch, try, unwind_protect}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
522 @end deftypefn"),
928
2f91e7098f8c [project @ 1994-11-15 21:53:40 by jwe]
jwe
parents: 867
diff changeset
523
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
524 pair_type ("end_try_catch",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
525 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
526 @deftypefn {} {} end_try_catch\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
527 Mark the end of an @code{try-catch} block.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
528 @seealso{try, catch}\n\
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
529 @end deftypefn"),
1489
3e705c864019 [project @ 1995-09-28 05:38:26 by jwe]
jwe
parents: 1488
diff changeset
530
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
531 pair_type ("end_unwind_protect",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
532 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
533 @deftypefn {} {} end_unwind_protect\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
534 Mark the end of an unwind_protect block.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
535 @seealso{unwind_protect}\n\
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
536 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
537
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
538 pair_type ("endfor",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
539 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
540 @deftypefn {} {} endfor\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
541 Mark the end of a for loop. See @code{for} for an example.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
542 @seealso{for}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
543 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
544
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
545 pair_type ("endfunction",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
546 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
547 @deftypefn {} {} endfunction\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
548 Mark the end of a function.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
549 @seealso{function}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
550 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
551
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
552 pair_type ("endif",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
553 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
554 @deftypefn {} {} endif\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
555 Mark the end of an if block. See @code{if} for an example.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
556 @seealso{if}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
557 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
558
13246
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
559 pair_type ("endparfor",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
560 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
561 @deftypefn {} {} endparfor\n\
13246
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
562 Mark the end of a parfor loop. See @code{parfor} for an example.\n\
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
563 @seealso{parfor}\n\
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
564 @end deftypefn"),
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
565
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
566 pair_type ("endswitch",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
567 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
568 @deftypefn {} {} endswitch\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
569 Mark the end of a switch block. See @code{switch} for an example.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
570 @seealso{switch}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
571 @end deftypefn"),
5122
695509577dc6 [project @ 2005-01-26 22:15:11 by jwe]
jwe
parents: 5041
diff changeset
572
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
573 pair_type ("endwhile",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
574 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
575 @deftypefn {} {} endwhile\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
576 Mark the end of a while loop. See @code{while} for an example.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
577 @seealso{do, while}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
578 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
579
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
580 pair_type ("for",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
581 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
582 @deftypefn {} {} for @var{i} = @var{range}\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
583 Begin a for loop.\n\
10840
89f4d7e294cc Grammarcheck .cc files
Rik <octave@nomad.inbox5.com>
parents: 10500
diff changeset
584 \n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
585 @example\n\
9064
7c02ec148a3c Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
586 @group\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
587 for i = 1:10\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
588 i\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
589 endfor\n\
9064
7c02ec148a3c Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
590 @end group\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
591 @end example\n\
13246
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
592 @seealso{do, parfor, while}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
593 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
594
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
595 pair_type ("function",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
596 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
597 @deftypefn {} {} function @var{outputs} = function (@var{input}, @dots{})\n\
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
598 @deftypefnx {} {} function {} function (@var{input}, @dots{})\n\
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
599 @deftypefnx {} {} function @var{outputs} = function\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
600 Begin a function body with @var{outputs} as results and @var{inputs} as\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
601 parameters.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
602 @seealso{return}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
603 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
604
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
605 pair_type ("global",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
606 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
607 @deftypefn {} {} global @var{var}\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
608 Declare variables to have global scope.\n\
10840
89f4d7e294cc Grammarcheck .cc files
Rik <octave@nomad.inbox5.com>
parents: 10500
diff changeset
609 \n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
610 @example\n\
9064
7c02ec148a3c Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
611 @group\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
612 global @var{x};\n\
14360
97883071e8e4 doc: Correct off-by-1 spacings in all .cc docstrings
Rik <octave@nomad.inbox5.com>
parents: 14171
diff changeset
613 if (isempty (@var{x}))\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
614 x = 1;\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
615 endif\n\
9064
7c02ec148a3c Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
616 @end group\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
617 @end example\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
618 @seealso{persistent}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
619 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
620
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
621 pair_type ("if",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
622 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
623 @deftypefn {} {} if (@var{cond}) @dots{} endif\n\
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
624 @deftypefnx {} {} if (@var{cond}) @dots{} else @dots{} endif\n\
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
625 @deftypefnx {} {} if (@var{cond}) @dots{} elseif (@var{cond}) @dots{} endif\n\
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
626 @deftypefnx {} {} if (@var{cond}) @dots{} elseif (@var{cond}) @dots{} else @dots{} endif\n\
5393
c8783205a7c6 [project @ 2005-06-15 17:03:54 by jwe]
jwe
parents: 5339
diff changeset
627 Begin an if block.\n\
10840
89f4d7e294cc Grammarcheck .cc files
Rik <octave@nomad.inbox5.com>
parents: 10500
diff changeset
628 \n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
629 @example\n\
9064
7c02ec148a3c Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
630 @group\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
631 x = 1;\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
632 if (x == 1)\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
633 disp (\"one\");\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
634 elseif (x == 2)\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
635 disp (\"two\");\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
636 else\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
637 disp (\"not one or two\");\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
638 endif\n\
9064
7c02ec148a3c Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
639 @end group\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
640 @end example\n\
5646
2b20d1707f29 [project @ 2006-03-06 22:38:32 by jwe]
jwe
parents: 5644
diff changeset
641 @seealso{switch}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
642 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
643
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
644 pair_type ("otherwise",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
645 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
646 @deftypefn {} {} otherwise\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
647 The default statement in a switch block (similar to else in an if block).\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
648 @seealso{switch}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
649 @end deftypefn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
650
13246
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
651 pair_type ("parfor",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
652 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
653 @deftypefn {} {} parfor @var{i} = @var{range}\n\
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
654 @deftypefnx {} {} parfor (@var{i} = @var{range}, @var{maxproc})\n\
13246
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
655 Begin a for loop that may execute in parallel.\n\
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
656 \n\
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
657 @example\n\
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
658 @group\n\
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
659 parfor i = 1:10\n\
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
660 i\n\
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
661 endparfor\n\
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
662 @end group\n\
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
663 @end example\n\
13773
59e5f8e1d516 Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents: 13749
diff changeset
664 @seealso{for, do, while}\n\
13246
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
665 @end deftypefn"),
0c69a564f2be additional parfor changes
John W. Eaton <jwe@octave.org>
parents: 12911
diff changeset
666
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
667 pair_type ("persistent",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
668 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
669 @deftypefn {} {} persistent @var{var}\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
670 Declare variables as persistent. A variable that has been declared\n\
5623
691de3e3c2f8 [project @ 2006-02-15 18:32:32 by jwe]
jwe
parents: 5594
diff changeset
671 persistent within a function will retain its contents in memory between\n\
691de3e3c2f8 [project @ 2006-02-15 18:32:32 by jwe]
jwe
parents: 5594
diff changeset
672 subsequent calls to the same function. The difference between persistent\n\
20172
4f45eaf83908 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20138
diff changeset
673 variables and global variables is that persistent variables are local in\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
674 scope to a particular function and are not visible elsewhere.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
675 @seealso{global}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
676 @end deftypefn"),
4686
c7ae43dfdea4 [project @ 2004-01-06 19:29:23 by jwe]
jwe
parents: 4469
diff changeset
677
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
678 pair_type ("return",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
679 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
680 @deftypefn {} {} return\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
681 Return from a function.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
682 @seealso{function}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
683 @end deftypefn"),
928
2f91e7098f8c [project @ 1994-11-15 21:53:40 by jwe]
jwe
parents: 867
diff changeset
684
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
685 pair_type ("static",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
686 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
687 @deftypefn {} {} static\n\
18228
64f178d8e1e0 doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents: 17829
diff changeset
688 This statement has been deprecated in favor of @code{persistent}.\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
689 @seealso{persistent}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
690 @end deftypefn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
691
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
692 pair_type ("switch",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
693 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
694 @deftypefn {} {} switch @var{statement}\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
695 Begin a switch block.\n\
10840
89f4d7e294cc Grammarcheck .cc files
Rik <octave@nomad.inbox5.com>
parents: 10500
diff changeset
696 \n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
697 @example\n\
9064
7c02ec148a3c Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
698 @group\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
699 yesno = \"yes\"\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
700 \n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
701 switch yesno\n\
5832
5e41e06f6a78 [project @ 2006-05-26 21:41:32 by jwe]
jwe
parents: 5823
diff changeset
702 case @{\"Yes\" \"yes\" \"YES\" \"y\" \"Y\"@}\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
703 value = 1;\n\
5832
5e41e06f6a78 [project @ 2006-05-26 21:41:32 by jwe]
jwe
parents: 5823
diff changeset
704 case @{\"No\" \"no\" \"NO\" \"n\" \"N\"@}\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
705 value = 0;\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
706 otherwise\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
707 error (\"invalid value\");\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
708 endswitch\n\
9064
7c02ec148a3c Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
709 @end group\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
710 @end example\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
711 @seealso{if, case, otherwise}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
712 @end deftypefn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
713
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
714 pair_type ("try",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
715 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
716 @deftypefn {} {} try\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
717 Begin a try-catch block.\n\
6138
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
718 \n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
719 If an error occurs within a try block, then the catch code will be run and\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
720 execution will proceed after the catch block (though it is often\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
721 recommended to use the lasterr function to re-throw the error after cleanup\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
722 is completed).\n\
12605
307e177dbaa8 doc: Add spaces after commas in @seealso blocks.
Rik <octave@nomad.inbox5.com>
parents: 12519
diff changeset
723 @seealso{catch, unwind_protect}\n\
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
724 @end deftypefn"),
1489
3e705c864019 [project @ 1995-09-28 05:38:26 by jwe]
jwe
parents: 1488
diff changeset
725
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
726 pair_type ("until",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
727 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
728 @deftypefn {} {} until (@var{cond})\n\
15908
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
729 End a do-until loop. See @code{do} for an example.\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
730 @seealso{do}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
731 @end deftypefn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
732
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
733 pair_type ("unwind_protect",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
734 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
735 @deftypefn {} {} unwind_protect\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
736 Begin an unwind_protect block.\n\
6138
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
737 \n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
738 If an error occurs within the first part of an unwind_protect block\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
739 the commands within the unwind_protect_cleanup block are executed before\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
740 the error is thrown. If an error is not thrown, then the\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
741 unwind_protect_cleanup block is still executed (in other words, the\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
742 unwind_protect_cleanup will be run with or without an error in the\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
743 unwind_protect block).\n\
12605
307e177dbaa8 doc: Add spaces after commas in @seealso blocks.
Rik <octave@nomad.inbox5.com>
parents: 12519
diff changeset
744 @seealso{unwind_protect_cleanup, try}\n\
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
745 @end deftypefn"),
928
2f91e7098f8c [project @ 1994-11-15 21:53:40 by jwe]
jwe
parents: 867
diff changeset
746
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
747 pair_type ("unwind_protect_cleanup",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
748 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
749 @deftypefn {} {} unwind_protect_cleanup\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
750 Begin the cleanup section of an unwind_protect block.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
751 @seealso{unwind_protect}\n\
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
752 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
753
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
754 pair_type ("varargin",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
755 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
756 @deftypefn {} {} varargin\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
757 Pass an arbitrary number of arguments into a function.\n\
13749
62d1f56b0be7 New nthargout function
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13246
diff changeset
758 @seealso{varargout, nargin, isargout, nargout, nthargout}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
759 @end deftypefn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
760
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
761 pair_type ("varargout",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
762 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
763 @deftypefn {} {} varargout\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
764 Pass an arbitrary number of arguments out of a function.\n\
13749
62d1f56b0be7 New nthargout function
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13246
diff changeset
765 @seealso{varargin, nargin, isargout, nargout, nthargout}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
766 @end deftypefn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
767
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
768 pair_type ("while",
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
769 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20803
diff changeset
770 @deftypefn {} {} while\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
771 Begin a while loop.\n\
15908
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
772 \n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
773 @example\n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
774 @group\n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
775 i = 0;\n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
776 while (i < 10)\n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
777 i++\n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
778 endwhile\n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
779 @end group\n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
780 @end example\n\
5a4a07a2ec73 doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents: 15489
diff changeset
781 @seealso{do, endwhile, for, until}\n\
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
782 @end deftypefn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
783 };
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
784
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
785 // Return a copy of the operator or keyword names.
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
786 static string_vector
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
787 names (const map_type& lst)
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
788 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
789 string_vector retval (lst.size ());
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
790 int j = 0;
20714
7b6d8c19dab0 Cuddle increment (++) and decrement (--) operators with variable in question.
Rik <rik@octave.org>
parents: 20700
diff changeset
791 for (map_iter iter = lst.begin (); iter != lst.end (); iter++)
15020
560317fd5977 maint: Cuddle open bracket used for indexing C++ arrays in source code.
Rik <rik@octave.org>
parents: 15005
diff changeset
792 retval[j++] = iter->first;
1755
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1742
diff changeset
793 return retval;
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
794 }
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
795
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
796 const static map_type operators_map (operators, operators + size (operators));
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
797 const static map_type keywords_map (keywords, keywords + size (keywords));
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
798 const static string_vector keyword_names = names (keywords_map);
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
799
22172
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
800 // Return a vector of all functions from this file,
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
801 // for use in command line auto-completion.
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
802 static string_vector
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
803 local_functions (void)
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
804 {
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
805 string_vector retval;
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
806
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
807 octave_user_code *curr_fcn = octave_call_stack::caller_user_code ();
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
808
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
809 if (! curr_fcn)
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
810 return retval;
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
811
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
812 // All subfunctions are listed in the top-level function of this file.
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
813 while (curr_fcn->is_subfunction ())
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
814 curr_fcn = symbol_table::get_curr_fcn (curr_fcn->parent_fcn_scope ());
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
815
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
816 // Get subfunctions.
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
817 const std::list<std::string> names = curr_fcn->subfunction_names ();
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
818
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
819 size_t sz = names.size ();
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
820 retval.resize (sz);
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
821
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
822 // Loop over them.
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
823 size_t i = 0;
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
824 for (std::list<std::string>::const_iterator p = names.begin ();
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
825 p != names.end (); p++)
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
826 retval(i++) = *p;
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
827
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
828 retval.resize (i);
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
829 return retval;
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
830 }
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
831
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
832 // FIXME: It's not likely that this does the right thing now.
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
833
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
834 string_vector
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
835 make_name_list (void)
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
836 {
20232
a9574e3c6e9e Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents: 20172
diff changeset
837 const int key_len = keyword_names.numel ();
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
838
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
839 const string_vector bif = symbol_table::built_in_function_names ();
20232
a9574e3c6e9e Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents: 20172
diff changeset
840 const int bif_len = bif.numel ();
4009
27e461aed956 [project @ 2002-07-31 09:33:03 by jwe]
jwe
parents: 3917
diff changeset
841
12911
d6151d774283 make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents: 12670
diff changeset
842 const string_vector cfl = symbol_table::cmdline_function_names ();
20232
a9574e3c6e9e Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents: 20172
diff changeset
843 const int cfl_len = cfl.numel ();
12911
d6151d774283 make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents: 12670
diff changeset
844
10500
8f27f368aba2 fix generating names for TAB completion
Jaroslav Hajek <highegg@gmail.com>
parents: 10315
diff changeset
845 const string_vector lcl = symbol_table::variable_names ();
20232
a9574e3c6e9e Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents: 20172
diff changeset
846 const int lcl_len = lcl.numel ();
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
847
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
848 const string_vector ffl = load_path::fcn_names ();
20232
a9574e3c6e9e Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents: 20172
diff changeset
849 const int ffl_len = ffl.numel ();
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
850
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
851 const string_vector afl = autoloaded_functions ();
20232
a9574e3c6e9e Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents: 20172
diff changeset
852 const int afl_len = afl.numel ();
5592
61d6cebd243b [project @ 2006-01-12 17:55:22 by dbateman]
dbateman
parents: 5576
diff changeset
853
22172
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
854 const string_vector lfl = local_functions ();
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
855 const int lfl_len = lfl.numel ();
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
856
12911
d6151d774283 make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents: 12670
diff changeset
857 const int total_len
22172
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
858 = key_len + bif_len + cfl_len + lcl_len + ffl_len + afl_len + lfl_len;
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
859
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
860 string_vector list (total_len);
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
861
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
862 // Put all the symbols in one big list.
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
863
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
864 int j = 0;
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
865 int i = 0;
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
866 for (i = 0; i < key_len; i++)
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
867 list[j++] = keyword_names[i];
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
868
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
869 for (i = 0; i < bif_len; i++)
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
870 list[j++] = bif[i];
4009
27e461aed956 [project @ 2002-07-31 09:33:03 by jwe]
jwe
parents: 3917
diff changeset
871
12911
d6151d774283 make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents: 12670
diff changeset
872 for (i = 0; i < cfl_len; i++)
d6151d774283 make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents: 12670
diff changeset
873 list[j++] = cfl[i];
d6151d774283 make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents: 12670
diff changeset
874
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
875 for (i = 0; i < lcl_len; i++)
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
876 list[j++] = lcl[i];
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
877
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
878 for (i = 0; i < ffl_len; i++)
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
879 list[j++] = ffl[i];
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
880
5592
61d6cebd243b [project @ 2006-01-12 17:55:22 by dbateman]
dbateman
parents: 5576
diff changeset
881 for (i = 0; i < afl_len; i++)
61d6cebd243b [project @ 2006-01-12 17:55:22 by dbateman]
dbateman
parents: 5576
diff changeset
882 list[j++] = afl[i];
61d6cebd243b [project @ 2006-01-12 17:55:22 by dbateman]
dbateman
parents: 5576
diff changeset
883
22172
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
884 for (i = 0; i < lfl_len; i++)
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
885 list[j++] = lfl[i];
ed8a0c39e14c Allow TAB autocompletion of local functions in debug mode (bug #48317)
Lachlan Andrew <lachlanbis@gmail.com>
parents: 22156
diff changeset
886
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
887 return list;
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
888 }
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
889
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
890 static bool
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
891 looks_like_html (const std::string& msg)
3014
38de16594cb4 [project @ 1997-06-02 20:28:09 by jwe]
jwe
parents: 3013
diff changeset
892 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
893 const size_t p1 = msg.find ('\n');
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
894 std::string t = msg.substr (0, p1);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
895 // FIXME: this comparison should be case-insensitive
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
896 const size_t p2 = t.find ("<html");
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
897
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
898 return (p2 != std::string::npos);
2470
1e673f0648b5 [project @ 1996-11-05 21:46:06 by jwe]
jwe
parents: 2442
diff changeset
899 }
3014
38de16594cb4 [project @ 1997-06-02 20:28:09 by jwe]
jwe
parents: 3013
diff changeset
900
38de16594cb4 [project @ 1997-06-02 20:28:09 by jwe]
jwe
parents: 3013
diff changeset
901 static bool
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
902 looks_like_texinfo (const std::string& msg, size_t& p1)
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
903 {
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
904 p1 = msg.find ('\n');
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
905
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
906 std::string t = msg.substr (0, p1);
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
907
8021
85184151822e fix typo in NPOS change
John W. Eaton <jwe@octave.org>
parents: 8019
diff changeset
908 if (p1 == std::string::npos)
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
909 p1 = 0;
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
910
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
911 size_t p2 = t.find ("-*- texinfo -*-");
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
912
8021
85184151822e fix typo in NPOS change
John W. Eaton <jwe@octave.org>
parents: 8019
diff changeset
913 return (p2 != std::string::npos);
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
914 }
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
915
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
916 static bool
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
917 raw_help_from_symbol_table (const std::string& nm, std::string& h,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10182
diff changeset
918 std::string& w, bool& symbol_found)
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
919 {
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
920 bool retval = false;
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
921
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
922 octave_value val = symbol_table::find_function (nm);
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
923
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
924 if (val.is_defined ())
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
925 {
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
926 octave_function *fcn = val.function_value ();
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
927
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
928 if (fcn)
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10182
diff changeset
929 {
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10182
diff changeset
930 symbol_found = true;
5399
db34dff19947 [project @ 2005-06-17 21:16:20 by jwe]
jwe
parents: 5393
diff changeset
931
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10182
diff changeset
932 h = fcn->doc_string ();
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
933
8631
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
934 retval = true;
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
935
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10182
diff changeset
936 w = fcn->fcn_file_name ();
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
937
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10182
diff changeset
938 if (w.empty ())
8631
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
939 w = fcn->is_user_function ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
940 ? "command-line function" : "built-in function";
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10182
diff changeset
941 }
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
942 }
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
943
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
944 return retval;
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
945 }
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
946
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
947 static bool
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
948 raw_help_from_file (const std::string& nm, std::string& h,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10182
diff changeset
949 std::string& file, bool& symbol_found)
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
950 {
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
951 bool retval = false;
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
952
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
953 h = get_help_from_file (nm, symbol_found, file);
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
954
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
955 if (h.length () > 0)
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
956 retval = true;
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
957
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
958 return retval;
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
959 }
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
960
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
961 static bool
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
962 raw_help_from_map (const std::string& nm, std::string& h,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10182
diff changeset
963 const map_type& map, bool& symbol_found)
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
964 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
965 map_iter idx = map.find (nm);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
966 symbol_found = (idx != map.end ());
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
967 h = (symbol_found) ? idx->second : "";
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
968 return symbol_found;
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
969 }
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
970
22198
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
971 static bool
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
972 raw_help_from_docstrings_file (const std::string& nm, std::string& h,
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
973 bool& symbol_found)
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
974 {
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
975 typedef std::pair<std::streampos, std::streamoff> txt_limits_type;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
976 typedef std::map<std::string, txt_limits_type> help_txt_map_type;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
977
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
978 static help_txt_map_type help_txt_map;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
979 static bool initialized = false;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
980
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
981 h = "";
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
982 symbol_found = false;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
983
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
984 // FIXME: Should we cache the timestamp of the file and reload the
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
985 // offsets if it changes? Or just warn about that? Or just ignore
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
986 // it, and assume it won't change?
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
987
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
988 if (! initialized)
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
989 {
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
990 std::string fname = Vbuilt_in_docstrings_file;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
991
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
992 std::ifstream file (fname.c_str (), std::ios::in | std::ios::binary);
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
993
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
994 if (! file)
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
995 error ("failed to open docstrings file: %s", fname.c_str ());
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
996
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
997 // Ignore header;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
998 file.ignore (std::numeric_limits<std::streamsize>::max(), 0x1d);
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
999
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1000 if (file.eof ())
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1001 error ("invalid built-in-docstrings file!");
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1002
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1003 // FIXME: eliminate fixed buffer size.
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1004 size_t bufsize = 1000;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1005 OCTAVE_LOCAL_BUFFER (char, buf, bufsize);
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1006
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1007 while (! file.eof ())
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1008 {
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1009 std::string name;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1010 int i = 0;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1011 int c;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1012 while (file && (c = file.get ()) != std::istream::traits_type::eof ())
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1013 {
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1014 if (c == '\n' || c == '\r')
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1015 {
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1016 buf[i] = '\0';
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1017 name = buf;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1018 break;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1019 }
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1020 else
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1021 buf[i++] = c;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1022 }
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1023
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1024 // Skip @c FILENAME which is part of current DOCSTRINGS
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1025 // syntax. This may disappear if a specific format for
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1026 // docstring files is developed.
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1027 while (file
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1028 && (c = file.get ()) != std::istream::traits_type::eof ()
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1029 && c != '\n' && c != '\r')
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1030 ; // skip text
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1031
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1032 // skip newline characters
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1033 while (file
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1034 && (c = file.get ()) != std::istream::traits_type::eof ()
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1035 && c == '\n' && c == '\r')
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1036 ; // skip text
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1037
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1038 file.unget ();
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1039
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1040 // Position of beginning of help text.
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1041 std::streampos beg = file.tellg ();
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1042
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1043 // Skip help text.
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1044 file.ignore (std::numeric_limits<std::streamsize>::max(), 0x1d);
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1045
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1046 // Position of end of help text.
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1047 std::streamoff len = file.tellg () - beg - 1;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1048
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1049 help_txt_map[name] = txt_limits_type (beg, len);
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1050 }
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1051
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1052 initialized = true;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1053 }
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1054
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1055 help_txt_map_type::const_iterator it = help_txt_map.find (nm);
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1056
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1057 if (it != help_txt_map.end ())
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1058 {
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1059 txt_limits_type txt_limits = it->second;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1060
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1061 std::streampos beg = txt_limits.first;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1062 std::streamoff len = txt_limits.second;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1063
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1064 std::string fname = Vbuilt_in_docstrings_file;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1065
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1066 std::ifstream file (fname.c_str (), std::ios::in | std::ios::binary);
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1067
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1068 if (! file)
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1069 error ("failed to open docstrings file: %s", fname.c_str ());
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1070
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1071 file.seekg (beg);
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1072
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1073 size_t txt_len = len;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1074 OCTAVE_LOCAL_BUFFER (char, buf, txt_len + 1);
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1075
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1076 file.read (buf, txt_len);
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1077
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1078 buf[txt_len] = '\0';
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1079
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1080 h = buf;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1081
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1082 symbol_found = true;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1083 }
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1084
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1085 return symbol_found;
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1086 }
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1087
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
1088 std::string
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1089 raw_help (const std::string& nm, bool& symbol_found)
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
1090 {
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
1091 std::string h;
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
1092 std::string w;
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
1093 std::string f;
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
1094
20138
4ff975c58584 Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents: 19872
diff changeset
1095 bool found;
4ff975c58584 Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents: 19872
diff changeset
1096
4ff975c58584 Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents: 19872
diff changeset
1097 found = raw_help_from_symbol_table (nm, h, w, symbol_found);
20678
4b00afb5e9c3 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20581
diff changeset
1098
4b00afb5e9c3 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20581
diff changeset
1099 if (! found)
20138
4ff975c58584 Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents: 19872
diff changeset
1100 {
4ff975c58584 Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents: 19872
diff changeset
1101 found = raw_help_from_file (nm, h, f, symbol_found);
20678
4b00afb5e9c3 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20581
diff changeset
1102
4b00afb5e9c3 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20581
diff changeset
1103 if (! found)
20138
4ff975c58584 Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents: 19872
diff changeset
1104 {
4ff975c58584 Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents: 19872
diff changeset
1105 found = raw_help_from_map (nm, h, operators_map, symbol_found);
20678
4b00afb5e9c3 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20581
diff changeset
1106
4b00afb5e9c3 eliminate more uses of error_state
John W. Eaton <jwe@octave.org>
parents: 20581
diff changeset
1107 if (! found)
22198
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1108 found = raw_help_from_map (nm, h, keywords_map, symbol_found);
20138
4ff975c58584 Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents: 19872
diff changeset
1109 }
4ff975c58584 Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents: 19872
diff changeset
1110 }
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
1111
22198
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1112 if (! found || h == "external-doc")
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1113 raw_help_from_docstrings_file (nm, h, symbol_found);
f6181638f6c5 search docstrings file for built-in and dld function help text (bug #48554)
John W. Eaton <jwe@octave.org>
parents: 22172
diff changeset
1114
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
1115 return h;
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
1116 }
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
1117
15470
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
1118 DEFUN (built_in_docstrings_file, args, nargout,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1119 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1120 @deftypefn {} {@var{val} =} built_in_docstrings_file ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1121 @deftypefnx {} {@var{old_val} =} built_in_docstrings_file (@var{new_val})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1122 @deftypefnx {} {} built_in_docstrings_file (@var{new_val}, "local")
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1123 Query or set the internal variable that specifies the name of the
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1124 file containing docstrings for built-in Octave functions.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1125
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1126 The default value is
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1127 @file{@var{octave-home}/share/octave/@var{version}/etc/built-in-docstrings},
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1128 in which @var{octave-home} is the root directory of the Octave installation,
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1129 and @var{version} is the Octave version number. The default value may be
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1130 overridden by the environment variable
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1131 @w{@env{OCTAVE_BUILT_IN_DOCSTRINGS_FILE}}, or the command line argument
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1132 @option{--built-in-docstrings-file FNAME}.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1133
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1134 Note: This variable is only used when Octave is initializing itself.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1135 Modifying it during a running session of Octave will have no effect.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1136 @end deftypefn */)
15470
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
1137 {
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
1138 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (built_in_docstrings_file);
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
1139 }
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
1140
1140
26d986865487 [project @ 1995-02-26 03:23:43 by jwe]
jwe
parents: 1118
diff changeset
1141 static void
9806
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1142 do_get_help_text (const std::string& name, std::string& text,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10182
diff changeset
1143 std::string& format)
1140
26d986865487 [project @ 1995-02-26 03:23:43 by jwe]
jwe
parents: 1118
diff changeset
1144 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1145 bool symbol_found = false;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1146 text = raw_help (name, symbol_found);
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
1147
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1148 format = "Not found";
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1149 if (symbol_found)
1140
26d986865487 [project @ 1995-02-26 03:23:43 by jwe]
jwe
parents: 1118
diff changeset
1150 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1151 size_t idx = -1;
8631
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
1152 if (text.empty ())
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
1153 {
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
1154 format = "Not documented";
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
1155 }
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
1156 else if (looks_like_texinfo (text, idx))
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1157 {
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1158 format = "texinfo";
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1159 text.erase (0, idx);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1160 }
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1161 else if (looks_like_html (text))
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1162 {
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1163 format = "html";
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1164 }
5399
db34dff19947 [project @ 2005-06-17 21:16:20 by jwe]
jwe
parents: 5393
diff changeset
1165 else
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1166 {
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1167 format = "plain text";
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1168 }
1140
26d986865487 [project @ 1995-02-26 03:23:43 by jwe]
jwe
parents: 1118
diff changeset
1169 }
26d986865487 [project @ 1995-02-26 03:23:43 by jwe]
jwe
parents: 1118
diff changeset
1170 }
26d986865487 [project @ 1995-02-26 03:23:43 by jwe]
jwe
parents: 1118
diff changeset
1171
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1172 DEFUN (get_help_text, args, ,
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1173 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1174 @deftypefn {} {[@var{text}, @var{format}] =} get_help_text (@var{name})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1175 Return the raw help text of function @var{name}.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1176
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1177 The raw help text is returned in @var{text} and the format in @var{format}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1178 The format is a string which is one of @qcode{"texinfo"},
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1179 @qcode{"html"}, or @qcode{"plain text"}.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1180 @seealso{get_help_text_from_file}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1181 @end deftypefn */)
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
1182 {
20803
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1183 if (args.length () != 1)
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1184 print_usage ();
1755
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1742
diff changeset
1185
20803
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1186 const std::string name = args(0).xstring_value ("get_help_text: NAME must be a string");
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
1187
20939
b17fda023ca6 maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents: 20922
diff changeset
1188 std::string text, format;
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
1189
20803
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1190 do_get_help_text (name, text, format);
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1191
20939
b17fda023ca6 maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents: 20922
diff changeset
1192 return ovl (text, format);
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
1193 }
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
1194
9806
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1195 static void
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1196 do_get_help_text_from_file (const std::string& fname, std::string& text,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10182
diff changeset
1197 std::string& format)
9806
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1198 {
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1199 bool symbol_found = false;
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1200
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1201 std::string f;
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1202
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1203 raw_help_from_file (fname, text, f, symbol_found);
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1204
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1205 format = "Not found";
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1206 if (symbol_found)
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1207 {
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1208 size_t idx = -1;
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1209 if (text.empty ())
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1210 {
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1211 format = "Not documented";
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1212 }
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1213 else if (looks_like_texinfo (text, idx))
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1214 {
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1215 format = "texinfo";
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1216 text.erase (0, idx);
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1217 }
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1218 else if (looks_like_html (text))
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1219 {
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1220 format = "html";
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1221 }
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1222 else
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1223 {
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1224 format = "plain text";
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1225 }
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1226 }
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1227 }
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1228
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1229 DEFUN (get_help_text_from_file, args, ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1230 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1231 @deftypefn {} {[@var{text}, @var{format}] =} get_help_text_from_file (@var{fname})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1232 Return the raw help text from the file @var{fname}.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1233
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1234 The raw help text is returned in @var{text} and the format in @var{format}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1235 The format is a string which is one of @qcode{"texinfo"},
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1236 @qcode{"html"}, or @qcode{"plain text"}.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1237 @seealso{get_help_text}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1238 @end deftypefn */)
9806
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1239 {
20803
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1240 if (args.length () != 1)
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1241 print_usage ();
9806
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1242
20803
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1243 const std::string fname = args(0).xstring_value ("get_help_text_from_file: NAME must be a string");
9806
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1244
20939
b17fda023ca6 maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents: 20922
diff changeset
1245 std::string text, format;
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
1246
20803
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1247 do_get_help_text_from_file (fname, text, format);
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1248
20939
b17fda023ca6 maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents: 20922
diff changeset
1249 return ovl (text, format);
9806
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1250 }
8e345f2fe4d6 improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents: 9416
diff changeset
1251
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1252 // Return a cell array of strings containing the names of all
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1253 // operators.
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1254
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1255 DEFUN (__operators__, , ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1256 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1257 @deftypefn {} {} __operators__ ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1258 Undocumented internal function.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1259 @end deftypefn */)
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
1260 {
21127
df7891224709 maint: Use "return ovl (...)" in DEFUN macros.
Rik <rik@octave.org>
parents: 21100
diff changeset
1261 return ovl (Cell (names (operators_map)));
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
1262 }
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
1263
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1264 // Return a cell array of strings containing the names of all
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1265 // keywords.
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1266
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1267 DEFUN (__keywords__, , ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1268 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1269 @deftypefn {} {} __keywords__ ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1270 Undocumented internal function.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1271 @end deftypefn */)
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
1272 {
21127
df7891224709 maint: Use "return ovl (...)" in DEFUN macros.
Rik <rik@octave.org>
parents: 21100
diff changeset
1273 return ovl (Cell (names (keywords_map)));
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
1274 }
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
1275
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1276 // Return a cell array of strings containing the names of all builtin
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1277 // functions.
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1278
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1279 DEFUN (__builtins__, , ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1280 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1281 @deftypefn {} {} __builtins__ ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1282 Undocumented internal function.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1283 @end deftypefn */)
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
1284 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1285 const string_vector bif = symbol_table::built_in_function_names ();
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
1286
21127
df7891224709 maint: Use "return ovl (...)" in DEFUN macros.
Rik <rik@octave.org>
parents: 21100
diff changeset
1287 return ovl (Cell (bif));
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
1288 }
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
1289
21765
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1290 DEFUN (localfunctions, args, ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1291 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1292 @deftypefn {} {} localfunctions ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1293 Return a list of all local functions, i.e., subfunctions, within the current
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1294 file.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1295
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1296 The return value is a column cell array of function handles to all local
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1297 functions accessible from the function from which @code{localfunctions} is
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1298 called. Nested functions are @emph{not} included in the list.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1299
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1300 If the call is from the command line, an anonymous function, or a script,
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1301 the return value is an empty cell array.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1302
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1303 Compatibility Note: Subfunctions which contain nested functions are not
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1304 included in the list. This is a known issue.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1305 @end deftypefn */)
21765
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1306 {
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1307 if (args.length () != 0)
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1308 print_usage ();
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1309
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1310 Cell retval;
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1311
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1312 // Find the main function we are in.
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1313 octave_user_code *parent_fcn = octave_call_stack::debug_user_code ();
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1314
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1315 if (! parent_fcn)
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1316 return ovl (retval);
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1317
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1318 // Find the subfunctions of this function.
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1319 // FIXME: This includes all nested functions.
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1320 // Once handles of nested functions are implemented,
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1321 // we will need to exclude ones not in scope.
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1322 const std::list<std::string> names = parent_fcn->subfunction_names ();
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1323 const std::map<std::string, octave_value> h = parent_fcn->subfunctions ();
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1324
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1325 size_t sz = names.size ();
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1326 retval.resize (dim_vector (sz, 1));
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1327
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1328 // loop over them.
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1329 size_t i = 0;
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1330 for (std::list<std::string>::const_iterator p = names.begin ();
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1331 p != names.end (); p++)
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1332 {
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1333 std::map<std::string, octave_value>::const_iterator q = h.find (*p);
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1334 if (q != h.end () &&
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1335 ! q->second.user_function_value ()->is_nested_function ())
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1336 retval(i++) = octave_value (new octave_fcn_handle (q->second, *p));
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1337 }
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1338
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1339 // remove pre-allocation for nested functions
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1340 retval.resize (dim_vector (i, 1));
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1341
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1342 return ovl (retval);
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1343 }
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1344
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1345 /*
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1346 %!test
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1347 %! f = tempname (".", "oct_");
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1348 %! fcn_name = f(3:end);
22016
d4ce10f57918 Clean up localfunctions BIST test
Mike Miller <mtmiller@octave.org>
parents: 21966
diff changeset
1349 %! f = [f ".m"];
d4ce10f57918 Clean up localfunctions BIST test
Mike Miller <mtmiller@octave.org>
parents: 21966
diff changeset
1350 %! unwind_protect
d4ce10f57918 Clean up localfunctions BIST test
Mike Miller <mtmiller@octave.org>
parents: 21966
diff changeset
1351 %! fid = fopen (f, "w+");
d4ce10f57918 Clean up localfunctions BIST test
Mike Miller <mtmiller@octave.org>
parents: 21966
diff changeset
1352 %! fprintf (fid, "function z = %s\n z = localfunctions; end\n", fcn_name);
d4ce10f57918 Clean up localfunctions BIST test
Mike Miller <mtmiller@octave.org>
parents: 21966
diff changeset
1353 %! fprintf (fid, "function z = b(x)\n z = x+1; end\n");
d4ce10f57918 Clean up localfunctions BIST test
Mike Miller <mtmiller@octave.org>
parents: 21966
diff changeset
1354 %! fprintf (fid, "function z = c(x)\n z = 2*x; end\n");
d4ce10f57918 Clean up localfunctions BIST test
Mike Miller <mtmiller@octave.org>
parents: 21966
diff changeset
1355 %! fclose (fid);
d4ce10f57918 Clean up localfunctions BIST test
Mike Miller <mtmiller@octave.org>
parents: 21966
diff changeset
1356 %! d = eval (fcn_name);
d4ce10f57918 Clean up localfunctions BIST test
Mike Miller <mtmiller@octave.org>
parents: 21966
diff changeset
1357 %! assert (size (d), [2, 1]);
d4ce10f57918 Clean up localfunctions BIST test
Mike Miller <mtmiller@octave.org>
parents: 21966
diff changeset
1358 %! assert (d{1}(3), 4);
d4ce10f57918 Clean up localfunctions BIST test
Mike Miller <mtmiller@octave.org>
parents: 21966
diff changeset
1359 %! assert (d{2}(3), 6);
d4ce10f57918 Clean up localfunctions BIST test
Mike Miller <mtmiller@octave.org>
parents: 21966
diff changeset
1360 %! unwind_protect_cleanup
d4ce10f57918 Clean up localfunctions BIST test
Mike Miller <mtmiller@octave.org>
parents: 21966
diff changeset
1361 %! unlink (f);
d4ce10f57918 Clean up localfunctions BIST test
Mike Miller <mtmiller@octave.org>
parents: 21966
diff changeset
1362 %! end_unwind_protect
21765
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1363 */
23a610a3f001 Implement localfunctions Matlab command (bug #47705).
Lachlan Andrew <lachlanbis@gmail.com>
parents: 21733
diff changeset
1364
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1365 static std::string
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1366 do_which (const std::string& name, std::string& type)
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
1367 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1368 std::string file;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1369
21017
93748bcaec17 maint: Replace emtpy 'std::string ()' calls with "".
Rik <rik@octave.org>
parents: 20996
diff changeset
1370 type = "";
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
1371
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
1372 octave_value val = symbol_table::find_function (name);
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
1373
9416
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1374 if (name.find_first_of ('.') == std::string::npos)
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
1375 {
9416
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1376 if (val.is_defined ())
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1377 {
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1378 octave_function *fcn = val.function_value ();
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
1379
9416
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1380 if (fcn)
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1381 {
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1382 file = fcn->fcn_file_name ();
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
1383
9416
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1384 if (file.empty ())
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1385 {
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1386 if (fcn->is_user_function ())
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1387 type = "command-line function";
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1388 else
15005
74c7265c057a fix failure with function handles caused by changeset ea6997657614
John W. Eaton <jwe@octave.org>
parents: 14766
diff changeset
1389 {
74c7265c057a fix failure with function handles caused by changeset ea6997657614
John W. Eaton <jwe@octave.org>
parents: 14766
diff changeset
1390 file = fcn->src_file_name ();
74c7265c057a fix failure with function handles caused by changeset ea6997657614
John W. Eaton <jwe@octave.org>
parents: 14766
diff changeset
1391 type = "built-in function";
74c7265c057a fix failure with function handles caused by changeset ea6997657614
John W. Eaton <jwe@octave.org>
parents: 14766
diff changeset
1392 }
9416
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1393 }
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1394 else
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1395 type = val.is_user_script ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1396 ? std::string ("script") : std::string ("function");
9416
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1397 }
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1398 }
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1399 else
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1400 {
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1401 // We might find a file that contains only a doc string.
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1402
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1403 file = load_path::find_fcn_file (name);
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1404 }
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
1405 }
8672
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
1406 else
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
1407 {
9416
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1408 // File query.
8672
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
1409
9416
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1410 // For compatibility: "file." queries "file".
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1411 if (name.size () > 1 && name[name.size () - 1] == '.')
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1412 file = load_path::find_file (name.substr (0, name.size () - 1));
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1413 else
2cc47338e427 allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
1414 file = load_path::find_file (name);
17829
c2d9d42f4fe1 which: return the full path to a regular file (bug #40332)
Mike Miller <mtmiller@ieee.org>
parents: 17787
diff changeset
1415
21732
6a1eded90355 use namespace for system env class
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
1416 file = octave::sys::env::make_absolute (file);
8672
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
1417 }
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1418
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1419 return file;
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
1420 }
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
1421
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1422 std::string
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1423 do_which (const std::string& name)
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1424 {
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1425 std::string retval;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1426
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1427 std::string type;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1428
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1429 retval = do_which (name, type);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1430
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1431 return retval;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1432 }
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1433
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1434 DEFUN (__which__, args, ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1435 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1436 @deftypefn {} {} __which__ (@var{name}, @dots{})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1437 Undocumented internal function.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1438 @end deftypefn */)
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
1439 {
20996
20bd3d4fabad Clean up instances of make_argv().
Rik <rik@octave.org>
parents: 20940
diff changeset
1440 string_vector argv = args.make_argv ();
1755
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1742
diff changeset
1441
20922
49081851fddc Eliminate duplicate input arg checking in which.m and __which__.
Rik <rik@octave.org>
parents: 20884
diff changeset
1442 int nargin = argv.numel ();
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
1443
20922
49081851fddc Eliminate duplicate input arg checking in which.m and __which__.
Rik <rik@octave.org>
parents: 20884
diff changeset
1444 octave_map m (dim_vector (1, nargin));
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
1445
20922
49081851fddc Eliminate duplicate input arg checking in which.m and __which__.
Rik <rik@octave.org>
parents: 20884
diff changeset
1446 Cell names (1, nargin);
49081851fddc Eliminate duplicate input arg checking in which.m and __which__.
Rik <rik@octave.org>
parents: 20884
diff changeset
1447 Cell files (1, nargin);
49081851fddc Eliminate duplicate input arg checking in which.m and __which__.
Rik <rik@octave.org>
parents: 20884
diff changeset
1448 Cell types (1, nargin);
20803
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1449
20922
49081851fddc Eliminate duplicate input arg checking in which.m and __which__.
Rik <rik@octave.org>
parents: 20884
diff changeset
1450 for (int i = 0; i < nargin; i++)
20803
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1451 {
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1452 std::string name = argv[i];
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1453
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1454 std::string type;
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1455
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1456 std::string file = do_which (name, type);
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1457
20922
49081851fddc Eliminate duplicate input arg checking in which.m and __which__.
Rik <rik@octave.org>
parents: 20884
diff changeset
1458 names(i) = name;
49081851fddc Eliminate duplicate input arg checking in which.m and __which__.
Rik <rik@octave.org>
parents: 20884
diff changeset
1459 files(i) = file;
49081851fddc Eliminate duplicate input arg checking in which.m and __which__.
Rik <rik@octave.org>
parents: 20884
diff changeset
1460 types(i) = type;
20803
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1461 }
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1462
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1463 m.assign ("name", names);
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1464 m.assign ("file", files);
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1465 m.assign ("type", types);
c22206c1a88f eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20714
diff changeset
1466
20922
49081851fddc Eliminate duplicate input arg checking in which.m and __which__.
Rik <rik@octave.org>
parents: 20884
diff changeset
1467 return ovl (m);
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
1468 }
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
1469
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1470 // FIXME: Are we sure this function always does the right thing?
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1471 inline bool
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1472 file_is_in_dir (const std::string filename, const std::string dir)
5447
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
1473 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1474 if (filename.find (dir) == 0)
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1475 {
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1476 const int dir_len = dir.size ();
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1477 const int filename_len = filename.size ();
21733
cb0fdd941d84 use namespace for system file_ops class
John W. Eaton <jwe@octave.org>
parents: 21732
diff changeset
1478 const int max_allowed_seps = octave::sys::file_ops::is_dir_sep (dir[dir_len-1]) ? 0
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
1479 : 1;
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
1480
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1481 int num_seps = 0;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1482 for (int i = dir_len; i < filename_len; i++)
21733
cb0fdd941d84 use namespace for system file_ops class
John W. Eaton <jwe@octave.org>
parents: 21732
diff changeset
1483 if (octave::sys::file_ops::is_dir_sep (filename[i]))
20714
7b6d8c19dab0 Cuddle increment (++) and decrement (--) operators with variable in question.
Rik <rik@octave.org>
parents: 20700
diff changeset
1484 num_seps++;
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
1485
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1486 return (num_seps <= max_allowed_seps);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1487 }
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1488 else
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1489 return false;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1490 }
5447
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
1491
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1492 // Return a cell array of strings containing the names of all
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1493 // functions available in DIRECTORY. If no directory is given, search
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1494 // the current path.
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1495
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
1496 DEFUN (__list_functions__, args, ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1497 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1498 @deftypefn {} {@var{retval} =} __list_functions__ ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1499 @deftypefnx {} {@var{retval} =} __list_functions__ (@var{directory})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1500 Undocumented internal function.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1501 @end deftypefn */)
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1502 {
8863
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
1503 octave_value retval;
5447
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
1504
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1505 // Get list of functions
8863
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
1506 string_vector ffl = load_path::fcn_names ();
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
1507 string_vector afl = autoloaded_functions ();
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
1508
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
1509 if (args.length () == 0)
8863
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
1510 retval = Cell (ffl.append (afl));
20581
fd0efcdb3718 use new string_value method to handle value extraction errors
John W. Eaton <jwe@octave.org>
parents: 20232
diff changeset
1511 else
5447
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
1512 {
20700
68e3a747ca02 rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents: 20678
diff changeset
1513 std::string dir = args(0).xstring_value ("__list_functions__: DIRECTORY argument must be a string");
8863
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
1514
19403
03067dab10ca Use stricter input validation when looking for a string as input (bug #42651).
Rik <rik@octave.org>
parents: 19269
diff changeset
1515 string_vector fl = load_path::files (dir, true);
03067dab10ca Use stricter input validation when looking for a string as input (bug #42651).
Rik <rik@octave.org>
parents: 19269
diff changeset
1516
20581
fd0efcdb3718 use new string_value method to handle value extraction errors
John W. Eaton <jwe@octave.org>
parents: 20232
diff changeset
1517 // Return a sorted list with unique entries (in case of
fd0efcdb3718 use new string_value method to handle value extraction errors
John W. Eaton <jwe@octave.org>
parents: 20232
diff changeset
1518 // .m and .oct versions of the same function in a given
fd0efcdb3718 use new string_value method to handle value extraction errors
John W. Eaton <jwe@octave.org>
parents: 20232
diff changeset
1519 // directory, for example).
fd0efcdb3718 use new string_value method to handle value extraction errors
John W. Eaton <jwe@octave.org>
parents: 20232
diff changeset
1520 fl.sort (true);
8863
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
1521
20581
fd0efcdb3718 use new string_value method to handle value extraction errors
John W. Eaton <jwe@octave.org>
parents: 20232
diff changeset
1522 retval = Cell (fl);
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11572
diff changeset
1523 }
5447
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
1524
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
1525 return retval;
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
1526 }
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
1527
8861
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
1528 DEFUN (doc_cache_file, args, nargout,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1529 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1530 @deftypefn {} {@var{val} =} doc_cache_file ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1531 @deftypefnx {} {@var{old_val} =} doc_cache_file (@var{new_val})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1532 @deftypefnx {} {} doc_cache_file (@var{new_val}, "local")
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1533 Query or set the internal variable that specifies the name of the
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1534 Octave documentation cache file.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1535
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1536 A cache file significantly improves the performance of the @code{lookfor}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1537 command. The default value is
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1538 @file{@var{octave-home}/share/octave/@var{version}/etc/doc-cache},
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1539 in which @var{octave-home} is the root directory of the Octave installation,
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1540 and @var{version} is the Octave version number.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1541 The default value may be overridden by the environment variable
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1542 @w{@env{OCTAVE_DOC_CACHE_FILE}}, or the command line argument
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1543 @option{--doc-cache-file FNAME}.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1544
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1545 When called from inside a function with the @qcode{"local"} option, the
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1546 variable is changed locally for the function and any subroutines it calls.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1547 The original variable value is restored when exiting the function.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1548 @seealso{doc_cache_create, lookfor, info_program, doc, help, makeinfo_program}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1549 @seealso{lookfor}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1550 @end deftypefn */)
8861
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
1551 {
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
1552 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (doc_cache_file);
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
1553 }
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
1554
14614
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14360
diff changeset
1555 DEFUN (texi_macros_file, args, nargout,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1556 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1557 @deftypefn {} {@var{val} =} texi_macros_file ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1558 @deftypefnx {} {@var{old_val} =} texi_macros_file (@var{new_val})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1559 @deftypefnx {} {} texi_macros_file (@var{new_val}, "local")
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1560 Query or set the internal variable that specifies the name of the
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1561 file containing Texinfo macros that are prepended to documentation strings
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1562 before they are passed to makeinfo.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1563
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1564 The default value is
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1565 @file{@var{octave-home}/share/octave/@var{version}/etc/macros.texi},
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1566 in which @var{octave-home} is the root directory of the Octave installation,
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1567 and @var{version} is the Octave version number.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1568 The default value may be overridden by the environment variable
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1569 @w{@env{OCTAVE_TEXI_MACROS_FILE}}, or the command line argument
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1570 @option{--texi-macros-file FNAME}.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1571
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1572 When called from inside a function with the @qcode{"local"} option, the
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1573 variable is changed locally for the function and any subroutines it calls.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1574 The original variable value is restored when exiting the function.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1575 @seealso{makeinfo_program}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1576 @end deftypefn */)
14614
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14360
diff changeset
1577 {
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14360
diff changeset
1578 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (texi_macros_file);
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14360
diff changeset
1579 }
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14360
diff changeset
1580
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1581 DEFUN (info_file, args, nargout,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1582 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1583 @deftypefn {} {@var{val} =} info_file ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1584 @deftypefnx {} {@var{old_val} =} info_file (@var{new_val})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1585 @deftypefnx {} {} info_file (@var{new_val}, "local")
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1586 Query or set the internal variable that specifies the name of the
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1587 Octave info file.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1588
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1589 The default value is
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1590 @file{@var{octave-home}/info/octave.info}, in
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1591 which @var{octave-home} is the root directory of the Octave installation.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1592 The default value may be overridden by the environment variable
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1593 @w{@env{OCTAVE_INFO_FILE}}, or the command line argument
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1594 @option{--info-file FNAME}.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1595
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1596 When called from inside a function with the @qcode{"local"} option, the
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1597 variable is changed locally for the function and any subroutines it calls.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1598 The original variable value is restored when exiting the function.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1599 @seealso{info_program, doc, help, makeinfo_program}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1600 @end deftypefn */)
2202
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
1601 {
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1602 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (info_file);
2202
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
1603 }
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
1604
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1605 DEFUN (info_program, args, nargout,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1606 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1607 @deftypefn {} {@var{val} =} info_program ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1608 @deftypefnx {} {@var{old_val} =} info_program (@var{new_val})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1609 @deftypefnx {} {} info_program (@var{new_val}, "local")
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1610 Query or set the internal variable that specifies the name of the
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1611 info program to run.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1612
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1613 The default value is
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1614 @file{@var{octave-home}/libexec/octave/@var{version}/exec/@var{arch}/info}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1615 in which @var{octave-home} is the root directory of the Octave installation,
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1616 @var{version} is the Octave version number, and @var{arch} is the system
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1617 type (for example, @code{i686-pc-linux-gnu}). The default value may be
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1618 overridden by the environment variable
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1619 @w{@env{OCTAVE_INFO_PROGRAM}}, or the command line argument
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1620 @option{--info-program NAME}.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1621
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1622 When called from inside a function with the @qcode{"local"} option, the
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1623 variable is changed locally for the function and any subroutines it calls.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1624 The original variable value is restored when exiting the function.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1625 @seealso{info_file, doc, help, makeinfo_program}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1626 @end deftypefn */)
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1627 {
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1628 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (info_program);
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1629 }
3686
9507d6de9bbd [project @ 2000-06-29 16:30:44 by jwe]
jwe
parents: 3584
diff changeset
1630
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1631 DEFUN (makeinfo_program, args, nargout,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1632 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1633 @deftypefn {} {@var{val} =} makeinfo_program ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1634 @deftypefnx {} {@var{old_val} =} makeinfo_program (@var{new_val})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1635 @deftypefnx {} {} makeinfo_program (@var{new_val}, "local")
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1636 Query or set the internal variable that specifies the name of the
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1637 program that Octave runs to format help text containing
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1638 Texinfo markup commands.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1639
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1640 The default value is @code{makeinfo}.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1641
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1642 When called from inside a function with the @qcode{"local"} option, the
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1643 variable is changed locally for the function and any subroutines it calls.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1644 The original variable value is restored when exiting the function.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1645 @seealso{texi_macros_file, info_file, info_program, doc, help}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1646 @end deftypefn */)
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1647 {
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1648 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (makeinfo_program);
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1649 }
2202
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
1650
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1651 DEFUN (suppress_verbose_help_message, args, nargout,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1652 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1653 @deftypefn {} {@var{val} =} suppress_verbose_help_message ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1654 @deftypefnx {} {@var{old_val} =} suppress_verbose_help_message (@var{new_val})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1655 @deftypefnx {} {} suppress_verbose_help_message (@var{new_val}, "local")
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1656 Query or set the internal variable that controls whether Octave
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1657 will add additional help information to the end of the output from
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1658 the @code{help} command and usage messages for built-in commands.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1659
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1660 When called from inside a function with the @qcode{"local"} option, the
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1661 variable is changed locally for the function and any subroutines it calls.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1662 The original variable value is restored when exiting the function.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21921
diff changeset
1663 @end deftypefn */)
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1664 {
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1665 return SET_INTERNAL_VARIABLE (suppress_verbose_help_message);
2189
d01936305d99 [project @ 1996-05-14 03:31:57 by jwe]
jwe
parents: 2177
diff changeset
1666 }