36 static Glib::RefPtr <dl>
create () {
return Glib::RefPtr <dl> (
new dl ()); }
40 void open (std::string
const &
file = std::string ());
48 template <
typename T> T &
get (std::string
const &name);
53 template <
typename T> T &
dl::get (std::string
const &name)
56 shevek_error (
"unable to get symbol: no valid handle");
62 hack.input = dlsym (m_handle, name.c_str ());
64 shevek_error (
ostring (
"unable to get symbol: %s", dlerror ()));
shevek::ostring is a C++ version of printf.
Definition: iostring.hh:322
Load symbols from dynamic libraries.
Definition: dl.hh:31
Use normal files with the fd class.
Definition: file.hh:26
Base class for classes which want reference counting through Glib::RefPtr.
Definition: refbase.hh:27
void open(std::string const &file=std::string())
Open a shared library.
void close()
Close the library, freeing the resources.
T & get(std::string const &name)
Get a symbol from the library.
Definition: dl.hh:53
~dl()
Close object and free structures.
static Glib::RefPtr< dl > create()
Create a new dl object.
Definition: dl.hh:36