Add a LIST_FOR_EACH_ENTRY list helper.

This commit is contained in:
Robert Shearman 2005-01-14 15:11:07 +00:00 committed by Alexandre Julliard
parent c905d691c8
commit 7b3d092c26
1 changed files with 6 additions and 0 deletions

View File

@ -149,6 +149,12 @@ inline static void list_init( struct list *list )
(cursor) != (list); \
(cursor) = (cursor2), (cursor2) = (cursor)->next)
/* iterate through the list using a list entry */
#define LIST_FOR_EACH_ENTRY(elem, list, type, field) \
for ((elem) = LIST_ENTRY((list)->next, type, field); \
&(elem)->field != (list); \
(elem) = LIST_ENTRY((elem)->field.next, type, field))
/* macros for statically initialized lists */
#define LIST_INIT(list) { &(list), &(list) }