return server;
}
-static int virtual_server_free(virtual_server_t *server)
+static int _virtual_server_free(virtual_server_t *server)
{
if (server->components) rbtree_free(server->components);
return 0;
}
}
-static int indexed_modcallable_free(indexed_modcallable *this)
+static int _indexed_modcallable_free(indexed_modcallable *this)
{
modcallable_free(&this->modulelist);
return 0;
/*
* Free a module entry.
*/
-static int module_entry_free(module_entry_t *this)
+static int _module_entry_free(module_entry_t *this)
{
#ifndef NDEBUG
/*
/* make room for the module type */
node = talloc_zero(cs, module_entry_t);
- talloc_set_destructor(node, module_entry_free);
+ talloc_set_destructor(node, _module_entry_free);
strlcpy(node->name, module_name, sizeof(node->name));
node->module = module;
node->handle = handle;
return NULL;
}
- talloc_set_destructor(c, indexed_modcallable_free);
+ talloc_set_destructor(c, _indexed_modcallable_free);
return c;
}
cf_section_filename(cs));
}
- components = rbtree_create(indexed_modcallable_cmp, NULL, 0);
- if (!components) {
- ERROR("Failed to initialize components\n");
- goto error;
- }
-
server = talloc_zero(cs, virtual_server_t);
server->name = name;
server->created = time(NULL);
server->cs = cs;
- server->components = components;
- talloc_set_destructor(server, virtual_server_free);
+ server->components = components = rbtree_create(server, indexed_modcallable_cmp, NULL, 0);
+ if (!components) {
+ ERROR("Failed to initialize components");
+ goto error;
+ }
+ talloc_set_destructor(server, _virtual_server_free);
/*
* Define types first.
/*
* Set up the internal module struct.
*/
- module_tree = rbtree_create(module_entry_cmp, NULL, 0);
+ module_tree = rbtree_create(NULL, module_entry_cmp, NULL, 0);
if (!module_tree) {
ERROR("Failed to initialize modules\n");
return -1;
}
- instance_tree = rbtree_create(module_instance_cmp,
+ instance_tree = rbtree_create(NULL, module_instance_cmp,
module_instance_free, 0);
if (!instance_tree) {
ERROR("Failed to initialize modules\n");