From 49c987ef8d54a0d0991798bd588311a543c65b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 12 Jan 2003 16:00:59 +0000 Subject: [PATCH] Added a macro to iterate through the kqueue. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2416 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/kqueue.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/headers/private/kernel/kqueue.h b/headers/private/kernel/kqueue.h index 2edfda5396..5ba2fba487 100644 --- a/headers/private/kernel/kqueue.h +++ b/headers/private/kernel/kqueue.h @@ -17,6 +17,10 @@ struct quehead { struct quehead *prev; }; +/* You can use this macro to iterate through the queue. */ +#define kqueue_foreach(head, element) \ + for ((element) = (void *)(head)->next; (element) != (void *)(head); (element) = (void *)((struct quehead *)(element))->next) + /** Initializes a queue to be used */