* drop redundant pa_core argument from module initialization functions

* make pa__done() implementations optional
* a couple of modernizations
* wrap lt_dlsym() at a single place
* allow passing of an "api" argument to the HAL module, to choose whether OSS devices or ALSA devices should be picked up
* optimize fd closing a little on linux in the forked gconf helper
* save a little memory in the xsmp module


git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1615 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2007-08-10 14:28:39 +00:00
parent e621071bf1
commit ffa1708070
33 changed files with 532 additions and 444 deletions

View file

@ -26,7 +26,6 @@
#endif
#include <unistd.h>
#include <assert.h>
#include <string.h>
#include <errno.h>
@ -48,21 +47,23 @@ static const char* const valid_modargs[] = {
NULL,
};
int pa__init(pa_core *c, pa_module*m) {
int pa__init(pa_module*m) {
pa_modargs *ma = NULL;
int ret = -1, fd = -1;
char x = 1;
assert(c && m);
pa_assert(m);
if (!(ma = pa_modargs_new(m->argument, valid_modargs)) ||
pa_modargs_get_value_s32(ma, "fd", &fd) < 0 ||
fd < 0) {
pa_log("Failed to parse module arguments");
goto finish;
}
if (pa_loop_write(fd, &x, sizeof(x), NULL) != sizeof(x))
pa_log("WARNING: write(%u, 1, 1) failed: %s", fd, pa_cstrerror(errno));
pa_log_warn("WARNING: write(%u, 1, 1) failed: %s", fd, pa_cstrerror(errno));
close(fd);
@ -76,9 +77,3 @@ finish:
return ret;
}
void pa__done(pa_core *c, pa_module*m) {
assert(c && m);
}