33 #include <sys/types.h>
113 if (s.substr (0, len) == prefix)
255 std::string tpath = path_arg;
285 if (! shell_path.empty ())
296 std::string tpath = path;
301 if (! tpath.empty ())
306 if (! tpath.empty ())
345 Vinfo_file = oct_info_file.empty () ? std_info_file : oct_info_file;
356 if (oct_info_prog.empty ())
370 if (! env_editor.empty ())
477 DEFUN (EDITOR, args, nargout,
479 @deftypefn {Built-in Function} {@var{val} =} EDITOR ()\n\
480 @deftypefnx {Built-in Function} {@var{old_val} =} EDITOR (@var{new_val})\n\
481 @deftypefnx {Built-in Function} {} EDITOR (@var{new_val}, \"local\")\n\
482 Query or set the internal variable that specifies the default text editor.\n\
484 The default value is taken from the environment variable @w{@env{EDITOR}}\n\
485 when Octave starts. If the environment variable is not initialized,\n\
486 @w{@env{EDITOR}} will be set to @qcode{\"emacs\"}.\n\
488 When called from inside a function with the @qcode{\"local\"} option, the\n\
489 variable is changed locally for the function and any subroutines it calls.\n\
490 The original variable value is restored when exiting the function.\n\
492 @seealso{edit, edit_history}\n\
510 DEFUN (EXEC_PATH, args, nargout,
512 @deftypefn {Built-in Function} {@var{val} =} EXEC_PATH ()\n\
513 @deftypefnx {Built-in Function} {@var{old_val} =} EXEC_PATH (@var{new_val})\n\
514 @deftypefnx {Built-in Function} {} EXEC_PATH (@var{new_val}, \"local\")\n\
515 Query or set the internal variable that specifies a colon separated\n\
516 list of directories to append to the shell PATH when executing external\n\
519 The initial value of is taken from the environment variable\n\
520 @w{@env{OCTAVE_EXEC_PATH}}, but that value can be overridden by the command\n\
521 line argument @option{--exec-path PATH}.\n\
523 When called from inside a function with the @qcode{\"local\"} option, the\n\
524 variable is changed locally for the function and any subroutines it calls.\n\
525 The original variable value is restored when exiting the function.\n\
527 @seealso{IMAGE_PATH, OCTAVE_HOME}\n\
532 if (args.length () > 0)
550 DEFUN (IMAGE_PATH, args, nargout,
552 @deftypefn {Built-in Function} {@var{val} =} IMAGE_PATH ()\n\
553 @deftypefnx {Built-in Function} {@var{old_val} =} IMAGE_PATH (@var{new_val})\n\
554 @deftypefnx {Built-in Function} {} IMAGE_PATH (@var{new_val}, \"local\")\n\
555 Query or set the internal variable that specifies a colon separated\n\
556 list of directories in which to search for image files.\n\
558 When called from inside a function with the @qcode{\"local\"} option, the\n\
559 variable is changed locally for the function and any subroutines it calls.\n\
560 The original variable value is restored when exiting the function.\n\
562 @seealso{EXEC_PATH, OCTAVE_HOME}\n\
580 DEFUN (OCTAVE_HOME, args, ,
582 @deftypefn {Built-in Function} {} OCTAVE_HOME ()\n\
583 Return the name of the top-level Octave installation directory.\n\
584 @seealso{EXEC_PATH, IMAGE_PATH}\n\
589 if (args.length () == 0)
604 @deftypefn {Built-in Function} {} OCTAVE_VERSION ()\n\
605 Return the version number of Octave as a string.\n\
606 @seealso{ver, version}\n\
611 int nargin = args.
length ();
static void set_default_bin_dir(void)
#define OCTAVE_FCNFILEDIR
void set_exec_path(const std::string &path_arg)
std::string Vsite_defaults_file
static void set_default_doc_cache_file(void)
std::string Vlocal_oct_file_dir
#define OCTAVE_LOCALVEROCTFILEDIR
static std::string path_sep_str(void)
std::string Vlocal_fcn_file_dir
std::string Vinfo_program
OCTINTERP_API void print_usage(void)
std::string Vlocal_ver_fcn_file_dir
#define OCTAVE_LOCALFCNFILEDIR
static void putenv(const std::string &name, const std::string &value)
static void set_default_local_arch_lib_dir(void)
#define OCTAVE_LOCALSTARTUPFILEDIR
static void set_default_info_dir(void)
std::string Vlocal_api_arch_lib_dir
#define DEFUN(name, args_name, nargout_name, doc)
#define OCTAVE_LOCALARCHLIBDIR
std::string Vfcn_file_dir
static void set_default_local_api_oct_file_dir(void)
#define OCTAVE_STARTUPFILEDIR
#define OCTAVE_OCTFILEDIR
std::string Vbuilt_in_docstrings_file
void set_image_path(const std::string &path)
#define OCTAVE_ARCHLIBDIR
std::string Vdoc_cache_file
static void set_default_fcn_file_dir(void)
static void set_default_arch_lib_dir(void)
std::string Voct_data_dir
static void set_default_oct_data_dir(void)
static void set_default_local_oct_file_dir(void)
static void set_default_oct_etc_dir(void)
static void set_default_info_prog(void)
static void set_default_local_api_fcn_file_dir(void)
std::string Vlocal_arch_lib_dir
static void replace(QString &text, const QRegExp &re, const QString &after)
std::string Vtexi_macros_file
std::string Vlocal_api_fcn_file_dir
static void set_default_libexec_dir(void)
static void set_default_local_ver_fcn_file_dir(void)
static void set_default_local_ver_arch_lib_dir(void)
static std::string getenv(const std::string &name)
#define DEFUNX(name, fname, args_name, nargout_name, doc)
std::string Vlocal_ver_arch_lib_dir
static void set_site_defaults_file(void)
std::string Vlocal_site_defaults_file
static void set_default_local_fcn_file_dir(void)
octave_idx_type length(void) const
static void set_default_image_dir(void)
#define OCTAVE_LOCALAPIFCNFILEDIR
static void set_default_texi_macros_file(void)
#define OCTAVE_LOCALOCTFILEDIR
#define OCTAVE_LOCALVERARCHLIBDIR
static void set_default_info_file(void)
#define SET_NONEMPTY_INTERNAL_STRING_VARIABLE(NM)
std::string Vlocal_ver_oct_file_dir
static void set_default_editor(void)
#define OCTAVE_OCTDATADIR
static void set_octave_home(void)
#define OCTAVE_LOCALAPIOCTFILEDIR
static void set_default_oct_locale_dir(void)
std::string Voct_file_dir
#define OCTAVE_OCTLOCALEDIR
#define OCTAVE_TEXI_MACROS_FILE
#define OCTAVE_DOC_CACHE_FILE
static void set_default_oct_file_dir(void)
static void set_local_site_defaults_file(void)
static std::string VIMAGE_PATH
static void set_built_in_docstrings_file(void)
static std::string VEXEC_PATH
static void set_default_data_dir(void)
#define OCTAVE_LOCALAPIARCHLIBDIR
static std::string dir_sep_str(void)
void install_defaults(void)
#define OCTAVE_LIBEXECDIR
std::string Varch_lib_dir
std::string subst_octave_home(const std::string &s)
std::string Voct_locale_dir
static void set_default_local_api_arch_lib_dir(void)
std::string genpath(const std::string &dirname, const string_vector &skip)
OCTAVE_EXPORT octave_value_list FOCTAVE_VERSION(const octave_value_list &args, int)
static void set_default_local_ver_oct_file_dir(void)
#define OCTAVE_LOCALVERFCNFILEDIR
static char dir_sep_char(void)
std::string Vlocal_api_oct_file_dir