summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-03-04 00:02:38 +0100
committerFelix Fietkau <nbd@openwrt.org>2012-03-04 00:02:38 +0100
commitc6e1778d4429032087b36fb0dde2ae2fecf53b4a (patch)
tree04e0f830cf5bfc8f4c3a4b72d62bd126e45d2f69 /utils.c
parent9fe20c8cbc4249c13d6f305adc91f4bc695f7c23 (diff)
downloadnetifd-c6e1778d4429032087b36fb0dde2ae2fecf53b4a.tar.gz
simplify vlist, move avl key handling to vlist_add()
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/utils.c b/utils.c
index 0b13f86..629cdb2 100644
--- a/utils.c
+++ b/utils.c
@@ -9,10 +9,8 @@ avl_strcmp(const void *k1, const void *k2, void *ptr)
}
void
-__vlist_init(struct vlist_tree *tree, avl_tree_comp cmp,
- vlist_update_cb update, int offset)
+vlist_init(struct vlist_tree *tree, avl_tree_comp cmp, vlist_update_cb update)
{
- tree->key_offset = offset;
tree->update = update;
tree->version = 1;
@@ -28,11 +26,10 @@ vlist_delete(struct vlist_tree *tree, struct vlist_node *node)
}
void
-vlist_add(struct vlist_tree *tree, struct vlist_node *node)
+vlist_add(struct vlist_tree *tree, struct vlist_node *node, void *key)
{
struct vlist_node *old_node = NULL;
struct avl_node *anode;
- void *key = (char *) node + tree->key_offset;
node->avl.key = key;
node->version = tree->version;