26 #if defined (HAVE_CONFIG_H)
49 #define STRINGIFY(s) STRINGIFY1(s)
50 #define STRINGIFY1(s) #s
60 std::list<std::string>
63 std::list<std::string> removed_fcns;
65 for (
auto p = m_lib_list.begin (); p != m_lib_list.end (); p++)
71 removed_fcns = shl.
close ();
85 for (
const auto& lib : m_lib_list)
87 if (lib.file_name () == file_name)
100 std::cerr <<
"current shared libraries:" << std::endl;
101 for (
const auto& lib : m_lib_list)
102 std::cerr <<
" " << lib.file_name () << std::endl;
108 warning_with_id (
"Octave:reload-forces-clear",
" %s", fcn_name.c_str ());
125 "reloading %s clears the following functions:",
130 for (
const auto& fcn_name : removed_fcns)
143 for (
const auto& fcn_name : removed_fcns)
150 const std::string& file_name,
164 oct_file.
open (file_name);
171 error (
"%s is not a valid shared library", file_name.c_str ());
188 retval =
f (oct_file, relative);
191 error (
"failed to install .oct file function '%s'",
200 const std::string& fcn_name,
bool& have_fmex)
230 const std::string& file_name,
242 mex_file.
open (file_name);
249 error (
"%s is not a valid shared library", file_name.c_str ());
251 bool have_fmex =
false;
253 void *
function =
try_load_mex (mex_file, fcn_name, have_fmex);
256 error (
"failed to install .mex file function '%s'", fcn_name.c_str ());
258 void *symbol = mex_file.
search (
"__mx_has_interleaved_complex__");
260 bool interleaved = symbol !=
nullptr;
277 retval = shl.
remove (fcn_name);
309 return "mexFunction";
315 return "_mexFunction";
void * search(const std::string &nm, const name_mangler &mangler=name_mangler()) const
void open(const std::string &f)
bool is_out_of_date(void) const
std::string file_name(void) const
std::size_t number_of_functions_loaded(void) const
std::list< std::string > close(void)
bool remove(const std::string &name)
std::list< std::string > remove(dynamic_library &shl)
std::list< dynamic_library > m_lib_list
void append(const dynamic_library &shl)
dynamic_library find_file(const std::string &file_name) const
static std::string name_mangler(const std::string &name)
void clear(dynamic_library &oct_file)
bool remove_oct(const std::string &fcn_name, dynamic_library &shl)
bool remove_mex(const std::string &fcn_name, dynamic_library &shl)
interpreter & m_interpreter
static std::string name_uscore_mangler(const std::string &name)
static std::string mex_f77_mangler(const std::string &name)
static std::string mex_uscore_mangler(const std::string &name)
octave_function * load_oct(const std::string &fcn_name, const std::string &file_name="", bool relative=false)
octave_function * load_mex(const std::string &fcn_name, const std::string &file_name="", bool relative=false)
static std::string mex_mangler(const std::string &name)
shlibs_list m_loaded_shlibs
static void * try_load_mex(dynamic_library &mex_file, const std::string &fcn_name, bool &have_fmex)
void clear_function(const std::string &fcn_name)
symbol_table & get_symbol_table(void)
void clear_dld_function(const std::string &name)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
octave_function *(* octave_dld_fcn_getter)(const octave::dynamic_library &, bool relative)
void warning_with_id(const char *id, const char *fmt,...)
void error(const char *fmt,...)
F77_RET_T const F77_DBLE const F77_DBLE * f
F77_RET_T F77_FUNC(xerbla, XERBLA)(F77_CONST_CHAR_ARG_DEF(s_arg