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:
jp abgrall 2013-09-25 11:36:02 -07:00 committed by Android Git Automerger
commit 8f4c14f1e7
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);