mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-06-02 06:01:10 +00:00
Update: Replaced module_container_new()
This commit is contained in:
parent
bdbe3379ce
commit
b875e80230
|
@ -38,7 +38,7 @@ void global_initialize(void)
|
|||
global.clients = 0;
|
||||
global.sources = 0;
|
||||
global.source_tree = avl_tree_new(source_compare_sources, NULL);
|
||||
global.modulecontainer = module_container_new();
|
||||
global.modulecontainer = refobject_new(module_container_t);
|
||||
thread_mutex_create(&_global_mutex);
|
||||
}
|
||||
|
||||
|
|
18
src/module.c
18
src/module.c
|
@ -50,24 +50,22 @@ static void __module_container_free(refobject_t self, void **userdata)
|
|||
avl_tree_free(cont->module, (avl_free_key_fun_type)refobject_unref);
|
||||
}
|
||||
|
||||
REFOBJECT_DEFINE_TYPE(module_container_t,
|
||||
REFOBJECT_DEFINE_TYPE_FREE(__module_container_free)
|
||||
);
|
||||
|
||||
module_container_t * module_container_new(void)
|
||||
int __module_container_new(refobject_t self, const refobject_type_t *type, va_list ap)
|
||||
{
|
||||
module_container_t *ret = refobject_new__new(module_container_t, NULL, NULL, NULL);
|
||||
|
||||
if (!ret)
|
||||
return NULL;
|
||||
module_container_t *ret = REFOBJECT_TO_TYPE(self, module_container_t*);
|
||||
|
||||
thread_mutex_create(&(ret->lock));
|
||||
|
||||
ret->module = avl_tree_new(compare_refobject_t_name, NULL);
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
REFOBJECT_DEFINE_TYPE(module_container_t,
|
||||
REFOBJECT_DEFINE_TYPE_FREE(__module_container_free),
|
||||
REFOBJECT_DEFINE_TYPE_NEW(__module_container_new)
|
||||
);
|
||||
|
||||
int module_container_add_module(module_container_t *self, module_t *module)
|
||||
{
|
||||
if (!self)
|
||||
|
|
|
@ -25,7 +25,6 @@ typedef struct {
|
|||
REFOBJECT_FORWARD_TYPE(module_container_t);
|
||||
REFOBJECT_FORWARD_TYPE(module_t);
|
||||
|
||||
module_container_t * module_container_new(void);
|
||||
int module_container_add_module(module_container_t *self, module_t *module);
|
||||
int module_container_delete_module(module_container_t *self, const char *name);
|
||||
module_t * module_container_get_module(module_container_t *self, const char *name);
|
||||
|
|
Loading…
Reference in New Issue
Block a user