1 #ifndef foopdispatchhfoo
2 #define foopdispatchhfoo
7 #include "mainloop-api.h"
11 /* It is safe to destroy the calling pdispatch object from all callbacks */
13 struct pa_pdispatch_command {
14 void (*proc)(struct pa_pdispatch *pd, uint32_t command, uint32_t tag, struct pa_tagstruct *t, void *userdata);
17 struct pa_pdispatch* pa_pdispatch_new(struct pa_mainloop_api *m, const struct pa_pdispatch_command*table, unsigned entries);
18 void pa_pdispatch_free(struct pa_pdispatch *pd);
20 int pa_pdispatch_run(struct pa_pdispatch *pd, struct pa_packet*p, void *userdata);
22 void pa_pdispatch_register_reply(struct pa_pdispatch *pd, uint32_t tag, int timeout, void (*cb)(struct pa_pdispatch *pd, uint32_t command, uint32_t tag, struct pa_tagstruct *t, void *userdata), void *userdata);
24 int pa_pdispatch_is_pending(struct pa_pdispatch *pd);
26 void pa_pdispatch_set_drain_callback(struct pa_pdispatch *pd, void (*cb)(struct pa_pdispatch *pd, void *userdata), void *userdata);
28 /* Remove all reply slots with the give userdata parameter */
29 void pa_pdispatch_unregister_reply(struct pa_pdispatch *pd, void *userdata);