]> code.delx.au - pulseaudio/commitdiff
make it compile
authorLennart Poettering <lennart@poettering.net>
Thu, 10 Jun 2004 23:22:16 +0000 (23:22 +0000)
committerLennart Poettering <lennart@poettering.net>
Thu, 10 Jun 2004 23:22:16 +0000 (23:22 +0000)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@4 fefdeb5f-60dc-0310-8127-8f9354f1896f

src/module.c
src/module.h

index bcd0b6c04922cca0978fcb127bdcdf01204e618c..94a431243cb590a0f88aa817128deec13403b137 100644 (file)
@@ -1,10 +1,12 @@
 #include <stdlib.h>
 #include <assert.h>
+#include <string.h>
 
 #include "module.h"
 
 struct module* module_load(struct core *c, const char *name, const char *argument) {
     struct module *m = NULL;
+    int r;
     
     assert(c && name);
 
@@ -23,6 +25,7 @@ struct module* module_load(struct core *c, const char *name, const char *argumen
     m->name = strdup(name);
     m->argument = argument ? strdup(argument) : NULL;
     m->userdata = NULL;
+    m->core = c;
 
     assert(m->init);
     if (m->init(c, m) < 0)
@@ -30,6 +33,7 @@ struct module* module_load(struct core *c, const char *name, const char *argumen
 
     if (!c->modules)
         c->modules = idxset_new(NULL, NULL);
+
     
     assert(c->modules);
     r = idxset_put(c->modules, m, &m->index);
@@ -48,18 +52,17 @@ fail:
 }
 
 static void module_free(struct module *m) {
-    assert(m && m->done);
-    m->done(c, m);
+    assert(m && m->done && m->core);
+    m->done(m->core, m);
 
-    lt_dlcose(m->dl);
+    lt_dlclose(m->dl);
     free(m->name);
     free(m->argument);
     free(m);
 }
 
 void module_unload(struct core *c, struct module *m) {
-    struct module *m;
-    assert(c && index != IDXSET_INVALID);
+    assert(c && m);
 
     assert(c->modules);
     if (!(m = idxset_remove_by_data(c->modules, m, NULL)))
@@ -68,7 +71,7 @@ void module_unload(struct core *c, struct module *m) {
     module_free(m);
 }
 
-void module_unload_by_index(struct core *c, guint32_t index) {
+void module_unload_by_index(struct core *c, uint32_t index) {
     struct module *m;
     assert(c && index != IDXSET_INVALID);
 
index d0dfa0454217c56224ba518890cfa110d862bf91..4ecef86e881dd7f8381dd5406e1764f69c9f17e2 100644 (file)
@@ -7,10 +7,11 @@
 #include "core.h"
 
 struct module {
+    struct core *core;
     char *name, *argument;
     uint32_t index;
 
-    lt_dlhandle *dl;
+    lt_dlhandle dl;
     
     int (*init)(struct core *c, struct module*m);
     void (*done)(struct core *c, struct module*m);