#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <sys/types.h>
#include <unistd.h>
#include "cmd-edit.h"
#include "file-ops.h"
#include "file-stat.h"
#include "oct-env.h"
#include "str-vec.h"
#include <defaults.h>
#include "defun.h"
#include "dirfns.h"
#include "error.h"
#include "gripes.h"
#include "help.h"
#include "input.h"
#include "load-path.h"
#include "oct-obj.h"
#include "ov-usr-fcn.h"
#include "pager.h"
#include "parse.h"
#include "pathsearch.h"
#include "procstream.h"
#include "pt-pr-code.h"
#include "sighandlers.h"
#include "symtab.h"
#include "syswait.h"
#include "toplev.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
#include "version.h"
#include "quit.h"
#include <map>
Go to the source code of this file.
Typedefs | |
typedef map_type::const_iterator | map_iter |
typedef std::map< std::string, std::string > | map_type |
typedef map_type::value_type | pair_type |
Functions | |
DEFUN (get_help_text, args,,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {[@var{text}, @var{format}] =} get_help_text (@var{name})\n\ Return the raw help text of function @var{name}.\n\ \n\ The raw help text is returned in @var{text} and the format in @var{format}\n\ The format is a string which is one of @t{\"texinfo\"}, @t{\"html\"}, or\n\ @t{\"plain text\"}.\n\ @end deftypefn") | |
DEFUN (__operators__,,,"-*- texinfo -*-\n\ @deftypefn {Function File} __operators__ ()\n\ Undocumented internal function.\n\ @end deftypefn") | |
DEFUN (makeinfo_program, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} makeinfo_program ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} makeinfo_program (@var{new_val})\n\ @deftypefnx {Built-in Function} {} makeinfo_program (@var{new_val}, \"local\")\n\ Query or set the internal variable that specifies the name of the\n\ program that Octave runs to format help text containing\n\ Texinfo markup commands. The default value is @code{makeinfo}.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @seealso{info_file, info_program, doc, help}\n\ @end deftypefn") | |
DEFUN (__keywords__,,,"-*- texinfo -*-\n\ @deftypefn {Function File} __keywords__ ()\n\ Undocumented internal function.\n\ @end deftypefn") | |
DEFUN (__builtins__,,,"-*- texinfo -*-\n\ @deftypefn {Function File} __builtins__ ()\n\ Undocumented internal function.\n\ @end deftypefn") | |
DEFUN (__which__, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __which__ (@var{name}, @dots{})\n\ Undocumented internal function.\n\ @end deftypefn") | |
DEFUN (__list_functions__, args,,"-*- texinfo -*-\n\ @deftypefn {Function File} {@var{retval} =} __list_functions__ ()\n\ @deftypefnx {Function File} {@var{retval} =} __list_functions__ (@var{directory})\n\ Undocumented internal function.\n\ @end deftypefn") | |
DEFUN (get_help_text_from_file, args,,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {[@var{text}, @var{format}] =} get_help_text_from_file (@var{fname})\n\ Return the raw help text from the file @var{fname}.\n\ \n\ The raw help text is returned in @var{text} and the format in @var{format}\n\ The format is a string which is one of @t{\"texinfo\"}, @t{\"html\"}, or\n\ @t{\"plain text\"}.\n\ @end deftypefn") | |
DEFUN (doc_cache_file, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} doc_cache_file ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} doc_cache_file (@var{new_val})\n\ @deftypefnx {Built-in Function} {} doc_cache_file (@var{new_val}, \"local\")\n\ Query or set the internal variable that specifies the name of the\n\ Octave documentation cache file. A cache file significantly improves\n\ the performance of the @code{lookfor} command. The default value is \n\ @file{@var{octave-home}/share/octave/@var{version}/etc/doc-cache},\n\ in which @var{octave-home} is the root directory of the Octave installation,\n\ and @var{version} is the Octave version number.\n\ The default value may be overridden by the environment variable\n\ @w{@env{OCTAVE_DOC_CACHE_FILE}}, or the command line argument\n\ @samp{--doc-cache-file NAME}.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @seealso{lookfor, info_program, doc, help, makeinfo_program}\n\ @end deftypefn") | |
DEFUN (info_file, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} info_file ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} info_file (@var{new_val})\n\ @deftypefnx {Built-in Function} {} info_file (@var{new_val}, \"local\")\n\ Query or set the internal variable that specifies the name of the\n\ Octave info file. The default value is\n\ @file{@var{octave-home}/info/octave.info}, in\n\ which @var{octave-home} is the root directory of the Octave installation.\n\ The default value may be overridden by the environment variable\n\ @w{@env{OCTAVE_INFO_FILE}}, or the command line argument\n\ @samp{--info-file NAME}.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @seealso{info_program, doc, help, makeinfo_program}\n\ @end deftypefn") | |
DEFUN (info_program, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} info_program ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} info_program (@var{new_val})\n\ @deftypefnx {Built-in Function} {} info_program (@var{new_val}, \"local\")\n\ Query or set the internal variable that specifies the name of the\n\ info program to run. The default value is\n\ @file{@var{octave-home}/libexec/octave/@var{version}/exec/@var{arch}/info}\n\ in which @var{octave-home} is the root directory of the Octave installation,\n\ @var{version} is the Octave version number, and @var{arch}\n\ is the system type (for example, @code{i686-pc-linux-gnu}). The\n\ default value may be overridden by the environment variable\n\ @w{@env{OCTAVE_INFO_PROGRAM}}, or the command line argument\n\ @samp{--info-program NAME}.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @seealso{info_file, doc, help, makeinfo_program}\n\ @end deftypefn") | |
DEFUN (suppress_verbose_help_message, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} suppress_verbose_help_message ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} suppress_verbose_help_message (@var{new_val})\n\ @deftypefnx {Built-in Function} {} suppress_verbose_help_message (@var{new_val}, \"local\")\n\ Query or set the internal variable that controls whether Octave\n\ will add additional help information to the end of the output from\n\ the @code{help} command and usage messages for built-in commands.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @end deftypefn") | |
static void | do_get_help_text (const std::string &name, std::string &text, std::string &format) |
static void | do_get_help_text_from_file (const std::string &fname, std::string &text, std::string &format) |
static std::string | do_which (const std::string &name, std::string &type) |
std::string | do_which (const std::string &name) |
bool | file_is_in_dir (const std::string filename, const std::string dir) |
static const map_type | keywords_map (keywords, keywords+size(keywords)) |
static bool | looks_like_html (const std::string &msg) |
static bool | looks_like_texinfo (const std::string &msg, size_t &p1) |
string_vector | make_name_list (void) |
static string_vector | names (const map_type &lst) |
static const map_type | operators_map (operators, operators+size(operators)) |
std::string | raw_help (const std::string &nm, bool &symbol_found) |
static bool | raw_help_from_file (const std::string &nm, std::string &h, std::string &file, bool &symbol_found) |
static bool | raw_help_from_map (const std::string &nm, std::string &h, const map_type &map, bool &symbol_found) |
static bool | raw_help_from_symbol_table (const std::string &nm, std::string &h, std::string &w, bool &symbol_found) |
template<typename T , std::size_t z> | |
std::size_t | size (T const (&)[z]) |
Variables | |
static const string_vector | keyword_names = names (keywords_map) |
static const pair_type | keywords [] |
static const pair_type | operators [] |
std::string | Vdoc_cache_file |
std::string | Vinfo_file |
std::string | Vinfo_program |
static std::string | Vmakeinfo_program = "makeinfo" |
static bool | Vsuppress_verbose_help_message = false |
DEFUN | ( | get_help_text | , | |
args | ||||
) |
Definition at line 951 of file help.cc.
References do_get_help_text(), error(), error_state, and print_usage().
DEFUN | ( | __operators__ | ) |
Definition at line 1057 of file help.cc.
References names(), octave_value(), and operators_map().
DEFUN | ( | makeinfo_program | , | |
args | , | |||
nargout | ||||
) |
Definition at line 1340 of file help.cc.
References SET_NONEMPTY_INTERNAL_STRING_VARIABLE.
DEFUN | ( | __keywords__ | ) |
Definition at line 1069 of file help.cc.
References keywords_map(), names(), and octave_value().
DEFUN | ( | __builtins__ | ) |
Definition at line 1081 of file help.cc.
References symbol_table::built_in_function_names(), and octave_value().
DEFUN | ( | __which__ | , | |
args | ||||
) |
Definition at line 1157 of file help.cc.
References octave_map::assign(), do_which(), error_state, Array< T >::length(), names(), and print_usage().
DEFUN | ( | __list_functions__ | , | |
args | ||||
) |
Definition at line 1230 of file help.cc.
References string_vector::append(), autoloaded_functions(), error(), error_state, load_path::fcn_names(), load_path::files(), string_vector::sort(), and octave_value::string_value().
DEFUN | ( | get_help_text_from_file | , | |
args | ||||
) |
Definition at line 1019 of file help.cc.
References do_get_help_text_from_file(), error(), error_state, and print_usage().
DEFUN | ( | doc_cache_file | , | |
args | , | |||
nargout | ||||
) |
Definition at line 1270 of file help.cc.
References SET_NONEMPTY_INTERNAL_STRING_VARIABLE.
DEFUN | ( | info_file | , | |
args | , | |||
nargout | ||||
) |
Definition at line 1294 of file help.cc.
References SET_NONEMPTY_INTERNAL_STRING_VARIABLE.
DEFUN | ( | info_program | , | |
args | , | |||
nargout | ||||
) |
Definition at line 1316 of file help.cc.
References SET_NONEMPTY_INTERNAL_STRING_VARIABLE.
DEFUN | ( | suppress_verbose_help_message | , | |
args | , | |||
nargout | ||||
) |
Definition at line 1358 of file help.cc.
References SET_INTERNAL_VARIABLE.
static void do_get_help_text | ( | const std::string & | name, | |
std::string & | text, | |||
std::string & | format | |||
) | [static] |
Definition at line 921 of file help.cc.
References looks_like_html(), looks_like_texinfo(), and raw_help().
Referenced by DEFUN().
static void do_get_help_text_from_file | ( | const std::string & | fname, | |
std::string & | text, | |||
std::string & | format | |||
) | [static] |
Definition at line 986 of file help.cc.
References f, looks_like_html(), looks_like_texinfo(), and raw_help_from_file().
Referenced by DEFUN().
static std::string do_which | ( | const std::string & | name, | |
std::string & | type | |||
) | [static] |
Definition at line 1093 of file help.cc.
References octave_function::fcn_file_name(), load_path::find_fcn_file(), load_path::find_file(), symbol_table::find_function(), octave_value::function_value(), octave_value::is_defined(), octave_base_value::is_user_function(), and octave_value::is_user_script().
Referenced by DEFUN(), and do_which().
std::string do_which | ( | const std::string & | name | ) |
Definition at line 1146 of file help.cc.
References do_which().
bool file_is_in_dir | ( | const std::string | filename, | |
const std::string | dir | |||
) | [inline] |
Definition at line 1207 of file help.cc.
References file_ops::is_dir_sep().
Referenced by DEFUN(), and raw_help().
static bool looks_like_html | ( | const std::string & | msg | ) | [static] |
Definition at line 821 of file help.cc.
Referenced by do_get_help_text(), and do_get_help_text_from_file().
static bool looks_like_texinfo | ( | const std::string & | msg, | |
size_t & | p1 | |||
) | [static] |
Definition at line 831 of file help.cc.
Referenced by do_get_help_text(), and do_get_help_text_from_file().
string_vector make_name_list | ( | void | ) |
Definition at line 771 of file help.cc.
References autoloaded_functions(), symbol_table::built_in_function_names(), symbol_table::cmdline_function_names(), load_path::fcn_names(), Array< T >::length(), and symbol_table::variable_names().
Referenced by generate_possible_completions().
static string_vector names | ( | const map_type & | lst | ) | [static] |
Definition at line 755 of file help.cc.
Referenced by DEFUN(), do_dbstack(), do_load(), do_who(), octave_base_value::get_umap_name(), octave_value_list::operator=(), pr_where(), read_mat5_binary_element(), octave_fcn_handle::set_fcn(), octave_value_list::slice(), and octave_value_list::stash_name_tags().
Referenced by DEFUN(), and raw_help().
std::string raw_help | ( | const std::string & | nm, | |
bool & | symbol_found | |||
) |
Definition at line 906 of file help.cc.
References f, keywords_map(), operators_map(), raw_help_from_file(), raw_help_from_map(), and raw_help_from_symbol_table().
Referenced by do_get_help_text().
static bool raw_help_from_file | ( | const std::string & | nm, | |
std::string & | h, | |||
std::string & | file, | |||
bool & | symbol_found | |||
) | [static] |
Definition at line 877 of file help.cc.
References get_help_from_file(), unwind_protect::protect_var(), and reading_script_file.
Referenced by do_get_help_text_from_file(), and raw_help().
static bool raw_help_from_map | ( | const std::string & | nm, | |
std::string & | h, | |||
const map_type & | map, | |||
bool & | symbol_found | |||
) | [static] |
Definition at line 896 of file help.cc.
Referenced by raw_help().
static bool raw_help_from_symbol_table | ( | const std::string & | nm, | |
std::string & | h, | |||
std::string & | w, | |||
bool & | symbol_found | |||
) | [static] |
Definition at line 846 of file help.cc.
References octave_function::doc_string(), octave_function::fcn_file_name(), symbol_table::find_function(), octave_value::function_value(), octave_value::is_defined(), and octave_base_value::is_user_function().
Referenced by raw_help().
std::size_t size | ( | T const | (&)[z] | ) |
Definition at line 97 of file help.cc.
Referenced by caseless_str::compare(), default_history_size(), DEFUN(), do_fread(), get_size(), gl2psWriteBigEndian(), octave_base_list< tree_index_expression * >::length(), lin_interpn(), and save_mat5_array_length().
const string_vector keyword_names = names (keywords_map) [static] |
Definition at line 439 of file help.cc.
Referenced by octave_struct::load_ascii(), octave_char_matrix_str::load_ascii(), octave_matrix::load_ascii(), octave_float_matrix::load_ascii(), octave_float_complex_matrix::load_ascii(), octave_complex_matrix::load_ascii(), octave_cell::load_ascii(), and octave_bool_matrix::load_ascii().
std::string Vdoc_cache_file |
Definition at line 72 of file help.cc.
Referenced by set_default_doc_cache_file().
std::string Vinfo_file |
Definition at line 76 of file help.cc.
Referenced by set_default_info_file().
std::string Vinfo_program |
Definition at line 80 of file help.cc.
Referenced by set_default_info_prog().
std::string Vmakeinfo_program = "makeinfo" [static] |
bool Vsuppress_verbose_help_message = false [static] |