annotate libinterp/octave-value/ov-dld-fcn.cc @ 33636:3ec6fcce7715 default tip @

gui: Avoid using HAVE_QSCINTILLA in more header files. * gui-settings.h, settings-dialog.h: Don't include QScintilla header. Forward-declare QSciLexer class instead if necessary. Declare all member functions unconditionally. * gui-settings.cc (gui_settings::get_valid_lexer_styles, gui_settings::read_lexer_settings), settings-dialog.cc (settings_dialog::update_lexer, settings_dialog::get_lexer_settings, settings_dialog::write_lexer_settings): Define functions unconditionally. * gui-preferences-ed.h: Don't include QScintilla header. Remove definition of local variable os_eol_mode from header. * gui-preferences-ed.cc (os_eol_mode): Move definition of local variable here.
author Markus Mützel <markus.muetzel@gmx.de>
date Tue, 28 May 2024 14:54:58 +0200
parents 2e484f9f1f18
children
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 //
32632
2e484f9f1f18 maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 31771
diff changeset
3 // Copyright (C) 1996-2024 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 ////////////////////////////////////////////////////////////////////////
3329
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
25
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
26 #if defined (HAVE_CONFIG_H)
21301
40de9f8f23a6 Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents: 21200
diff changeset
27 # include "config.h"
3329
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
28 #endif
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
29
29639
161daebce243 Mark compiled system functions correctly if OCTAVE_HOME is non-canonical (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29358
diff changeset
30 #include "file-ops.h"
3329
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
31 #include "oct-shlib.h"
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
32
25460
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents: 25440
diff changeset
33 #include "defaults.h"
3329
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
34 #include "dynamic-ld.h"
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
35 #include "error.h"
23627
0a6e87804cab don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents: 23518
diff changeset
36 #include "interpreter-private.h"
25460
627d6bde9b8d solve installation info initialization problem differently
John W. Eaton <jwe@octave.org>
parents: 25440
diff changeset
37 #include "ovl.h"
3329
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
38 #include "ov-dld-fcn.h"
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
39 #include "ov.h"
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
40
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
41
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
42 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_dld_function,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10184
diff changeset
43 "dynamically-linked function",
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10184
diff changeset
44 "dynamically-linked function");
3329
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
45
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
46 octave_dld_function::octave_dld_function
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31105
diff changeset
47 (octave_builtin::fcn ff, const octave::dynamic_library& shl,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31105
diff changeset
48 const std::string& nm, const std::string& ds)
30077
b16e0d357437 maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents: 30034
diff changeset
49 : octave_builtin (ff, nm, ds), m_sh_lib (shl)
3329
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
50 {
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
51 mark_fcn_file_up_to_date (time_parsed ());
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
52
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3329
diff changeset
53 std::string file_name = fcn_file_name ();
3329
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
54
29643
874430de1cc7 Fix error if test suite is run before Octave is installed (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29639
diff changeset
55 static const std::string canonical_oct_file_dir
874430de1cc7 Fix error if test suite is run before Octave is installed (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29639
diff changeset
56 = octave::sys::canonicalize_file_name (octave::config::oct_file_dir ());
29639
161daebce243 Mark compiled system functions correctly if OCTAVE_HOME is non-canonical (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29358
diff changeset
57 static const std::string oct_file_dir
29643
874430de1cc7 Fix error if test suite is run before Octave is installed (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29639
diff changeset
58 = canonical_oct_file_dir.empty () ? octave::config::oct_file_dir ()
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31105
diff changeset
59 : canonical_oct_file_dir;
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23627
diff changeset
60
30077
b16e0d357437 maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents: 30034
diff changeset
61 m_system_fcn_file
3329
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
62 = (! file_name.empty ()
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23627
diff changeset
63 && oct_file_dir == file_name.substr (0, oct_file_dir.length ()));
3329
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
64 }
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
65
23518
8744d4ed8fb4 provide DEFMETHOD macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
66 octave_dld_function::octave_dld_function
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31105
diff changeset
67 (octave_builtin::meth mm, const octave::dynamic_library& shl,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31105
diff changeset
68 const std::string& nm, const std::string& ds)
30077
b16e0d357437 maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents: 30034
diff changeset
69 : octave_builtin (mm, nm, ds), m_sh_lib (shl)
23518
8744d4ed8fb4 provide DEFMETHOD macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
70 {
8744d4ed8fb4 provide DEFMETHOD macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
71 mark_fcn_file_up_to_date (time_parsed ());
8744d4ed8fb4 provide DEFMETHOD macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
72
8744d4ed8fb4 provide DEFMETHOD macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
73 std::string file_name = fcn_file_name ();
8744d4ed8fb4 provide DEFMETHOD macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
74
29643
874430de1cc7 Fix error if test suite is run before Octave is installed (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29639
diff changeset
75 static const std::string canonical_oct_file_dir
874430de1cc7 Fix error if test suite is run before Octave is installed (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29639
diff changeset
76 = octave::sys::canonicalize_file_name (octave::config::oct_file_dir ());
29639
161daebce243 Mark compiled system functions correctly if OCTAVE_HOME is non-canonical (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29358
diff changeset
77 static const std::string oct_file_dir
29643
874430de1cc7 Fix error if test suite is run before Octave is installed (bug #60554).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29639
diff changeset
78 = canonical_oct_file_dir.empty () ? octave::config::oct_file_dir ()
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 31105
diff changeset
79 : canonical_oct_file_dir;
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23627
diff changeset
80
30077
b16e0d357437 maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents: 30034
diff changeset
81 m_system_fcn_file
23518
8744d4ed8fb4 provide DEFMETHOD macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
82 = (! file_name.empty ()
23717
06579337237b move configuration variables inside octave::config namespace
John W. Eaton <jwe@octave.org>
parents: 23627
diff changeset
83 && oct_file_dir == file_name.substr (0, oct_file_dir.length ()));
23518
8744d4ed8fb4 provide DEFMETHOD macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
84 }
8744d4ed8fb4 provide DEFMETHOD macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
85
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
86 octave_dld_function::~octave_dld_function ()
3329
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
87 {
31105
670a0d878af1 eliminate WHO arguments from interpreter-private functions
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
88 octave::dynamic_loader& dyn_loader = octave::__get_dynamic_loader__ ();
23627
0a6e87804cab don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents: 23518
diff changeset
89
30077
b16e0d357437 maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents: 30034
diff changeset
90 dyn_loader.remove_oct (m_name, m_sh_lib);
3329
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
91 }
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
92
3536
e8fbc8c3d6d9 [project @ 2000-02-02 12:01:00 by jwe]
jwe
parents: 3534
diff changeset
93 std::string
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
94 octave_dld_function::fcn_file_name () const
3329
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
95 {
30077
b16e0d357437 maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents: 30034
diff changeset
96 return m_sh_lib.file_name ();
3329
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
97 }
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
98
21730
30c53770f47e use namespace for system time classes
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
99 octave::sys::time
31771
21f9b34eb893 maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents: 31706
diff changeset
100 octave_dld_function::time_parsed () const
3329
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
101 {
30077
b16e0d357437 maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents: 30034
diff changeset
102 return m_sh_lib.time_loaded ();
3329
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
103 }
e84e324db1de [project @ 1999-11-01 21:58:57 by jwe]
jwe
parents:
diff changeset
104
7349
a1ab9dbc9622 [project @ 2008-01-07 14:40:23 by jwe]
jwe
parents: 7017
diff changeset
105 // Note: this wrapper around the octave_dld_function constructor is
a1ab9dbc9622 [project @ 2008-01-07 14:40:23 by jwe]
jwe
parents: 7017
diff changeset
106 // necessary to work around a MSVC limitation handling in
a1ab9dbc9622 [project @ 2008-01-07 14:40:23 by jwe]
jwe
parents: 7017
diff changeset
107 // virtual destructors that prevents unloading a dynamic module
a1ab9dbc9622 [project @ 2008-01-07 14:40:23 by jwe]
jwe
parents: 7017
diff changeset
108 // before *all* objects (of class using a virtual dtor) have
a1ab9dbc9622 [project @ 2008-01-07 14:40:23 by jwe]
jwe
parents: 7017
diff changeset
109 // been fully deleted; indeed, MSVC attaches auto-generated code
a1ab9dbc9622 [project @ 2008-01-07 14:40:23 by jwe]
jwe
parents: 7017
diff changeset
110 // (scalar deleting destructor) to objects created in a dynamic
a1ab9dbc9622 [project @ 2008-01-07 14:40:23 by jwe]
jwe
parents: 7017
diff changeset
111 // module, and this code will be executed in the dynamic module
a1ab9dbc9622 [project @ 2008-01-07 14:40:23 by jwe]
jwe
parents: 7017
diff changeset
112 // context at object deletion; unloading the dynamic module
a1ab9dbc9622 [project @ 2008-01-07 14:40:23 by jwe]
jwe
parents: 7017
diff changeset
113 // before objects have been deleted will make the "delete" code
a1ab9dbc9622 [project @ 2008-01-07 14:40:23 by jwe]
jwe
parents: 7017
diff changeset
114 // of objects to point to an invalid code segment.
a1ab9dbc9622 [project @ 2008-01-07 14:40:23 by jwe]
jwe
parents: 7017
diff changeset
115
30390
a61e1a0f6024 maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents: 30077
diff changeset
116 octave_dld_function *
22407
34ce5be04942 maint: Style check C++ code in libinterp/.
Rik <rik@octave.org>
parents: 22323
diff changeset
117 octave_dld_function::create (octave_builtin::fcn ff,
34ce5be04942 maint: Style check C++ code in libinterp/.
Rik <rik@octave.org>
parents: 22323
diff changeset
118 const octave::dynamic_library& shl,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10184
diff changeset
119 const std::string& nm, const std::string& ds)
7349
a1ab9dbc9622 [project @ 2008-01-07 14:40:23 by jwe]
jwe
parents: 7017
diff changeset
120 {
a1ab9dbc9622 [project @ 2008-01-07 14:40:23 by jwe]
jwe
parents: 7017
diff changeset
121 return new octave_dld_function (ff, shl, nm, ds);
a1ab9dbc9622 [project @ 2008-01-07 14:40:23 by jwe]
jwe
parents: 7017
diff changeset
122 }
23518
8744d4ed8fb4 provide DEFMETHOD macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
123
30390
a61e1a0f6024 maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents: 30077
diff changeset
124 octave_dld_function *
23518
8744d4ed8fb4 provide DEFMETHOD macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
125 octave_dld_function::create (octave_builtin::meth mm,
8744d4ed8fb4 provide DEFMETHOD macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
126 const octave::dynamic_library& shl,
8744d4ed8fb4 provide DEFMETHOD macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
127 const std::string& nm, const std::string& ds)
8744d4ed8fb4 provide DEFMETHOD macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
128 {
8744d4ed8fb4 provide DEFMETHOD macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
129 return new octave_dld_function (mm, shl, nm, ds);
8744d4ed8fb4 provide DEFMETHOD macros
John W. Eaton <jwe@octave.org>
parents: 23466
diff changeset
130 }