drop unused variable
[pulseaudio.git] / src / tests / hook-list-test.c
blob6879eae5359b34df1e473d9690bdbd10272097bf
1 /* $Id$ */
3 #include <pulsecore/hook-list.h>
4 #include <pulsecore/log.h>
6 static pa_hook_result_t func1(const char*hook_data, const char*call_data, const char*slot_data) {
7 pa_log("(func1) hook=%s call=%s slot=%s", hook_data, call_data, slot_data);
8 return PA_HOOK_OK;
11 static pa_hook_result_t func2(const char*hook_data, const char*call_data, const char*slot_data) {
12 pa_log("(func2) hook=%s call=%s slot=%s", hook_data, call_data, slot_data);
13 return PA_HOOK_OK;
16 int main(int argc, char *argv[]) {
17 pa_hook hook;
18 pa_hook_slot *slot;
20 pa_hook_init(&hook, (void*) "hook");
22 pa_hook_connect(&hook, (pa_hook_cb_t) func1, (void*) "slot1");
23 slot = pa_hook_connect(&hook, (pa_hook_cb_t) func2, (void*) "slot2");
24 pa_hook_connect(&hook, (pa_hook_cb_t) func1, (void*) "slot3");
26 pa_hook_fire(&hook, (void*) "call1");
28 pa_hook_slot_free(slot);
30 pa_hook_fire(&hook, (void*) "call2");
32 pa_hook_free(&hook);
34 return 0;