aboutsummaryrefslogtreecommitdiff
path: root/src/tree.c
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2021-05-02 19:15:56 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2021-05-02 19:15:56 +0200
commit98c68ed8cc11fa8932e480256b2544c50aaa790b (patch)
tree97e7a5b0a3af20dd3e5014cfbb3e17289cb64c88 /src/tree.c
parent009dc3ba991290de19f0a5e4e4a25a33e82689cc (diff)
downloaddns-98c68ed8cc11fa8932e480256b2544c50aaa790b.tar.gz
convert to typedef structs
Diffstat (limited to 'src/tree.c')
-rw-r--r--src/tree.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tree.c b/src/tree.c
index 974a5bb..79bfd65 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -48,9 +48,9 @@ static int string_compare ( const char* _1, const char* _2 )
return 99;
}
-int tree_insert ( struct tree_node** _root, char* _key, void* _data )
+int tree_insert ( tree_node_t** _root, char* _key, void* _data )
{
- struct tree_node** node = _root;
+ tree_node_t** node = _root;
while( *node ) {
int ret = string_compare ( (*node)->key, _key );
@@ -74,7 +74,7 @@ int tree_insert ( struct tree_node** _root, char* _key, void* _data )
return 0;
}
-int tree_balanced_insert ( struct tree_node** _root, void* _data[], char* _key[], unsigned int _len)
+int tree_balanced_insert ( tree_node_t** _root, void* _data[], char* _key[], unsigned int _len)
{
// n is the smallest n, for which 2^(n+1) - 1 >= _len,
// thus describes the minimal tree depth required to store
@@ -111,14 +111,14 @@ int tree_balanced_insert ( struct tree_node** _root, void* _data[], char* _key[
return 0;
}
-int tree_destroy ( struct tree_node** _root, uint8_t _options )
+int tree_destroy ( tree_node_t** _root, uint8_t _options )
{
//Not efficient, but this code is for testing only.
unsigned int max_depth = 0;
unsigned int node_cnt = 0;
while(*_root)
{
- struct tree_node** node = _root;
+ tree_node_t** node = _root;
unsigned int depth = 0;
while( (*node)->above || (*node)->below ) {
@@ -144,9 +144,9 @@ int tree_destroy ( struct tree_node** _root, uint8_t _options )
return 0;
}
-void* tree_get ( struct tree_node** _root, const char* _query )
+void* tree_get ( tree_node_t** _root, const char* _query )
{
- struct tree_node** node = _root;
+ tree_node_t** node = _root;
while(*node) {
int ret = string_compare ( (*node)->key, _query );