sys/queue.h: add LIST_FOREACH_SAFE
This commit is contained in:
parent
361f377493
commit
d23c3d110e
1 changed files with 5 additions and 0 deletions
|
@ -166,6 +166,11 @@ struct { \
|
||||||
(var); \
|
(var); \
|
||||||
(var) = ((var)->field.le_next))
|
(var) = ((var)->field.le_next))
|
||||||
|
|
||||||
|
#define LIST_FOREACH_SAFE(var, head, field, tvar) \
|
||||||
|
for ((var) = LIST_FIRST((head)); \
|
||||||
|
(var) && ((tvar) = LIST_NEXT((var), field), 1); \
|
||||||
|
(var) = (tvar))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* List access methods.
|
* List access methods.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue