From: Michael D. Lowis Date: Wed, 3 Sep 2014 17:34:01 +0000 (-0400) Subject: Fix indentation X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=ee782f0c751ce64386eb97c5a972566556e9afa5;p=projs%2Flibcds.git Fix indentation --- diff --git a/source/rbt/rbt.h b/source/rbt/rbt.h index 512d1ca..b47755d 100644 --- a/source/rbt/rbt.h +++ b/source/rbt/rbt.h @@ -11,86 +11,86 @@ extern "C" { #include "rt.h" - /** node colors */ - typedef enum { - RED = 0, - BLACK - } rbt_color_t; - - /** a function pointer for comparing node contents - should return -1, 0, or 1 if a is <, ==, or > b, respectively */ - typedef int (*comparator_t)(void* p_a, void* p_b); - - /** a red-black tree node */ - typedef struct rbt_node_t { - /** pointers to immediate relatives */ - struct rbt_node_t* left; - struct rbt_node_t* right; - struct rbt_node_t* parent; - /** node color */ - rbt_color_t color; - /** pointer to node contents */ - void* contents; - } rbt_node_t; - - /** a red-black tree */ - typedef struct { - /** pointer to the root of the tree */ - rbt_node_t* root; - /** function pointer for comparing node contents */ - comparator_t comp; - } rbt_t; - - - /** - * @brief creates a new red-black tree - * - * @param comparator pointer to the comparator function - * - * @return pointer to newly created tree - */ - rbt_t* rbt_new(comparator_t comparator); - - - /** - * @brief find a value in a red-black tree - * - * @param tree pointer to the tree on which to operate - * @param value pointer to the data to find - * - * @return pointer to the node containing the given value - * NULL if the value is present in the tree - */ - rbt_node_t* rbt_lookup(rbt_t* tree, void* value); - - - /** - * @brief count the number of nodes in a red-black tree - * - * @param tree pointer to the tree on which to operate - * - * @return the number of nodes present in the tree - */ - int rbt_size(rbt_t* tree); - - /** - * @brief insert a value into a red-black tree - * - * @param tree pointer to the tree on which to operate - * @param value pointer to the value to be inserted - * - * @return a pointer to the new node - */ - rbt_node_t* rbt_insert(rbt_t* tree, void* value); - - - /** - * @brief removes a value from a red-black tree - * - * @param tree pointer to the tree on which to operate - * @param value pointer to the value to be removed - */ - void rbt_delete(rbt_t* tree, void* value); +/** node colors */ +typedef enum { + RED = 0, + BLACK +} rbt_color_t; + +/** a function pointer for comparing node contents + should return -1, 0, or 1 if a is <, ==, or > b, respectively */ +typedef int (*comparator_t)(void* p_a, void* p_b); + +/** a red-black tree node */ +typedef struct rbt_node_t { + /** pointers to immediate relatives */ + struct rbt_node_t* left; + struct rbt_node_t* right; + struct rbt_node_t* parent; + /** node color */ + rbt_color_t color; + /** pointer to node contents */ + void* contents; +} rbt_node_t; + +/** a red-black tree */ +typedef struct { + /** pointer to the root of the tree */ + rbt_node_t* root; + /** function pointer for comparing node contents */ + comparator_t comp; +} rbt_t; + + +/** + * @brief creates a new red-black tree + * + * @param comparator pointer to the comparator function + * + * @return pointer to newly created tree + */ +rbt_t* rbt_new(comparator_t comparator); + + +/** + * @brief find a value in a red-black tree + * + * @param tree pointer to the tree on which to operate + * @param value pointer to the data to find + * + * @return pointer to the node containing the given value + * NULL if the value is present in the tree + */ +rbt_node_t* rbt_lookup(rbt_t* tree, void* value); + + +/** + * @brief count the number of nodes in a red-black tree + * + * @param tree pointer to the tree on which to operate + * + * @return the number of nodes present in the tree + */ +int rbt_size(rbt_t* tree); + +/** + * @brief insert a value into a red-black tree + * + * @param tree pointer to the tree on which to operate + * @param value pointer to the value to be inserted + * + * @return a pointer to the new node + */ +rbt_node_t* rbt_insert(rbt_t* tree, void* value); + + +/** + * @brief removes a value from a red-black tree + * + * @param tree pointer to the tree on which to operate + * @param value pointer to the value to be removed + */ +void rbt_delete(rbt_t* tree, void* value); #ifdef __cplusplus }