10 int load_module(const char* file_name, int argc, char *argv[]) {
11 GModule* module = NULL;
12 void (*initialize) LDAP_P((int argc, char *argv[]));
14 if (!g_module_supported()) {
15 Debug(LDAP_DEBUG_ANY, "loadable modules not supported on this platform\n", 0, 0, 0);
19 if ((module = g_module_open(file_name, G_MODULE_BIND_LAZY)) == NULL) {
20 Debug(LDAP_DEBUG_ANY, "failed to load module %s: %s\n", file_name, g_module_error(), 0);
24 Debug(LDAP_DEBUG_CONFIG, "loaded module %s\n", file_name, 0, 0);
26 if (g_module_symbol(module, "init_module", (gpointer *) &initialize)) {
27 initialize(argc, argv);
29 Debug(LDAP_DEBUG_CONFIG, "module %s: no init_module() function found\n", file_name, 0, 0);
36 #endif /* SLAPD_MODULES */