mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
more cleanups
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@11 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
c8cf0c1ce9
commit
5ce204829f
13 changed files with 162 additions and 39 deletions
14
src/client.c
14
src/client.c
|
|
@ -14,7 +14,7 @@ struct client *client_new(struct core *core, const char *protocol_name, char *na
|
|||
c->protocol_name = protocol_name;
|
||||
c->name = name ? strdup(name) : NULL;
|
||||
c->kill = NULL;
|
||||
c->userdata = NULL;
|
||||
c->kill_userdata = NULL;
|
||||
c->core = core;
|
||||
|
||||
r = idxset_put(core->clients, c, &c->index);
|
||||
|
|
@ -30,3 +30,15 @@ void client_free(struct client *c) {
|
|||
free(c->name);
|
||||
free(c);
|
||||
}
|
||||
|
||||
void client_set_kill_callback(struct client *c, void (*kill)(struct client *c, void *userdata), void *userdata) {
|
||||
assert(c && kill);
|
||||
c->kill = kill;
|
||||
c->kill_userdata = userdata;
|
||||
}
|
||||
|
||||
void client_kill(struct client *c) {
|
||||
assert(c);
|
||||
c->kill(c, c->kill_userdata);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue