Merge "cutils: list: add list_for_each_safe"

This commit is contained in:
jp abgrall 2013-09-25 18:31:44 +00:00 committed by Gerrit Code Review
commit 9196266939
1 changed files with 5 additions and 0 deletions

View File

@ -44,6 +44,11 @@ struct listnode
#define list_for_each_reverse(node, list) \
for (node = (list)->prev; node != (list); node = node->prev)
#define list_for_each_safe(node, next, list) \
for (node = (list)->next, next = node->next; \
node != (list); \
node = next, next = node->next)
void list_init(struct listnode *list);
void list_add_tail(struct listnode *list, struct listnode *item);
void list_remove(struct listnode *item);