am 08170103: am 91962669: Merge "cutils: list: add list_for_each_safe"
* commit '0817010366feecb53fc70719b3784dd7c6d66b55': cutils: list: add list_for_each_safe
This commit is contained in:
commit
8f4c14f1e7
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue