This allows the callback to get status information if the caller has
embedded his opts structure inside of some other structure.
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
count += bintree_walk(tree->left, ops);
if (ops->callback)
- ops->callback(tree);
+ ops->callback(tree, ops);
count++;
struct bintree_ops {
int (*compare)(struct bintree *a, struct bintree *b);
- void (*callback)(struct bintree *tree);
+ void (*callback)(struct bintree *tree, struct bintree_ops *ops);
};
struct bintree *bintree_add(struct bintree *tree, struct bintree *new,
struct bintree_ops *ops);
+int bintree_walk(struct bintree *tree, struct bintree_ops *ops);
#endif