projects
/
project
/
libubox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
411d10c
)
vlist: add static initializer macros
author
Felix Fietkau
<nbd@openwrt.org>
Thu, 5 Jun 2014 13:28:45 +0000
(15:28 +0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Thu, 5 Jun 2014 13:28:45 +0000
(15:28 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
vlist.h
patch
|
blob
|
history
diff --git
a/vlist.h
b/vlist.h
index
9e188e2
..
8170abf
100644
(file)
--- a/
vlist.h
+++ b/
vlist.h
@@
-41,6
+41,19
@@
struct vlist_node {
int version;
};
int version;
};
+#define VLIST_TREE_INIT(_name, _comp, _update, _keep_old, _no_delete) \
+ { \
+ .avl = AVL_TREE_INIT(_name.avl, _comp, false, NULL), \
+ .update = _update, \
+ .version = 1, \
+ .keep_old = _keep_old, \
+ .no_delete = _no_delete, \
+ }
+
+#define VLIST_TREE(_name, ...) \
+ struct vlist_tree _name = \
+ VLIST_TREE_INIT(_name, __VA_ARGS__)
+
void vlist_init(struct vlist_tree *tree, avl_tree_comp cmp, vlist_update_cb update);
#define vlist_find(tree, name, element, node_member) \
void vlist_init(struct vlist_tree *tree, avl_tree_comp cmp, vlist_update_cb update);
#define vlist_find(tree, name, element, node_member) \