summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1999-08-30 01:01:19 +0000
committerjdp <jdp@FreeBSD.org>1999-08-30 01:01:19 +0000
commitf1d29df71c7afe5137bb040f3409f92caa5059fb (patch)
treee2e7717ed173e2fee6505fc0e26bccb98e83d063
parent005f49ab4e0c87e6808f822c4afd572998f11b1b (diff)
downloadFreeBSD-src-f1d29df71c7afe5137bb040f3409f92caa5059fb.zip
FreeBSD-src-f1d29df71c7afe5137bb040f3409f92caa5059fb.tar.gz
Add STAILQ_FOREACH.
-rw-r--r--sys/sys/queue.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/sys/queue.h b/sys/sys/queue.h
index 4bf34b8..e03ed9b 100644
--- a/sys/sys/queue.h
+++ b/sys/sys/queue.h
@@ -96,7 +96,7 @@
* _NEXT + + + + +
* _PREV - - - + +
* _LAST - - + + +
- * _FOREACH + + - + +
+ * _FOREACH + + + + +
* _INSERT_HEAD + + + + +
* _INSERT_BEFORE - + - + +
* _INSERT_AFTER + + + + +
@@ -192,6 +192,9 @@ struct { \
#define STAILQ_FIRST(head) ((head)->stqh_first)
#define STAILQ_LAST(head) (*(head)->stqh_last)
+#define STAILQ_FOREACH(var, head, field) \
+ for((var) = (head)->stqh_first; (var); (var) = (var)->field.stqe_next)
+
#define STAILQ_INSERT_HEAD(head, elm, field) do { \
if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
(head)->stqh_last = &(elm)->field.stqe_next; \
OpenPOWER on IntegriCloud