]>
code.delx.au - pulseaudio/blob - src/client.c
8 struct pa_client
*pa_client_new(struct pa_core
*core
, const char *protocol_name
, char *name
) {
13 c
= malloc(sizeof(struct pa_client
));
15 c
->name
= name
? strdup(name
) : NULL
;
18 c
->protocol_name
= protocol_name
;
23 r
= pa_idxset_put(core
->clients
, c
, &c
->index
);
24 assert(c
->index
!= PA_IDXSET_INVALID
&& r
>= 0);
26 fprintf(stderr
, "client: created %u \"%s\"\n", c
->index
, c
->name
);
31 void pa_client_free(struct pa_client
*c
) {
34 pa_idxset_remove_by_data(c
->core
->clients
, c
, NULL
);
35 fprintf(stderr
, "client: freed %u \"%s\"\n", c
->index
, c
->name
);
40 void pa_client_kill(struct pa_client
*c
) {
43 fprintf(stderr
, "kill() operation not implemented for client %u\n", c
->index
);
50 void pa_client_rename(struct pa_client
*c
, const char *name
) {
53 c
->name
= name
? strdup(name
) : NULL
;