summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/cli.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-01-15 17:52:29 +0100
committerLennart Poettering <lennart@poettering.net>2009-01-15 17:52:29 +0100
commit5abda63a1fa4d2c867af8b33b0090cd651ba8599 (patch)
tree608d616ae082b7d0accec9caa317c4aa56a27696 /src/pulsecore/cli.c
parent75119e91cdb4f29b0567689d07d00ddc17a98b5c (diff)
convert pa_client instantiation to use a pa_client_new_data struct and add hooks for manipulating it
Diffstat (limited to 'src/pulsecore/cli.c')
-rw-r--r--src/pulsecore/cli.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/pulsecore/cli.c b/src/pulsecore/cli.c
index 67bf1e73..25a4f748 100644
--- a/src/pulsecore/cli.c
+++ b/src/pulsecore/cli.c
@@ -67,20 +67,33 @@ static void client_kill(pa_client *c);
pa_cli* pa_cli_new(pa_core *core, pa_iochannel *io, pa_module *m) {
char cname[256];
pa_cli *c;
+ pa_client_new_data data;
+ pa_client *client;
+
pa_assert(io);
+ pa_iochannel_socket_peer_to_string(io, cname, sizeof(cname));
+
+ pa_client_new_data_init(&data);
+ data.driver = __FILE__;
+ data.module = m;
+ pa_proplist_sets(data.proplist, PA_PROP_APPLICATION_NAME, cname);
+ client = pa_client_new(core, &data);
+ pa_client_new_data_done(&data);
+
+ if (!client)
+ return NULL;
+
c = pa_xnew(pa_cli, 1);
c->core = core;
+ c->client = client;
pa_assert_se(c->line = pa_ioline_new(io));
c->userdata = NULL;
c->eof_callback = NULL;
- pa_iochannel_socket_peer_to_string(io, cname, sizeof(cname));
- pa_assert_se(c->client = pa_client_new(core, __FILE__, cname));
c->client->kill = client_kill;
c->client->userdata = c;
- c->client->module = m;
pa_ioline_set_callback(c->line, line_callback, c);
pa_ioline_puts(c->line, "Welcome to PulseAudio! Use \"help\" for usage information.\n"PROMPT);