mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1234 fefdeb5f-60dc-0310-8127-8f9354f1896f
32 lines
793 B
C
32 lines
793 B
C
/* $Id$ */
|
|
|
|
#include <pulsecore/hook-list.h>
|
|
#include <pulsecore/log.h>
|
|
|
|
static pa_hook_result_t func1(const char*a, void *userdata) {
|
|
pa_log("#1 arg=%s userdata=%s", a, (char*) userdata);
|
|
return PA_HOOK_OK;
|
|
}
|
|
|
|
static pa_hook_result_t func2(const char*a, void *userdata) {
|
|
pa_log("#2 arg=%s userdata=%s", a, (char*) userdata);
|
|
return PA_HOOK_OK;
|
|
}
|
|
|
|
int main(int argc, char *argv[]) {
|
|
pa_hook hook;
|
|
pa_hook_slot *slot;
|
|
|
|
pa_hook_init(&hook);
|
|
|
|
pa_hook_connect(&hook, (pa_hook_cb_t) func1, (void*) "1-1");
|
|
slot = pa_hook_connect(&hook, (pa_hook_cb_t) func2, (void*) "2-1");
|
|
pa_hook_connect(&hook, (pa_hook_cb_t) func1, (void*) "1-2");
|
|
|
|
pa_hook_fire(&hook, (void*) "arg2");
|
|
|
|
pa_hook_slot_free(slot);
|
|
pa_hook_free(&hook);
|
|
|
|
return 0;
|
|
}
|