Typedefs | Functions | Variables

help.cc File Reference

#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>
Include dependency graph for help.cc:

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

Typedef Documentation

typedef map_type::const_iterator map_iter

Definition at line 93 of file help.cc.

typedef std::map<std::string, std::string> map_type

Definition at line 91 of file help.cc.

typedef map_type::value_type pair_type

Definition at line 92 of file help.cc.


Function Documentation

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   
)
DEFUN ( __list_functions__  ,
args   
)
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]
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().

static const map_type keywords_map ( keywords  ,
keywords sizekeywords 
) [static]

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   ) 
static string_vector names ( const map_type lst  )  [static]
static const map_type operators_map ( operators  ,
operators sizeoperators 
) [static]

Referenced by DEFUN(), and raw_help().

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]
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]
template<typename T , std::size_t z>
std::size_t size ( T const   (&)[z]  ) 

Variable Documentation

const string_vector keyword_names = names (keywords_map) [static]

Definition at line 766 of file help.cc.

const pair_type keywords[] [static]
const pair_type operators[] [static]

Definition at line 102 of file help.cc.

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]

Definition at line 83 of file help.cc.

Definition at line 87 of file help.cc.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines