add vlist_for_each_element iterator
authorFelix Fietkau <nbd@openwrt.org>
Sun, 2 Oct 2011 18:31:44 +0000 (20:31 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 2 Oct 2011 18:31:44 +0000 (20:31 +0200)
utils.h

diff --git a/utils.h b/utils.h
index 31fcd1f090bac56f3c22d0cede6e62d0bd39271a..d71a8f7489f411a38c164c047efe770f6978d0ee 100644 (file)
--- 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)
 {