annotate libinterp/corefcn/defaults.in.cc @ 23717:06579337237b

move configuration variables inside octave::config namespace * defaults.h, defaults.in.cc: Define access functions for configuration variables inside octave::config namespace and make variables static inside defaults.cc, effectively making these values read-only for users. Change all uses. A few variables that may be modified by users remain in the global namespace. These may be moved later.
author John W. Eaton <jwe@octave.org>
date Thu, 29 Jun 2017 02:33:19 -0400
parents 4feef926733a
children 69a111259a2c
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
23219
3ac9f9ecfae5 maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents: 23083
diff changeset
3 Copyright (C) 1996-2017 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
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
8 under the terms of the GNU General Public License as published by
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
9 the Free Software Foundation; either version 3 of the License, or
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
10 (at your option) any later version.
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
11
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
12 Octave is distributed in the hope that it will be useful, but
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
13 WITHOUT ANY WARRANTY; without even the implied warranty of
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
15 GNU General Public License for more details.
2203
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
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
23 #if defined (HAVE_CONFIG_H)
21301
40de9f8f23a6 Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents: 21200
diff changeset
24 # include "config.h"
2203
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
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
33 #include "dir-ops.h"
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
34 #include "oct-env.h"
4217
301cc4cf87e9 [project @ 2002-12-05 03:33:01 by jwe]
jwe
parents: 3971
diff changeset
35 #include "file-stat.h"
3174
390d5e396682 [project @ 1998-05-04 16:36:17 by jwe]
jwe
parents: 3141
diff changeset
36 #include "pathsearch.h"
4217
301cc4cf87e9 [project @ 2002-12-05 03:33:01 by jwe]
jwe
parents: 3971
diff changeset
37 #include "str-vec.h"
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
38
23466
5da300c55e89 use "" instead of <> for including defaults.h and version.h
John W. Eaton <jwe@octave.org>
parents: 23450
diff changeset
39 #include "defaults.h"
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
40 #include "defun.h"
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
41 #include "error.h"
3040
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2993
diff changeset
42 #include "file-ops.h"
21100
e39e05d90788 Switch gripe_XXX to either err_XXX or warn_XXX naming scheme.
Rik <rik@octave.org>
parents: 20940
diff changeset
43 #include "errwarn.h"
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
44 #include "help.h"
5395
8db4eb48f546 [project @ 2005-06-16 20:19:18 by jwe]
jwe
parents: 5333
diff changeset
45 #include "input.h"
5832
5e41e06f6a78 [project @ 2006-05-26 21:41:32 by jwe]
jwe
parents: 5823
diff changeset
46 #include "load-path.h"
20940
48b2ad5ee801 maint: Rename oct-obj.[cc|h] to ovl.[cc|h] for clarity.
Rik <rik@octave.org>
parents: 20853
diff changeset
47 #include "ovl.h"
2390
c2c1482c34c8 [project @ 1996-10-12 19:13:23 by jwe]
jwe
parents: 2203
diff changeset
48 #include "ov.h"
4217
301cc4cf87e9 [project @ 2002-12-05 03:33:01 by jwe]
jwe
parents: 3971
diff changeset
49 #include "parse.h"
22094
9203833cab7d move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents: 21966
diff changeset
50 #include "interpreter.h"
4217
301cc4cf87e9 [project @ 2002-12-05 03:33:01 by jwe]
jwe
parents: 3971
diff changeset
51 #include "unwind-prot.h"
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
52 #include "variables.h"
23466
5da300c55e89 use "" instead of <> for including defaults.h and version.h
John W. Eaton <jwe@octave.org>
parents: 23450
diff changeset
53 #include "version.h"
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
54
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
55 // These are used by functions declared in defaults.h and defined in
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
56 // defaults.cc.
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
57
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
58 #if ! defined (OCTAVE_CANONICAL_HOST_TYPE)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
59 # define OCTAVE_CANONICAL_HOST_TYPE %OCTAVE_CANONICAL_HOST_TYPE%
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
60 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
61
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
62 #if ! defined (OCTAVE_RELEASE)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
63 # define OCTAVE_RELEASE %OCTAVE_RELEASE%
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
64 #endif
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
65
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
66 #if ! defined (OCTAVE_DEFAULT_PAGER)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
67 # define OCTAVE_DEFAULT_PAGER %OCTAVE_DEFAULT_PAGER%
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
68 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
69
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
70 #if ! defined (OCTAVE_PREFIX)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
71 # define OCTAVE_PREFIX %OCTAVE_PREFIX%
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
72 #endif
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
73
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
74 #if ! defined (OCTAVE_EXEC_PREFIX)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
75 # define OCTAVE_EXEC_PREFIX %OCTAVE_EXEC_PREFIX%
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
76 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
77
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
78 #if ! defined (OCTAVE_BINDIR)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
79 # define OCTAVE_BINDIR %OCTAVE_BINDIR%
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
80 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
81
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
82 #if ! defined (OCTAVE_DATADIR)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
83 # define OCTAVE_DATADIR %OCTAVE_DATADIR%
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
84 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
85
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
86 #if ! defined (OCTAVE_DATAROOTDIR)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
87 # define OCTAVE_DATAROOTDIR %OCTAVE_DATAROOTDIR%
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
88 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
89
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
90 #if ! defined (OCTAVE_INCLUDEDIR)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
91 # define OCTAVE_INCLUDEDIR %OCTAVE_INCLUDEDIR%
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
92 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
93
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
94 #if ! defined (OCTAVE_LIBDIR)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
95 # define OCTAVE_LIBDIR %OCTAVE_LIBDIR%
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
96 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
97
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
98 #if ! defined (OCTAVE_LIBEXECDIR)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
99 # define OCTAVE_LIBEXECDIR %OCTAVE_LIBEXECDIR%
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
100 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
101
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
102 #if ! defined (OCTAVE_LOCALVERARCHLIBDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
103 # define OCTAVE_LOCALVERARCHLIBDIR %OCTAVE_LOCALVERARCHLIBDIR%
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
104 #endif
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
105
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
106 #if ! defined (OCTAVE_LOCALAPIARCHLIBDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
107 # define OCTAVE_LOCALAPIARCHLIBDIR %OCTAVE_LOCALAPIARCHLIBDIR%
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
108 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
109
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
110 #if ! defined (OCTAVE_LOCALARCHLIBDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
111 # define OCTAVE_LOCALARCHLIBDIR %OCTAVE_LOCALARCHLIBDIR%
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
112 #endif
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
113
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
114 #if ! defined (OCTAVE_ARCHLIBDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
115 # define OCTAVE_ARCHLIBDIR %OCTAVE_ARCHLIBDIR%
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
116 #endif
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
117
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
118 #if ! defined (OCTAVE_LOCALVEROCTFILEDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
119 # define OCTAVE_LOCALVEROCTFILEDIR %OCTAVE_LOCALVEROCTFILEDIR%
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
120 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
121
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
122 #if ! defined (OCTAVE_LOCALAPIOCTFILEDIR)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
123 # define OCTAVE_LOCALAPIOCTFILEDIR %OCTAVE_LOCALAPIOCTFILEDIR%
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
124 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
125
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
126 #if ! defined (OCTAVE_LOCALOCTFILEDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
127 # define OCTAVE_LOCALOCTFILEDIR %OCTAVE_LOCALOCTFILEDIR%
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
128 #endif
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
129
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
130 #if ! defined (OCTAVE_OCTFILEDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
131 # define OCTAVE_OCTFILEDIR %OCTAVE_OCTFILEDIR%
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
132 #endif
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
133
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
134 #if ! defined (OCTAVE_LOCALVERFCNFILEDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
135 # define OCTAVE_LOCALVERFCNFILEDIR %OCTAVE_LOCALVERFCNFILEDIR%
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
136 #endif
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
137
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
138 #if ! defined (OCTAVE_LOCALAPIFCNFILEDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
139 # define OCTAVE_LOCALAPIFCNFILEDIR %OCTAVE_LOCALAPIFCNFILEDIR%
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
140 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
141
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
142 #if ! defined (OCTAVE_LOCALFCNFILEDIR)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
143 # define OCTAVE_LOCALFCNFILEDIR %OCTAVE_LOCALFCNFILEDIR%
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
144 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
145
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
146 #if ! defined (OCTAVE_FCNFILEDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
147 # define OCTAVE_FCNFILEDIR %OCTAVE_FCNFILEDIR%
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
148 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
149
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
150 #if ! defined (OCTAVE_OCTDATADIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
151 # define OCTAVE_OCTDATADIR %OCTAVE_OCTDATADIR%
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
152 #endif
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
153
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
154 #if ! defined (OCTAVE_OCTETCDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
155 # define OCTAVE_OCTETCDIR %OCTAVE_OCTETCDIR%
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
156 #endif
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
157
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
158 #if ! defined (OCTAVE_OCTINCLUDEDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
159 # define OCTAVE_OCTINCLUDEDIR %OCTAVE_OCTINCLUDEDIR%
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
160 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
161
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
162 #if ! defined (OCTAVE_OCTLIBDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
163 # define OCTAVE_OCTLIBDIR %OCTAVE_OCTLIBDIR%
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
164 #endif
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
165
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
166 #if ! defined (OCTAVE_OCTLOCALEDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
167 # define OCTAVE_OCTLOCALEDIR %OCTAVE_OCTLOCALEDIR%
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
168 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
169
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
170 #if ! defined (OCTAVE_OCTTESTSDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
171 # define OCTAVE_OCTTESTSDIR %OCTAVE_OCTTESTSDIR%
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
172 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
173
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
174 #if ! defined (OCTAVE_INFODIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
175 # define OCTAVE_INFODIR %OCTAVE_INFODIR%
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
176 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
177
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
178 #if ! defined (OCTAVE_MANDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
179 # define OCTAVE_MANDIR %OCTAVE_MANDIR%
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
180 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
181
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
182 #if ! defined (OCTAVE_MAN1DIR)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
183 # define OCTAVE_MAN1DIR %OCTAVE_MAN1DIR%
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
184 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
185
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
186 #if ! defined (OCTAVE_MAN1EXT)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
187 # define OCTAVE_MAN1EXT %OCTAVE_MAN1EXT%
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
188 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
189
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
190 #if ! defined (OCTAVE_IMAGEDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
191 # define OCTAVE_IMAGEDIR %OCTAVE_IMAGEDIR%
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
192 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
193
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
194 #if ! defined (OCTAVE_LOCALSTARTUPFILEDIR)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
195 # define OCTAVE_LOCALSTARTUPFILEDIR %OCTAVE_LOCALSTARTUPFILEDIR%
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
196 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
197
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
198 #if ! defined (OCTAVE_STARTUPFILEDIR)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
199 # define OCTAVE_STARTUPFILEDIR %OCTAVE_STARTUPFILEDIR%
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
200 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
201
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
202 // These are used by variables defined in other files. Maybe they
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
203 // should be moved? Or maybe it is best to have just one generated file
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
204 // containing variable substitutions?
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
205
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
206 #if ! defined (OCTAVE_INFOFILE)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
207 # define OCTAVE_INFOFILE %OCTAVE_INFOFILE%
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
208 #endif
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
209
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
210 #if ! defined (OCTAVE_TEXI_MACROS_FILE)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
211 # define OCTAVE_TEXI_MACROS_FILE %OCTAVE_TEXI_MACROS_FILE%
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
212 #endif
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
213
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
214 #if ! defined (OCTAVE_DOC_CACHE_FILE)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
215 # define OCTAVE_DOC_CACHE_FILE %OCTAVE_DOC_CACHE_FILE%
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
216 #endif
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
217
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
218 static bool initialized = false;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
219
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
220 static std::string Voctave_home;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
221 static std::string Voctave_exec_home;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
222
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
223 static std::string Vbin_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
224 static std::string Vdata_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
225 static std::string Vdataroot_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
226 static std::string Vinclude_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
227 static std::string Vlib_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
228 static std::string Vlibexec_dir;
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
229
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
230 static std::string Vlocal_ver_arch_lib_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
231 static std::string Vlocal_api_arch_lib_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
232 static std::string Vlocal_arch_lib_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
233 static std::string Varch_lib_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
234
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
235 static std::string Vlocal_ver_oct_file_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
236 static std::string Vlocal_api_oct_file_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
237 static std::string Vlocal_oct_file_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
238 static std::string Voct_file_dir;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
239
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
240 static std::string Vlocal_ver_fcn_file_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
241 static std::string Vlocal_api_fcn_file_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
242 static std::string Vlocal_fcn_file_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
243 static std::string Vfcn_file_dir;
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
244
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
245 static std::string Voct_data_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
246 static std::string Voct_etc_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
247 static std::string Voct_include_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
248 static std::string Voct_lib_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
249 static std::string Voct_locale_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
250 static std::string Voct_tests_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
251
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
252 static std::string Vinfo_dir;
15157
a87fa9132b72 provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents: 15088
diff changeset
253
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
254 static std::string Vman_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
255 static std::string Vman1_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
256 static std::string Vman1_ext;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
257
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
258 static std::string Vimage_dir;
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
259
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
260 static std::string Vlocal_startupfile_dir;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
261 static std::string Vstartupfile_dir;
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
262
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
263 static std::string Vlocal_site_defaults_file;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
264 static std::string Vsite_defaults_file;
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
265
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
266 // FIXME: these may be changed by users. Maybe they should be defined
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
267 // somewhere else?
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
268
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
269 std::string Vbuilt_in_docstrings_file;
4447
252b9162c084 [project @ 2003-07-08 18:37:53 by jwe]
jwe
parents: 4264
diff changeset
270
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
271 // 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
272 // (--exec-path path)
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
273 std::string VEXEC_PATH;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
274
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
275 // 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
276 std::string VEDITOR;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
277
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
278 std::string VIMAGE_PATH;
15470
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
279
23712
b95c430c0649 revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
280 // Variables that name directories or files are substituted into source
b95c430c0649 revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
281 // files with "${prefix}/" stripped from the beginning of the string.
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
282
23712
b95c430c0649 revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
283 // All configure variables of this form should be specified as absolute
b95c430c0649 revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
284 // directory names. The only ones that should not be absolute here are
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
285 // ones that have had "${prefix}/" or "${exec_prefix} stripped.
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
286
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
287 static std::string
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
288 prepend_home_dir (const std::string& hd, const std::string& s)
23712
b95c430c0649 revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
289 {
b95c430c0649 revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
290 std::string retval = s;
6276
d26c558691cd [project @ 2007-02-07 09:01:24 by jwe]
jwe
parents: 6274
diff changeset
291
23712
b95c430c0649 revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
292 char dir_sep_char = octave::sys::file_ops::dir_sep_char ();
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
293
23712
b95c430c0649 revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
294 if (! octave::sys::env::absolute_pathname (retval))
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
295 retval = hd + dir_sep_char + s;
23712
b95c430c0649 revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
296
b95c430c0649 revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
297 if (dir_sep_char != '/')
b95c430c0649 revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
298 std::replace (retval.begin (), retval.end (), '/', dir_sep_char);
6114
a0dafb51dd06 [project @ 2006-10-27 14:02:16 by jwe]
jwe
parents: 5909
diff changeset
299
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
300 return retval;
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
301 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
302
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
303 static std::string
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
304 prepend_octave_home (const std::string& s)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
305 {
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
306 return prepend_home_dir (Voctave_home, s);
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
307 }
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
308
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
309 static std::string
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
310 prepend_octave_exec_home (const std::string& s)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
311 {
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
312 return prepend_home_dir (Voctave_exec_home, s);
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
313 }
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
314
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
315 static void
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
316 set_octave_home (void)
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
317 {
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
318 std::string op = OCTAVE_PREFIX;
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
319 std::string oep = OCTAVE_EXEC_PREFIX;
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
320
21732
6a1eded90355 use namespace for system env class
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
321 std::string oh = octave::sys::env::getenv ("OCTAVE_HOME");
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
322 std::string oeh = octave::sys::env::getenv ("OCTAVE_EXEC_HOME");
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
323
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
324 // If OCTAVE_HOME is set in the enviornment, use that. Otherwise,
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
325 // default to ${prefix} from configure.
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
326
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
327 Voctave_home = (oh.empty () ? op : oh);
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
328
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
329 // If OCTAVE_EXEC_HOME is set in the environment, use that.
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
330 // Otherwise, if ${prefix} and ${exec_prefix} from configure are set
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
331 // to the same value, use OCTAVE_HOME from the environment if it is set.
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
332 // Othewise, default to ${exec_prefix} from configure.
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
333
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
334 if (! oeh.empty ())
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
335 Voctave_exec_home = oeh;
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
336 else
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
337 {
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
338 if (op == oep && ! oh.empty ())
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
339 Voctave_exec_home = oh;
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
340 else
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
341 Voctave_exec_home = oep;
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
342 }
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
343 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
344
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
345 static void
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
346 set_local_site_defaults_file (void)
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
347 {
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
348 std::string lsf = octave::sys::env::getenv ("OCTAVE_SITE_INITFILE");
5909
a6a2423a9c25 [project @ 2006-07-27 19:35:22 by jwe]
jwe
parents: 5832
diff changeset
349
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
350 if (lsf.empty ())
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
351 Vlocal_site_defaults_file = Vlocal_startupfile_dir + "/octaverc";
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
352 else
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
353 Vlocal_site_defaults_file = lsf;
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
354 }
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
355
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
356 static void
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
357 set_site_defaults_file (void)
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
358 {
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
359 std::string sf = octave::sys::env::getenv ("OCTAVE_VERSION_INITFILE");
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
360
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
361 if (sf.empty ())
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
362 Vsite_defaults_file = Vstartupfile_dir + "/octaverc";
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
363 else
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
364 Vsite_defaults_file = sf;
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
365 }
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
366
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
367 void
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
368 init_defaults (void)
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
369 {
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
370 if (initialized)
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
371 return;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
372
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
373 // OCTAVE_HOME must be set first!
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
374
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
375 set_octave_home ();
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
376
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
377 Vbin_dir = prepend_octave_exec_home (OCTAVE_BINDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
378 Vdata_dir = prepend_octave_home (OCTAVE_DATADIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
379 Vdataroot_dir = prepend_octave_home (OCTAVE_DATAROOTDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
380 Vinclude_dir = prepend_octave_home (OCTAVE_INCLUDEDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
381 Vlib_dir = prepend_octave_exec_home (OCTAVE_LIBDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
382 Vlibexec_dir = prepend_octave_exec_home (OCTAVE_LIBEXECDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
383
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
384 Vlocal_ver_arch_lib_dir = prepend_octave_exec_home (OCTAVE_LOCALVERARCHLIBDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
385 Vlocal_api_arch_lib_dir = prepend_octave_exec_home (OCTAVE_LOCALAPIARCHLIBDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
386 Vlocal_arch_lib_dir = prepend_octave_exec_home (OCTAVE_LOCALARCHLIBDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
387 Varch_lib_dir = prepend_octave_exec_home (OCTAVE_ARCHLIBDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
388
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
389 Vlocal_ver_oct_file_dir = prepend_octave_exec_home (OCTAVE_LOCALVEROCTFILEDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
390 Vlocal_api_oct_file_dir = prepend_octave_exec_home (OCTAVE_LOCALAPIOCTFILEDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
391 Vlocal_oct_file_dir = prepend_octave_exec_home (OCTAVE_LOCALOCTFILEDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
392 Voct_file_dir = prepend_octave_exec_home (OCTAVE_OCTFILEDIR);
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
393
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
394 Vlocal_ver_fcn_file_dir = prepend_octave_home (OCTAVE_LOCALVERFCNFILEDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
395 Vlocal_api_fcn_file_dir = prepend_octave_home (OCTAVE_LOCALAPIFCNFILEDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
396 Vlocal_fcn_file_dir = prepend_octave_home (OCTAVE_LOCALFCNFILEDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
397 Vfcn_file_dir = prepend_octave_home (OCTAVE_FCNFILEDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
398
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
399 Voct_data_dir = prepend_octave_home (OCTAVE_OCTDATADIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
400 Voct_etc_dir = prepend_octave_home (OCTAVE_OCTETCDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
401 Voct_include_dir = prepend_octave_home (OCTAVE_OCTINCLUDEDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
402 Voct_lib_dir = prepend_octave_exec_home (OCTAVE_OCTLIBDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
403 Voct_locale_dir = prepend_octave_home (OCTAVE_OCTLOCALEDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
404 Voct_tests_dir = prepend_octave_home (OCTAVE_OCTTESTSDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
405
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
406 Vinfo_dir = prepend_octave_home (OCTAVE_INFODIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
407
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
408 Vman_dir = prepend_octave_home (OCTAVE_MANDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
409 Vman1_dir = prepend_octave_home (OCTAVE_MAN1DIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
410 Vman1_ext = OCTAVE_MAN1EXT;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
411
23712
b95c430c0649 revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
412 Vimage_dir = prepend_octave_home (OCTAVE_IMAGEDIR);
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
413
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
414 Vlocal_startupfile_dir = prepend_octave_home (OCTAVE_LOCALSTARTUPFILEDIR);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
415 Vstartupfile_dir = prepend_octave_home (OCTAVE_STARTUPFILEDIR);
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
416
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
417 set_local_site_defaults_file ();
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
418
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
419 set_site_defaults_file ();
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
420
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
421 initialized = true;
19032
d902542221c8 new data directory for storing data files we distribute
John W. Eaton <jwe@octave.org>
parents: 17991
diff changeset
422 }
d902542221c8 new data directory for storing data files we distribute
John W. Eaton <jwe@octave.org>
parents: 17991
diff changeset
423
d902542221c8 new data directory for storing data files we distribute
John W. Eaton <jwe@octave.org>
parents: 17991
diff changeset
424 static void
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
425 set_default_info_file (void)
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
426 {
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
427 if (Vinfo_file.empty ())
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
428 {
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
429 std::string std_info_file = prepend_octave_home (OCTAVE_INFOFILE);
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
430
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
431 std::string oct_info_file = octave::sys::env::getenv ("OCTAVE_INFO_FILE");
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
432
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
433 Vinfo_file = (oct_info_file.empty () ? std_info_file : oct_info_file);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
434 }
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
435 }
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
436
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
437 static void
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
438 set_default_info_prog (void)
15157
a87fa9132b72 provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents: 15088
diff changeset
439 {
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
440 if (Vinfo_program.empty ())
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
441 {
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
442 std::string oct_info_prog = octave::sys::env::getenv ("OCTAVE_INFO_PROGRAM");
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
443
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
444 if (oct_info_prog.empty ())
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
445 Vinfo_program = "info";
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
446 else
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
447 Vinfo_program = std::string (oct_info_prog);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
448 }
15157
a87fa9132b72 provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents: 15088
diff changeset
449 }
a87fa9132b72 provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents: 15088
diff changeset
450
a87fa9132b72 provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents: 15088
diff changeset
451 static void
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
452 set_default_texi_macros_file (void)
15971
e27d9b9b71f4 gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents: 15478
diff changeset
453 {
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
454 if (Vtexi_macros_file.empty ())
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
455 {
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
456 std::string def_file = prepend_octave_home (OCTAVE_TEXI_MACROS_FILE);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
457
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
458 std::string env_file = octave::sys::env::getenv ("OCTAVE_TEXI_MACROS_FILE");
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
459
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
460 Vtexi_macros_file = (env_file.empty () ? def_file : env_file);
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
461 }
15971
e27d9b9b71f4 gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents: 15478
diff changeset
462 }
e27d9b9b71f4 gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents: 15478
diff changeset
463
e27d9b9b71f4 gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents: 15478
diff changeset
464 static void
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
465 set_default_editor (void)
5397
b12c0f920da0 [project @ 2005-06-17 07:52:28 by jwe]
jwe
parents: 5395
diff changeset
466 {
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
467 VEDITOR = "emacs";
5397
b12c0f920da0 [project @ 2005-06-17 07:52:28 by jwe]
jwe
parents: 5395
diff changeset
468
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
469 std::string env_editor = octave::sys::env::getenv ("EDITOR");
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
470
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
471 if (! env_editor.empty ())
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
472 VEDITOR = env_editor;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
473 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
474
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
475 void
11294
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
476 set_exec_path (const std::string& path_arg)
4447
252b9162c084 [project @ 2003-07-08 18:37:53 by jwe]
jwe
parents: 4264
diff changeset
477 {
11294
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
478 std::string tpath = path_arg;
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
479
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
480 if (tpath.empty ())
21732
6a1eded90355 use namespace for system env class
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
481 tpath = octave::sys::env::getenv ("OCTAVE_EXEC_PATH");
11294
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
482
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
483 if (tpath.empty ())
21745
bf1121302404 use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
484 tpath = Vlocal_ver_arch_lib_dir + octave::directory_path::path_sep_str ()
bf1121302404 use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
485 + Vlocal_api_arch_lib_dir + octave::directory_path::path_sep_str ()
bf1121302404 use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
486 + Vlocal_arch_lib_dir + octave::directory_path::path_sep_str ()
bf1121302404 use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
487 + Varch_lib_dir + octave::directory_path::path_sep_str ()
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
488 + Vbin_dir;
11294
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
489
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
490 VEXEC_PATH = tpath;
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
491
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
492 // 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
493 // 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
494 // PATH with calls like
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
495 //
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
496 // setenv ("PATH", "/my/path");
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
497 //
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
498 // 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
499 // 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
500 // 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
501 // searching.
e2a4f3478b7c datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents: 10840
diff changeset
502
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
503 // 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
504 // 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
505 // before we start modifying it.
21732
6a1eded90355 use namespace for system env class
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
506 static std::string shell_path = octave::sys::env::getenv ("PATH");
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
507
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
508 if (! shell_path.empty ())
21745
bf1121302404 use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
509 tpath = shell_path + octave::directory_path::path_sep_str () + tpath;
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
510
21732
6a1eded90355 use namespace for system env class
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
511 octave::sys::env::putenv ("PATH", tpath);
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
512 }
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
513
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
514 void
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
515 set_image_path (const std::string& path)
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
516 {
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
517 VIMAGE_PATH = ".";
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
518
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
519 std::string tpath = path;
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
520
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
521 if (tpath.empty ())
21732
6a1eded90355 use namespace for system env class
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
522 tpath = octave::sys::env::getenv ("OCTAVE_IMAGE_PATH");
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
523
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
524 if (! tpath.empty ())
21745
bf1121302404 use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
525 VIMAGE_PATH += octave::directory_path::path_sep_str () + tpath;
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
526
23445
8e310ef0fa97 move load_path class to octave namespace
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
527 tpath = octave::genpath (Vimage_dir, "");
5832
5e41e06f6a78 [project @ 2006-05-26 21:41:32 by jwe]
jwe
parents: 5823
diff changeset
528
5e41e06f6a78 [project @ 2006-05-26 21:41:32 by jwe]
jwe
parents: 5823
diff changeset
529 if (! tpath.empty ())
21745
bf1121302404 use namespace for dir_path class
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
530 VIMAGE_PATH += octave::directory_path::path_sep_str () + tpath;
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
531 }
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
532
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
533 static void
8865
eace5649a8b5 set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents: 8008
diff changeset
534 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
535 {
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
536 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
537 {
23712
b95c430c0649 revamp insertion of config variables into binaries and eliminate some macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
538 std::string def_file = prepend_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
539
21732
6a1eded90355 use namespace for system env class
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
540 std::string env_file = octave::sys::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
541
23450
855122b993da maint: Wrap tertiary operator in parentheses "(COND ? x : y)".
Rik <rik@octave.org>
parents: 23445
diff changeset
542 Vdoc_cache_file = (env_file.empty () ? def_file : env_file);
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
543 }
8865
eace5649a8b5 set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents: 8008
diff changeset
544 }
eace5649a8b5 set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents: 8008
diff changeset
545
eace5649a8b5 set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents: 8008
diff changeset
546 static void
15470
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
547 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
548 {
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
549 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
550 {
21732
6a1eded90355 use namespace for system env class
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
551 std::string df = octave::sys::env::getenv ("OCTAVE_BUILT_IN_DOCSTRINGS_FILE");
15470
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
552
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
553 if (df.empty ())
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
554 Vbuilt_in_docstrings_file
21733
cb0fdd941d84 use namespace for system file_ops class
John W. Eaton <jwe@octave.org>
parents: 21732
diff changeset
555 = Voct_etc_dir + octave::sys::file_ops::dir_sep_str () + "built-in-docstrings";
15470
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
556 else
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
557 Vbuilt_in_docstrings_file = df;
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
558 }
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
559 }
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
560
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
561 void
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
562 install_defaults (void)
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
563 {
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
564 // In case this hasn't been done yet...
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
565 init_defaults ();
3141
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3040
diff changeset
566
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
567 set_default_info_file ();
2439
dc870b8b229f [project @ 1996-10-30 07:57:31 by jwe]
jwe
parents: 2390
diff changeset
568
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
569 set_default_info_prog ();
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
570
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
571 set_default_texi_macros_file ();
15157
a87fa9132b72 provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents: 15088
diff changeset
572
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
573 set_default_editor ();
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
574
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
575 set_exec_path ();
4447
252b9162c084 [project @ 2003-07-08 18:37:53 by jwe]
jwe
parents: 4264
diff changeset
576
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
577 set_image_path ();
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
578
8865
eace5649a8b5 set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents: 8008
diff changeset
579 set_default_doc_cache_file ();
eace5649a8b5 set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents: 8008
diff changeset
580
15470
bf0857c789f4 initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
581 set_built_in_docstrings_file ();
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
582 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
583
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
584 #define RETURN(VAR) \
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
585 if (! initialized) \
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
586 init_defaults (); \
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
587 return VAR;
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
588
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
589 namespace octave
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
590 {
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
591 namespace config
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
592 {
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
593 std::string canonical_host_type (void) { return OCTAVE_CANONICAL_HOST_TYPE; }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
594
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
595 std::string release (void) { return OCTAVE_RELEASE; }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
596
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
597 std::string default_pager (void) { return OCTAVE_DEFAULT_PAGER; }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
598
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
599 std::string octave_home (void) { RETURN (Voctave_home); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
600 std::string octave_exec_home (void) { RETURN (Voctave_exec_home); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
601
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
602 std::string bin_dir (void) { RETURN (Vbin_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
603 std::string data_dir (void) { RETURN (Vdata_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
604 std::string dataroot_dir (void) { RETURN (Vdataroot_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
605 std::string include_dir (void) { RETURN (Vinclude_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
606 std::string lib_dir (void) { RETURN (Vlib_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
607 std::string libexec_dir (void) { RETURN (Vlibexec_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
608 std::string arch_lib_dir (void) { RETURN (Varch_lib_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
609 std::string info_dir (void) { RETURN (Vinfo_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
610
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
611 std::string local_ver_arch_lib_dir (void) { RETURN (Vlocal_ver_arch_lib_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
612 std::string local_api_arch_lib_dir (void) { RETURN (Vlocal_api_arch_lib_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
613 std::string local_arch_lib_dir (void) { RETURN (Vlocal_arch_lib_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
614
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
615 std::string local_ver_oct_file_dir (void) { RETURN (Vlocal_ver_oct_file_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
616 std::string local_api_oct_file_dir (void) { RETURN (Vlocal_api_oct_file_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
617 std::string local_oct_file_dir (void) { RETURN (Vlocal_oct_file_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
618 std::string oct_file_dir (void) { RETURN (Voct_file_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
619
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
620 std::string local_ver_fcn_file_dir (void) { RETURN (Vlocal_ver_fcn_file_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
621 std::string local_api_fcn_file_dir (void) { RETURN (Vlocal_api_fcn_file_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
622 std::string local_fcn_file_dir (void) { RETURN (Vlocal_fcn_file_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
623 std::string fcn_file_dir (void) { RETURN (Vfcn_file_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
624
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
625 std::string oct_data_dir (void) { RETURN (Voct_data_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
626 std::string oct_etc_dir (void) { RETURN (Voct_etc_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
627 std::string oct_include_dir (void) { RETURN (Voct_include_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
628 std::string oct_lib_dir (void) { RETURN (Voct_lib_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
629 std::string oct_locale_dir (void) { RETURN (Voct_locale_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
630 std::string oct_tests_dir (void) { RETURN (Voct_tests_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
631
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
632 std::string man_dir (void) { RETURN (Vman_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
633 std::string man1_dir (void) { RETURN (Vman1_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
634 std::string man1_ext (void) { RETURN (Vman1_ext); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
635
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
636 std::string image_dir (void) { RETURN (Vimage_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
637
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
638 std::string local_startupfile_dir (void) { RETURN (Vlocal_startupfile_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
639 std::string startupfile_dir (void) { RETURN (Vstartupfile_dir); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
640
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
641 std::string local_site_defaults_file (void) { RETURN (Vlocal_site_defaults_file); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
642 std::string site_defaults_file (void) { RETURN (Vsite_defaults_file); }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
643 }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
644 }
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
645
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
646 #undef RETURN
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
647
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
648 DEFUN (EDITOR, args, nargout,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
649 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
650 @deftypefn {} {@var{val} =} EDITOR ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
651 @deftypefnx {} {@var{old_val} =} EDITOR (@var{new_val})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
652 @deftypefnx {} {} EDITOR (@var{new_val}, "local")
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
653 Query or set the internal variable that specifies the default text editor.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
654
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
655 The default value is taken from the environment variable @w{@env{EDITOR}}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
656 when Octave starts. If the environment variable is not initialized,
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
657 @w{@env{EDITOR}} will be set to @qcode{"emacs"}.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
658
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
659 When called from inside a function with the @qcode{"local"} option, the
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
660 variable is changed locally for the function and any subroutines it calls.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
661 The original variable value is restored when exiting the function.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
662
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
663 @seealso{edit, edit_history}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
664 @end deftypefn */)
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
665 {
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
666 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (EDITOR);
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
667 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
668
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
669 /*
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
670 %!test
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
671 %! orig_val = EDITOR ();
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
672 %! old_val = EDITOR ("X");
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
673 %! assert (orig_val, old_val);
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
674 %! assert (EDITOR (), "X");
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
675 %! EDITOR (orig_val);
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
676 %! assert (EDITOR (), orig_val);
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
677
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
678 %!error (EDITOR (1, 2))
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
679 */
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
680
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
681 DEFUN (EXEC_PATH, args, nargout,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
682 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
683 @deftypefn {} {@var{val} =} EXEC_PATH ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
684 @deftypefnx {} {@var{old_val} =} EXEC_PATH (@var{new_val})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
685 @deftypefnx {} {} EXEC_PATH (@var{new_val}, "local")
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
686 Query or set the internal variable that specifies a colon separated
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
687 list of directories to append to the shell PATH when executing external
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
688 programs.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
689
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
690 The initial value of is taken from the environment variable
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
691 @w{@env{OCTAVE_EXEC_PATH}}, but that value can be overridden by the command
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
692 line argument @option{--exec-path PATH}.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
693
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
694 When called from inside a function with the @qcode{"local"} option, the
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
695 variable is changed locally for the function and any subroutines it calls.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
696 The original variable value is restored when exiting the function.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
697
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
698 @seealso{IMAGE_PATH, OCTAVE_HOME, OCTAVE_EXEC_HOME}
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
699 @end deftypefn */)
4217
301cc4cf87e9 [project @ 2002-12-05 03:33:01 by jwe]
jwe
parents: 3971
diff changeset
700 {
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
701 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
702
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
703 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
704 set_exec_path (VEXEC_PATH);
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
705
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
706 return retval;
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
707 }
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
708
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
709 /*
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
710 %!test
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
711 %! orig_val = EXEC_PATH ();
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
712 %! old_val = EXEC_PATH ("X");
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
713 %! assert (orig_val, old_val);
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
714 %! assert (EXEC_PATH (), "X");
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
715 %! EXEC_PATH (orig_val);
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
716 %! 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
717
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
718 %!error (EXEC_PATH (1, 2))
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
719 */
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
720
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
721 DEFUN (IMAGE_PATH, args, nargout,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
722 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
723 @deftypefn {} {@var{val} =} IMAGE_PATH ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
724 @deftypefnx {} {@var{old_val} =} IMAGE_PATH (@var{new_val})
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
725 @deftypefnx {} {} IMAGE_PATH (@var{new_val}, "local")
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
726 Query or set the internal variable that specifies a colon separated
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
727 list of directories in which to search for image files.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
728
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
729 When called from inside a function with the @qcode{"local"} option, the
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
730 variable is changed locally for the function and any subroutines it calls.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
731 The original variable value is restored when exiting the function.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
732
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
733 @seealso{EXEC_PATH, OCTAVE_HOME, OCTAVE_EXEC_HOME}
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
734 @end deftypefn */)
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
735 {
5814
67bf9b4f2ae2 [project @ 2006-05-11 21:58:34 by jwe]
jwe
parents: 5794
diff changeset
736 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (IMAGE_PATH);
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
737 }
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5781
diff changeset
738
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
739 /*
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
740 %!test
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
741 %! orig_val = IMAGE_PATH ();
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
742 %! old_val = IMAGE_PATH ("X");
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
743 %! assert (orig_val, old_val);
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
744 %! assert (IMAGE_PATH (), "X");
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
745 %! IMAGE_PATH (orig_val);
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
746 %! 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
747
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
748 %!error (IMAGE_PATH (1, 2))
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
749 */
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
750
5780
cbf717bf8150 [project @ 2006-04-27 20:02:30 by jwe]
jwe
parents: 5777
diff changeset
751 DEFUN (OCTAVE_HOME, args, ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
752 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
753 @deftypefn {} {} OCTAVE_HOME ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
754 Return the name of the top-level Octave installation directory.
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
755 OCTAVE_HOME corresponds to the configuration variable @var{prefix}.
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
756 @seealso{EXEC_PATH, IMAGE_PATH, OCTAVE_EXEC_HOME}
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
757 @end deftypefn */)
5780
cbf717bf8150 [project @ 2006-04-27 20:02:30 by jwe]
jwe
parents: 5777
diff changeset
758 {
20802
8bb38ba1bad6 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20172
diff changeset
759 if (args.length () != 0)
5823
080c08b192d8 [project @ 2006-05-19 05:32:17 by jwe]
jwe
parents: 5814
diff changeset
760 print_usage ();
5780
cbf717bf8150 [project @ 2006-04-27 20:02:30 by jwe]
jwe
parents: 5777
diff changeset
761
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
762 return ovl (octave::config::octave_home ());
5749
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
763 }
3446
5ee5afb3981a [project @ 2000-01-17 09:42:43 by jwe]
jwe
parents: 3402
diff changeset
764
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
765 /*
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
766 %!assert (ischar (OCTAVE_HOME ()))
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
767 %!error OCTAVE_HOME (1)
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
768 */
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
769
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
770 DEFUN (OCTAVE_EXEC_HOME, args, ,
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
771 doc: /* -*- texinfo -*-
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
772 @deftypefn {} {} OCTAVE_HOME ()
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
773 Return the name of the top-level Octave installation directory for
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
774 architecture-dependendent files. If not specified separately, the value
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
775 is the same as OCTAVE_HOME. OCTAVE_EXEC_HOME corresponds to the
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
776 configuration variable @var{exec_prefix}.
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
777 @seealso{EXEC_PATH, IMAGE_PATH, OCTAVE_HOME}
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
778 @end deftypefn */)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
779 {
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
780 if (args.length () != 0)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
781 print_usage ();
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
782
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23713
diff changeset
783 return ovl (octave::config::octave_exec_home ());
23713
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
784 }
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
785
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
786 /*
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
787 %!assert (ischar (OCTAVE_EXEC_HOME ()))
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
788 %!error OCTAVE_EXEC_HOME (1)
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
789 */
4feef926733a rename files missed in previous commit
John W. Eaton <jwe@octave.org>
parents: 23712
diff changeset
790
5749
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
791 DEFUNX ("OCTAVE_VERSION", FOCTAVE_VERSION, args, ,
21966
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
792 doc: /* -*- texinfo -*-
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
793 @deftypefn {} {} OCTAVE_VERSION ()
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
794 Return the version number of Octave as a string.
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
795 @seealso{ver, version}
112b20240c87 move docstrings in C++ files out of C strings and into comments
John W. Eaton <jwe@octave.org>
parents: 21962
diff changeset
796 @end deftypefn */)
5749
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
797 {
20802
8bb38ba1bad6 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20172
diff changeset
798 if (args.length () != 0)
5823
080c08b192d8 [project @ 2006-05-19 05:32:17 by jwe]
jwe
parents: 5814
diff changeset
799 print_usage ();
5749
26beffa9f66f [project @ 2006-04-07 20:35:07 by jwe]
jwe
parents: 5451
diff changeset
800
21127
df7891224709 maint: Use "return ovl (...)" in DEFUN macros.
Rik <rik@octave.org>
parents: 21100
diff changeset
801 return ovl (OCTAVE_VERSION);
2203
88a4d3580427 [project @ 1996-05-15 06:09:30 by jwe]
jwe
parents:
diff changeset
802 }
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
803
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
804 /*
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
805 %!assert (ischar (OCTAVE_VERSION ()))
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
806 %!error OCTAVE_VERSION (1)
12851
7fce673b934a codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
807 */