summaryrefslogtreecommitdiffstats
path: root/src/queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/queue.c')
-rw-r--r--src/queue.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/queue.c b/src/queue.c
index 2509538..70ee54b 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -85,3 +85,13 @@ void fastd_queue_filter(fastd_context *ctx, fastd_queue *queue, bool (*pred)(fas
entry = &(*entry)->next;
}
}
+
+bool fastd_queue_has_entry(fastd_context *ctx, fastd_queue *queue, bool (*pred)(fastd_queue_entry*, void*), void *extra) {
+ fastd_queue_entry *entry;
+ for (entry = queue->head; entry; entry = entry->next) {
+ if (pred(entry, extra))
+ return true;
+ }
+
+ return false;
+}