63 #ifndef __binarytree_h__ 64 #define __binarytree_h__ 83 #define MAX_TREE_STR 65536 84 #define MAX_INDENTS 512 170 val_tostr valtostr_fun,
char valstr[],
char treestr[]);
174 char valstr[],
char* indents,
char treestr[]);
void *(* mem_alloc)(size_t size)
binarytree_t * binarytree_listalloc(size_t elt_size, int num_elts, mem_alloc m_alloc)
void binarytree_del(binarytree_t **root, mem_free m_free)
binarytree_t * binarytree_listify(binarytree_t *root)
binarytree_t * binarytree_rightsubtree(binarytree_t *tree)
struct binarytree_s * right
int compare(SrcFile::ln x, SrcFile::ln y)
void binarytree_set_rightsubtree(binarytree_t *tree, binarytree_t *subtree)
void * binarytree_rootval(binarytree_t *tree)
void binarytree_tostring_indent(binarytree_t *tree, val_tostr tostr, char valstr[], char *indents, char treestr[])
binarytree_t * binarytree_leftsubtree(binarytree_t *tree)
binarytree_t * binarytree_insert(binarytree_t *tree, val_cmp compare, binarytree_t *key)
void binarytree_tostring(binarytree_t *root, val_tostr valtostr_fun, char valstr[], char treestr[])
void(* val_tostr)(void *val, char str[])
struct binarytree_s binarytree_t
int binarytree_count(binarytree_t *node)
binarytree_t * binarytree_find(binarytree_t *tree, val_cmp fn, void *val)
int(* val_cmp)(void *lhs, void *rhs)
struct binarytree_s * left
void binarytree_set_leftsubtree(binarytree_t *tree, binarytree_t *subtree)
int binarytree_height(binarytree_t *tree)
binarytree_t * binarytree_list_to_tree(binarytree_t **head, int count)
binarytree_t * binarytree_new(size_t size, mem_alloc m_alloc)
void(* mem_free)(void *ptr)