From: Felix Fietkau Date: Sun, 2 Oct 2011 18:31:44 +0000 (+0200) Subject: add vlist_for_each_element iterator X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=504b87e64062fc52fdedea4e35bb03467c8bf97f;p=oweals%2Fnetifd.git add vlist_for_each_element iterator --- diff --git a/utils.h b/utils.h index 31fcd1f..d71a8f7 100644 --- a/utils.h +++ b/utils.h @@ -48,6 +48,9 @@ void vlist_delete(struct vlist_tree *tree, struct vlist_node *node); void vlist_flush(struct vlist_tree *tree); void vlist_flush_all(struct vlist_tree *tree); +#define vlist_for_each_element(tree, element, node_member) \ + avl_for_each_element(&(tree)->avl, element, node_member.avl) + #ifdef __linux__ static inline int fls(int x) {