diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2021-05-02 19:15:56 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2021-05-02 19:15:56 +0200 |
commit | 98c68ed8cc11fa8932e480256b2544c50aaa790b (patch) | |
tree | 97e7a5b0a3af20dd3e5014cfbb3e17289cb64c88 /src/tree.h | |
parent | 009dc3ba991290de19f0a5e4e4a25a33e82689cc (diff) | |
download | dns-98c68ed8cc11fa8932e480256b2544c50aaa790b.tar.gz |
convert to typedef structs
Diffstat (limited to 'src/tree.h')
-rw-r--r-- | src/tree.h | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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 ); |