Add STAILQ_FOREACH.
This commit is contained in:
parent
30f6d5b508
commit
a2c07ebf59
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50604
@ -96,7 +96,7 @@
|
|||||||
* _NEXT + + + + +
|
* _NEXT + + + + +
|
||||||
* _PREV - - - + +
|
* _PREV - - - + +
|
||||||
* _LAST - - + + +
|
* _LAST - - + + +
|
||||||
* _FOREACH + + - + +
|
* _FOREACH + + + + +
|
||||||
* _INSERT_HEAD + + + + +
|
* _INSERT_HEAD + + + + +
|
||||||
* _INSERT_BEFORE - + - + +
|
* _INSERT_BEFORE - + - + +
|
||||||
* _INSERT_AFTER + + + + +
|
* _INSERT_AFTER + + + + +
|
||||||
@ -192,6 +192,9 @@ struct { \
|
|||||||
#define STAILQ_FIRST(head) ((head)->stqh_first)
|
#define STAILQ_FIRST(head) ((head)->stqh_first)
|
||||||
#define STAILQ_LAST(head) (*(head)->stqh_last)
|
#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 { \
|
#define STAILQ_INSERT_HEAD(head, elm, field) do { \
|
||||||
if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
|
if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
|
||||||
(head)->stqh_last = &(elm)->field.stqe_next; \
|
(head)->stqh_last = &(elm)->field.stqe_next; \
|
||||||
|
Loading…
Reference in New Issue
Block a user