X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Flist.h;h=855b42723bc448a3dfc115ecedd7abbe9e134b24;hb=0b8b23e0dd7219344543f135ca0aeba8a4a42d48;hp=4fe48dbeb465fc10ca0c65ad1982f7f0dfaff002;hpb=ff306f0cdaedb50de1472e7c1fb55de922a6ca60;p=tinc diff --git a/src/list.h b/src/list.h index 4fe48dbe..855b4272 100644 --- a/src/list.h +++ b/src/list.h @@ -77,4 +77,6 @@ extern void list_delete_list(list_t *); extern void list_foreach(list_t *, list_action_t); extern void list_foreach_node(list_t *, list_action_node_t); +#define list_each(type, item, list) (type *item = (type *)1; item; item = NULL) for(list_node_t *node = (list)->head, *next; item = node ? node->data : NULL, next = node ? node->next : NULL, node; node = next) + #endif /* __TINC_LIST_H__ */