mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
2e7931c760
The basic API that this commit adds allows in-order iterating over a GTree. For this the following API were implemented or exported: 1) Returning the first or the last node in the tree, 2) Taking a pointer to a node in the tree and returning the previous or the next in-order node, 3) Allowing to do a binary search for a particular key value and returning the pointer to its node, 4) Returning the newly inserted or set node from both insert and replace functions, so this node is immediately available and does not have to be looked up, 5) Traversing the tree in-order providing a node pointer to the caller-provided traversal function. Most of the above functions were already present in the code, but they returned the value that is stored at a particular node instead of the pointer to the node itself. So most of the code for these new API calls is shared with these existing ones, just adapted to return the pointer to the node. Additionally, the so called "lower bound" and "upper bound" operations were implemented. The first one returns the first element that is greater than or equal to the searched key, while the second returns the first element that is strictly greater than the searched key. Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com> |
||
---|---|---|
.. | ||
reference | ||
CODEOWNERS | ||
debugging.txt | ||
macros.txt |