85 ptrdiff_t loc_children, |
85 ptrdiff_t loc_children, |
86 ptrdiff_t loc_prev, |
86 ptrdiff_t loc_prev, |
87 ptrdiff_t loc_next |
87 ptrdiff_t loc_next |
88 ); |
88 ); |
89 |
89 |
|
90 /** |
|
91 * Function pointer for a search function. |
|
92 * |
|
93 * A function of this kind shall check if the specified \p node |
|
94 * contains the given \p data or if one of the children might contain |
|
95 * the data. |
|
96 * |
|
97 * For example if a tree stores file path information, a node that is |
|
98 * describing a parent directory of a filename that is searched, shall |
|
99 * return 1 to indicate that a child node might contain the searched item. |
|
100 * On the other hand, if the node denotes a path that is not a prefix of |
|
101 * the searched filename, the function would return -1 to indicate that |
|
102 * the search does not need to be continued in that branch. |
|
103 * |
|
104 * @param node the node that is currently investigated |
|
105 * @param data the data that is searched for |
|
106 * |
|
107 * @return 0 if the node contains the data, |
|
108 * 1 if one of the children might contain the data, |
|
109 * -1 if neither the node, nor the children contains the data |
|
110 */ |
|
111 int (*cx_tree_search_func)(void const *node, void const* data); |
|
112 |
90 #ifdef __cplusplus |
113 #ifdef __cplusplus |
91 } // extern "C" |
114 } // extern "C" |
92 #endif |
115 #endif |
93 |
116 |
94 #endif //UCX_TREE_H |
117 #endif //UCX_TREE_H |