]> git.mdlowis.com Git - projs/libcds.git/commitdiff
Fix indentation
authorMichael D. Lowis <mike.lowis@gentex.com>
Wed, 3 Sep 2014 17:34:01 +0000 (13:34 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Wed, 3 Sep 2014 17:34:01 +0000 (13:34 -0400)
source/rbt/rbt.h

index 512d1ca9a491c6ed64a9fb6f6c84bfb1999cbb08..b47755d3c2eca2f32bd2901edb8b6e679fd99b8b 100644 (file)
@@ -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
 }