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
#include <config.h>
#endif
+#include <pulse/xmalloc.h>
+
#include <pulsecore/macro.h>
#include "hook-list.h"
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);
slot = pa_xnew(pa_hook_slot, 1);
slot->hook = hook;
- slot->dead = FALSE;
+ slot->dead = false;
slot->callback = cb;
slot->data = data;
slot->priority = prio;
pa_assert(!slot->dead);
if (slot->hook->n_firing > 0) {
- slot->dead = TRUE;
+ slot->dead = true;
slot->hook->n_dead++;
} else
slot_free(slot->hook, slot);
hook->n_firing ++;
- for (slot = hook->slots; slot; slot = slot->next) {
+ PA_LLIST_FOREACH(slot, hook->slots) {
if (slot->dead)
continue;
return result;
}
+
+bool pa_hook_is_firing(pa_hook *hook) {
+ pa_assert(hook);
+
+ return hook->n_firing > 0;
+}