X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=utils.c;fp=utils.c;h=629cdb2bf228fdc4cf66b38e58d81d0c05b775aa;hp=0b13f86c7c2fd514f50c6ade39c5dec1fdf14490;hb=c6e1778d4429032087b36fb0dde2ae2fecf53b4a;hpb=9fe20c8cbc4249c13d6f305adc91f4bc695f7c23 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;