diff options
author | archie <archie@FreeBSD.org> | 2000-04-27 22:50:12 +0000 |
---|---|---|
committer | archie <archie@FreeBSD.org> | 2000-04-27 22:50:12 +0000 |
commit | 3e88ebfc3bb1caf670976b0728a058d37f5b2d3a (patch) | |
tree | 55e369e17406572761228727309292d664523524 /sys | |
parent | 9c5f71c789949460932581597c50bb5525b80e58 (diff) | |
download | FreeBSD-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.h | 5 |
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); \ |