]> code.delx.au - pulseaudio/blob - src/pdispatch.h
main part of the native protocol
[pulseaudio] / src / pdispatch.h
1 #ifndef foopdispatchhfoo
2 #define foopdispatchhfoo
3
4 #include <inttypes.h>
5 #include "tagstruct.h"
6 #include "packet.h"
7 #include "mainloop-api.h"
8
9 struct pdispatch;
10
11 struct pdispatch_command {
12 int (*proc)(struct pdispatch *pd, uint32_t command, uint32_t tag, struct tagstruct *t, void *userdata);
13 };
14
15 struct pdispatch* pdispatch_new(struct pa_mainloop_api *m, const struct pdispatch_command*table, unsigned entries);
16 void pdispatch_free(struct pdispatch *pd);
17
18 int pdispatch_run(struct pdispatch *pd, struct packet*p, void *userdata);
19
20 void pdispatch_register_reply(struct pdispatch *pd, uint32_t tag, int timeout, int (*cb)(struct pdispatch *pd, uint32_t command, uint32_t tag, struct tagstruct *t, void *userdata), void *userdata);
21
22 #endif