alsa: changed ret values
[transsip.git] / src / call-notifier.c
blob0b6b3d059e5848aa9e22016d1634d134878f8aaa
1 #include "notifier.h"
2 #include "locking.h"
3 #include "call-notifier.h"
5 static struct event_head call_notifier;
7 void init_call_notifier(void)
9 call_notifier.head = NULL;
10 mutexlock_init(&call_notifier.lock);
13 int register_call_notifier(struct event_block *block)
15 int ret;
17 mutexlock_lock(&call_notifier.lock);
18 ret = register_event_hook(&call_notifier.head, block);
19 mutexlock_unlock(&call_notifier.lock);
21 return ret;
24 int register_call_notifier_once(struct event_block *block)
26 int ret;
28 mutexlock_lock(&call_notifier.lock);
29 ret = register_event_hook_once(&call_notifier.head, block);
30 mutexlock_unlock(&call_notifier.lock);
32 return ret;
35 int unregister_call_notifier(struct event_block *block)
37 int ret;
39 mutexlock_lock(&call_notifier.lock);
40 ret = unregister_event_hook(&call_notifier.head, block);
41 mutexlock_unlock(&call_notifier.lock);
43 return ret;
46 int call_notifier_exec(unsigned long event, const void *arg)
48 int ret;
50 mutexlock_lock(&call_notifier.lock);
51 ret = call_event_hooks(&call_notifier.head, event, arg, NULL);
52 mutexlock_unlock(&call_notifier.lock);
54 return ret;