4 #include <boost/filesystem.hpp> 16 static bool first =
true;
34 raise(
"failed to initialize dladvise: ", lt_dlerror());
41 if (lt_dladvise_destroy(&
advise_))
42 raise(
"failed to destroy dladvise: ", lt_dlerror());
48 if (global ? lt_dladvise_global(&
advise_) : lt_dladvise_local(&
advise_))
49 raise(
"failed to set dladvise to ", global ?
"global" :
"local",
58 raise(
"failed to set dladvise to ext: ", lt_dlerror());
92 std::cerr <<
"xltdl: dlopen(" << s <<
")... ";
93 auto res = lt_dlopenadvise(s.c_str(),
advise_);
97 std::cerr <<
"success\n";
99 std::cerr <<
"fail: " << lt_dlerror() <<
'\n';
107 auto res = lt_dlhandle{
nullptr};
121 raise(
"failed to dlopen module ", s,
": ", lt_dlerror());
150 int errors = lt_dlclose(
handle);
153 raise(
"failed to dlclose module: ", lt_dlerror());
xlt_advise & global(bool global)
lt_dlhandle handle
The handle.
void attach(lt_dlhandle h)
Detach so that destruction does not close.
void detach()
Detach so that destruction does not close.
Explicit path representation.
lt_dlhandle dlopen_(const file_library::path &s) const
Does not use the search path. Can return 0.
void close()
Close the handle.
const file_library & path() const noexcept
xlt_handle(lt_dlhandle h=nullptr)
boost::filesystem::path path
xlt_handle xlt_openext(const std::string &s, bool global)
Wrapper around lt_dlopenext.
const path_list_type & search_path_get() const
xlt_handle open(const std::string &s)
xlt_advise & verbose(int v)
Whether to report dlopen attempts.