]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/hook-list.c
Remove unnecessary #includes
[pulseaudio] / src / pulsecore / hook-list.c
index 0aac475910fe653b3c0e7fe1ea01dc6eadd63d44..00981be3031d682a664965bc9a085b29e4025fd6 100644 (file)
@@ -5,7 +5,7 @@
 
   PulseAudio is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as
-  published by the Free Software Foundation; either version 2 of the
+  published by the Free Software Foundation; either version 2.1 of the
   License, or (at your option) any later version.
 
   PulseAudio is distributed in the hope that it will be useful, but
@@ -23,6 +23,8 @@
 #include <config.h>
 #endif
 
+#include <pulse/xmalloc.h>
+
 #include <pulsecore/macro.h>
 
 #include "hook-list.h"
@@ -44,7 +46,7 @@ static void slot_free(pa_hook *hook, pa_hook_slot *slot) {
     pa_xfree(slot);
 }
 
-void pa_hook_free(pa_hook *hook) {
+void pa_hook_done(pa_hook *hook) {
     pa_assert(hook);
     pa_assert(hook->n_firing == 0);
 
@@ -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;
+}