Mercurial > hg > octave-nkf
comparison src/load-path.cc @ 6626:af16354ea09c
[project @ 2007-05-16 14:58:26 by jwe]
author | jwe |
---|---|
date | Wed, 16 May 2007 14:58:26 +0000 |
parents | 5d02dfacfc9e |
children | 0fcc8d65b571 |
comparison
equal
deleted
inserted
replaced
6625:5d02dfacfc9e | 6626:af16354ea09c |
---|---|
46 load_path *load_path::instance = 0; | 46 load_path *load_path::instance = 0; |
47 load_path::hook_function_ptr load_path::add_hook = execute_pkg_add; | 47 load_path::hook_function_ptr load_path::add_hook = execute_pkg_add; |
48 load_path::hook_function_ptr load_path::remove_hook = execute_pkg_del; | 48 load_path::hook_function_ptr load_path::remove_hook = execute_pkg_del; |
49 std::string load_path::command_line_path; | 49 std::string load_path::command_line_path; |
50 | 50 |
51 static std::string Vsystem_path; | |
52 | |
53 std::string | |
54 octave_system_path (void) | |
55 { | |
56 return Vsystem_path; | |
57 } | |
58 | |
59 void | 51 void |
60 load_path::dir_info::update (void) | 52 load_path::dir_info::update (void) |
61 { | 53 { |
62 if (is_relative) | 54 if (is_relative) |
63 initialize (); | 55 initialize (); |
358 } | 350 } |
359 | 351 |
360 void | 352 void |
361 load_path::do_initialize (bool set_initial_path) | 353 load_path::do_initialize (bool set_initial_path) |
362 { | 354 { |
363 Vsystem_path = dir_path::path_sep_str; | 355 sys_path = dir_path::path_sep_str; |
364 | 356 |
365 if (set_initial_path) | 357 if (set_initial_path) |
366 { | 358 { |
367 maybe_add_path_elts (Vsystem_path, Vlocal_ver_oct_file_dir); | 359 maybe_add_path_elts (sys_path, Vlocal_ver_oct_file_dir); |
368 maybe_add_path_elts (Vsystem_path, Vlocal_api_oct_file_dir); | 360 maybe_add_path_elts (sys_path, Vlocal_api_oct_file_dir); |
369 maybe_add_path_elts (Vsystem_path, Vlocal_oct_file_dir); | 361 maybe_add_path_elts (sys_path, Vlocal_oct_file_dir); |
370 maybe_add_path_elts (Vsystem_path, Vlocal_ver_fcn_file_dir); | 362 maybe_add_path_elts (sys_path, Vlocal_ver_fcn_file_dir); |
371 maybe_add_path_elts (Vsystem_path, Vlocal_api_fcn_file_dir); | 363 maybe_add_path_elts (sys_path, Vlocal_api_fcn_file_dir); |
372 maybe_add_path_elts (Vsystem_path, Vlocal_fcn_file_dir); | 364 maybe_add_path_elts (sys_path, Vlocal_fcn_file_dir); |
373 maybe_add_path_elts (Vsystem_path, Voct_file_dir); | 365 maybe_add_path_elts (sys_path, Voct_file_dir); |
374 maybe_add_path_elts (Vsystem_path, Vfcn_file_dir); | 366 maybe_add_path_elts (sys_path, Vfcn_file_dir); |
375 } | 367 } |
376 | 368 |
377 std::string tpath = load_path::command_line_path; | 369 std::string tpath = load_path::command_line_path; |
378 | 370 |
379 if (tpath.empty ()) | 371 if (tpath.empty ()) |
382 std::string xpath = "."; | 374 std::string xpath = "."; |
383 | 375 |
384 if (! tpath.empty ()) | 376 if (! tpath.empty ()) |
385 xpath += dir_path::path_sep_str + tpath; | 377 xpath += dir_path::path_sep_str + tpath; |
386 | 378 |
387 if (Vsystem_path != dir_path::path_sep_str) | 379 if (sys_path != dir_path::path_sep_str) |
388 xpath += Vsystem_path; | 380 xpath += sys_path; |
389 | 381 |
390 do_set (xpath, false); | 382 do_set (xpath, false); |
391 } | 383 } |
392 | 384 |
393 void | 385 void |
1293 Return the default list of directories in which to search for function\n\ | 1285 Return the default list of directories in which to search for function\n\ |
1294 files.\n\ | 1286 files.\n\ |
1295 @seealso{path, addpath, rmpath, genpath, savepath, pathsep}\n\ | 1287 @seealso{path, addpath, rmpath, genpath, savepath, pathsep}\n\ |
1296 @end deftypefn") | 1288 @end deftypefn") |
1297 { | 1289 { |
1298 return octave_value (Vsystem_path); | 1290 return load_path::system_path (); |
1299 } | 1291 } |
1300 | 1292 |
1301 DEFUN (path, args, nargout, | 1293 DEFUN (path, args, nargout, |
1302 "-*- texinfo -*-\n\ | 1294 "-*- texinfo -*-\n\ |
1303 @deftypefn {Function File} {} path (@dots{})\n\ | 1295 @deftypefn {Function File} {} path (@dots{})\n\ |