]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/hook-list.c
Remove unnecessary #includes
[pulseaudio] / src / pulsecore / hook-list.c
index 5f7a8665edfa7c9b72c8485dce90e1f674358f92..00981be3031d682a664965bc9a085b29e4025fd6 100644 (file)
@@ -23,6 +23,8 @@
 #include <config.h>
 #endif
 
+#include <pulse/xmalloc.h>
+
 #include <pulsecore/macro.h>
 
 #include "hook-list.h"
@@ -97,7 +99,7 @@ pa_hook_result_t pa_hook_fire(pa_hook *hook, void *data) {
 
     hook->n_firing ++;
 
-    for (slot = hook->slots; slot; slot = slot->next) {
+    PA_LLIST_FOREACH(slot, hook->slots) {
         if (slot->dead)
             continue;
 
@@ -121,3 +123,9 @@ pa_hook_result_t pa_hook_fire(pa_hook *hook, void *data) {
 
     return result;
 }
+
+pa_bool_t pa_hook_is_firing(pa_hook *hook) {
+    pa_assert(hook);
+
+    return hook->n_firing > 0;
+}