summaryrefslogtreecommitdiffstats
path: root/libnetdata/avl/avl.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-07 11:49:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-07 12:42:05 +0000
commit2e85f9325a797977eea9dfea0a925775ddd211d9 (patch)
tree452c7f30d62fca5755f659b99e4e53c7b03afc21 /libnetdata/avl/avl.h
parentReleasing debian version 1.19.0-4. (diff)
downloadnetdata-2e85f9325a797977eea9dfea0a925775ddd211d9.tar.xz
netdata-2e85f9325a797977eea9dfea0a925775ddd211d9.zip
Merging upstream version 1.29.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libnetdata/avl/avl.h')
-rw-r--r--libnetdata/avl/avl.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/libnetdata/avl/avl.h b/libnetdata/avl/avl.h
index 070bb3d3..32e3f27a 100644
--- a/libnetdata/avl/avl.h
+++ b/libnetdata/avl/avl.h
@@ -34,13 +34,13 @@ typedef struct avl {
} avl;
/* An AVL tree */
-typedef struct avl_tree {
+typedef struct avl_tree_type {
avl *root;
int (*compar)(void *a, void *b);
-} avl_tree;
+} avl_tree_type;
typedef struct avl_tree_lock {
- avl_tree avl_tree;
+ avl_tree_type avl_tree;
#ifndef AVL_WITHOUT_PTHREADS
#ifdef AVL_LOCK_WITH_MUTEX
@@ -60,7 +60,7 @@ typedef struct avl_tree_lock {
* be properly allocated by the caller.
*/
avl *avl_insert_lock(avl_tree_lock *tree, avl *item) NEVERNULL WARNUNUSED;
-avl *avl_insert(avl_tree *tree, avl *item) NEVERNULL WARNUNUSED;
+avl *avl_insert(avl_tree_type *tree, avl *item) NEVERNULL WARNUNUSED;
/* Remove an element a from the AVL tree t
* returns a pointer to the removed element
@@ -68,22 +68,25 @@ avl *avl_insert(avl_tree *tree, avl *item) NEVERNULL WARNUNUSED;
* (equal as returned by t->compar())
*/
avl *avl_remove_lock(avl_tree_lock *tree, avl *item) WARNUNUSED;
-avl *avl_remove(avl_tree *tree, avl *item) WARNUNUSED;
+avl *avl_remove(avl_tree_type *tree, avl *item) WARNUNUSED;
/* Find the element into the tree that equal to a
* (equal as returned by t->compar())
* returns NULL is no element is equal to a
*/
avl *avl_search_lock(avl_tree_lock *tree, avl *item);
-avl *avl_search(avl_tree *tree, avl *item);
+avl *avl_search(avl_tree_type *tree, avl *item);
/* Initialize the avl_tree_lock
*/
void avl_init_lock(avl_tree_lock *tree, int (*compar)(void *a, void *b));
-void avl_init(avl_tree *tree, int (*compar)(void *a, void *b));
+void avl_init(avl_tree_type *tree, int (*compar)(void *a, void *b));
+/* Destroy the avl_tree_lock locks
+ */
+void avl_destroy_lock(avl_tree_lock *tree);
int avl_traverse_lock(avl_tree_lock *tree, int (*callback)(void *entry, void *data), void *data);
-int avl_traverse(avl_tree *tree, int (*callback)(void *entry, void *data), void *data);
+int avl_traverse(avl_tree_type *tree, int (*callback)(void *entry, void *data), void *data);
#endif /* avl.h */