Add missing LIST_FOR_EACH_ENTRY_REV macro

svn path=/trunk/; revision=27932
This commit is contained in:
Hervé Poussineau
2007-07-27 15:07:07 +00:00
parent c6b03c24b9
commit fb76bb0053
+6
View File
@@ -171,6 +171,12 @@ inline static unsigned int list_count( const struct list *list )
(cursor) = (cursor2), \
(cursor2) = LIST_ENTRY((cursor)->field.next, type, field))
/* iterate through the list in reverse order using a list entry */
#define LIST_FOR_EACH_ENTRY_REV(elem, list, type, field) \
for ((elem) = LIST_ENTRY((list)->prev, type, field); \
&(elem)->field != (list); \
(elem) = LIST_ENTRY((elem)->field.prev, type, field))
/* macros for statically initialized lists */
#define LIST_INIT(list) { &(list), &(list) }