Wed, 14 Feb 2024 21:31:38 +0100
add code documentation for tree functions
src/cx/tree.h | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cx/tree.h Wed Feb 14 21:27:12 2024 +0100 1.2 +++ b/src/cx/tree.h Wed Feb 14 21:31:38 2024 +0100 1.3 @@ -43,6 +43,19 @@ 1.4 #endif 1.5 1.6 1.7 +/** 1.8 + * Links a node to a (new) parent. 1.9 + * 1.10 + * If the node has already a parent, it is unlinked, first. 1.11 + * 1.12 + * @param parent the parent node 1.13 + * @param node the node that shall be linked 1.14 + * @param loc_parent offset in the node struct for the parent pointer 1.15 + * @param loc_children offset in the node struct for the children linked list 1.16 + * @param loc_prev offset in the node struct for the prev pointer 1.17 + * @param loc_next offset in the node struct for the next pointer 1.18 + * @see cx_tree_unlink() 1.19 + */ 1.20 __attribute__((__nonnull__)) 1.21 void cx_tree_link( 1.22 void * restrict parent, 1.23 @@ -53,6 +66,18 @@ 1.24 ptrdiff_t loc_next 1.25 ); 1.26 1.27 +/** 1.28 + * Unlinks a node from its parent. 1.29 + * 1.30 + * If the node has no parent, this function does nothing. 1.31 + * 1.32 + * @param node the node that shall be unlinked from its parent 1.33 + * @param loc_parent offset in the node struct for the parent pointer 1.34 + * @param loc_children offset in the node struct for the children linked list 1.35 + * @param loc_prev offset in the node struct for the prev pointer 1.36 + * @param loc_next offset in the node struct for the next pointer 1.37 + * @see cx_tree_link() 1.38 + */ 1.39 __attribute__((__nonnull__)) 1.40 void cx_tree_unlink( 1.41 void *node,