64 #include "gw-config.h" 72 void *dl_handle, *addr;
77 dl_handle = dlopen(lib_path, RTLD_NOW | RTLD_LOCAL);
80 error(0,
"error opening shared library `%s': %s", (lib_path == NULL ?
"" : lib_path), err);
84 debug(
"gw_dlopen", 0,
"shared library `%s' opened", (lib_path == NULL ?
"" : lib_path));
86 addr = dlsym(dl_handle,
name);
88 error(0,
"error find name in shared library `%s': %s", (lib_path == NULL ?
"" : lib_path), dlerror());
void error(int err, const char *fmt,...)
int gw_dlopen_get_symbol(const char *lib_path, const char *name, void **result)
void debug(const char *place, int err, const char *fmt,...)