list: add LIF_LIST_FOREACH_REVERSE()
This commit is contained in:
parent
80cdfc7f96
commit
dfb979d00d
1 changed files with 3 additions and 0 deletions
|
@ -42,4 +42,7 @@ extern void lif_node_delete(struct lif_node *node, struct lif_list *list);
|
|||
#define LIF_LIST_FOREACH_SAFE(iter, iter_next, head) \
|
||||
for ((iter) = (head), (iter_next) = (iter)->next; (iter) != NULL; (iter) = (iter_next), (iter_next) = (iter) != NULL ? (iter)->next : NULL)
|
||||
|
||||
#define LIF_LIST_FOREACH_REVERSE(iter, tail) \
|
||||
for ((iter) = (tail); (iter) != NULL; (iter) = (iter)->prev)
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue