]>
code.delx.au - pulseaudio/blob - src/tests/hook-list-test.c
3 #include <pulsecore/hook-list.h>
4 #include <pulsecore/log.h>
6 static pa_hook_result_t
func1(const char*a
, void *userdata
) {
7 pa_log("#1 arg=%s userdata=%s", a
, (char*) userdata
);
11 static pa_hook_result_t
func2(const char*a
, void *userdata
) {
12 pa_log("#2 arg=%s userdata=%s", a
, (char*) userdata
);
16 int main(int argc
, char *argv
[]) {
22 pa_hook_connect(&hook
, (pa_hook_cb_t
) func1
, (void*) "1-1");
23 slot
= pa_hook_connect(&hook
, (pa_hook_cb_t
) func2
, (void*) "2-1");
24 pa_hook_connect(&hook
, (pa_hook_cb_t
) func1
, (void*) "1-2");
26 pa_hook_fire(&hook
, (void*) "arg2");
28 pa_hook_slot_free(slot
);