annotate libinterp/corefcn/environment.h @ 29960:939bef0b66e0

merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks In files with both OCTAVE_NAMESPACE_BEGIN/END and "namespace octave" blocks, merge adjacent blocks. Use the macros in place of "namespace octave" in affected files and the corresponding header files. Files affected: call-stack.cc, call-stack.h, defaults.cc, defaults.h, defun-int.h, display.cc, display.h, environment.cc, environment.h, error.cc, error.h, event-manager.cc, event-manager.h, fcn-info.cc, fcn-info.h, help.cc, help.h, input.cc, input.h, interpreter.cc, interpreter.h, load-path.cc, load-path.h, load-save.cc, load-save.h, oct-hist.cc, oct-hist.h, pager.cc, pager.h, settings.cc, settings.h, sighandlers.cc, sighandlers.h, symtab.cc, symtab.h, sysdep.cc, sysdep.h, utils.cc, utils.h, __ode15__.cc, gzip.cc, ov-fcn-handle.cc, ov-fcn-handle.h, ov-java.cc, ov-java.h, ov-typeinfo.cc, ov-typeinfo.h, ov.cc, ov.h, octave.cc, octave.h, lex.ll, oct-parse.yy, profiler.cc, profiler.h, pt-eval.cc, and pt-eval.h.
author John W. Eaton <jwe@octave.org>
date Sat, 14 Aug 2021 21:50:26 -0400
parents 0a5b15007766
children 796f54d4ddbf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
29358
0a5b15007766 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
3 // Copyright (C) 2017-2021 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
23719
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 #if ! defined (octave_environment_h)
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 #define octave_environment_h 1
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 #include "octave-config.h"
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 #include <string>
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 class octave_value;
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 class octave_value_list;
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35
29960
939bef0b66e0 merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
36 OCTAVE_NAMESPACE_BEGIN
939bef0b66e0 merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
37
23719
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 class environment
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 {
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 public:
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41
25460
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents: 25439
diff changeset
42 environment (void)
23719
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 : m_editor (init_editor ()),
25460
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents: 25439
diff changeset
44 m_exec_path (init_exec_path ()),
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents: 25439
diff changeset
45 m_image_path (init_image_path ())
23719
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 { }
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48 octave_value editor (const octave_value_list& args, int nargout);
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 std::string editor (void) const { return m_editor; }
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 std::string editor (const std::string& ed)
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53 {
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 return set (m_editor, ed);
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55 }
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57 octave_value exec_path (const octave_value_list& args, int nargout);
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 std::string exec_path (void) const { return m_exec_path; }
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 std::string exec_path (const std::string& path);
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
63 octave_value image_path (const octave_value_list& args, int nargout);
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
64
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
65 std::string image_path (void) const { return m_image_path; }
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67 std::string image_path (const std::string& path)
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68 {
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69 return set (m_image_path, path);
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70 }
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72 private:
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74 std::string m_editor;
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
76 std::string m_exec_path;
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
77
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78 std::string m_image_path;
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
79
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80 static std::string init_editor (void);
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
81
25460
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents: 25439
diff changeset
82 static std::string init_exec_path (void);
23719
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
83
25460
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents: 25439
diff changeset
84 static std::string init_image_path (void);
23719
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
85
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
86 std::string set (std::string& var, const std::string& new_val)
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
87 {
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
88 std::string old_val = var;
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
89 var = new_val;
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
90 return old_val;
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
91 }
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
92 };
29960
939bef0b66e0 merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
93
939bef0b66e0 merge "namespace octave" and OCTAVE_NAMESPACE_BEGIN/END blocks
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
94 OCTAVE_NAMESPACE_END
23719
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
95
69a111259a2c eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
diff changeset
96 #endif