10 int module_load(const char* file_name, int argc, char *argv[])
12 lt_dlhandle* module = NULL;
16 * The result of lt_dlerror(), when called, must be cached prior
17 * to calling Debug. This is because Debug is a macro that expands
18 * into multiple function calls.
21 int (*initialize) LDAP_P((int argc, char *argv[]));
25 Debug(LDAP_DEBUG_ANY, "lt_dlinit failed: %s\n", error, 0, 0);
29 if ((module = lt_dlopen(file_name)) == NULL) {
31 Debug(LDAP_DEBUG_ANY, "lt_dlopen failed: (%s) %s\n", file_name,
36 Debug(LDAP_DEBUG_CONFIG, "loaded module %s\n", file_name, 0, 0);
38 if ((initialize = lt_dlsym(module, "init_module")))
39 return initialize(argc, argv);
41 Debug(LDAP_DEBUG_CONFIG, "module %s: no init_module() function found\n",
46 int module_path(const char *path)
51 * The result of lt_dlerror(), when called, must be cached prior
52 * to calling Debug. This is because Debug is a macro that expands
53 * into multiple function calls.
58 Debug(LDAP_DEBUG_ANY, "lt_dlinit failed: %s\n", error, 0, 0);
62 return lt_dlsetsearchpath( path );
64 #endif /* SLAPD_MODULES */