/** * The AVL node struct definition */ typedef struct avl_node_t avl_node_t; struct avl_node_t { /* left child - smaller key */ avl_node_t *left; /* right child - bigger key */ avl_node_t *right; /* the key of the node which will also be used for sorting */ char *key; /* height of the node */ int height; }; /** * The AVL tree struct definition */ typedef struct avl_tree_t avl_tree_t; struct avl_tree_t { /* root of the tree */ avl_node_t *root; /* function used for sorting the keys */ int (*cmp)(const void *key1, const void *key2); };