26 _nmsg_dlmod_init(
const char *path) {
29 dlmod = calloc(1,
sizeof(*dlmod));
30 assert(dlmod != NULL);
31 ISC_LINK_INIT(dlmod, link);
32 dlmod->path = strdup(path);
33 assert(dlmod->path != NULL);
35 dlmod->handle = dlopen(path, RTLD_LAZY);
36 if (dlmod->handle == NULL) {
37 _nmsg_dprintf(1,
"%s: %s\n", __func__, dlerror());
45 _nmsg_dlmod_destroy(
struct nmsg_dlmod **dlmod) {
46 if (dlclose((*dlmod)->handle) != 0)
47 _nmsg_dprintf(1,
"%s: %s\n", __func__, dlerror());
an nmsg_message MUST always have a non-NULL ->np member.