#ifndef _BINTREE_H #define _BINTREE_H struct bintree { struct bintree *left, *right; }; struct bintree_ops { int (*compare)(struct bintree *a, struct bintree *b); void (*callback)(struct bintree *tree, struct bintree_ops *ops); }; struct bintree *bintree_add(struct bintree *tree, struct bintree *new, struct bintree_ops *ops); struct bintree *bintree_find(struct bintree *tree, struct bintree *new, struct bintree_ops *ops); int bintree_walk(struct bintree *tree, struct bintree_ops *ops); #endif