From 6a9cb902ae25efa6f853dc10b20cd657b8a1f809 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 7 Dec 2011 03:08:58 +0100 Subject: [PATCH] Add ngx_queue_foreach() macro. --- include/uv-private/ngx-queue.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/uv-private/ngx-queue.h b/include/uv-private/ngx-queue.h index f8576d67..8c5e4617 100644 --- a/include/uv-private/ngx-queue.h +++ b/include/uv-private/ngx-queue.h @@ -99,4 +99,8 @@ struct ngx_queue_s { (type *) ((unsigned char *) q - offsetof(type, link)) +#define ngx_queue_foreach(q, h) \ + for ((q) = ngx_queue_head(h); (q) != (h); (q) = ngx_queue_next(q)) + + #endif /* _NGX_QUEUE_H_INCLUDED_ */