add code documentation for tree functions

Wed, 14 Feb 2024 21:31:38 +0100

author
Mike Becker <universe@uap-core.de>
date
Wed, 14 Feb 2024 21:31:38 +0100
changeset 822
e2243453127f
parent 821
5e6f15005efd
child 823
f4faa7f73cb8

add code documentation for tree functions

src/cx/tree.h file | annotate | diff | comparison | revisions
--- a/src/cx/tree.h	Wed Feb 14 21:27:12 2024 +0100
+++ b/src/cx/tree.h	Wed Feb 14 21:31:38 2024 +0100
@@ -43,6 +43,19 @@
 #endif
 
 
+/**
+ * Links a node to a (new) parent.
+ *
+ * If the node has already a parent, it is unlinked, first.
+ *
+ * @param parent the parent node
+ * @param node the node that shall be linked
+ * @param loc_parent offset in the node struct for the parent pointer
+ * @param loc_children offset in the node struct for the children linked list
+ * @param loc_prev offset in the node struct for the prev pointer
+ * @param loc_next offset in the node struct for the next pointer
+ * @see cx_tree_unlink()
+ */
 __attribute__((__nonnull__))
 void cx_tree_link(
         void * restrict parent,
@@ -53,6 +66,18 @@
         ptrdiff_t loc_next
 );
 
+/**
+ * Unlinks a node from its parent.
+ *
+ * If the node has no parent, this function does nothing.
+ *
+ * @param node the node that shall be unlinked from its parent
+ * @param loc_parent offset in the node struct for the parent pointer
+ * @param loc_children offset in the node struct for the children linked list
+ * @param loc_prev offset in the node struct for the prev pointer
+ * @param loc_next offset in the node struct for the next pointer
+ * @see cx_tree_link()
+ */
 __attribute__((__nonnull__))
 void cx_tree_unlink(
         void *node,

mercurial