g_tree_lookup_extended
- From: Sven Neumann <sven gimp org>
- To: gtk-devel-list gnome org
- Subject: g_tree_lookup_extended
- Date: 08 Mar 2001 02:30:42 +0100
Hi,
I proposed this one a while ago and it's in bugzilla, but it
wasn't applied until now, so I thought I should simply post
it again and ask if anyone would object against adding this
public function to the GTree API:
gboolean
g_tree_lookup_extended (GTree *tree,
gconstpointer lookup_key,
gpointer *orig_key,
gpointer *value)
{
GRealTree *rtree;
GTreeNode *node;
g_return_val_if_fail (tree != NULL, FALSE);
rtree = (GRealTree*) tree;
node = g_tree_node_lookup (rtree->root, rtree->key_compare,
rtree->key_compare_data, lookup_key);
if (node)
{
if (orig_key)
*orig_key = node->key;
if (value)
*value = node->value;
return TRUE;
}
else
return FALSE;
}
It's the equivalent of g_hash_table_lookup_extended() which has
been around for a long time and IMHO its an important missing
feature. So if nobody objects, I'll commit this...
Salut, Sven
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]