# HG changeset patch # User jwe # Date 1179327506 0 # Node ID af16354ea09cd760bbb5944452b4756e913017e4 # Parent 5d02dfacfc9eb858d3f48f7f37b06dd6a90fa594 [project @ 2007-05-16 14:58:26 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2007-05-16 John W. Eaton + + * load-path.h (load_path::sys_path): New static data member. + (load_path::system_path): New static function. + (load_path::do_system_path): New function. + * load-path.cc (Vsystem_path): Delete. + (load_path::do_initialize): Use sys_path, not Vsystem_path. + (Fpathdef): Call load_path::system_path instead of using Vsystem_path. + * ls-mat5.cc (read_mat5_binary_element): Likewise. + * ov-fcn-handle.cc (octave_fcn_handle::set_fcn): Likewise. + 2007-05-16 David Bateman * load_pathc.cc (std::string octave_system_path (void)): New diff --git a/src/load-path.cc b/src/load-path.cc --- a/src/load-path.cc +++ b/src/load-path.cc @@ -48,14 +48,6 @@ load_path::hook_function_ptr load_path::remove_hook = execute_pkg_del; std::string load_path::command_line_path; -static std::string Vsystem_path; - -std::string -octave_system_path (void) -{ - return Vsystem_path; -} - void load_path::dir_info::update (void) { @@ -360,18 +352,18 @@ void load_path::do_initialize (bool set_initial_path) { - Vsystem_path = dir_path::path_sep_str; + sys_path = dir_path::path_sep_str; if (set_initial_path) { - maybe_add_path_elts (Vsystem_path, Vlocal_ver_oct_file_dir); - maybe_add_path_elts (Vsystem_path, Vlocal_api_oct_file_dir); - maybe_add_path_elts (Vsystem_path, Vlocal_oct_file_dir); - maybe_add_path_elts (Vsystem_path, Vlocal_ver_fcn_file_dir); - maybe_add_path_elts (Vsystem_path, Vlocal_api_fcn_file_dir); - maybe_add_path_elts (Vsystem_path, Vlocal_fcn_file_dir); - maybe_add_path_elts (Vsystem_path, Voct_file_dir); - maybe_add_path_elts (Vsystem_path, Vfcn_file_dir); + maybe_add_path_elts (sys_path, Vlocal_ver_oct_file_dir); + maybe_add_path_elts (sys_path, Vlocal_api_oct_file_dir); + maybe_add_path_elts (sys_path, Vlocal_oct_file_dir); + maybe_add_path_elts (sys_path, Vlocal_ver_fcn_file_dir); + maybe_add_path_elts (sys_path, Vlocal_api_fcn_file_dir); + maybe_add_path_elts (sys_path, Vlocal_fcn_file_dir); + maybe_add_path_elts (sys_path, Voct_file_dir); + maybe_add_path_elts (sys_path, Vfcn_file_dir); } std::string tpath = load_path::command_line_path; @@ -384,8 +376,8 @@ if (! tpath.empty ()) xpath += dir_path::path_sep_str + tpath; - if (Vsystem_path != dir_path::path_sep_str) - xpath += Vsystem_path; + if (sys_path != dir_path::path_sep_str) + xpath += sys_path; do_set (xpath, false); } @@ -1295,7 +1287,7 @@ @seealso{path, addpath, rmpath, genpath, savepath, pathsep}\n\ @end deftypefn") { - return octave_value (Vsystem_path); + return load_path::system_path (); } DEFUN (path, args, nargout, diff --git a/src/load-path.h b/src/load-path.h --- a/src/load-path.h +++ b/src/load-path.h @@ -173,6 +173,11 @@ command_line_path += dir_path::path_sep_str + p; } + static std::string system_path (void) + { + return instance_ok () ? do_system_path () : std::string (); + } + private: static const int M_FILE = 1; @@ -277,6 +282,8 @@ static std::string command_line_path; + static std::string sys_path; + static bool instance_ok (void); typedef std::list::const_iterator const_dir_info_list_iterator; @@ -332,6 +339,8 @@ void do_display (std::ostream& os) const; + std::string system_path (void) const { return sys_path; } + void add_to_fcn_map (const dir_info& di, bool at_end) const; }; @@ -341,8 +350,6 @@ extern void execute_pkg_add (const std::string& dir); extern void execute_pkg_del (const std::string& dir); -extern std::string octave_system_path (void); - #endif /* diff --git a/src/ls-mat5.cc b/src/ls-mat5.cc --- a/src/ls-mat5.cc +++ b/src/ls-mat5.cc @@ -800,7 +800,7 @@ names(1) = fname + ".mex"; names(2) = fname + ".m"; - dir_path p (octave_system_path ()); + dir_path p (load_path::system_path ()); str = octave_env::make_absolute (p.find_first_of (names), octave_env::getcwd ()); diff --git a/src/ov-fcn-handle.cc b/src/ov-fcn-handle.cc --- a/src/ov-fcn-handle.cc +++ b/src/ov-fcn-handle.cc @@ -197,7 +197,7 @@ names(1) = nm + ".mex"; names(2) = nm + ".m"; - dir_path p (octave_system_path ()); + dir_path p (load_path::system_path ()); str = octave_env::make_absolute (p.find_first_of (names), octave_env::getcwd ());