Add reverse foreach for lists
This commit is contained in:
parent
99ca785025
commit
fb49a12728
@ -47,5 +47,6 @@ void list_append_before(list_t * list, node_t * after, node_t * node);
|
||||
node_t * list_insert_before(list_t * list, node_t * after, void * item);
|
||||
|
||||
#define foreach(i, list) for (node_t * i = list->head; i != NULL; i = i->next)
|
||||
#define foreachr(i, list) for (node_t * i = list->tail; i != NULL; i = i->prev)
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user