24 #ifndef __CCL_TREE_H__
25 # define __CCL_TREE_H__
int ccl_tree_get_nb_childs(const ccl_tree *t)
Returns the number of childs of t.
Frequently used prototypes of generic functions.
Generic simple linked list.
void ccl_tree_add_child(ccl_tree *t, ccl_tree *child)
Add a new child to the tree t The child is added at the end of the liust of sons of t...
Structure storing a node of a generic tree.
ccl_tree * childs
A pointer to the first child of the node.
void ccl_tree_del_reference(ccl_tree *t)
Suppresses one reference to t. When no more reference exists the node is deleted. ...
ccl_tree * ccl_tree_get_child(ccl_tree *t, int index)
Returns the index th child of t.
ccl_tree * next
A pointer to the first sibling of the node.
int ccl_tree_is_leaf(const ccl_tree *t)
Checks if the node t is a leaf.
ccl_delete_proc * del
The procedure call to free resources allocated to the object.
ccl_tree * ccl_tree_create(void *obj, ccl_delete_proc *del)
Create a leaf node label with the object obj.
struct ccl_list_st ccl_list
Type of a generic list.
void * object
The object labelling the node.
void ccl_delete_proc(void *ptr)
Prototype of procedures used to release the resources allocated to the object pointed by ptr...
int ccl_tree_get_nb_siblings(const ccl_tree *t)
Returns the number of siblings of t.
int ccl_tree_get_depth(const ccl_tree *t)
Returns the depth of the tree t.
void ccl_tree_set_label(ccl_tree *t, void *obj, ccl_delete_proc *del)
Changes the label of t with the object obj.
ccl_tree * ccl_tree_add_reference(ccl_tree *t)
Increments the counter of references to the tree t.