diff options
author | Lennart Poettering <lennart@poettering.net> | 2007-08-10 14:28:39 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2007-08-10 14:28:39 +0000 |
commit | ffa170807086e959ce7cd9b21fb0c29b104b222b (patch) | |
tree | f1361aa0b1a54e9545a1de5398cbf1cf17c4b4cb /src/modules/module-cli.c | |
parent | e621071bf1a4f82ce5eba36917e67048ac0c59ef (diff) |
* 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
Diffstat (limited to 'src/modules/module-cli.c')
-rw-r--r-- | src/modules/module-cli.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/modules/module-cli.c b/src/modules/module-cli.c index 19ac0c26..fd180bc7 100644 --- a/src/modules/module-cli.c +++ b/src/modules/module-cli.c @@ -66,15 +66,14 @@ static void eof_and_exit_cb(pa_cli*c, void *userdata) { m->core->mainloop->quit(m->core->mainloop, 0); } -int pa__init(pa_core *c, pa_module*m) { +int pa__init(pa_module*m) { pa_iochannel *io; pa_modargs *ma; int exit_on_eof = 0; - assert(c); assert(m); - if (c->running_as_daemon) { + if (m->core->running_as_daemon) { pa_log_info("Running as daemon, refusing to load this module."); return 0; } @@ -94,12 +93,10 @@ int pa__init(pa_core *c, pa_module*m) { goto fail; } - io = pa_iochannel_new(c->mainloop, STDIN_FILENO, STDOUT_FILENO); - assert(io); + io = pa_iochannel_new(m->core->mainloop, STDIN_FILENO, STDOUT_FILENO); pa_iochannel_set_noclose(io, 1); - m->userdata = pa_cli_new(c, io, m); - assert(m->userdata); + m->userdata = pa_cli_new(m->core, io, m); pa_cli_set_eof_callback(m->userdata, exit_on_eof ? eof_and_exit_cb : eof_and_unload_cb, m); @@ -115,11 +112,10 @@ fail: return -1; } -void pa__done(pa_core *c, pa_module*m) { - assert(c); +void pa__done(pa_module*m) { assert(m); - if (c->running_as_daemon == 0) { + if (m->core->running_as_daemon == 0) { pa_cli_free(m->userdata); pa_stdio_release(); } |