2203
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
2203
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #ifdef HAVE_CONFIG_H |
|
24 #include <config.h> |
|
25 #endif |
|
26 |
|
27 #include <cstdlib> |
|
28 |
3503
|
29 #include <iostream> |
2203
|
30 #include <string> |
|
31 |
|
32 #ifdef HAVE_UNISTD_H |
2442
|
33 #ifdef HAVE_SYS_TYPES_H |
2203
|
34 #include <sys/types.h> |
2442
|
35 #endif |
2203
|
36 #include <unistd.h> |
|
37 #endif |
|
38 |
2926
|
39 #include "oct-env.h" |
4217
|
40 #include "file-stat.h" |
3174
|
41 #include "pathsearch.h" |
4217
|
42 #include "str-vec.h" |
2926
|
43 |
2492
|
44 #include <defaults.h> |
2203
|
45 #include "defun.h" |
|
46 #include "error.h" |
3040
|
47 #include "file-ops.h" |
2203
|
48 #include "gripes.h" |
|
49 #include "help.h" |
3185
|
50 #include "oct-obj.h" |
2390
|
51 #include "ov.h" |
4217
|
52 #include "parse.h" |
2203
|
53 #include "toplev.h" |
4217
|
54 #include "unwind-prot.h" |
2203
|
55 #include "variables.h" |
2492
|
56 #include <version.h> |
2203
|
57 |
3523
|
58 std::string Voctave_home; |
2203
|
59 |
3523
|
60 std::string Vbin_dir; |
|
61 std::string Vinfo_dir; |
|
62 std::string Vdata_dir; |
|
63 std::string Vlibexec_dir; |
|
64 std::string Varch_lib_dir; |
|
65 std::string Vlocal_arch_lib_dir; |
3597
|
66 std::string Vlocal_ver_arch_lib_dir; |
3523
|
67 std::string Vfcn_file_dir; |
2203
|
68 |
4447
|
69 // The default path that will be searched for programs that we |
|
70 // execute (in addition to the user-specified --exec-path). |
|
71 static std::string Vdefault_exec_path; |
|
72 |
2203
|
73 // The path that will be searched for programs that we execute. |
|
74 // (--exec-path path) |
3523
|
75 std::string Vexec_path; |
2203
|
76 |
|
77 // Load path specified on command line. |
|
78 // (--path path; -p path) |
3523
|
79 static std::string Vload_path; |
2203
|
80 |
3192
|
81 // The default load path with OCTAVE_HOME appropriately substituted. |
3523
|
82 static std::string Vdefault_load_path; |
3192
|
83 |
3174
|
84 // And the cached directory path corresponding to Vload_path. |
|
85 dir_path Vload_path_dir_path; |
|
86 |
2203
|
87 // Name of the editor to be invoked by the edit_history command. |
3523
|
88 std::string Veditor; |
2203
|
89 |
3523
|
90 std::string Vimagepath; |
2203
|
91 |
3523
|
92 std::string Vlocal_site_defaults_file; |
|
93 std::string Vsite_defaults_file; |
2203
|
94 |
4217
|
95 // Each element of A and B should be directory names. For each |
|
96 // element of A not in the list B, execute SCRIPT_FILE in that |
|
97 // directory if it exists. |
|
98 |
|
99 static void |
|
100 maybe_add_or_del_packages (const string_vector& a, |
|
101 const string_vector& b, |
4247
|
102 const std::string& script_file) |
4217
|
103 { |
|
104 if (! octave_interpreter_ready) |
|
105 return; |
|
106 |
|
107 unwind_protect::begin_frame ("maybe_add_or_del_packages"); |
|
108 |
|
109 unwind_protect_bool (input_from_startup_file); |
|
110 |
|
111 input_from_startup_file = true; |
|
112 |
|
113 int a_len = a.length (); |
|
114 int b_len = b.length (); |
|
115 |
|
116 for (int i = 0; i < a_len; i++) |
|
117 { |
|
118 std::string a_dir = a[i]; |
|
119 |
|
120 bool found = false; |
|
121 |
|
122 for (int j = 0; j < b_len; j++) |
|
123 { |
|
124 if (b[j] == a_dir) |
|
125 { |
|
126 found = true; |
|
127 break; |
|
128 } |
|
129 } |
|
130 |
|
131 if (! found) |
|
132 { |
|
133 std::string file = a_dir + file_ops::dir_sep_str + script_file; |
|
134 |
|
135 file_stat fs = file_stat (file); |
|
136 |
|
137 if (fs.exists ()) |
4486
|
138 source_file (file); |
4217
|
139 |
|
140 if (error_state) |
|
141 return; |
|
142 } |
|
143 } |
|
144 |
|
145 unwind_protect::run_frame ("maybe_add_or_del_packages"); |
|
146 } |
|
147 |
|
148 static void |
|
149 update_load_path_dir_path (void) |
|
150 { |
|
151 string_vector old_dirs = Vload_path_dir_path.all_directories (); |
|
152 |
|
153 Vload_path_dir_path = dir_path (Vload_path, Vdefault_load_path); |
|
154 |
|
155 string_vector new_dirs = Vload_path_dir_path.all_directories (); |
|
156 |
|
157 maybe_add_or_del_packages (old_dirs, new_dirs, "PKG_DEL"); |
|
158 |
|
159 if (! error_state) |
|
160 maybe_add_or_del_packages (new_dirs, old_dirs, "PKG_ADD"); |
|
161 } |
|
162 |
|
163 void |
|
164 execute_default_pkg_add_files (void) |
|
165 { |
|
166 string_vector old_dirs; |
|
167 string_vector new_dirs = Vload_path_dir_path.all_directories (); |
|
168 |
|
169 maybe_add_or_del_packages (new_dirs, old_dirs, "PKG_ADD"); |
|
170 } |
|
171 |
3535
|
172 static std::string |
3523
|
173 subst_octave_home (const std::string& s) |
2203
|
174 { |
3523
|
175 std::string retval; |
2203
|
176 |
3523
|
177 std::string prefix = OCTAVE_PREFIX; |
2203
|
178 |
|
179 retval = s; |
|
180 |
|
181 if (Voctave_home != prefix) |
|
182 { |
|
183 int len = prefix.length (); |
|
184 size_t start = 0; |
2522
|
185 while ((start = retval.find (prefix, start)) != NPOS) |
2203
|
186 { |
|
187 retval.replace (start, len, Voctave_home); |
2522
|
188 start += len; |
2203
|
189 } |
|
190 } |
|
191 |
|
192 return retval; |
|
193 } |
|
194 |
|
195 static void |
|
196 set_octave_home (void) |
|
197 { |
3523
|
198 std::string oh = octave_env::getenv ("OCTAVE_HOME"); |
2203
|
199 |
3523
|
200 Voctave_home = oh.empty () ? std::string (OCTAVE_PREFIX) : oh; |
2203
|
201 } |
|
202 |
|
203 static void |
|
204 set_default_info_dir (void) |
|
205 { |
|
206 Vinfo_dir = subst_octave_home (OCTAVE_INFODIR); |
|
207 } |
|
208 |
|
209 static void |
3141
|
210 set_default_data_dir (void) |
|
211 { |
|
212 Vdata_dir = subst_octave_home (OCTAVE_DATADIR); |
|
213 } |
|
214 |
|
215 static void |
|
216 set_default_libexec_dir (void) |
|
217 { |
|
218 Vlibexec_dir = subst_octave_home (OCTAVE_LIBEXECDIR); |
|
219 } |
|
220 |
|
221 static void |
2203
|
222 set_default_arch_lib_dir (void) |
|
223 { |
|
224 Varch_lib_dir = subst_octave_home (OCTAVE_ARCHLIBDIR); |
|
225 } |
|
226 |
|
227 static void |
2439
|
228 set_default_local_arch_lib_dir (void) |
|
229 { |
|
230 Vlocal_arch_lib_dir = subst_octave_home (OCTAVE_LOCALARCHLIBDIR); |
|
231 } |
|
232 |
|
233 static void |
3597
|
234 set_default_local_ver_arch_lib_dir (void) |
|
235 { |
|
236 Vlocal_ver_arch_lib_dir = subst_octave_home (OCTAVE_LOCALVERARCHLIBDIR); |
|
237 } |
|
238 |
|
239 static void |
2203
|
240 set_default_fcn_file_dir (void) |
|
241 { |
|
242 Vfcn_file_dir = subst_octave_home (OCTAVE_FCNFILEDIR); |
|
243 } |
|
244 |
|
245 static void |
|
246 set_default_bin_dir (void) |
|
247 { |
|
248 Vbin_dir = subst_octave_home (OCTAVE_BINDIR); |
|
249 } |
|
250 |
|
251 static void |
4447
|
252 set_default_default_exec_path (void) |
|
253 { |
|
254 Vdefault_exec_path |
|
255 = Vlocal_ver_arch_lib_dir + std::string (SEPCHAR_STR) |
|
256 + Vlocal_arch_lib_dir + std::string (SEPCHAR_STR) |
|
257 + Varch_lib_dir + std::string (SEPCHAR_STR) |
|
258 + Vbin_dir; |
|
259 } |
|
260 |
|
261 static void |
2203
|
262 set_default_exec_path (void) |
|
263 { |
3523
|
264 std::string octave_exec_path = octave_env::getenv ("OCTAVE_EXEC_PATH"); |
2203
|
265 |
2926
|
266 if (octave_exec_path.empty ()) |
2203
|
267 { |
3523
|
268 std::string shell_path = octave_env::getenv ("PATH"); |
2203
|
269 |
2926
|
270 if (! shell_path.empty ()) |
2203
|
271 { |
3523
|
272 Vexec_path = std::string (":"); |
2203
|
273 Vexec_path.append (shell_path); |
|
274 } |
|
275 } |
2926
|
276 else |
3523
|
277 Vexec_path = std::string (octave_exec_path); |
2203
|
278 } |
|
279 |
|
280 static void |
|
281 set_default_path (void) |
|
282 { |
3192
|
283 Vdefault_load_path = subst_octave_home (OCTAVE_FCNFILEPATH); |
2203
|
284 |
3523
|
285 std::string oct_path = octave_env::getenv ("OCTAVE_PATH"); |
2203
|
286 |
3523
|
287 Vload_path = oct_path.empty () ? std::string (":") : oct_path; |
3174
|
288 |
4217
|
289 update_load_path_dir_path (); |
2203
|
290 } |
|
291 |
|
292 static void |
|
293 set_default_info_file (void) |
|
294 { |
3523
|
295 std::string std_info_file = subst_octave_home (OCTAVE_INFOFILE); |
2512
|
296 |
3523
|
297 std::string oct_info_file = octave_env::getenv ("OCTAVE_INFO_FILE"); |
2203
|
298 |
2926
|
299 Vinfo_file = oct_info_file.empty () ? std_info_file : oct_info_file; |
2203
|
300 } |
|
301 |
|
302 static void |
|
303 set_default_info_prog (void) |
|
304 { |
3523
|
305 std::string oct_info_prog = octave_env::getenv ("OCTAVE_INFO_PROGRAM"); |
2203
|
306 |
2926
|
307 if (oct_info_prog.empty ()) |
3141
|
308 Vinfo_prog = "info"; |
2926
|
309 else |
3523
|
310 Vinfo_prog = std::string (oct_info_prog); |
2203
|
311 } |
|
312 |
|
313 static void |
|
314 set_default_editor (void) |
|
315 { |
2993
|
316 Veditor = "emacs"; |
2203
|
317 |
3523
|
318 std::string env_editor = octave_env::getenv ("EDITOR"); |
2203
|
319 |
2926
|
320 if (! env_editor.empty ()) |
|
321 Veditor = env_editor; |
2203
|
322 } |
|
323 |
|
324 static void |
|
325 set_local_site_defaults_file (void) |
|
326 { |
|
327 Vlocal_site_defaults_file = subst_octave_home (OCTAVE_LOCALSTARTUPFILEDIR); |
|
328 Vlocal_site_defaults_file.append ("/octaverc"); |
|
329 } |
|
330 |
|
331 static void |
|
332 set_site_defaults_file (void) |
|
333 { |
|
334 Vsite_defaults_file = subst_octave_home (OCTAVE_STARTUPFILEDIR); |
|
335 Vsite_defaults_file.append ("/octaverc"); |
|
336 } |
|
337 |
3534
|
338 std::string |
3523
|
339 maybe_add_default_load_path (const std::string& pathstring) |
2203
|
340 { |
3523
|
341 std::string retval; |
2203
|
342 |
|
343 if (! pathstring.empty ()) |
|
344 { |
|
345 if (pathstring[0] == SEPCHAR) |
|
346 { |
3192
|
347 retval = Vdefault_load_path; |
2203
|
348 retval.append (pathstring); |
|
349 } |
|
350 else |
|
351 retval = pathstring; |
|
352 |
|
353 if (pathstring[pathstring.length () - 1] == SEPCHAR) |
3192
|
354 retval.append (Vdefault_load_path); |
|
355 |
|
356 size_t pos = 0; |
|
357 do |
|
358 { |
|
359 pos = retval.find ("::"); |
|
360 |
|
361 if (pos != NPOS) |
|
362 retval.insert (pos+1, Vdefault_load_path); |
|
363 } |
|
364 while (pos != NPOS); |
2203
|
365 } |
|
366 |
|
367 return retval; |
|
368 } |
|
369 |
|
370 void |
|
371 install_defaults (void) |
|
372 { |
|
373 // OCTAVE_HOME must be set first! |
|
374 |
|
375 set_octave_home (); |
|
376 |
|
377 set_default_info_dir (); |
|
378 |
3141
|
379 set_default_data_dir (); |
|
380 |
|
381 set_default_libexec_dir (); |
|
382 |
2203
|
383 set_default_arch_lib_dir (); |
|
384 |
2439
|
385 set_default_local_arch_lib_dir (); |
|
386 |
3597
|
387 set_default_local_ver_arch_lib_dir (); |
|
388 |
2203
|
389 set_default_fcn_file_dir (); |
|
390 |
|
391 set_default_bin_dir (); |
|
392 |
4447
|
393 set_default_default_exec_path (); |
|
394 |
2203
|
395 set_default_exec_path (); |
|
396 |
|
397 set_default_path (); |
|
398 |
|
399 set_default_info_file (); |
|
400 |
|
401 set_default_info_prog (); |
|
402 |
|
403 set_default_editor (); |
|
404 |
|
405 set_local_site_defaults_file (); |
|
406 |
|
407 set_site_defaults_file (); |
|
408 } |
|
409 |
4264
|
410 DEFUN (rehash, , , |
|
411 "-*- texinfo -*-\n\ |
|
412 @deftypefn {Built-in Function} {} rehash ()\n\ |
|
413 Reinitialize Octave's @code{LOADPATH} directory cache.\n\ |
|
414 @end deftypefn") |
|
415 { |
|
416 octave_value_list retval; |
|
417 |
|
418 Vload_path_dir_path.rehash (); |
|
419 |
|
420 return retval; |
|
421 } |
|
422 |
2203
|
423 static int |
|
424 editor (void) |
|
425 { |
|
426 int status = 0; |
|
427 |
3523
|
428 std::string s = builtin_string_variable ("EDITOR"); |
2203
|
429 |
|
430 if (s.empty ()) |
|
431 { |
|
432 gripe_invalid_value_specified ("EDITOR"); |
|
433 status = -1; |
|
434 } |
|
435 else |
|
436 Veditor = s; |
|
437 |
|
438 return status; |
|
439 } |
|
440 |
|
441 static int |
|
442 exec_path (void) |
|
443 { |
|
444 int status = 0; |
|
445 |
3523
|
446 std::string s = builtin_string_variable ("EXEC_PATH"); |
2439
|
447 |
|
448 if (s.empty ()) |
2203
|
449 { |
|
450 gripe_invalid_value_specified ("EXEC_PATH"); |
|
451 status = -1; |
|
452 } |
|
453 else |
|
454 { |
2439
|
455 Vexec_path = s; |
|
456 |
3523
|
457 std::string path; |
2203
|
458 |
|
459 int eplen = Vexec_path.length (); |
|
460 |
|
461 if (eplen > 0) |
|
462 { |
2926
|
463 bool prepend = (Vexec_path[0] == ':'); |
|
464 bool append = (eplen > 1 && Vexec_path[eplen-1] == ':'); |
2203
|
465 |
|
466 if (prepend) |
|
467 { |
4447
|
468 path = Vdefault_exec_path + Vexec_path; |
2203
|
469 } |
|
470 else |
|
471 { |
2926
|
472 path = Vexec_path; |
|
473 |
2203
|
474 if (append) |
4447
|
475 path.append (Vdefault_exec_path); |
2203
|
476 } |
|
477 } |
|
478 else |
4447
|
479 path = Vdefault_exec_path; |
2203
|
480 |
2926
|
481 octave_env::putenv ("PATH", path); |
2203
|
482 } |
|
483 |
|
484 return status; |
|
485 } |
|
486 |
|
487 static int |
4447
|
488 default_exec_path (void) |
|
489 { |
|
490 int status = 0; |
|
491 |
|
492 std::string s = builtin_string_variable ("DEFAULT_EXEC_PATH"); |
|
493 |
|
494 if (s.empty ()) |
|
495 { |
|
496 gripe_invalid_value_specified ("DEFAULT_EXEC_PATH"); |
|
497 status = -1; |
|
498 } |
|
499 else |
|
500 { |
|
501 Vdefault_exec_path = s; |
|
502 |
|
503 // Now also update PATH in environment. |
|
504 exec_path (); |
|
505 } |
|
506 |
|
507 return status; |
|
508 } |
|
509 |
|
510 static int |
2203
|
511 imagepath (void) |
|
512 { |
|
513 int status = 0; |
|
514 |
3523
|
515 std::string s = builtin_string_variable ("IMAGEPATH"); |
2203
|
516 |
|
517 if (s.empty ()) |
|
518 { |
|
519 gripe_invalid_value_specified ("IMAGEPATH"); |
|
520 status = -1; |
|
521 } |
|
522 else |
|
523 Vimagepath = s; |
|
524 |
|
525 return status; |
|
526 } |
|
527 |
|
528 static int |
|
529 loadpath (void) |
|
530 { |
|
531 int status = 0; |
|
532 |
3523
|
533 std::string s = builtin_string_variable ("LOADPATH"); |
2203
|
534 |
|
535 if (s.empty ()) |
|
536 { |
|
537 gripe_invalid_value_specified ("LOADPATH"); |
|
538 status = -1; |
|
539 } |
|
540 else |
3174
|
541 { |
3971
|
542 // I'm not sure whether this causes more problems that it |
|
543 // solves... |
|
544 // if (! (s[0] == ':' || s[s.length () - 1] == ':' |
|
545 // || s.find ("::") != NPOS)) |
|
546 // warning ("LOADPATH will ignore default load path"); |
3967
|
547 |
3195
|
548 Vload_path = s; |
3174
|
549 |
4217
|
550 update_load_path_dir_path (); |
|
551 } |
|
552 |
|
553 return status; |
|
554 } |
|
555 |
|
556 static int |
|
557 default_load_path (void) |
|
558 { |
|
559 int status = 0; |
|
560 |
|
561 std::string s = builtin_string_variable ("DEFAULT_LOADPATH"); |
|
562 |
|
563 if (s.empty ()) |
|
564 { |
|
565 gripe_invalid_value_specified ("DEFAULT_LOADPATH"); |
|
566 status = -1; |
|
567 } |
|
568 else |
|
569 { |
|
570 Vdefault_load_path = s; |
|
571 |
|
572 update_load_path_dir_path (); |
3174
|
573 } |
2203
|
574 |
|
575 return status; |
|
576 } |
|
577 |
|
578 void |
|
579 symbols_of_defaults (void) |
|
580 { |
3258
|
581 DEFVAR (EDITOR, Veditor, editor, |
3368
|
582 "-*- texinfo -*-\n\ |
|
583 @defvr {Built-in Variable} EDITOR\n\ |
|
584 A string naming the editor to use with the @code{edit_history} command.\n\ |
|
585 If the environment variable @code{EDITOR} is set when Octave starts, its\n\ |
|
586 value is used as the default. Otherwise, @code{EDITOR} is set to\n\ |
|
587 @code{\"emacs\"}.\n\ |
|
588 @end defvr"); |
2203
|
589 |
3258
|
590 DEFVAR (EXEC_PATH, Vexec_path, exec_path, |
3301
|
591 "-*- texinfo -*-\n\ |
|
592 @defvr {Built-in Variable} EXEC_PATH\n\ |
|
593 The variable @code{EXEC_PATH} is a colon separated list of directories\n\ |
4447
|
594 to search when executing external programs. Its initial value is taken from\n\ |
3301
|
595 the environment variable @code{OCTAVE_EXEC_PATH} (if it exists) or\n\ |
|
596 @code{PATH}, but that value can be overridden by the command line\n\ |
|
597 argument @code{--exec-path PATH}, or by setting the value of\n\ |
|
598 @code{EXEC_PATH} in a startup script. If the value of @code{EXEC_PATH}\n\ |
|
599 begins (ends) with a colon, the directories\n\ |
|
600 \n\ |
|
601 @example\n\ |
|
602 @group\n\ |
|
603 @var{octave-home}/libexec/octave/site/exec/@var{arch}\n\ |
|
604 @var{octave-home}/libexec/octave/@var{version}/exec/@var{arch}\n\ |
|
605 @end group\n\ |
|
606 @end example\n\ |
|
607 \n\ |
|
608 @noindent\n\ |
|
609 are prepended (appended) to @code{EXEC_PATH}, where @var{octave-home}\n\ |
|
610 is the top-level directory where all of Octave is installed\n\ |
|
611 (the default value is @file{@value{OCTAVEHOME}}). If you don't specify\n\ |
|
612 a value for @code{EXEC_PATH} explicitly, these special directories are\n\ |
|
613 prepended to your shell path.\n\ |
|
614 @end defvr"); |
2203
|
615 |
4447
|
616 DEFVAR (DEFAULT_EXEC_PATH, Vdefault_exec_path, default_exec_path, |
|
617 "-*- texinfo -*-\n\ |
|
618 @defvr {Built-in Variable} DEFAULT_EXEC_PATH\n\ |
|
619 A colon separated list of directories in which to search when executing\n\ |
|
620 external programs. The value of this variable is automatically\n\ |
|
621 substituted for leading, trailing, or doubled colons that appear in the\n\ |
|
622 built-in variable @code{EXEC_PATH}.\n\ |
|
623 @end defvr"); |
|
624 |
3258
|
625 DEFVAR (LOADPATH, Vload_path, loadpath, |
3371
|
626 "-*- texinfo -*-\n\ |
|
627 @defvr {Built-in Variable} LOADPATH\n\ |
|
628 A colon separated list of directories in which to search for function\n\ |
|
629 files. @xref{Functions and Scripts}. The value of @code{LOADPATH}\n\ |
|
630 overrides the environment variable @code{OCTAVE_PATH}. @xref{Installation}.\n\ |
|
631 \n\ |
|
632 @code{LOADPATH} is now handled in the same way as @TeX{} handles\n\ |
|
633 @code{TEXINPUTS}. Leading, trailing, or doubled colons that appear in\n\ |
|
634 @code{LOADPATH} are replaced by the value of @code{DEFAULT_LOADPATH}.\n\ |
|
635 The default value of @code{LOADPATH} is @code{\":\"}, which tells Octave\n\ |
|
636 to search in the directories specified by @code{DEFAULT_LOADPATH}.\n\ |
|
637 \n\ |
|
638 In addition, if any path element ends in @samp{//}, that directory and\n\ |
|
639 all subdirectories it contains are searched recursively for function\n\ |
|
640 files. This can result in a slight delay as Octave caches the lists of\n\ |
|
641 files found in the @code{LOADPATH} the first time Octave searches for a\n\ |
|
642 function. After that, searching is usually much faster because Octave\n\ |
|
643 normally only needs to search its internal cache for files.\n\ |
|
644 \n\ |
|
645 To improve performance of recursive directory searching, it is best for\n\ |
|
646 each directory that is to be searched recursively to contain\n\ |
|
647 @emph{either} additional subdirectories @emph{or} function files, but\n\ |
|
648 not a mixture of both.\n\ |
|
649 \n\ |
3402
|
650 @xref{Organization of Functions}, for a description of the function file\n\ |
3371
|
651 directories that are distributed with Octave.\n\ |
|
652 @end defvr"); |
2203
|
653 |
4217
|
654 DEFVAR (DEFAULT_LOADPATH, Vdefault_load_path, default_load_path, |
3371
|
655 "-*- texinfo -*-\n\ |
|
656 @defvr {Built-in Variable} DEFAULT_LOADPATH\n\ |
|
657 A colon separated list of directories in which to search for function\n\ |
4447
|
658 files. The value of this variable is automatically substituted for\n\ |
|
659 leading, trailing, or doubled colons that appear in the built-in\n\ |
|
660 variable @code{LOADPATH}.\n\ |
3371
|
661 @end defvr"); |
3192
|
662 |
3258
|
663 DEFVAR (IMAGEPATH, OCTAVE_IMAGEPATH, imagepath, |
3373
|
664 "-*- texinfo -*-\n\ |
3532
|
665 @defvr {Built-in Variable} IMAGEPATH\n\ |
3373
|
666 A colon separated list of directories in which to search for image\n\ |
|
667 files.\n\ |
|
668 @end defvr"); |
2203
|
669 |
3141
|
670 DEFCONST (OCTAVE_HOME, Voctave_home, |
3446
|
671 "-*- texinfo -*-\n\ |
|
672 @defvr {Built-in Variable} OCTAVE_HOME\n\ |
|
673 The name of the top-level Octave installation directory.\n\ |
|
674 @end defvr"); |
2831
|
675 |
3141
|
676 DEFCONSTX ("OCTAVE_VERSION", SBV_OCTAVE_VERSION, OCTAVE_VERSION, |
3301
|
677 "-*- texinfo -*-\n\ |
3373
|
678 @defvr {Built-in Variable} OCTAVE_VERSION\n\ |
3301
|
679 The version number of Octave, as a string.\n\ |
|
680 @end defvr"); |
3446
|
681 |
2203
|
682 } |
|
683 |
|
684 /* |
|
685 ;;; Local Variables: *** |
|
686 ;;; mode: C++ *** |
|
687 ;;; End: *** |
|
688 */ |