36 #include <sys/types.h>
97 typedef std::map<std::string, std::string>
map_type;
101 template<
typename T,
size_t z>
112 @deftypefn {Operator} {} !\n\
113 Logical 'not' operator.\n\
119 @deftypefn {Operator} {} ~\n\
120 Logical 'not' operator.\n\
126 @deftypefn {Operator} {} !=\n\
127 Logical 'not equals' operator.\n\
133 @deftypefn {Operator} {} ~=\n\
134 Logical 'not equals' operator.\n\
140 @deftypefn {Operator} {} \"\n\
146 @deftypefn {Operator} {} #\n\
147 Begin comment character.\n\
148 @seealso{%, #@\\{}\n\
153 @deftypefn {Operator} {} %\n\
154 Begin comment character.\n\
155 @seealso{#, %@\\{}\n\
160 @deftypefn {Operator} {} #@{\n\
161 Begin block comment. There must be nothing else, other than\n\
162 whitespace, in the line both before and after @code{#@{}.\n\
163 It is possible to nest block comments.\n\
164 @seealso{%@\\{, #@\\}, #}\n\
169 @deftypefn {Operator} {} %@{\n\
170 Begin block comment. There must be nothing else, other than\n\
171 whitespace, in the line both before and after @code{%@{}.\n\
172 It is possible to nest block comments.\n\
173 @seealso{#@\\{, %@\\}, %}\n\
178 @deftypefn {Operator} {} #@}\n\
179 Close block comment. There must be nothing else, other than\n\
180 whitespace, in the line both before and after @code{#@}}.\n\
181 It is possible to nest block comments.\n\
182 @seealso{%@\\}, #@\\{, #}\n\
187 @deftypefn {Operator} {} %@}\n\
188 Close block comment. There must be nothing else, other than\n\
189 whitespace, in the line both before and after @code{%@}}.\n\
190 It is possible to nest block comments.\n\
191 @seealso{#@\\}, %@\\{, %}\n\
196 @deftypefn {Operator} {} ...\n\
197 Continuation marker. Joins current line with following line.\n\
202 @deftypefn {Operator} {} &\n\
203 Element by element logical 'and' operator.\n\
209 @deftypefn {Operator} {} &&\n\
210 Logical 'and' operator (with short-circuit evaluation).\n\
216 @deftypefn {Operator} {} '\n\
217 Matrix transpose operator. For complex matrices, computes the\n\
218 complex conjugate (Hermitian) transpose.\n\
220 The single quote character may also be used to delimit strings, but\n\
221 it is better to use the double quote character, since that is never\n\
223 @seealso{.', transpose}\n\
228 @deftypefn {Operator} {} (\n\
229 Array index or function argument delimiter.\n\
234 @deftypefn {Operator} {})\n\
235 Array index or function argument delimiter.\n\
240 @deftypefn {Operator} {} *\n\
241 Multiplication operator.\n\
242 @seealso{.*, times}\n\
247 @deftypefn {Operator} {} **\n\
248 Power operator. This may return complex results for real inputs. Use\n\
249 @code{realsqrt}, @code{cbrt}, @code{nthroot}, or @code{realroot} to obtain\n\
250 real results when possible.\n\
251 @seealso{power, ^, .**, .^, realpow, realsqrt, cbrt, nthroot}\n\
256 @deftypefn {Operator} {} ^\n\
257 Power operator. This may return complex results for real inputs. Use\n\
258 @code{realsqrt}, @code{cbrt}, @code{nthroot}, or @code{realroot} to obtain\n\
259 real results when possible.\n\
260 @seealso{power, **, .^, .**, realpow, realsqrt, cbrt, nthroot}\n\
265 @deftypefn {Operator} {} +\n\
266 Addition operator.\n\
272 @deftypefn {Operator} {} ++\n\
273 Increment operator. As in C, may be applied as a prefix or postfix\n\
280 @deftypefn {Operator} {} ,\n\
281 Array index, function argument, or command separator.\n\
286 @deftypefn {Operator} {} -\n\
287 Subtraction or unary negation operator.\n\
293 @deftypefn {Operator} {} --\n\
294 Decrement operator. As in C, may be applied as a prefix or postfix\n\
301 @deftypefn {Operator} {} .'\n\
302 Matrix transpose operator. For complex matrices, computes the\n\
303 transpose, @emph{not} the complex conjugate transpose.\n\
304 @seealso{', transpose}\n\
309 @deftypefn {Operator} {} .*\n\
310 Element by element multiplication operator.\n\
311 @seealso{*, times}\n\
316 @deftypefn {Operator} {} .*\n\
317 Element by element power operator. If several complex results are possible,\n\
318 returns the one with smallest non-negative argument (angle). Use\n\
319 @code{realpow}, @code{realsqrt}, @code{cbrt}, or @code{nthroot} if a\n\
320 real result is preferred.\n\
321 @seealso{**, ^, .^, power, realpow, realsqrt, cbrt, nthroot}\n\
326 @deftypefn {Operator} {} .^\n\
327 Element by element power operator. If several complex results are possible,\n\
328 returns the one with smallest non-negative argument (angle). Use\n\
329 @code{realpow}, @code{realsqrt}, @code{cbrt}, or @code{nthroot} if a\n\
330 real result is preferred.\n\
331 @seealso{.**, ^, **, power, realpow, realsqrt, cbrt, nthroot}\n\
336 @deftypefn {Operator} {} ./\n\
337 Element by element right division operator.\n\
338 @seealso{/, .\\, rdivide, mrdivide}\n\
343 @deftypefn {Operator} {} /\n\
344 Right division operator.\n\
345 @seealso{./, \\, rdivide, mrdivide}\n\
350 @deftypefn {Operator} {} .\\\n\
351 Element by element left division operator.\n\
352 @seealso{\\, ./, rdivide, mrdivide}\n\
357 @deftypefn {Operator} {} \\\n\
358 Left division operator.\n\
359 @seealso{.\\, /, ldivide, mldivide}\n\
364 @deftypefn {Operator} {} :\n\
365 Select entire rows or columns of matrices.\n\
370 @deftypefn {Operator} {} ;\n\
371 Array row or command separator.\n\
377 @deftypefn {Operator} {} <\n\
378 'Less than' operator.\n\
384 @deftypefn {Operator} {} <=\n\
385 'Less than' or 'equals' operator.\n\
391 @deftypefn {Operator} {} =\n\
392 Assignment operator.\n\
397 @deftypefn {Operator} {} ==\n\
398 Equality test operator.\n\
404 @deftypefn {Operator} {} >\n\
405 'Greater than' operator.\n\
411 @deftypefn {Operator} {} >=\n\
412 'Greater than' or 'equals' operator.\n\
418 @deftypefn {Operator} {} [\n\
419 Return list delimiter.\n\
425 @deftypefn {Operator} {} ]\n\
426 Return list delimiter.\n\
432 @deftypefn {Operator} {} |\n\
433 Element by element logical 'or' operator.\n\
439 @deftypefn {Operator} {} ||\n\
440 Logical 'or' (with short-circuit evaluation) operator.\n\
449 @deftypefn {Keyword} {} break\n\
450 Exit the innermost enclosing do, while or for loop.\n\
451 @seealso{do, while, for, parfor, continue}\n\
456 @deftypefn {Keyword} {} case @var{value}\n\
457 @deftypefnx {Keyword} {} case @{@var{value}, @dots{}@}\n\
458 A case statement in a switch. Octave cases are exclusive and do not\n\
459 fall-through as do C-language cases. A switch statement must have at least\n\
460 one case. See @code{switch} for an example.\n\
466 @deftypefn {Keyword} {} catch\n\
467 @deftypefnx {Keyword} {} catch @var{value}\n\
468 Begin the cleanup part of a try-catch block.\n\
474 @deftypefn {Keyword} {} continue\n\
475 Jump to the end of the innermost enclosing do, while or for loop.\n\
476 @seealso{do, while, for, parfor, break}\n\
481 @deftypefn {Keyword} {} do\n\
482 Begin a do-until loop. This differs from a do-while loop in that the\n\
483 body of the loop is executed at least once.\n\
493 @seealso{for, until, while}\n\
498 @deftypefn {Keyword} {} else\n\
499 Alternate action for an if block. See @code{if} for an example.\n\
505 @deftypefn {Keyword} {} elseif (@var{condition})\n\
506 Alternate conditional test for an if block. See @code{if} for an example.\n\
512 @deftypefn {Keyword} {} end\n\
513 Mark the end of any @code{for}, @code{parfor}, @code{if}, @code{do},\n\
514 @code{while}, @code{function}, @code{switch}, @code{try}, or\n\
515 @code{unwind_protect} block.\n\
516 @seealso{for, parfor, if, do, while, function, switch, try, unwind_protect}\n\
521 @deftypefn {Keyword} {} end_try_catch\n\
522 Mark the end of an @code{try-catch} block.\n\
523 @seealso{try, catch}\n\
528 @deftypefn {Keyword} {} end_unwind_protect\n\
529 Mark the end of an unwind_protect block.\n\
530 @seealso{unwind_protect}\n\
535 @deftypefn {Keyword} {} endfor\n\
536 Mark the end of a for loop. See @code{for} for an example.\n\
542 @deftypefn {Keyword} {} endfunction\n\
543 Mark the end of a function.\n\
544 @seealso{function}\n\
549 @deftypefn {Keyword} {} endif\n\
550 Mark the end of an if block. See @code{if} for an example.\n\
556 @deftypefn {Keyword} {} endparfor\n\
557 Mark the end of a parfor loop. See @code{parfor} for an example.\n\
563 @deftypefn {Keyword} {} endswitch\n\
564 Mark the end of a switch block. See @code{switch} for an example.\n\
570 @deftypefn {Keyword} {} endwhile\n\
571 Mark the end of a while loop. See @code{while} for an example.\n\
572 @seealso{do, while}\n\
577 @deftypefn {Keyword} {} for @var{i} = @var{range}\n\
587 @seealso{do, parfor, while}\n\
592 @deftypefn {Keyword} {} function @var{outputs} = function (@var{input}, @dots{})\n\
593 @deftypefnx {Keyword} {} function {} function (@var{input}, @dots{})\n\
594 @deftypefnx {Keyword} {} function @var{outputs} = function\n\
595 Begin a function body with @var{outputs} as results and @var{inputs} as\n\
602 @deftypefn {Keyword} {} global @var{var}\n\
603 Declare variables to have global scope.\n\
608 if (isempty (@var{x}))\n\
613 @seealso{persistent}\n\
618 @deftypefn {Keyword} {} if (@var{cond}) @dots{} endif\n\
619 @deftypefnx {Keyword} {} if (@var{cond}) @dots{} else @dots{} endif\n\
620 @deftypefnx {Keyword} {} if (@var{cond}) @dots{} elseif (@var{cond}) @dots{} endif\n\
621 @deftypefnx {Keyword} {} if (@var{cond}) @dots{} elseif (@var{cond}) @dots{} else @dots{} endif\n\
622 Begin an if block.\n\
632 disp (\"not one or two\");\n\
641 @deftypefn {Keyword} {} otherwise\n\
642 The default statement in a switch block (similar to else in an if block).\n\
648 @deftypefn {Keyword} {} parfor @var{i} = @var{range}\n\
649 @deftypefnx {Keyword} {} parfor (@var{i} = @var{range}, @var{maxproc})\n\
650 Begin a for loop that may execute in parallel.\n\
659 @seealso{for, do, while}\n\
664 @deftypefn {Keyword} {} persistent @var{var}\n\
665 Declare variables as persistent. A variable that has been declared\n\
666 persistent within a function will retain its contents in memory between\n\
667 subsequent calls to the same function. The difference between persistent\n\
668 variables and global variables is that persistent variables are local in\n\
669 scope to a particular function and are not visible elsewhere.\n\
675 @deftypefn {Keyword} {} return\n\
676 Return from a function.\n\
677 @seealso{function}\n\
682 @deftypefn {Keyword} {} static\n\
683 This statement has been deprecated in favor of @code{persistent}.\n\
684 @seealso{persistent}\n\
689 @deftypefn {Keyword} {} switch @var{statement}\n\
690 Begin a switch block.\n\
697 case @{\"Yes\" \"yes\" \"YES\" \"y\" \"Y\"@}\n\
699 case @{\"No\" \"no\" \"NO\" \"n\" \"N\"@}\n\
702 error (\"invalid value\");\n\
706 @seealso{if, case, otherwise}\n\
711 @deftypefn {Keyword} {} try\n\
712 Begin a try-catch block.\n\
714 If an error occurs within a try block, then the catch code will be run and\n\
715 execution will proceed after the catch block (though it is often\n\
716 recommended to use the lasterr function to re-throw the error after cleanup\n\
718 @seealso{catch, unwind_protect}\n\
723 @deftypefn {Keyword} {} until (@var{cond})\n\
724 End a do-until loop. See @code{do} for an example.\n\
730 @deftypefn {Keyword} {} unwind_protect\n\
731 Begin an unwind_protect block.\n\
733 If an error occurs within the first part of an unwind_protect block\n\
734 the commands within the unwind_protect_cleanup block are executed before\n\
735 the error is thrown. If an error is not thrown, then the\n\
736 unwind_protect_cleanup block is still executed (in other words, the\n\
737 unwind_protect_cleanup will be run with or without an error in the\n\
738 unwind_protect block).\n\
739 @seealso{unwind_protect_cleanup, try}\n\
744 @deftypefn {Keyword} {} unwind_protect_cleanup\n\
745 Begin the cleanup section of an unwind_protect block.\n\
746 @seealso{unwind_protect}\n\
751 @deftypefn {Keyword} {} varargin\n\
752 Pass an arbitrary number of arguments into a function.\n\
753 @seealso{varargout, nargin, isargout, nargout, nthargout}\n\
758 @deftypefn {Keyword} {} varargout\n\
759 Pass an arbitrary number of arguments out of a function.\n\
760 @seealso{varargin, nargin, isargout, nargout, nthargout}\n\
765 @deftypefn {Keyword} {} while\n\
766 Begin a while loop.\n\
776 @seealso{do, endwhile, for, until}\n\
786 for (
map_iter iter = lst.begin (); iter != lst.end (); iter ++)
787 retval[j++] = iter->first;
800 const int key_len = keyword_names.
length ();
803 const int bif_len = bif.
length ();
806 const int cfl_len = cfl.
length ();
809 const int lcl_len = lcl.
length ();
812 const int ffl_len = ffl.
length ();
815 const int afl_len = afl.
length ();
818 = key_len + bif_len + cfl_len + lcl_len + ffl_len + afl_len;
826 for (i = 0; i < key_len; i++)
827 list[j++] = keyword_names[i];
829 for (i = 0; i < bif_len; i++)
832 for (i = 0; i < cfl_len; i++)
835 for (i = 0; i < lcl_len; i++)
838 for (i = 0; i < ffl_len; i++)
841 for (i = 0; i < afl_len; i++)
850 const size_t p1 = msg.find (
'\n');
851 std::string t = msg.substr (0, p1);
853 const size_t p2 = t.find (
"<html");
855 return (p2 != std::string::npos);
861 p1 = msg.find (
'\n');
863 std::string t = msg.substr (0, p1);
865 if (p1 == std::string::npos)
868 size_t p2 = t.find (
"-*- texinfo -*-");
870 return (p2 != std::string::npos);
875 std::string&
w,
bool& symbol_found)
897 ?
"command-line function" :
"built-in function";
906 std::string& file,
bool& symbol_found)
923 symbol_found = (idx != map.end ());
924 h = (symbol_found) ? idx->second :
"";
929 raw_help (
const std::string& nm,
bool& symbol_found)
954 DEFUN (built_in_docstrings_file, args, nargout,
956 @deftypefn {Built-in Function} {@var{val} =} built_in_docstrings_file ()\n\
957 @deftypefnx {Built-in Function} {@var{old_val} =} built_in_docstrings_file (@var{new_val})\n\
958 @deftypefnx {Built-in Function} {} built_in_docstrings_file (@var{new_val}, \"local\")\n\
959 Query or set the internal variable that specifies the name of the\n\
960 file containing docstrings for built-in Octave functions.\n\
962 The default value is\n\
963 @file{@var{octave-home}/share/octave/@var{version}/etc/built-in-docstrings},\n\
964 in which @var{octave-home} is the root directory of the Octave installation,\n\
965 and @var{version} is the Octave version number. The default value may be\n\
966 overridden by the environment variable\n\
967 @w{@env{OCTAVE_BUILT_IN_DOCSTRINGS_FILE}}, or the command line argument\n\
968 @option{--built-in-docstrings-file FNAME}.\n\
970 Note: This variable is only used when Octave is initializing itself.\n\
971 Modifying it during a running session of Octave will have no effect.\n\
982 std::ifstream file (fname.c_str (), std::ios::in | std::ios::binary);
987 file.ignore (1000, 0x1d);
989 if (file.gcount () == 1000)
996 std::cerr <<
"warning: is builtin-docstrings file corrupted?"
1002 size_t bufsize = 100000;
1006 while (! file.eof ())
1008 file.getline (buf, bufsize, 0x1d);
1010 std::string tmp (buf);
1012 size_t pos = tmp.find (
'\n');
1014 std::string fcn = tmp.substr (0, pos);
1024 tmp = tmp.substr (pos+1);
1029 while (tmp.length () > 2 && tmp[0] ==
'@' && tmp[1] ==
'c')
1031 pos = tmp.find (
'\n');
1032 tmp = tmp.substr (pos+1);
1044 std::cerr <<
"warning: docstring file '" << fname <<
"' not found"
1052 std::string& format)
1054 bool symbol_found =
false;
1055 text =
raw_help (name, symbol_found);
1057 format =
"Not found";
1063 format =
"Not documented";
1068 text.erase (0, idx);
1076 format =
"plain text";
1081 DEFUN (get_help_text, args, ,
"-*- texinfo -*-\n\
1082 @deftypefn {Built-in Function} {[@var{text}, @var{format}] =} get_help_text (@var{name})\n\
1083 Return the raw help text of function @var{name}.\n\
1085 The raw help text is returned in @var{text} and the format in @var{format}\n\
1086 The format is a string which is one of @qcode{\"texinfo\"},\n\
1087 @qcode{\"html\"}, or @qcode{\"plain text\"}.\n\
1088 @seealso{get_help_text_from_file}\n\
1093 if (args.length () == 1)
1095 const std::string name = args(0).string_value ();
1108 error (
"get_help_text: invalid input");
1118 std::string& format)
1120 bool symbol_found =
false;
1126 format =
"Not found";
1132 format =
"Not documented";
1137 text.erase (0, idx);
1145 format =
"plain text";
1150 DEFUN (get_help_text_from_file, args, ,
1152 @deftypefn {Built-in Function} {[@var{text}, @var{format}] =} get_help_text_from_file (@var{fname})\n\
1153 Return the raw help text from the file @var{fname}.\n\
1155 The raw help text is returned in @var{text} and the format in @var{format}\n\
1156 The format is a string which is one of @qcode{\"texinfo\"},\n\
1157 @qcode{\"html\"}, or @qcode{\"plain text\"}.\n\
1158 @seealso{get_help_text}\n\
1163 if (args.length () == 1)
1165 const std::string fname = args(0).string_value ();
1178 error (
"get_help_text_from_file: invalid input");
1189 DEFUN (__operators__, , ,
1191 @deftypefn {Function File} {} __operators__ ()\n\
1192 Undocumented internal function.\n\
1201 DEFUN (__keywords__, , ,
1203 @deftypefn {Function File} {} __keywords__ ()\n\
1204 Undocumented internal function.\n\
1213 DEFUN (__builtins__, , ,
1215 @deftypefn {Function File} {} __builtins__ ()\n\
1216 Undocumented internal function.\n\
1229 type = std::string ();
1233 if (name.find_first_of (
'.') == std::string::npos)
1246 type =
"command-line function";
1250 type =
"built-in function";
1255 ? std::string (
"script") : std::string (
"function");
1270 if (name.size () > 1 && name[name.size () - 1] ==
'.')
1294 DEFUN (__which__, args, ,
1296 @deftypefn {Built-in Function} {} __which__ (@var{name}, @dots{})\n\
1297 Undocumented internal function.\n\
1306 int argc = argv.
length ();
1313 Cell files (1, argc-1);
1314 Cell types (1, argc-1);
1316 for (
int i = 1; i < argc; i++)
1318 std::string name = argv[i];
1322 std::string file =
do_which (name, type);
1329 m.
assign (
"name", names);
1330 m.
assign (
"file", files);
1331 m.
assign (
"type", types);
1346 if (filename.find (dir) == 0)
1348 const int dir_len = dir.size ();
1349 const int filename_len = filename.size ();
1354 for (
int i = dir_len; i < filename_len; i++)
1358 return (num_seps <= max_allowed_seps);
1368 DEFUN (__list_functions__, args, ,
1370 @deftypefn {Function File} {@var{retval} =} __list_functions__ ()\n\
1371 @deftypefnx {Function File} {@var{retval} =} __list_functions__ (@var{directory})\n\
1372 Undocumented internal function.\n\
1381 if (args.length () == 0)
1383 else if (args(0).is_string ())
1385 std::string dir = args(0).string_value ();
1400 error (
"__list_functions__: DIRECTORY argument must be a string");
1405 DEFUN (doc_cache_file, args, nargout,
1407 @deftypefn {Built-in Function} {@var{val} =} doc_cache_file ()\n\
1408 @deftypefnx {Built-in Function} {@var{old_val} =} doc_cache_file (@var{new_val})\n\
1409 @deftypefnx {Built-in Function} {} doc_cache_file (@var{new_val}, \"local\")\n\
1410 Query or set the internal variable that specifies the name of the\n\
1411 Octave documentation cache file.\n\
1413 A cache file significantly improves the performance of the @code{lookfor}\n\
1414 command. The default value is\n\
1415 @file{@var{octave-home}/share/octave/@var{version}/etc/doc-cache},\n\
1416 in which @var{octave-home} is the root directory of the Octave installation,\n\
1417 and @var{version} is the Octave version number.\n\
1418 The default value may be overridden by the environment variable\n\
1419 @w{@env{OCTAVE_DOC_CACHE_FILE}}, or the command line argument\n\
1420 @option{--doc-cache-file FNAME}.\n\
1422 When called from inside a function with the @qcode{\"local\"} option, the\n\
1423 variable is changed locally for the function and any subroutines it calls.\n\
1424 The original variable value is restored when exiting the function.\n\
1425 @seealso{doc_cache_create, lookfor, info_program, doc, help, makeinfo_program}\n\
1426 @seealso{lookfor}\n\
1432 DEFUN (texi_macros_file, args, nargout,
1434 @deftypefn {Built-in Function} {@var{val} =} texi_macros_file ()\n\
1435 @deftypefnx {Built-in Function} {@var{old_val} =} texi_macros_file (@var{new_val})\n\
1436 @deftypefnx {Built-in Function} {} texi_macros_file (@var{new_val}, \"local\")\n\
1437 Query or set the internal variable that specifies the name of the\n\
1438 file containing Texinfo macros that are prepended to documentation strings\n\
1439 before they are passed to makeinfo.\n\
1441 The default value is\n\
1442 @file{@var{octave-home}/share/octave/@var{version}/etc/macros.texi},\n\
1443 in which @var{octave-home} is the root directory of the Octave installation,\n\
1444 and @var{version} is the Octave version number.\n\
1445 The default value may be overridden by the environment variable\n\
1446 @w{@env{OCTAVE_TEXI_MACROS_FILE}}, or the command line argument\n\
1447 @option{--texi-macros-file FNAME}.\n\
1449 When called from inside a function with the @qcode{\"local\"} option, the\n\
1450 variable is changed locally for the function and any subroutines it calls.\n\
1451 The original variable value is restored when exiting the function.\n\
1452 @seealso{makeinfo_program}\n\
1458 DEFUN (info_file, args, nargout,
1460 @deftypefn {Built-in Function} {@var{val} =} info_file ()\n\
1461 @deftypefnx {Built-in Function} {@var{old_val} =} info_file (@var{new_val})\n\
1462 @deftypefnx {Built-in Function} {} info_file (@var{new_val}, \"local\")\n\
1463 Query or set the internal variable that specifies the name of the\n\
1464 Octave info file.\n\
1466 The default value is\n\
1467 @file{@var{octave-home}/info/octave.info}, in\n\
1468 which @var{octave-home} is the root directory of the Octave installation.\n\
1469 The default value may be overridden by the environment variable\n\
1470 @w{@env{OCTAVE_INFO_FILE}}, or the command line argument\n\
1471 @option{--info-file FNAME}.\n\
1473 When called from inside a function with the @qcode{\"local\"} option, the\n\
1474 variable is changed locally for the function and any subroutines it calls.\n\
1475 The original variable value is restored when exiting the function.\n\
1476 @seealso{info_program, doc, help, makeinfo_program}\n\
1482 DEFUN (info_program, args, nargout,
1484 @deftypefn {Built-in Function} {@var{val} =} info_program ()\n\
1485 @deftypefnx {Built-in Function} {@var{old_val} =} info_program (@var{new_val})\n\
1486 @deftypefnx {Built-in Function} {} info_program (@var{new_val}, \"local\")\n\
1487 Query or set the internal variable that specifies the name of the\n\
1488 info program to run.\n\
1490 The default value is\n\
1491 @file{@var{octave-home}/libexec/octave/@var{version}/exec/@var{arch}/info}\n\
1492 in which @var{octave-home} is the root directory of the Octave installation,\n\
1493 @var{version} is the Octave version number, and @var{arch} is the system\n\
1494 type (for example, @code{i686-pc-linux-gnu}). The default value may be\n\
1495 overridden by the environment variable\n\
1496 @w{@env{OCTAVE_INFO_PROGRAM}}, or the command line argument\n\
1497 @option{--info-program NAME}.\n\
1499 When called from inside a function with the @qcode{\"local\"} option, the\n\
1500 variable is changed locally for the function and any subroutines it calls.\n\
1501 The original variable value is restored when exiting the function.\n\
1502 @seealso{info_file, doc, help, makeinfo_program}\n\
1508 DEFUN (makeinfo_program, args, nargout,
1510 @deftypefn {Built-in Function} {@var{val} =} makeinfo_program ()\n\
1511 @deftypefnx {Built-in Function} {@var{old_val} =} makeinfo_program (@var{new_val})\n\
1512 @deftypefnx {Built-in Function} {} makeinfo_program (@var{new_val}, \"local\")\n\
1513 Query or set the internal variable that specifies the name of the\n\
1514 program that Octave runs to format help text containing\n\
1515 Texinfo markup commands.\n\
1517 The default value is @code{makeinfo}.\n\
1519 When called from inside a function with the @qcode{\"local\"} option, the\n\
1520 variable is changed locally for the function and any subroutines it calls.\n\
1521 The original variable value is restored when exiting the function.\n\
1522 @seealso{texi_macros_file, info_file, info_program, doc, help}\n\
1528 DEFUN (suppress_verbose_help_message, args, nargout,
1530 @deftypefn {Built-in Function} {@var{val} =} suppress_verbose_help_message ()\n\
1531 @deftypefnx {Built-in Function} {@var{old_val} =} suppress_verbose_help_message (@var{new_val})\n\
1532 @deftypefnx {Built-in Function} {} suppress_verbose_help_message (@var{new_val}, \"local\")\n\
1533 Query or set the internal variable that controls whether Octave\n\
1534 will add additional help information to the end of the output from\n\
1535 the @code{help} command and usage messages for built-in commands.\n\
1537 When called from inside a function with the @qcode{\"local\"} option, the\n\
1538 variable is changed locally for the function and any subroutines it calls.\n\
1539 The original variable value is restored when exiting the function.\n\
static std::string do_which(const std::string &name, std::string &type)
void document(const std::string &ds)
static std::list< std::string > cmdline_function_names(void)
void assign(const std::string &k, const Cell &val)
std::string Vinfo_program
OCTINTERP_API void print_usage(void)
map_type::const_iterator map_iter
bool is_defined(void) const
std::string doc_string(void) const
bool file_is_in_dir(const std::string filename, const std::string dir)
static std::string find_file(const std::string &file)
static bool raw_help_from_file(const std::string &nm, std::string &h, std::string &file, bool &symbol_found)
std::map< std::string, std::string > map_type
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
string_vector autoloaded_functions(void)
std::string raw_help(const std::string &nm, bool &symbol_found)
#define SET_INTERNAL_VARIABLE(NM)
static octave_value find_built_in_function(const std::string &name)
octave_value map(octave_base_value::unary_mapper_t umap) const
static string_vector names(const map_type &lst)
std::string Vbuilt_in_docstrings_file
virtual std::string src_file_name(void) const
std::string get_help_from_file(const std::string &nm, bool &symbol_found, std::string &full_file)
map_type::value_type pair_type
std::string Vdoc_cache_file
static bool looks_like_html(const std::string &msg)
static string_vector files(const std::string &dir, bool omit_exts=false)
static octave_value find_function(const std::string &name, const octave_value_list &args=octave_value_list(), bool local_funcs=true)
static std::string Vmakeinfo_program
static string_vector fcn_names(void)
static void do_get_help_text_from_file(const std::string &fname, std::string &text, std::string &format)
static void do_get_help_text(const std::string &name, std::string &text, std::string &format)
F77_RET_T const double const double * f
std::string Vtexi_macros_file
static const pair_type operators[]
static std::string make_absolute(const std::string &s, const std::string &dot_path=get_current_directory())
std::complex< double > w(std::complex< double > z, double relerr=0)
string_vector & append(const std::string &s)
static const string_vector keyword_names
bool is_user_script(void) const
string_vector & sort(bool make_uniq=false)
virtual bool is_user_function(void) const
size_t size(T const (&)[z])
static const map_type keywords_map(keywords, keywords+size(keywords))
#define SET_NONEMPTY_INTERNAL_STRING_VARIABLE(NM)
static bool raw_help_from_symbol_table(const std::string &nm, std::string &h, std::string &w, bool &symbol_found)
static bool looks_like_texinfo(const std::string &msg, size_t &p1)
octave_function * function_value(bool silent=false) const
static std::list< std::string > variable_names(void)
static std::string find_fcn_file(const std::string &fcn, const std::string &pack_name=std::string())
virtual std::string fcn_file_name(void) const
octave_idx_type length(void) const
Number of elements in the array.
static const map_type operators_map(operators, operators+size(operators))
static bool is_dir_sep(char c)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
string_vector make_name_list(void)
static const pair_type keywords[]
static bool Vsuppress_verbose_help_message
void install_built_in_docstrings(void)
static std::list< std::string > built_in_function_names(void)
static bool raw_help_from_map(const std::string &nm, std::string &h, const map_type &map, bool &symbol_found)
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))