diff options
| author | Archie Cobbs <archie@FreeBSD.org> | 2000-05-01 18:17:14 +0000 |
|---|---|---|
| committer | Archie Cobbs <archie@FreeBSD.org> | 2000-05-01 18:17:14 +0000 |
| commit | 2be85d6daca1bf82a0d9364a79b3eff3bf048422 (patch) | |
| tree | 759a55b22ac2937ce3cbf4ba9eddba8b7d000478 | |
| parent | 7892318c6529ecef0291f0aebc34e02a8d99bad2 (diff) | |
Notes
| -rw-r--r-- | sys/sys/queue.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/sys/queue.h b/sys/sys/queue.h index d20354ff5101..a7ec5da4dd8a 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -74,7 +74,7 @@ * linked so that an arbitrary element can be removed without a need to * traverse the list. New elements can be added to the list before or * after an existing element, at the head of the list, or at the end of - * the list. A tail queue may only be traversed in the forward direction. + * the list. A tail queue may be traversed in either direction. * * A circle queue is headed by a pair of pointers, one to the head of the * list and the other to the tail of the list. The elements are doubly @@ -97,6 +97,7 @@ * _PREV - - - + + * _LAST - - + + + * _FOREACH + + + + + + * _FOREACH_REVERSE - - - + + * _INSERT_HEAD + + + + + * _INSERT_BEFORE - + - + + * _INSERT_AFTER + + + + + @@ -332,6 +333,11 @@ struct { \ #define TAILQ_FOREACH(var, head, field) \ for (var = TAILQ_FIRST(head); var; var = TAILQ_NEXT(var, field)) +#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ + for ((var) = TAILQ_LAST((head), headname); \ + (var); \ + (var) = TAILQ_PREV((var), headname, field)) + #define TAILQ_FIRST(head) ((head)->tqh_first) #define TAILQ_LAST(head, headname) \ |
