30#ifndef __CLAW_DYNAMIC_LIBRARY_TRAITS_UNIX_HPP__
31#define __CLAW_DYNAMIC_LIBRARY_TRAITS_UNIX_HPP__
57 handle h = dlopen(name.c_str(), RTLD_LAZY);
72 handle h = dlopen(NULL, RTLD_LAZY);
100 *(
void**)(&result) = dlsym(h, name.c_str());
112 return dlsym(h, name.c_str()) != NULL;
Unix interface for using dynamic libraries.
static T get_symbol(handle h, const std::string &name)
Get a symbol from a library.
static bool have_symbol(handle h, const std::string &name)
Tell if a symbol is in the library.
static handle open(const std::string &name)
Open a library.
static handle auto_open(const std::string &name)
Open the current program.
static void close(handle h)
Close a library.
void * handle
Type of the system handle to the library.
static bool valid_handle(handle h)
Tell if an handle is a valid library handle.
A simple class to use as exception with string message.
A simple class to use as exception with string message.
This is the main namespace.
dynamic_library_traits_unix dynamic_library_traits
The traits to access the dynamic libraries in Unix system.