Add STAILQ_FOREACH.

This commit is contained in:
John Polstra 1999-08-30 01:01:19 +00:00
parent 30f6d5b508
commit a2c07ebf59
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50604

View File

@ -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; \