From 98c68ed8cc11fa8932e480256b2544c50aaa790b Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Sun, 2 May 2021 19:15:56 +0200 Subject: convert to typedef structs --- src/tree.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/tree.h') diff --git a/src/tree.h b/src/tree.h index 2623cb3..2496a85 100644 --- a/src/tree.h +++ b/src/tree.h @@ -54,24 +54,24 @@ #define _TREE_FREE_DATA 0x01 #define _TREE_FREE_KEY 0x02 -struct tree_node { +typedef struct tree_node { char* key; void* data; struct tree_node* above; struct tree_node* below; -}; +} tree_node_t; -int tree_insert ( struct tree_node** _root, char* _key, void* _data ); +int tree_insert ( tree_node_t** _root, char* _key, void* _data ); /** * Inserts the given list into the tree, achieving optimal depth. * Expects a sorted list. * */ -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); /** * Returns (void*)node->data on success, NULL on failure * */ -void* tree_get ( struct tree_node** _root, const char* _query ); +void* tree_get ( tree_node_t** _root, const char* _query ); -int tree_destroy( struct tree_node** _root, uint8_t _options ); +int tree_destroy( tree_node_t** _root, uint8_t _options ); -- cgit v1.2.3