diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2010-05-10 11:17:23 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-05-10 11:17:23 -0700 |
commit | 752c905b8ca694df1e863d500653b386653c35e7 (patch) | |
tree | 85cfbe62a3484077e2c9df35e5fc33cc586095d7 /list.h | |
parent | 43bfc2b6b5477b24d831f49a6ab2123ce95ba747 (diff) |
exec_list: Add simpler exec_list for-each macros
Diffstat (limited to 'list.h')
-rw-r--r-- | list.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -337,4 +337,14 @@ struct exec_list { #endif }; +#define foreach_list(__node, __list) \ + for (exec_node * __node = (__list)->head \ + ; (__node)->next != NULL \ + ; (__node) = (__node)->next) + +#define foreach_list_const(__node, __list) \ + for (const exec_node * __node = (__list)->head \ + ; (__node)->next != NULL \ + ; (__node) = (__node)->next) + #endif /* LIST_CONTAINER_H */ |