aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/queue.h
diff options
context:
space:
mode:
authorJohn Polstra <jdp@FreeBSD.org>1999-08-30 01:01:19 +0000
committerJohn Polstra <jdp@FreeBSD.org>1999-08-30 01:01:19 +0000
commita2c07ebf59864a44aab845fb5e94fe0f850cd2a6 (patch)
tree9a923b1a8d1f8b14a2f15dcdde01e2e2d3d42746 /sys/sys/queue.h
parent30f6d5b5084f821e3ce5f2aa552ea26f5771fd74 (diff)
downloadsrc-a2c07ebf59864a44aab845fb5e94fe0f850cd2a6.tar.gz
src-a2c07ebf59864a44aab845fb5e94fe0f850cd2a6.zip
Add STAILQ_FOREACH.
Notes
Notes: svn path=/head/; revision=50604
Diffstat (limited to 'sys/sys/queue.h')
-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 4bf34b8d720e..e03ed9b47e39 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; \