annotate libinterp/corefcn/defaults.cc @ 20654:b65888ec820e draft default tip gccjit

dmalcom gcc jit import
author Stefan Mahr <dac922@gmx.de>
date Fri, 27 Feb 2015 16:59:36 +0100
parents 4f45eaf83908
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
1 /*
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
2
19731
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 19226
diff changeset
3 Copyright (C) 1996-2015 John W. Eaton
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
4
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
6
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6276
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6276
diff changeset
10 option) any later version.
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
11
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
15 for more details.
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
16
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6276
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6276
diff changeset
19 <http://www.gnu.org/licenses/>.
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
20
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
21 */
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
22
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
23 #ifdef HAVE_CONFIG_H
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
24 #include <config.h>
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
25 #endif
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
26
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
27 #include <cstdlib>
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
28
6114
a0dafb51dd06 [project @ 2006-10-27 14:02:16 by jwe]
jwe
parents: 5909
diff changeset
29 #include <algorithm>
3503
d14c483b3c12 [project @ 2000-02-01 04:06:07 by jwe]
jwe
parents: 3446
diff changeset
30 #include <iostream>
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
31 #include <string>
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
32
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
33 #include <sys/types.h>
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
34 #include <unistd.h>
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
35
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
36 #include "dir-ops.h"
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
37 #include "oct-env.h"
4217
301cc4cf87e9 [project @ 2002-12-05 03:33:01 by jwe]
jwe
parents: 3971
diff changeset
38 #include "file-stat.h"
3174
390d5e396682 [project @ 1998-05-04 16:36:17 by jwe]
jwe
parents: 3141
diff changeset
39 #include "pathsearch.h"
4217
301cc4cf87e9 [project @ 2002-12-05 03:33:01 by jwe]
jwe
parents: 3971
diff changeset
40 #include "str-vec.h"
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
41
2492
06595bc7f2d0 [project @ 1996-11-09 00:13:50 by jwe]
jwe
parents: 2466
diff changeset
42 #include <defaults.h>
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
43 #include "defun.h"
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
44 #include "error.h"
3040
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2993
diff changeset
45 #include "file-ops.h"
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
46 #include "gripes.h"
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
47 #include "help.h"
5395
8db4eb48f546 [project @ 2005-06-16 20:19:18 by jwe]
jwe
parents: 5333
diff changeset
48 #include "input.h"
5832
5e41e06f6a78 [project @ 2006-05-26 21:41:32 by jwe]
jwe
parents: 5823
diff changeset
49 #include "load-path.h"
3185
9580887dd160 [project @ 1998-09-26 02:45:55 by jwe]
jwe
parents: 3174
diff changeset
50 #include "oct-obj.h"
2390
c2c1482c34c8 [project @ 1996-10-12 19:13:23 by jwe]
jwe
parents: 2203
diff changeset
51 #include "ov.h"
4217
301cc4cf87e9 [project @ 2002-12-05 03:33:01 by jwe]
jwe
parents: 3971
diff changeset
52 #include "parse.h"
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
53 #include "toplev.h"
4217
301cc4cf87e9 [project @ 2002-12-05 03:33:01 by jwe]
jwe
parents: 3971
diff changeset
54 #include "unwind-prot.h"
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
55 #include "variables.h"
2492
06595bc7f2d0 [project @ 1996-11-09 00:13:50 by jwe]
jwe
parents: 2466
diff changeset
56 #include <version.h>
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
57
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
58 std::string Voctave_home;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
59
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
60 std::string Vbin_dir;
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
61 std::string Vinfo_dir;
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
62 std::string Vdata_dir;
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
63 std::string Vlibexec_dir;
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
64 std::string Varch_lib_dir;
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
65 std::string Vlocal_arch_lib_dir;
5909
a6a2423a9c25 [project @ 2006-07-27 19:35:22 by jwe]
jwe
parents: 5832
diff changeset
66 std::string Vlocal_api_arch_lib_dir;
3597
26662775f4e9 [project @ 2000-02-12 02:24:41 by jwe]
jwe
parents: 3535
diff changeset
67 std::string Vlocal_ver_arch_lib_dir;
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
68
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
69 std::string Vlocal_ver_oct_file_dir;
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
70 std::string Vlocal_api_oct_file_dir;
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
71 std::string Vlocal_oct_file_dir;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
72
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
73 std::string Vlocal_ver_fcn_file_dir;
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
74 std::string Vlocal_api_fcn_file_dir;
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
75 std::string Vlocal_fcn_file_dir;
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
76
19066
d902542221c8 new data directory for storing data files we distribute
John W. Eaton <jwe@octave.org>
parents: 17991
diff changeset
77 std::string Voct_data_dir;
15157
a87fa9132b72 provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents: 15088
diff changeset
78 std::string Voct_etc_dir;
15971
e27d9b9b71f4 gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents: 15478
diff changeset
79 std::string Voct_locale_dir;
15157
a87fa9132b72 provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents: 15088
diff changeset
80
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
81 std::string Voct_file_dir;
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
82 std::string Vfcn_file_dir;
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
83
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
84 std::string Vimage_dir;
4447
252b9162c084 [project @ 2003-07-08 18:37:53 by jwe]
jwe
parents: 4264
diff changeset
85
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
86 // The path that will be searched for programs that we execute.
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
87 // (--exec-path path)
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
88 static std::string VEXEC_PATH;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
89
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
90 // Name of the editor to be invoked by the edit_history command.
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
91 std::string VEDITOR;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
92
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
93 static std::string VIMAGE_PATH;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
94
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
95 std::string Vlocal_site_defaults_file;
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
96 std::string Vsite_defaults_file;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
97
15470
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
98 std::string Vbuilt_in_docstrings_file;
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
99
6274
d42abdfcb8e9 [project @ 2007-02-07 07:22:02 by jwe]
jwe
parents: 6228
diff changeset
100 std::string
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
101 subst_octave_home (const std::string& s)
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
102 {
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
103 std::string retval;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
104
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
105 std::string prefix = OCTAVE_PREFIX;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
106
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
107 retval = s;
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
108
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
109 if (Voctave_home != prefix)
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
110 {
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 4776
diff changeset
111 octave_idx_type len = prefix.length ();
6276
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6274
diff changeset
112
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6274
diff changeset
113 if (s.substr (0, len) == prefix)
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10182
diff changeset
114 retval.replace (0, len, Voctave_home);
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
115 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
116
8007
a2ab20ba78f7 make file_ops a proper singleton class
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
117 if (file_ops::dir_sep_char () != '/')
a2ab20ba78f7 make file_ops a proper singleton class
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
118 std::replace (retval.begin (), retval.end (), '/',
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10182
diff changeset
119 file_ops::dir_sep_char ());
6114
a0dafb51dd06 [project @ 2006-10-27 14:02:16 by jwe]
jwe
parents: 5909
diff changeset
120
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
121 return retval;
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
122 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
123
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
124 static void
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
125 set_octave_home (void)
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
126 {
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
127 std::string oh = octave_env::getenv ("OCTAVE_HOME");
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
128
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
129 Voctave_home = oh.empty () ? std::string (OCTAVE_PREFIX) : oh;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
130 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
131
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
132 static void
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
133 set_default_info_dir (void)
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
134 {
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
135 Vinfo_dir = subst_octave_home (OCTAVE_INFODIR);
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
136 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
137
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
138 static void
3141
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
139 set_default_data_dir (void)
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
140 {
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
141 Vdata_dir = subst_octave_home (OCTAVE_DATADIR);
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
142 }
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
143
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
144 static void
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
145 set_default_libexec_dir (void)
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
146 {
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
147 Vlibexec_dir = subst_octave_home (OCTAVE_LIBEXECDIR);
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
148 }
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
149
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
150 static void
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
151 set_default_arch_lib_dir (void)
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
152 {
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
153 Varch_lib_dir = subst_octave_home (OCTAVE_ARCHLIBDIR);
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
154 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
155
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
156 static void
2439
dc870b8b229f [project @ 1996-10-30 07:57:31 by jwe]
jwe
parents: 2390
diff changeset
157 set_default_local_arch_lib_dir (void)
dc870b8b229f [project @ 1996-10-30 07:57:31 by jwe]
jwe
parents: 2390
diff changeset
158 {
dc870b8b229f [project @ 1996-10-30 07:57:31 by jwe]
jwe
parents: 2390
diff changeset
159 Vlocal_arch_lib_dir = subst_octave_home (OCTAVE_LOCALARCHLIBDIR);
dc870b8b229f [project @ 1996-10-30 07:57:31 by jwe]
jwe
parents: 2390
diff changeset
160 }
dc870b8b229f [project @ 1996-10-30 07:57:31 by jwe]
jwe
parents: 2390
diff changeset
161
dc870b8b229f [project @ 1996-10-30 07:57:31 by jwe]
jwe
parents: 2390
diff changeset
162 static void
5909
a6a2423a9c25 [project @ 2006-07-27 19:35:22 by jwe]
jwe
parents: 5832
diff changeset
163 set_default_local_api_arch_lib_dir (void)
a6a2423a9c25 [project @ 2006-07-27 19:35:22 by jwe]
jwe
parents: 5832
diff changeset
164 {
a6a2423a9c25 [project @ 2006-07-27 19:35:22 by jwe]
jwe
parents: 5832
diff changeset
165 Vlocal_api_arch_lib_dir = subst_octave_home (OCTAVE_LOCALAPIARCHLIBDIR);
a6a2423a9c25 [project @ 2006-07-27 19:35:22 by jwe]
jwe
parents: 5832
diff changeset
166 }
a6a2423a9c25 [project @ 2006-07-27 19:35:22 by jwe]
jwe
parents: 5832
diff changeset
167
a6a2423a9c25 [project @ 2006-07-27 19:35:22 by jwe]
jwe
parents: 5832
diff changeset
168 static void
3597
26662775f4e9 [project @ 2000-02-12 02:24:41 by jwe]
jwe
parents: 3535
diff changeset
169 set_default_local_ver_arch_lib_dir (void)
26662775f4e9 [project @ 2000-02-12 02:24:41 by jwe]
jwe
parents: 3535
diff changeset
170 {
26662775f4e9 [project @ 2000-02-12 02:24:41 by jwe]
jwe
parents: 3535
diff changeset
171 Vlocal_ver_arch_lib_dir = subst_octave_home (OCTAVE_LOCALVERARCHLIBDIR);
26662775f4e9 [project @ 2000-02-12 02:24:41 by jwe]
jwe
parents: 3535
diff changeset
172 }
26662775f4e9 [project @ 2000-02-12 02:24:41 by jwe]
jwe
parents: 3535
diff changeset
173
26662775f4e9 [project @ 2000-02-12 02:24:41 by jwe]
jwe
parents: 3535
diff changeset
174 static void
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
175 set_default_local_ver_oct_file_dir (void)
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
176 {
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
177 Vlocal_ver_oct_file_dir = subst_octave_home (OCTAVE_LOCALVEROCTFILEDIR);
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
178 }
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
179
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
180 static void
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
181 set_default_local_api_oct_file_dir (void)
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
182 {
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
183 Vlocal_api_oct_file_dir = subst_octave_home (OCTAVE_LOCALAPIOCTFILEDIR);
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
184 }
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
185
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
186 static void
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
187 set_default_local_oct_file_dir (void)
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
188 {
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
189 Vlocal_oct_file_dir = subst_octave_home (OCTAVE_LOCALOCTFILEDIR);
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
190 }
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
191
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
192 static void
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
193 set_default_local_ver_fcn_file_dir (void)
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
194 {
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
195 Vlocal_ver_fcn_file_dir = subst_octave_home (OCTAVE_LOCALVERFCNFILEDIR);
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
196 }
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
197
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
198 static void
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
199 set_default_local_api_fcn_file_dir (void)
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
200 {
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
201 Vlocal_api_fcn_file_dir = subst_octave_home (OCTAVE_LOCALAPIFCNFILEDIR);
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
202 }
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
203
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
204 static void
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
205 set_default_local_fcn_file_dir (void)
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
206 {
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
207 Vlocal_fcn_file_dir = subst_octave_home (OCTAVE_LOCALFCNFILEDIR);
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
208 }
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
209
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
210 static void
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
211 set_default_fcn_file_dir (void)
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
212 {
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
213 Vfcn_file_dir = subst_octave_home (OCTAVE_FCNFILEDIR);
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
214 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
215
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
216 static void
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
217 set_default_image_dir (void)
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
218 {
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
219 Vimage_dir = subst_octave_home (OCTAVE_IMAGEDIR);
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
220 }
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
221
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
222 static void
19066
d902542221c8 new data directory for storing data files we distribute
John W. Eaton <jwe@octave.org>
parents: 17991
diff changeset
223 set_default_oct_data_dir (void)
d902542221c8 new data directory for storing data files we distribute
John W. Eaton <jwe@octave.org>
parents: 17991
diff changeset
224 {
d902542221c8 new data directory for storing data files we distribute
John W. Eaton <jwe@octave.org>
parents: 17991
diff changeset
225 Voct_data_dir = subst_octave_home (OCTAVE_OCTDATADIR);
d902542221c8 new data directory for storing data files we distribute
John W. Eaton <jwe@octave.org>
parents: 17991
diff changeset
226 }
d902542221c8 new data directory for storing data files we distribute
John W. Eaton <jwe@octave.org>
parents: 17991
diff changeset
227
d902542221c8 new data directory for storing data files we distribute
John W. Eaton <jwe@octave.org>
parents: 17991
diff changeset
228 static void
15157
a87fa9132b72 provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents: 15088
diff changeset
229 set_default_oct_etc_dir (void)
a87fa9132b72 provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents: 15088
diff changeset
230 {
a87fa9132b72 provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents: 15088
diff changeset
231 Voct_etc_dir = subst_octave_home (OCTAVE_OCTETCDIR);
a87fa9132b72 provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents: 15088
diff changeset
232 }
a87fa9132b72 provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents: 15088
diff changeset
233
a87fa9132b72 provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents: 15088
diff changeset
234 static void
15971
e27d9b9b71f4 gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents: 15478
diff changeset
235 set_default_oct_locale_dir (void)
e27d9b9b71f4 gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents: 15478
diff changeset
236 {
e27d9b9b71f4 gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents: 15478
diff changeset
237 Voct_locale_dir = subst_octave_home (OCTAVE_OCTLOCALEDIR);
e27d9b9b71f4 gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents: 15478
diff changeset
238 }
e27d9b9b71f4 gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents: 15478
diff changeset
239
e27d9b9b71f4 gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents: 15478
diff changeset
240 static void
5397
b12c0f920da0 [project @ 2005-06-17 07:52:28 by jwe]
jwe
parents: 5395
diff changeset
241 set_default_oct_file_dir (void)
b12c0f920da0 [project @ 2005-06-17 07:52:28 by jwe]
jwe
parents: 5395
diff changeset
242 {
b12c0f920da0 [project @ 2005-06-17 07:52:28 by jwe]
jwe
parents: 5395
diff changeset
243 Voct_file_dir = subst_octave_home (OCTAVE_OCTFILEDIR);
b12c0f920da0 [project @ 2005-06-17 07:52:28 by jwe]
jwe
parents: 5395
diff changeset
244 }
b12c0f920da0 [project @ 2005-06-17 07:52:28 by jwe]
jwe
parents: 5395
diff changeset
245
b12c0f920da0 [project @ 2005-06-17 07:52:28 by jwe]
jwe
parents: 5395
diff changeset
246 static void
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
247 set_default_bin_dir (void)
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
248 {
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
249 Vbin_dir = subst_octave_home (OCTAVE_BINDIR);
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
250 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
251
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
252 void
11294
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
253 set_exec_path (const std::string& path_arg)
4447
252b9162c084 [project @ 2003-07-08 18:37:53 by jwe]
jwe
parents: 4264
diff changeset
254 {
11294
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
255 std::string tpath = path_arg;
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
256
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
257 if (tpath.empty ())
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
258 tpath = octave_env::getenv ("OCTAVE_EXEC_PATH");
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
259
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
260 if (tpath.empty ())
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
261 tpath = Vlocal_ver_arch_lib_dir + dir_path::path_sep_str ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
262 + Vlocal_api_arch_lib_dir + dir_path::path_sep_str ()
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
263 + Vlocal_arch_lib_dir + dir_path::path_sep_str ()
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
264 + Varch_lib_dir + dir_path::path_sep_str ()
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
265 + Vbin_dir;
11294
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
266
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
267 VEXEC_PATH = tpath;
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
268
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
269 // FIXME: should we really be modifying PATH in the environment?
11294
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
270 // The way things are now, Octave will ignore directories set in the
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
271 // PATH with calls like
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
272 //
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
273 // setenv ("PATH", "/my/path");
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
274 //
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
275 // To fix this, I think Octave should be searching the combination of
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
276 // PATH and EXEC_PATH for programs that it executes instead of setting
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
277 // the PATH in the environment and relying on the shell to do the
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
278 // searching.
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
279
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
280 // This is static so that even if set_exec_path is called more than
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
281 // once, shell_path is the original PATH from the environment,
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
282 // before we start modifying it.
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
283 static std::string shell_path = octave_env::getenv ("PATH");
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
284
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
285 if (! shell_path.empty ())
11294
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
286 tpath = shell_path + dir_path::path_sep_str () + tpath;
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
287
11294
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
288 octave_env::putenv ("PATH", tpath);
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
289 }
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
290
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
291 void
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
292 set_image_path (const std::string& path)
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
293 {
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
294 VIMAGE_PATH = ".";
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
295
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
296 std::string tpath = path;
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
297
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
298 if (tpath.empty ())
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
299 tpath = octave_env::getenv ("OCTAVE_IMAGE_PATH");
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
300
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
301 if (! tpath.empty ())
8008
4d13a7a2f6ab dir_path: use singleton class for static data members
John W. Eaton <jwe@octave.org>
parents: 8007
diff changeset
302 VIMAGE_PATH += dir_path::path_sep_str () + tpath;
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
303
5832
5e41e06f6a78 [project @ 2006-05-26 21:41:32 by jwe]
jwe
parents: 5823
diff changeset
304 tpath = genpath (Vimage_dir, "");
5e41e06f6a78 [project @ 2006-05-26 21:41:32 by jwe]
jwe
parents: 5823
diff changeset
305
5e41e06f6a78 [project @ 2006-05-26 21:41:32 by jwe]
jwe
parents: 5823
diff changeset
306 if (! tpath.empty ())
8008
4d13a7a2f6ab dir_path: use singleton class for static data members
John W. Eaton <jwe@octave.org>
parents: 8007
diff changeset
307 VIMAGE_PATH += dir_path::path_sep_str () + tpath;
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
308 }
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
309
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
310 static void
8865
eace5649a8b5 set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents: 8008
diff changeset
311 set_default_doc_cache_file (void)
eace5649a8b5 set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents: 8008
diff changeset
312 {
15478
b1ff8c83e232 set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15473
diff changeset
313 if (Vdoc_cache_file.empty ())
b1ff8c83e232 set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15473
diff changeset
314 {
b1ff8c83e232 set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15473
diff changeset
315 std::string def_file = subst_octave_home (OCTAVE_DOC_CACHE_FILE);
8865
eace5649a8b5 set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents: 8008
diff changeset
316
15478
b1ff8c83e232 set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15473
diff changeset
317 std::string env_file = octave_env::getenv ("OCTAVE_DOC_CACHE_FILE");
8865
eace5649a8b5 set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents: 8008
diff changeset
318
15478
b1ff8c83e232 set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15473
diff changeset
319 Vdoc_cache_file = env_file.empty () ? def_file : env_file;
b1ff8c83e232 set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15473
diff changeset
320 }
8865
eace5649a8b5 set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents: 8008
diff changeset
321 }
eace5649a8b5 set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents: 8008
diff changeset
322
eace5649a8b5 set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents: 8008
diff changeset
323 static void
14614
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
324 set_default_texi_macros_file (void)
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
325 {
15478
b1ff8c83e232 set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15473
diff changeset
326 if (Vtexi_macros_file.empty ())
b1ff8c83e232 set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15473
diff changeset
327 {
b1ff8c83e232 set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15473
diff changeset
328 std::string def_file = subst_octave_home (OCTAVE_TEXI_MACROS_FILE);
14614
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
329
15478
b1ff8c83e232 set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15473
diff changeset
330 std::string env_file = octave_env::getenv ("OCTAVE_TEXI_MACROS_FILE");
14614
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
331
15478
b1ff8c83e232 set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15473
diff changeset
332 Vtexi_macros_file = env_file.empty () ? def_file : env_file;
b1ff8c83e232 set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15473
diff changeset
333 }
14614
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
334 }
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
335
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
336 static void
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
337 set_default_info_file (void)
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
338 {
15473
457a2ff2a71b set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15470
diff changeset
339 if (Vinfo_file.empty ())
457a2ff2a71b set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15470
diff changeset
340 {
457a2ff2a71b set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15470
diff changeset
341 std::string std_info_file = subst_octave_home (OCTAVE_INFOFILE);
2512
fda09c1e787e [project @ 1996-11-14 08:39:41 by jwe]
jwe
parents: 2492
diff changeset
342
15473
457a2ff2a71b set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15470
diff changeset
343 std::string oct_info_file = octave_env::getenv ("OCTAVE_INFO_FILE");
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
344
15473
457a2ff2a71b set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15470
diff changeset
345 Vinfo_file = oct_info_file.empty () ? std_info_file : oct_info_file;
457a2ff2a71b set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15470
diff changeset
346 }
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
347 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
348
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
349 static void
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
350 set_default_info_prog (void)
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
351 {
15473
457a2ff2a71b set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15470
diff changeset
352 if (Vinfo_program.empty ())
457a2ff2a71b set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15470
diff changeset
353 {
457a2ff2a71b set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15470
diff changeset
354 std::string oct_info_prog = octave_env::getenv ("OCTAVE_INFO_PROGRAM");
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
355
15473
457a2ff2a71b set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15470
diff changeset
356 if (oct_info_prog.empty ())
457a2ff2a71b set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15470
diff changeset
357 Vinfo_program = "info";
457a2ff2a71b set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15470
diff changeset
358 else
457a2ff2a71b set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15470
diff changeset
359 Vinfo_program = std::string (oct_info_prog);
457a2ff2a71b set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents: 15470
diff changeset
360 }
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
361 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
362
4773
ccfbd6047a54 [project @ 2004-02-16 19:02:32 by jwe]
jwe
parents: 4486
diff changeset
363 static void
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
364 set_default_editor (void)
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
365 {
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
366 VEDITOR = "emacs";
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
367
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
368 std::string env_editor = octave_env::getenv ("EDITOR");
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
369
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
370 if (! env_editor.empty ())
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
371 VEDITOR = env_editor;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
372 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
373
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
374 static void
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
375 set_local_site_defaults_file (void)
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
376 {
9132
eb1747dbd360 Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
377 std::string lsf = octave_env::getenv ("OCTAVE_SITE_INITFILE");
5781
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5780
diff changeset
378
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5780
diff changeset
379 if (lsf.empty ())
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5780
diff changeset
380 {
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
381 Vlocal_site_defaults_file
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
382 = subst_octave_home (OCTAVE_LOCALSTARTUPFILEDIR);
5781
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5780
diff changeset
383 Vlocal_site_defaults_file.append ("/octaverc");
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5780
diff changeset
384 }
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5780
diff changeset
385 else
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5780
diff changeset
386 Vlocal_site_defaults_file = lsf;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
387 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
388
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
389 static void
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
390 set_site_defaults_file (void)
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
391 {
9132
eb1747dbd360 Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
392 std::string sf = octave_env::getenv ("OCTAVE_VERSION_INITFILE");
5781
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5780
diff changeset
393
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5780
diff changeset
394 if (sf.empty ())
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5780
diff changeset
395 {
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5780
diff changeset
396 Vsite_defaults_file = subst_octave_home (OCTAVE_STARTUPFILEDIR);
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5780
diff changeset
397 Vsite_defaults_file.append ("/octaverc");
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5780
diff changeset
398 }
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5780
diff changeset
399 else
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5780
diff changeset
400 Vsite_defaults_file = sf;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
401 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
402
15470
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
403 static void
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
404 set_built_in_docstrings_file (void)
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
405 {
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
406 if (Vbuilt_in_docstrings_file.empty ())
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
407 {
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
408 std::string df = octave_env::getenv ("OCTAVE_BUILT_IN_DOCSTRINGS_FILE");
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
409
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
410 if (df.empty ())
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
411 Vbuilt_in_docstrings_file
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
412 = Voct_etc_dir + file_ops::dir_sep_str () + "built-in-docstrings";
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
413 else
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
414 Vbuilt_in_docstrings_file = df;
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
415 }
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
416 }
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
417
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
418 void
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
419 install_defaults (void)
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
420 {
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
421 // OCTAVE_HOME must be set first!
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
422
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
423 set_octave_home ();
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
424
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
425 set_default_info_dir ();
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
426
3141
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
427 set_default_data_dir ();
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
428
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
429 set_default_libexec_dir ();
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
430
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
431 set_default_arch_lib_dir ();
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
432
5909
a6a2423a9c25 [project @ 2006-07-27 19:35:22 by jwe]
jwe
parents: 5832
diff changeset
433 set_default_local_ver_arch_lib_dir ();
a6a2423a9c25 [project @ 2006-07-27 19:35:22 by jwe]
jwe
parents: 5832
diff changeset
434 set_default_local_api_arch_lib_dir ();
2439
dc870b8b229f [project @ 1996-10-30 07:57:31 by jwe]
jwe
parents: 2390
diff changeset
435 set_default_local_arch_lib_dir ();
dc870b8b229f [project @ 1996-10-30 07:57:31 by jwe]
jwe
parents: 2390
diff changeset
436
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
437 set_default_local_ver_oct_file_dir ();
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
438 set_default_local_api_oct_file_dir ();
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
439 set_default_local_oct_file_dir ();
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
440
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
441 set_default_local_ver_fcn_file_dir ();
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
442 set_default_local_api_fcn_file_dir ();
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
443 set_default_local_fcn_file_dir ();
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
444
19066
d902542221c8 new data directory for storing data files we distribute
John W. Eaton <jwe@octave.org>
parents: 17991
diff changeset
445 set_default_oct_data_dir ();
15157
a87fa9132b72 provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents: 15088
diff changeset
446 set_default_oct_etc_dir ();
15971
e27d9b9b71f4 gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents: 15478
diff changeset
447 set_default_oct_locale_dir ();
15157
a87fa9132b72 provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents: 15088
diff changeset
448
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
449 set_default_fcn_file_dir ();
5397
b12c0f920da0 [project @ 2005-06-17 07:52:28 by jwe]
jwe
parents: 5395
diff changeset
450 set_default_oct_file_dir ();
b12c0f920da0 [project @ 2005-06-17 07:52:28 by jwe]
jwe
parents: 5395
diff changeset
451
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
452 set_default_image_dir ();
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
453
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
454 set_default_bin_dir ();
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
455
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
456 set_exec_path ();
4447
252b9162c084 [project @ 2003-07-08 18:37:53 by jwe]
jwe
parents: 4264
diff changeset
457
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
458 set_image_path ();
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
459
8865
eace5649a8b5 set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents: 8008
diff changeset
460 set_default_doc_cache_file ();
eace5649a8b5 set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents: 8008
diff changeset
461
14614
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
462 set_default_texi_macros_file ();
4e9dc46d4125 handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents: 14429
diff changeset
463
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
464 set_default_info_file ();
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
465
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
466 set_default_info_prog ();
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
467
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
468 set_default_editor ();
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
469
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
470 set_local_site_defaults_file ();
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
471
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
472 set_site_defaults_file ();
15470
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
473
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
474 set_built_in_docstrings_file ();
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
475 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
476
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
477 DEFUN (EDITOR, args, nargout,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
478 "-*- texinfo -*-\n\
10840
89f4d7e294cc Grammarcheck .cc files
Rik <octave@nomad.inbox5.com>
parents: 10315
diff changeset
479 @deftypefn {Built-in Function} {@var{val} =} EDITOR ()\n\
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
480 @deftypefnx {Built-in Function} {@var{old_val} =} EDITOR (@var{new_val})\n\
13951
79aa00a94e9e doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents: 12855
diff changeset
481 @deftypefnx {Built-in Function} {} EDITOR (@var{new_val}, \"local\")\n\
17991
22187db555cf Remove editor option from edit() and use only EDITOR() (bug #40600)
Carnë Draug <carandraug@octave.org>
parents: 17787
diff changeset
482 Query or set the internal variable that specifies the default text editor.\n\
22187db555cf Remove editor option from edit() and use only EDITOR() (bug #40600)
Carnë Draug <carandraug@octave.org>
parents: 17787
diff changeset
483 \n\
22187db555cf Remove editor option from edit() and use only EDITOR() (bug #40600)
Carnë Draug <carandraug@octave.org>
parents: 17787
diff changeset
484 The default value is taken from the environment variable @w{@env{EDITOR}}\n\
20207
4f45eaf83908 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19731
diff changeset
485 when Octave starts. If the environment variable is not initialized,\n\
4f45eaf83908 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19731
diff changeset
486 @w{@env{EDITOR}} will be set to @qcode{\"emacs\"}.\n\
13951
79aa00a94e9e doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents: 12855
diff changeset
487 \n\
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 16926
diff changeset
488 When called from inside a function with the @qcode{\"local\"} option, the\n\
20207
4f45eaf83908 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19731
diff changeset
489 variable is changed locally for the function and any subroutines it calls.\n\
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 16926
diff changeset
490 The original variable value is restored when exiting the function.\n\
16926
23f6852052bb defaults.cc: refer to more functions in the seealso section of help text.
Carnë Draug <carandraug@octave.org>
parents: 16892
diff changeset
491 \n\
17991
22187db555cf Remove editor option from edit() and use only EDITOR() (bug #40600)
Carnë Draug <carandraug@octave.org>
parents: 17787
diff changeset
492 @seealso{edit, edit_history}\n\
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
493 @end deftypefn")
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
494 {
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
495 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (EDITOR);
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
496 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
497
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
498 /*
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
499 %!test
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
500 %! orig_val = EDITOR ();
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
501 %! old_val = EDITOR ("X");
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
502 %! assert (orig_val, old_val);
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
503 %! assert (EDITOR (), "X");
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
504 %! EDITOR (orig_val);
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
505 %! assert (EDITOR (), orig_val);
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
506
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
507 %!error (EDITOR (1, 2))
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
508 */
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
509
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
510 DEFUN (EXEC_PATH, args, nargout,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
511 "-*- texinfo -*-\n\
10840
89f4d7e294cc Grammarcheck .cc files
Rik <octave@nomad.inbox5.com>
parents: 10315
diff changeset
512 @deftypefn {Built-in Function} {@var{val} =} EXEC_PATH ()\n\
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
513 @deftypefnx {Built-in Function} {@var{old_val} =} EXEC_PATH (@var{new_val})\n\
13951
79aa00a94e9e doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents: 12855
diff changeset
514 @deftypefnx {Built-in Function} {} EXEC_PATH (@var{new_val}, \"local\")\n\
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
515 Query or set the internal variable that specifies a colon separated\n\
11294
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
516 list of directories to append to the shell PATH when executing external\n\
20207
4f45eaf83908 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19731
diff changeset
517 programs.\n\
4f45eaf83908 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19731
diff changeset
518 \n\
4f45eaf83908 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19731
diff changeset
519 The initial value of is taken from the environment variable\n\
4f45eaf83908 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19731
diff changeset
520 @w{@env{OCTAVE_EXEC_PATH}}, but that value can be overridden by the command\n\
4f45eaf83908 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19731
diff changeset
521 line argument @option{--exec-path PATH}.\n\
13951
79aa00a94e9e doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents: 12855
diff changeset
522 \n\
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 16926
diff changeset
523 When called from inside a function with the @qcode{\"local\"} option, the\n\
20207
4f45eaf83908 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19731
diff changeset
524 variable is changed locally for the function and any subroutines it calls.\n\
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 16926
diff changeset
525 The original variable value is restored when exiting the function.\n\
16926
23f6852052bb defaults.cc: refer to more functions in the seealso section of help text.
Carnë Draug <carandraug@octave.org>
parents: 16892
diff changeset
526 \n\
23f6852052bb defaults.cc: refer to more functions in the seealso section of help text.
Carnë Draug <carandraug@octave.org>
parents: 16892
diff changeset
527 @seealso{IMAGE_PATH, OCTAVE_HOME}\n\
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
528 @end deftypefn")
4217
301cc4cf87e9 [project @ 2002-12-05 03:33:01 by jwe]
jwe
parents: 3971
diff changeset
529 {
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
530 octave_value retval = SET_NONEMPTY_INTERNAL_STRING_VARIABLE (EXEC_PATH);
4217
301cc4cf87e9 [project @ 2002-12-05 03:33:01 by jwe]
jwe
parents: 3971
diff changeset
531
11298
cb94bdc74670 defaults.cc (FEXEC_PATH): only call set_exec_path if nargin is greater than zero
John W. Eaton <jwe@octave.org>
parents: 11294
diff changeset
532 if (args.length () > 0)
cb94bdc74670 defaults.cc (FEXEC_PATH): only call set_exec_path if nargin is greater than zero
John W. Eaton <jwe@octave.org>
parents: 11294
diff changeset
533 set_exec_path (VEXEC_PATH);
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
534
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
535 return retval;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
536 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
537
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
538 /*
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
539 %!test
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
540 %! orig_val = EXEC_PATH ();
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
541 %! old_val = EXEC_PATH ("X");
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
542 %! assert (orig_val, old_val);
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
543 %! assert (EXEC_PATH (), "X");
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
544 %! EXEC_PATH (orig_val);
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
545 %! assert (EXEC_PATH (), orig_val);
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
546
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
547 %!error (EXEC_PATH (1, 2))
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
548 */
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
549
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
550 DEFUN (IMAGE_PATH, args, nargout,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
551 "-*- texinfo -*-\n\
10840
89f4d7e294cc Grammarcheck .cc files
Rik <octave@nomad.inbox5.com>
parents: 10315
diff changeset
552 @deftypefn {Built-in Function} {@var{val} =} IMAGE_PATH ()\n\
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
553 @deftypefnx {Built-in Function} {@var{old_val} =} IMAGE_PATH (@var{new_val})\n\
13951
79aa00a94e9e doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents: 12855
diff changeset
554 @deftypefnx {Built-in Function} {} IMAGE_PATH (@var{new_val}, \"local\")\n\
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
555 Query or set the internal variable that specifies a colon separated\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
556 list of directories in which to search for image files.\n\
13951
79aa00a94e9e doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents: 12855
diff changeset
557 \n\
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 16926
diff changeset
558 When called from inside a function with the @qcode{\"local\"} option, the\n\
20207
4f45eaf83908 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19731
diff changeset
559 variable is changed locally for the function and any subroutines it calls.\n\
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 16926
diff changeset
560 The original variable value is restored when exiting the function.\n\
16926
23f6852052bb defaults.cc: refer to more functions in the seealso section of help text.
Carnë Draug <carandraug@octave.org>
parents: 16892
diff changeset
561 \n\
23f6852052bb defaults.cc: refer to more functions in the seealso section of help text.
Carnë Draug <carandraug@octave.org>
parents: 16892
diff changeset
562 @seealso{EXEC_PATH, OCTAVE_HOME}\n\
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
563 @end deftypefn")
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
564 {
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
565 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (IMAGE_PATH);
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
566 }
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
567
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
568 /*
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
569 %!test
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
570 %! orig_val = IMAGE_PATH ();
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
571 %! old_val = IMAGE_PATH ("X");
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
572 %! assert (orig_val, old_val);
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
573 %! assert (IMAGE_PATH (), "X");
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
574 %! IMAGE_PATH (orig_val);
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
575 %! assert (IMAGE_PATH (), orig_val);
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
576
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
577 %!error (IMAGE_PATH (1, 2))
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
578 */
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
579
5780
cbf717bf8150 [project @ 2006-04-27 20:02:30 by jwe]
jwe
parents: 5777
diff changeset
580 DEFUN (OCTAVE_HOME, args, ,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
581 "-*- texinfo -*-\n\
5780
cbf717bf8150 [project @ 2006-04-27 20:02:30 by jwe]
jwe
parents: 5777
diff changeset
582 @deftypefn {Built-in Function} {} OCTAVE_HOME ()\n\
cbf717bf8150 [project @ 2006-04-27 20:02:30 by jwe]
jwe
parents: 5777
diff changeset
583 Return the name of the top-level Octave installation directory.\n\
16926
23f6852052bb defaults.cc: refer to more functions in the seealso section of help text.
Carnë Draug <carandraug@octave.org>
parents: 16892
diff changeset
584 @seealso{EXEC_PATH, IMAGE_PATH}\n\
5780
cbf717bf8150 [project @ 2006-04-27 20:02:30 by jwe]
jwe
parents: 5777
diff changeset
585 @end deftypefn")
cbf717bf8150 [project @ 2006-04-27 20:02:30 by jwe]
jwe
parents: 5777
diff changeset
586 {
cbf717bf8150 [project @ 2006-04-27 20:02:30 by jwe]
jwe
parents: 5777
diff changeset
587 octave_value retval;
2831
19c45d29f177 [project @ 1997-03-26 04:17:16 by jwe]
jwe
parents: 2651
diff changeset
588
5780
cbf717bf8150 [project @ 2006-04-27 20:02:30 by jwe]
jwe
parents: 5777
diff changeset
589 if (args.length () == 0)
cbf717bf8150 [project @ 2006-04-27 20:02:30 by jwe]
jwe
parents: 5777
diff changeset
590 retval = Voctave_home;
cbf717bf8150 [project @ 2006-04-27 20:02:30 by jwe]
jwe
parents: 5777
diff changeset
591 else
5823
080c08b192d8 [project @ 2006-05-19 05:32:17 by jwe]
jwe
parents: 5814
diff changeset
592 print_usage ();
5780
cbf717bf8150 [project @ 2006-04-27 20:02:30 by jwe]
jwe
parents: 5777
diff changeset
593
cbf717bf8150 [project @ 2006-04-27 20:02:30 by jwe]
jwe
parents: 5777
diff changeset
594 return retval;
5749
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
595 }
3446
5ee5afb3981a [project @ 2000-01-17 09:42:43 by jwe]
jwe
parents: 3402
diff changeset
596
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
597 /*
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
598 %!assert (ischar (OCTAVE_HOME ()))
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
599 %!error OCTAVE_HOME (1)
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
600 */
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
601
5749
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
602 DEFUNX ("OCTAVE_VERSION", FOCTAVE_VERSION, args, ,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
603 "-*- texinfo -*-\n\
5749
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
604 @deftypefn {Built-in Function} {} OCTAVE_VERSION ()\n\
19226
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 19066
diff changeset
605 Return the version number of Octave as a string.\n\
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 19066
diff changeset
606 @seealso{ver, version}\n\
5749
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
607 @end deftypefn")
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
608 {
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
609 octave_value retval;
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
610
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
611 int nargin = args.length ();
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
612
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
613 if (nargin == 0)
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
614 retval = OCTAVE_VERSION;
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
615 else
5823
080c08b192d8 [project @ 2006-05-19 05:32:17 by jwe]
jwe
parents: 5814
diff changeset
616 print_usage ();
5749
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
617
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
618 return retval;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
619 }
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
620
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
621 /*
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
622 %!assert (ischar (OCTAVE_VERSION ()))
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
623 %!error OCTAVE_VERSION (1)
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
624 */