docs(tree): add function docstrings
ci/woodpecker/pr/lint Pipeline is pending Details
ci/woodpecker/pr/test-mem Pipeline is pending Details
ci/woodpecker/pr/test Pipeline is pending Details

pull/5/head
Jef Roosens 2023-01-28 09:09:17 +01:00
parent e4e92b3e57
commit adfdca18da
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
1 changed files with 18 additions and 0 deletions

View File

@ -12,19 +12,37 @@ typedef enum vieter_tree_error {
vieter_tree_not_present = 2 vieter_tree_not_present = 2
} vieter_tree_error; } vieter_tree_error;
/*
* Allocate and initialize a new red-black binary tree.
*/
vieter_tree *vieter_tree_init(); vieter_tree *vieter_tree_init();
/*
* Deallocate a red-black binary tree.
*/
void vieter_tree_free(vieter_tree *tree); void vieter_tree_free(vieter_tree *tree);
/*
* Insert a new entry into the tree.
*/
vieter_tree_error vieter_tree_insert(vieter_tree *tree, uint64_t key, vieter_tree_error vieter_tree_insert(vieter_tree *tree, uint64_t key,
void *data); void *data);
/*
* Look for an entry in the tree.
*/
vieter_tree_error vieter_tree_search(void **out, vieter_tree *tree, vieter_tree_error vieter_tree_search(void **out, vieter_tree *tree,
uint64_t key); uint64_t key);
/*
* Remove a given entry from the tree.
*/
vieter_tree_error vieter_tree_remove(void **out, vieter_tree *tree, vieter_tree_error vieter_tree_remove(void **out, vieter_tree *tree,
uint64_t key); uint64_t key);
/*
* Return how many entries are currently in the tree.
*/
uint64_t vieter_tree_size(vieter_tree *tree); uint64_t vieter_tree_size(vieter_tree *tree);
#endif #endif