summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorarchie <archie@FreeBSD.org>2000-04-27 22:50:12 +0000
committerarchie <archie@FreeBSD.org>2000-04-27 22:50:12 +0000
commit3e88ebfc3bb1caf670976b0728a058d37f5b2d3a (patch)
tree55e369e17406572761228727309292d664523524 /sys
parent9c5f71c789949460932581597c50bb5525b80e58 (diff)
downloadFreeBSD-src-3e88ebfc3bb1caf670976b0728a058d37f5b2d3a.zip
FreeBSD-src-3e88ebfc3bb1caf670976b0728a058d37f5b2d3a.tar.gz
Add a new macro CIRCLEQ_FOREACH_REVERSE for traversing through a
circle queue in the reverse direction (from tail to head).
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/queue.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/sys/queue.h b/sys/sys/queue.h
index b34558a..d20354f 100644
--- a/sys/sys/queue.h
+++ b/sys/sys/queue.h
@@ -417,6 +417,11 @@ struct { \
(var) != (void *)(head); \
(var) = (var)->field.cqe_next)
+#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
+ for((var) = (head)->cqh_last; \
+ (var) != (void *)(head); \
+ (var) = (var)->field.cqe_prev)
+
#define CIRCLEQ_INIT(head) do { \
(head)->cqh_first = (void *)(head); \
(head)->cqh_last = (void *)(head); \
OpenPOWER on IntegriCloud