summaryrefslogtreecommitdiffstats
path: root/src/module.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-07-03 23:35:12 +0000
committerLennart Poettering <lennart@poettering.net>2004-07-03 23:35:12 +0000
commite61c2dddb7bc392ab4073d5691870615ada82922 (patch)
treeb7e98c4232ca855c7bac6ba88e47b7ff45a9cbe1 /src/module.c
parenta8a5ab1c79c0b6567ecc98343ff1ae944f2285b9 (diff)
add pa_ prefix to all identifiers.
fix downsampling/resampling add support for U8 samples git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@49 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/module.c')
-rw-r--r--src/module.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/module.c b/src/module.c
index 883a22df..468998ba 100644
--- a/src/module.c
+++ b/src/module.c
@@ -8,13 +8,13 @@
#include "module.h"
#include "strbuf.h"
-struct module* module_load(struct core *c, const char *name, const char *argument) {
- struct module *m = NULL;
+struct pa_module* pa_module_load(struct pa_core *c, const char *name, const char *argument) {
+ struct pa_module *m = NULL;
int r;
assert(c && name);
- m = malloc(sizeof(struct module));
+ m = malloc(sizeof(struct pa_module));
assert(m);
m->name = strdup(name);
@@ -37,11 +37,11 @@ struct module* module_load(struct core *c, const char *name, const char *argumen
goto fail;
if (!c->modules)
- c->modules = idxset_new(NULL, NULL);
+ c->modules = pa_idxset_new(NULL, NULL);
assert(c->modules);
- r = idxset_put(c->modules, m, &m->index);
- assert(r >= 0 && m->index != IDXSET_INVALID);
+ r = pa_idxset_put(c->modules, m, &m->index);
+ assert(r >= 0 && m->index != PA_IDXSET_INVALID);
fprintf(stderr, "module: loaded %u \"%s\" with argument \"%s\".\n", m->index, m->name, m->argument);
@@ -61,7 +61,7 @@ fail:
return NULL;
}
-static void module_free(struct module *m) {
+static void pa_module_free(struct pa_module *m) {
assert(m && m->done && m->core);
m->done(m->core, m);
@@ -75,75 +75,75 @@ static void module_free(struct module *m) {
}
-void module_unload(struct core *c, struct module *m) {
+void pa_module_unload(struct pa_core *c, struct pa_module *m) {
assert(c && m);
assert(c->modules);
- if (!(m = idxset_remove_by_data(c->modules, m, NULL)))
+ if (!(m = pa_idxset_remove_by_data(c->modules, m, NULL)))
return;
- module_free(m);
+ pa_module_free(m);
}
-void module_unload_by_index(struct core *c, uint32_t index) {
- struct module *m;
- assert(c && index != IDXSET_INVALID);
+void pa_module_unload_by_index(struct pa_core *c, uint32_t index) {
+ struct pa_module *m;
+ assert(c && index != PA_IDXSET_INVALID);
assert(c->modules);
- if (!(m = idxset_remove_by_index(c->modules, index)))
+ if (!(m = pa_idxset_remove_by_index(c->modules, index)))
return;
- module_free(m);
+ pa_module_free(m);
}
-void free_callback(void *p, void *userdata) {
- struct module *m = p;
+static void free_callback(void *p, void *userdata) {
+ struct pa_module *m = p;
assert(m);
- module_free(m);
+ pa_module_free(m);
}
-void module_unload_all(struct core *c) {
+void pa_module_unload_all(struct pa_core *c) {
assert(c);
if (!c->modules)
return;
- idxset_free(c->modules, free_callback, NULL);
+ pa_idxset_free(c->modules, free_callback, NULL);
c->modules = NULL;
}
-char *module_list_to_string(struct core *c) {
- struct strbuf *s;
- struct module *m;
- uint32_t index = IDXSET_INVALID;
+char *pa_module_list_to_string(struct pa_core *c) {
+ struct pa_strbuf *s;
+ struct pa_module *m;
+ uint32_t index = PA_IDXSET_INVALID;
assert(c);
- s = strbuf_new();
+ s = pa_strbuf_new();
assert(s);
- strbuf_printf(s, "%u module(s) loaded.\n", idxset_ncontents(c->modules));
+ pa_strbuf_printf(s, "%u module(s) loaded.\n", pa_idxset_ncontents(c->modules));
- for (m = idxset_first(c->modules, &index); m; m = idxset_next(c->modules, &index))
- strbuf_printf(s, " index: %u, name: <%s>, argument: <%s>\n", m->index, m->name, m->argument);
+ for (m = pa_idxset_first(c->modules, &index); m; m = pa_idxset_next(c->modules, &index))
+ pa_strbuf_printf(s, " index: %u, name: <%s>, argument: <%s>\n", m->index, m->name, m->argument);
- return strbuf_tostring_free(s);
+ return pa_strbuf_tostring_free(s);
}
struct once_info {
- struct core *core;
+ struct pa_core *core;
uint32_t index;
};
-void module_unload_once_callback(void *userdata) {
+static void module_unload_once_callback(void *userdata) {
struct once_info *i = userdata;
assert(i);
- module_unload_by_index(i->core, i->index);
+ pa_module_unload_by_index(i->core, i->index);
free(i);
}
-void module_unload_request(struct core *c, struct module *m) {
+void pa_module_unload_request(struct pa_core *c, struct pa_module *m) {
struct once_info *i;
assert(c && m);