diff options
author | Katharina Fey <kookie@spacekookie.de> | 2016-12-11 03:09:14 +0100 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2019-06-04 20:21:03 +0200 |
commit | a4b6f559da2af7f1c035446a1ad8f01fd4d9dbf7 (patch) | |
tree | 7352aadae99d24f4df57c523f1f5015836f2e27f /include/dtree/dtree.h | |
parent | e3fe9401e4593c317ca967738d4c14e638a6ccd6 (diff) |
Adding new function that gets the parent of a current node in a recursive structure
Diffstat (limited to '')
-rw-r--r-- | include/dtree/dtree.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/dtree/dtree.h b/include/dtree/dtree.h index 7662412..a315014 100644 --- a/include/dtree/dtree.h +++ b/include/dtree/dtree.h @@ -189,6 +189,19 @@ dt_err dtree_merge_trees(dtree *data, dtree *merge); /** + * You can use this function to search the structure of a root node to find the + * parent of the node you provide as "data". It will leave the search pointer + * blanked if the node can't be found in the structure. + * + * @param root Root reference to search + * @param data The node we are searching for + * @param parent The node parent we are interested in + * @return + */ +dt_err dtree_parent(dtree *root, dtree *data, dtree **parent); + + +/** * Recursive tree search function that will return the first occurence match * to a provided payload (with an exact type). If you have data duplication * in your tree this _might_ return some false positives. |