]> code.delx.au - pulseaudio/blob - src/polypcore/pdispatch.h
Reorganised the source tree. We now have src/ with a couple of subdirs:
[pulseaudio] / src / polypcore / pdispatch.h
1 #ifndef foopdispatchhfoo
2 #define foopdispatchhfoo
3
4 /* $Id$ */
5
6 /***
7 This file is part of polypaudio.
8
9 polypaudio is free software; you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as
11 published by the Free Software Foundation; either version 2.1 of the
12 License, or (at your option) any later version.
13
14 polypaudio is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with polypaudio; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA.
23 ***/
24
25 #include <inttypes.h>
26 #include "tagstruct.h"
27 #include "packet.h"
28 #include <polyp/mainloop-api.h>
29
30 typedef struct pa_pdispatch pa_pdispatch;
31
32 typedef void (*pa_pdispatch_callback)(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
33
34 pa_pdispatch* pa_pdispatch_new(pa_mainloop_api *m, const pa_pdispatch_callback*table, unsigned entries);
35 void pa_pdispatch_unref(pa_pdispatch *pd);
36 pa_pdispatch* pa_pdispatch_ref(pa_pdispatch *pd);
37
38 int pa_pdispatch_run(pa_pdispatch *pd, pa_packet*p, void *userdata);
39
40 void pa_pdispatch_register_reply(pa_pdispatch *pd, uint32_t tag, int timeout, pa_pdispatch_callback callback, void *userdata);
41
42 int pa_pdispatch_is_pending(pa_pdispatch *pd);
43
44 typedef void (*pa_pdispatch_drain_callback)(pa_pdispatch *pd, void *userdata);
45 void pa_pdispatch_set_drain_callback(pa_pdispatch *pd, pa_pdispatch_drain_callback callback, void *userdata);
46
47 /* Remove all reply slots with the give userdata parameter */
48 void pa_pdispatch_unregister_reply(pa_pdispatch *pd, void *userdata);
49
50 #endif