annotate libinterp/corefcn/dynamic-ld.cc @ 20428:7ac907da9fba

Use error() rather than ::error() unless explicitly required. * resource-manager.cc (instance_ok), shortcut-manager.cc (instance_ok), daspk.cc (DASPK_ABORT, DASPK_ABORT2), dasrt.cc (DASRT_ABORT, DASRT_ABORT2), dassl.cc (DASSL_ABORT, DASSL_ABORT2), debug.cc (instance_ok), display.cc (instance_ok), dynamic-ld.cc (octave_shlib_list::instance_ok, octave_dynamic_loader::instance_ok, do_load_oct, do_load_mex), file-io.cc (fopen_mode_to_ios_mode, do_stream_open, Ffprintf, Fsprintf, Fscanf, Ffscanf, get_sscanf_data, Fsscanf, do_fread, do_fwrite, Fpopen, Ftempname, convert, Fumask), graphics.in.h (graphics_toolkit::instance_ok, gh_manager::instance_ok), load-path.cc (instance_ok), ls-oct-ascii.cc (save_three_d), lsode.cc (LSODE_ABORT, LSODE_ABORT2), oct-errno.in.cc (instance_ok), octave-link.cc (connect_link), pager.cc (octave_pager_stream::instance_ok, octave_diary_stream::instance_ok), quad.cc (QUAD_ABORT, QUAD_ABORT2), sighandlers.cc (w32_interrupt_manager::instance_ok, octave_child_list::instance_ok), symtab.cc (do_update_nest), symtab.h (instance_ok), syscalls.cc (convert), toplev.h (instance_ok), txt-eng-ft.cc (instance_ok, set_mode), urlwrite.cc (instance_ok), __init_fltk__.cc (instance_ok), ov-builtin.cc (do_multi_index_op), ov-classdef.cc (class_fevalStatic, make_class, octave_classdef::subsasgn, do_multi_index_op, cdef_object_array::subsref, cdef_object_array::subsasgn, install_meth, meta_subsref, run_constructor, make_meta_class, get_value, set_value, check_method), ov-classdef.h (meta_subsref, instance_ok), ov-fcn-handle.cc (octave_fcn_handle), ov-mex-fcn.cc (do_multi_index_op), ov-range.h (octave_range), ov-typeinfo.cc (instance_ok), ov-usr-fcn.cc (subsref, do_multi_index_op), pt-arg-list.cc (Fend, convert_to_const_vector), pt-cell.cc (rvalue1), pt-colon.cc (append, rvalue1), pt-eval.cc (visit_simple_for_command, visit_switch_command), pt-exp.cc (is_logically_true, rvalue), pt-id.cc (eval_undefined_error), pt-id.h (workspace_error), pt-mat.cc (get_concat_class): Use error() rather than ::error().
author Rik <rik@octave.org>
date Thu, 06 Aug 2015 08:09:01 -0700
parents 4197fc428c7d
children f90c8372b7ba
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
2
19697
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17787
diff changeset
3 Copyright (C) 1993-2015 John W. Eaton
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
4
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
6
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6323
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6323
diff changeset
10 option) any later version.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
11
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
15 for more details.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
16
78fd87e624cb [project @ 1993-08-08 01:13:40 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: 6323
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: 6323
diff changeset
19 <http://www.gnu.org/licenses/>.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
20
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
21 */
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
22
240
a99f28f5e351 [project @ 1993-11-30 20:24:36 by jwe]
jwe
parents: 184
diff changeset
23 #ifdef HAVE_CONFIG_H
1192
b6360f2d4fa6 [project @ 1995-03-30 21:38:35 by jwe]
jwe
parents: 1155
diff changeset
24 #include <config.h>
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
25 #endif
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
26
8950
d865363208d6 include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents: 8920
diff changeset
27 #include <iostream>
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4009
diff changeset
28 #include <list>
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4009
diff changeset
29
13983
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
30 #include "file-stat.h"
6323
ea65de49e18e [project @ 2007-02-17 02:51:02 by jwe]
jwe
parents: 6221
diff changeset
31 #include "oct-env.h"
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
32 #include "oct-time.h"
13983
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
33 #include "singleton-cleanup.h"
707
d7c4962ec7a0 [project @ 1994-09-16 13:50:20 by jwe]
jwe
parents: 527
diff changeset
34
2492
06595bc7f2d0 [project @ 1996-11-09 00:13:50 by jwe]
jwe
parents: 2370
diff changeset
35 #include <defaults.h>
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
36
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
37 #include "defun.h"
1352
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1315
diff changeset
38 #include "dynamic-ld.h"
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
39 #include "ov-fcn.h"
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
40 #include "ov-dld-fcn.h"
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
41 #include "ov-mex-fcn.h"
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
42 #include "parse.h"
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
43 #include "unwind-prot.h"
1352
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1315
diff changeset
44 #include "utils.h"
707
d7c4962ec7a0 [project @ 1994-09-16 13:50:20 by jwe]
jwe
parents: 527
diff changeset
45 #include "variables.h"
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
46
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
47 #define STRINGIFY(s) STRINGIFY1(s)
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
48 #define STRINGIFY1(s) #s
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
49
2894
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
50 class
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
51 octave_shlib_list
1664
913a157f1e02 [project @ 1995-12-24 07:00:22 by jwe]
jwe
parents: 1488
diff changeset
52 {
2894
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
53 public:
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
54
7748
3dc91baee089 dynamic-ld.cc: cleanups
John W. Eaton <jwe@octave.org>
parents: 7745
diff changeset
55 typedef std::list<octave_shlib>::iterator iterator;
3dc91baee089 dynamic-ld.cc: cleanups
John W. Eaton <jwe@octave.org>
parents: 7745
diff changeset
56 typedef std::list<octave_shlib>::const_iterator const_iterator;
3dc91baee089 dynamic-ld.cc: cleanups
John W. Eaton <jwe@octave.org>
parents: 7745
diff changeset
57
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
58 static void append (const octave_shlib& shl);
2894
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
59
6063
8010902404b9 [project @ 2006-10-19 01:27:35 by jwe]
jwe
parents: 5864
diff changeset
60 static void remove (octave_shlib& shl, octave_shlib::close_hook cl_hook = 0);
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
61
7749
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
62 static octave_shlib find_file (const std::string& file_name);
2894
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
63
7745
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
64 static void display (void);
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
65
2894
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
66 private:
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
67
11584
cda4aa780d58 Another round of initialising members in the constructor initialisation list
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11523
diff changeset
68 octave_shlib_list (void) : lib_list () { }
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
69
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
70 ~octave_shlib_list (void) { }
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
71
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
72 void do_append (const octave_shlib& shl);
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
73
6063
8010902404b9 [project @ 2006-10-19 01:27:35 by jwe]
jwe
parents: 5864
diff changeset
74 void do_remove (octave_shlib& shl, octave_shlib::close_hook cl_hook = 0);
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
75
7749
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
76 octave_shlib do_find_file (const std::string& file_name) const;
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
77
7745
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
78 void do_display (void) const;
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
79
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
80 static octave_shlib_list *instance;
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
81
13983
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
82 static void cleanup_instance (void) { delete instance; instance = 0; }
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
83
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
84 static bool instance_ok (void);
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
85
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
86 // List of libraries we have loaded.
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4009
diff changeset
87 std::list<octave_shlib> lib_list;
2894
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
88
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
89 // No copying!
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
90
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
91 octave_shlib_list (const octave_shlib_list&);
2894
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
92
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
93 octave_shlib_list& operator = (const octave_shlib_list&);
2894
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
94 };
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
95
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
96 octave_shlib_list *octave_shlib_list::instance = 0;
3321
6923abb04e16 [project @ 1999-10-26 18:15:30 by jwe]
jwe
parents: 3222
diff changeset
97
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
98 void
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
99 octave_shlib_list::do_append (const octave_shlib& shl)
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
100 {
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4009
diff changeset
101 lib_list.push_back (shl);
1664
913a157f1e02 [project @ 1995-12-24 07:00:22 by jwe]
jwe
parents: 1488
diff changeset
102 }
913a157f1e02 [project @ 1995-12-24 07:00:22 by jwe]
jwe
parents: 1488
diff changeset
103
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
104 void
6063
8010902404b9 [project @ 2006-10-19 01:27:35 by jwe]
jwe
parents: 5864
diff changeset
105 octave_shlib_list::do_remove (octave_shlib& shl,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
106 octave_shlib::close_hook cl_hook)
1664
913a157f1e02 [project @ 1995-12-24 07:00:22 by jwe]
jwe
parents: 1488
diff changeset
107 {
7748
3dc91baee089 dynamic-ld.cc: cleanups
John W. Eaton <jwe@octave.org>
parents: 7745
diff changeset
108 for (iterator p = lib_list.begin (); p != lib_list.end (); p++)
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
109 {
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4009
diff changeset
110 if (*p == shl)
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
111 {
9958
80432f0ee895 improve octave_shlib for safer shared libs treatment
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
112 // Erase first to avoid potentially invalidating the pointer by the
80432f0ee895 improve octave_shlib for safer shared libs treatment
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
113 // following hooks.
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
114 lib_list.erase (p);
1664
913a157f1e02 [project @ 1995-12-24 07:00:22 by jwe]
jwe
parents: 1488
diff changeset
115
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
116 shl.close (cl_hook);
3033
968e85a82e25 [project @ 1997-06-05 16:50:05 by jwe]
jwe
parents: 2994
diff changeset
117
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
118 break;
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
119 }
1664
913a157f1e02 [project @ 1995-12-24 07:00:22 by jwe]
jwe
parents: 1488
diff changeset
120 }
913a157f1e02 [project @ 1995-12-24 07:00:22 by jwe]
jwe
parents: 1488
diff changeset
121 }
913a157f1e02 [project @ 1995-12-24 07:00:22 by jwe]
jwe
parents: 1488
diff changeset
122
7749
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
123 octave_shlib
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
124 octave_shlib_list::do_find_file (const std::string& file_name) const
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
125 {
7749
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
126 octave_shlib retval;
1664
913a157f1e02 [project @ 1995-12-24 07:00:22 by jwe]
jwe
parents: 1488
diff changeset
127
7749
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
128 for (const_iterator p = lib_list.begin (); p != lib_list.end (); p++)
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
129 {
7749
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
130 if (p->file_name () == file_name)
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
131 {
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
132 retval = *p;
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
133 break;
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
134 }
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
135 }
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
136
7749
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
137 return retval;
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
138 }
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
139
7745
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
140 void
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
141 octave_shlib_list::do_display (void) const
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
142 {
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
143 std::cerr << "current shared libraries:" << std::endl;
7748
3dc91baee089 dynamic-ld.cc: cleanups
John W. Eaton <jwe@octave.org>
parents: 7745
diff changeset
144 for (const_iterator p = lib_list.begin (); p != lib_list.end (); p++)
7745
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
145 std::cerr << " " << p->file_name () << std::endl;
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
146 }
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
147
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
148 bool
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
149 octave_shlib_list::instance_ok (void)
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
150 {
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
151 bool retval = true;
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
152
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
153 if (! instance)
13983
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
154 {
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
155 instance = new octave_shlib_list ();
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
156
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
157 if (instance)
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
158 singleton_cleanup_list::add (cleanup_instance);
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
159 }
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
160
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
161 if (! instance)
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
162 {
20428
7ac907da9fba Use error() rather than ::error() unless explicitly required.
Rik <rik@octave.org>
parents: 19697
diff changeset
163 error ("unable to create shared library list object!");
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
164
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
165 retval = false;
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
166 }
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
167
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
168 return retval;
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
169 }
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
170
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2895
diff changeset
171 void
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
172 octave_shlib_list::append (const octave_shlib& shl)
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
173 {
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
174 if (instance_ok ())
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
175 instance->do_append (shl);
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
176 }
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
177
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
178 void
6063
8010902404b9 [project @ 2006-10-19 01:27:35 by jwe]
jwe
parents: 5864
diff changeset
179 octave_shlib_list::remove (octave_shlib& shl,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
180 octave_shlib::close_hook cl_hook)
2894
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
181 {
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
182 if (instance_ok ())
6063
8010902404b9 [project @ 2006-10-19 01:27:35 by jwe]
jwe
parents: 5864
diff changeset
183 instance->do_remove (shl, cl_hook);
2894
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
184 }
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
185
7749
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
186 octave_shlib
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
187 octave_shlib_list::find_file (const std::string& file_name)
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
188 {
7749
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
189 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
190 ? instance->do_find_file (file_name) : octave_shlib ();
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
191 }
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
192
7745
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
193 void
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
194 octave_shlib_list::display (void)
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
195 {
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
196 if (instance_ok ())
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
197 instance->do_display ();
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
198 }
0ff0fc033f28 better handling of functions found by relative lookup
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
199
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
200 octave_dynamic_loader *octave_dynamic_loader::instance = 0;
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
201
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
202 bool octave_dynamic_loader::doing_load = false;
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
203
2969
1b47dd00a831 [project @ 1997-05-15 17:57:48 by jwe]
jwe
parents: 2926
diff changeset
204 bool
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
205 octave_dynamic_loader::instance_ok (void)
707
d7c4962ec7a0 [project @ 1994-09-16 13:50:20 by jwe]
jwe
parents: 527
diff changeset
206 {
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
207 bool retval = true;
1664
913a157f1e02 [project @ 1995-12-24 07:00:22 by jwe]
jwe
parents: 1488
diff changeset
208
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
209 if (! instance)
13983
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
210 {
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
211 instance = new octave_dynamic_loader ();
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
212
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
213 if (instance)
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
214 singleton_cleanup_list::add (cleanup_instance);
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
215 }
707
d7c4962ec7a0 [project @ 1994-09-16 13:50:20 by jwe]
jwe
parents: 527
diff changeset
216
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
217 if (! instance)
707
d7c4962ec7a0 [project @ 1994-09-16 13:50:20 by jwe]
jwe
parents: 527
diff changeset
218 {
20428
7ac907da9fba Use error() rather than ::error() unless explicitly required.
Rik <rik@octave.org>
parents: 19697
diff changeset
219 error ("unable to create dynamic loader object!");
707
d7c4962ec7a0 [project @ 1994-09-16 13:50:20 by jwe]
jwe
parents: 527
diff changeset
220
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
221 retval = false;
707
d7c4962ec7a0 [project @ 1994-09-16 13:50:20 by jwe]
jwe
parents: 527
diff changeset
222 }
d7c4962ec7a0 [project @ 1994-09-16 13:50:20 by jwe]
jwe
parents: 527
diff changeset
223
2893
9fd1df4b464a [project @ 1997-04-28 02:07:38 by jwe]
jwe
parents: 2862
diff changeset
224 return retval;
9fd1df4b464a [project @ 1997-04-28 02:07:38 by jwe]
jwe
parents: 2862
diff changeset
225 }
9fd1df4b464a [project @ 1997-04-28 02:07:38 by jwe]
jwe
parents: 2862
diff changeset
226
10287
7c7685cc0676 fix reload warning for dynamically linked functions
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
227 static void
7c7685cc0676 fix reload warning for dynamically linked functions
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
228 do_clear_function (const std::string& fcn_name)
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
229 {
5781
faafc2d98b8d [project @ 2006-05-02 19:40:19 by jwe]
jwe
parents: 5760
diff changeset
230 warning_with_id ("Octave:reload-forces-clear", " %s", fcn_name.c_str ());
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
231
9958
80432f0ee895 improve octave_shlib for safer shared libs treatment
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
232 symbol_table::clear_dld_function (fcn_name);
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
233 }
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
234
6323
ea65de49e18e [project @ 2007-02-17 02:51:02 by jwe]
jwe
parents: 6221
diff changeset
235 static void
ea65de49e18e [project @ 2007-02-17 02:51:02 by jwe]
jwe
parents: 6221
diff changeset
236 clear (octave_shlib& oct_file)
ea65de49e18e [project @ 2007-02-17 02:51:02 by jwe]
jwe
parents: 6221
diff changeset
237 {
ea65de49e18e [project @ 2007-02-17 02:51:02 by jwe]
jwe
parents: 6221
diff changeset
238 if (oct_file.number_of_functions_loaded () > 1)
10287
7c7685cc0676 fix reload warning for dynamically linked functions
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
239 {
7c7685cc0676 fix reload warning for dynamically linked functions
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
240 warning_with_id ("Octave:reload-forces-clear",
7c7685cc0676 fix reload warning for dynamically linked functions
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
241 "reloading %s clears the following functions:",
14846
460a3c6d8bf1 maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
242 oct_file.file_name ().c_str ());
6323
ea65de49e18e [project @ 2007-02-17 02:51:02 by jwe]
jwe
parents: 6221
diff changeset
243
10287
7c7685cc0676 fix reload warning for dynamically linked functions
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
244 octave_shlib_list::remove (oct_file, do_clear_function);
7c7685cc0676 fix reload warning for dynamically linked functions
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
245 }
7c7685cc0676 fix reload warning for dynamically linked functions
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
246 else
7c7685cc0676 fix reload warning for dynamically linked functions
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
247 octave_shlib_list::remove (oct_file, symbol_table::clear_dld_function);
6323
ea65de49e18e [project @ 2007-02-17 02:51:02 by jwe]
jwe
parents: 6221
diff changeset
248 }
ea65de49e18e [project @ 2007-02-17 02:51:02 by jwe]
jwe
parents: 6221
diff changeset
249
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
250 octave_function *
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
251 octave_dynamic_loader::do_load_oct (const std::string& fcn_name,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
252 const std::string& file_name,
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
253 bool relative)
2893
9fd1df4b464a [project @ 1997-04-28 02:07:38 by jwe]
jwe
parents: 2862
diff changeset
254 {
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
255 octave_function *retval = 0;
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
256
10066
2cd940306a06 make unwind_protect frames local
Jaroslav Hajek <highegg@gmail.com>
parents: 9958
diff changeset
257 unwind_protect frame;
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
258
10066
2cd940306a06 make unwind_protect frames local
Jaroslav Hajek <highegg@gmail.com>
parents: 9958
diff changeset
259 frame.protect_var (octave_dynamic_loader::doing_load);
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
260
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
261 doing_load = true;
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
262
7749
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
263 octave_shlib oct_file = octave_shlib_list::find_file (file_name);
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
264
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
265 if (oct_file && oct_file.is_out_of_date ())
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
266 clear (oct_file);
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
267
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
268 if (! oct_file)
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
269 {
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
270 oct_file.open (file_name);
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
271
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
272 if (! error_state && oct_file)
9958
80432f0ee895 improve octave_shlib for safer shared libs treatment
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
273 octave_shlib_list::append (oct_file);
7749
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
274 }
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
275
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
276 if (! error_state)
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
277 {
7749
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
278 if (oct_file)
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
279 {
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
280 void *function = oct_file.search (fcn_name, name_mangler);
7996
6a7db240b3a3 configure.in: eliminate CXX_ABI and OCTAVE_CXX_PREPEND_UNDERSCORE
John W. Eaton <jwe@octave.org>
parents: 7872
diff changeset
281
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
282 if (! function)
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
283 {
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
284 // FIXME: can we determine this C mangling scheme
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
285 // automatically at run time or configure time?
7996
6a7db240b3a3 configure.in: eliminate CXX_ABI and OCTAVE_CXX_PREPEND_UNDERSCORE
John W. Eaton <jwe@octave.org>
parents: 7872
diff changeset
286
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
287 function = oct_file.search (fcn_name, name_uscore_mangler);
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
288 }
7749
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
289
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
290 if (function)
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
291 {
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
292 octave_dld_fcn_getter f
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
293 = FCN_PTR_CAST (octave_dld_fcn_getter, function);
7748
3dc91baee089 dynamic-ld.cc: cleanups
John W. Eaton <jwe@octave.org>
parents: 7745
diff changeset
294
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
295 retval = f (oct_file, relative);
7748
3dc91baee089 dynamic-ld.cc: cleanups
John W. Eaton <jwe@octave.org>
parents: 7745
diff changeset
296
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
297 if (! retval)
20428
7ac907da9fba Use error() rather than ::error() unless explicitly required.
Rik <rik@octave.org>
parents: 19697
diff changeset
298 error ("failed to install .oct file function '%s'",
7ac907da9fba Use error() rather than ::error() unless explicitly required.
Rik <rik@octave.org>
parents: 19697
diff changeset
299 fcn_name.c_str ());
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
300 }
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
301 }
7749
14e05160b99f reference counting for functions loaded from shared libraries
John W. Eaton <jwe@octave.org>
parents: 7748
diff changeset
302 else
20428
7ac907da9fba Use error() rather than ::error() unless explicitly required.
Rik <rik@octave.org>
parents: 19697
diff changeset
303 error ("%s is not a valid shared library", file_name.c_str ());
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
304 }
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11584
diff changeset
305
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
306 return retval;
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
307 }
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
308
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
309 octave_function *
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
310 octave_dynamic_loader::do_load_mex (const std::string& fcn_name,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
311 const std::string& file_name,
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
312 bool /*relative*/)
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
313 {
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
314 octave_function *retval = 0;
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
315
10066
2cd940306a06 make unwind_protect frames local
Jaroslav Hajek <highegg@gmail.com>
parents: 9958
diff changeset
316 unwind_protect frame;
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
317
10066
2cd940306a06 make unwind_protect frames local
Jaroslav Hajek <highegg@gmail.com>
parents: 9958
diff changeset
318 frame.protect_var (octave_dynamic_loader::doing_load);
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
319
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
320 doing_load = true;
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
321
8832
9dddbad47122 automatically reload out of date mex files
John W. Eaton <jwe@octave.org>
parents: 7996
diff changeset
322 octave_shlib mex_file = octave_shlib_list::find_file (file_name);
6323
ea65de49e18e [project @ 2007-02-17 02:51:02 by jwe]
jwe
parents: 6221
diff changeset
323
8832
9dddbad47122 automatically reload out of date mex files
John W. Eaton <jwe@octave.org>
parents: 7996
diff changeset
324 if (mex_file && mex_file.is_out_of_date ())
9dddbad47122 automatically reload out of date mex files
John W. Eaton <jwe@octave.org>
parents: 7996
diff changeset
325 clear (mex_file);
9dddbad47122 automatically reload out of date mex files
John W. Eaton <jwe@octave.org>
parents: 7996
diff changeset
326
9dddbad47122 automatically reload out of date mex files
John W. Eaton <jwe@octave.org>
parents: 7996
diff changeset
327 if (! mex_file)
6323
ea65de49e18e [project @ 2007-02-17 02:51:02 by jwe]
jwe
parents: 6221
diff changeset
328 {
8832
9dddbad47122 automatically reload out of date mex files
John W. Eaton <jwe@octave.org>
parents: 7996
diff changeset
329 mex_file.open (file_name);
6323
ea65de49e18e [project @ 2007-02-17 02:51:02 by jwe]
jwe
parents: 6221
diff changeset
330
8832
9dddbad47122 automatically reload out of date mex files
John W. Eaton <jwe@octave.org>
parents: 7996
diff changeset
331 if (! error_state && mex_file)
9958
80432f0ee895 improve octave_shlib for safer shared libs treatment
Jaroslav Hajek <highegg@gmail.com>
parents: 9377
diff changeset
332 octave_shlib_list::append (mex_file);
6323
ea65de49e18e [project @ 2007-02-17 02:51:02 by jwe]
jwe
parents: 6221
diff changeset
333 }
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
334
8832
9dddbad47122 automatically reload out of date mex files
John W. Eaton <jwe@octave.org>
parents: 7996
diff changeset
335 if (! error_state)
9dddbad47122 automatically reload out of date mex files
John W. Eaton <jwe@octave.org>
parents: 7996
diff changeset
336 {
9dddbad47122 automatically reload out of date mex files
John W. Eaton <jwe@octave.org>
parents: 7996
diff changeset
337 if (mex_file)
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
338 {
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
339 void *function = 0;
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
340
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
341 bool have_fmex = false;
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
342
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
343 function = mex_file.search (fcn_name, mex_mangler);
8832
9dddbad47122 automatically reload out of date mex files
John W. Eaton <jwe@octave.org>
parents: 7996
diff changeset
344
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
345 if (! function)
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
346 {
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
347 // FIXME: can we determine this C mangling scheme
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
348 // automatically at run time or configure time?
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
349
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
350 function = mex_file.search (fcn_name, mex_uscore_mangler);
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
351
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
352 if (! function)
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
353 {
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
354 function = mex_file.search (fcn_name, mex_f77_mangler);
6221
8e0f1eda266b [project @ 2007-01-03 17:23:33 by jwe]
jwe
parents: 6063
diff changeset
355
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
356 if (function)
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
357 have_fmex = true;
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
358 }
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
359 }
8832
9dddbad47122 automatically reload out of date mex files
John W. Eaton <jwe@octave.org>
parents: 7996
diff changeset
360
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
361 if (function)
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
362 retval = new octave_mex_function (function, have_fmex,
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
363 mex_file, fcn_name);
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
364 else
20428
7ac907da9fba Use error() rather than ::error() unless explicitly required.
Rik <rik@octave.org>
parents: 19697
diff changeset
365 error ("failed to install .mex file function '%s'",
7ac907da9fba Use error() rather than ::error() unless explicitly required.
Rik <rik@octave.org>
parents: 19697
diff changeset
366 fcn_name.c_str ());
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
367 }
8832
9dddbad47122 automatically reload out of date mex files
John W. Eaton <jwe@octave.org>
parents: 7996
diff changeset
368 else
20428
7ac907da9fba Use error() rather than ::error() unless explicitly required.
Rik <rik@octave.org>
parents: 19697
diff changeset
369 error ("%s is not a valid shared library", file_name.c_str ());
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
370 }
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
371
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
372 return retval;
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
373 }
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
374
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
375 bool
7872
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
376 octave_dynamic_loader::do_remove_oct (const std::string& fcn_name,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
377 octave_shlib& shl)
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
378 {
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
379 bool retval = false;
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
380
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
381 // We don't need to do anything if this is called because we are in
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
382 // the process of reloading a .oct file that has changed.
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
383
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
384 if (! doing_load)
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
385 {
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
386 retval = shl.remove (fcn_name);
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
387
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
388 if (shl.number_of_functions_loaded () == 0)
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
389 octave_shlib_list::remove (shl);
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
390 }
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
391
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
392 return retval;
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
393 }
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
394
7872
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
395 bool
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
396 octave_dynamic_loader::do_remove_mex (const std::string& fcn_name,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
397 octave_shlib& shl)
7872
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
398 {
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
399 bool retval = false;
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
400
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
401 // We don't need to do anything if this is called because we are in
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
402 // the process of reloading a .oct file that has changed.
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
403
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
404 if (! doing_load)
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
405 {
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
406 retval = shl.remove (fcn_name);
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
407
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
408 if (shl.number_of_functions_loaded () == 0)
16143
752a5de459c2 Fix mex function reloading (bug 34861).
Janne Olavi Paanajärvi <janne.paanajarvi@aalto.fi>
parents: 15467
diff changeset
409 octave_shlib_list::remove (shl);
7872
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
410 }
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
411
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
412 return retval;
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
413 }
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
414
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
415 octave_function *
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
416 octave_dynamic_loader::load_oct (const std::string& fcn_name,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
417 const std::string& file_name,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
418 bool relative)
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
419 {
6323
ea65de49e18e [project @ 2007-02-17 02:51:02 by jwe]
jwe
parents: 6221
diff changeset
420 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
421 ? instance->do_load_oct (fcn_name, file_name, relative) : 0;
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
422 }
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
423
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
424 octave_function *
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
425 octave_dynamic_loader::load_mex (const std::string& fcn_name,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
426 const std::string& file_name,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
427 bool relative)
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5854
diff changeset
428 {
6323
ea65de49e18e [project @ 2007-02-17 02:51:02 by jwe]
jwe
parents: 6221
diff changeset
429 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
430 ? instance->do_load_mex (fcn_name, file_name, relative) : 0;
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
431 }
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
432
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
433 bool
7872
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
434 octave_dynamic_loader::remove_oct (const std::string& fcn_name,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
435 octave_shlib& shl)
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3321
diff changeset
436 {
7872
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
437 return (instance_ok ()) ? instance->do_remove_oct (fcn_name, shl) : false;
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
438 }
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
439
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
440 bool
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
441 octave_dynamic_loader::remove_mex (const std::string& fcn_name,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10287
diff changeset
442 octave_shlib& shl)
7872
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
443 {
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
444 return (instance_ok ()) ? instance->do_remove_mex (fcn_name, shl) : false;
2893
9fd1df4b464a [project @ 1997-04-28 02:07:38 by jwe]
jwe
parents: 2862
diff changeset
445 }
707
d7c4962ec7a0 [project @ 1994-09-16 13:50:20 by jwe]
jwe
parents: 527
diff changeset
446
3536
e8fbc8c3d6d9 [project @ 2000-02-02 12:01:00 by jwe]
jwe
parents: 3534
diff changeset
447 std::string
7996
6a7db240b3a3 configure.in: eliminate CXX_ABI and OCTAVE_CXX_PREPEND_UNDERSCORE
John W. Eaton <jwe@octave.org>
parents: 7872
diff changeset
448 octave_dynamic_loader::name_mangler (const std::string& name)
2894
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
449 {
7996
6a7db240b3a3 configure.in: eliminate CXX_ABI and OCTAVE_CXX_PREPEND_UNDERSCORE
John W. Eaton <jwe@octave.org>
parents: 7872
diff changeset
450 return "G" + name;
2894
f1c5f8151397 [project @ 1997-04-28 05:39:26 by jwe]
jwe
parents: 2893
diff changeset
451 }
707
d7c4962ec7a0 [project @ 1994-09-16 13:50:20 by jwe]
jwe
parents: 527
diff changeset
452
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
453 std::string
7996
6a7db240b3a3 configure.in: eliminate CXX_ABI and OCTAVE_CXX_PREPEND_UNDERSCORE
John W. Eaton <jwe@octave.org>
parents: 7872
diff changeset
454 octave_dynamic_loader::name_uscore_mangler (const std::string& name)
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
455 {
7996
6a7db240b3a3 configure.in: eliminate CXX_ABI and OCTAVE_CXX_PREPEND_UNDERSCORE
John W. Eaton <jwe@octave.org>
parents: 7872
diff changeset
456 return "_G" + name;
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
457 }
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
458
7872
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
459 std::string
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
460 octave_dynamic_loader::mex_mangler (const std::string&)
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
461 {
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
462 return "mexFunction";
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
463 }
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
464
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
465 std::string
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
466 octave_dynamic_loader::mex_uscore_mangler (const std::string&)
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
467 {
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
468 return "_mexFunction";
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
469 }
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
470
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
471 std::string
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
472 octave_dynamic_loader::mex_f77_mangler (const std::string&)
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
473 {
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
474 return STRINGIFY (F77_FUNC (mexfunction, MEXFUNCTION));
1b63f8da772d fix unloading of mex files
John W. Eaton <jwe@octave.org>
parents: 7749
diff changeset
475 }