Method

GLibTreeupper_bound

since: 2.68

Declaration

GTreeNode*
g_tree_upper_bound (
  GTree* tree,
  gconstpointer key
)

Description

Gets the upper bound node corresponding to the given key, or NULL if the tree is empty or all the nodes in the tree have keys that are lower than or equal to the searched key.

The upper bound is the first node that has its key strictly greater than the searched key.

Available since: 2.68

Parameters

key

Type: gconstpointer

The key to calculate the upper bound for.

The argument can be NULL.
The data is owned by the caller of the function.

Return value

Type: GTreeNode

The tree node corresponding to the upper bound, or NULL if the tree is empty or has only keys lower than or equal to the searched key.

The data is owned by the instance.
The return value can be NULL.