qulogic/libgnt

Function to get the parent key.

2008-01-22, Sadrul Habib Chowdhury
fe1018b3b0f0
Parents 017f243ff2d6
Children 88d799ecf9d6
Function to get the parent key.
  • +6 -0
    gnttree.c
  • +11 -0
    gnttree.h
  • --- a/gnttree.c Wed Jan 16 22:26:59 2008 +0000
    +++ b/gnttree.c Tue Jan 22 07:28:11 2008 +0000
    @@ -1841,3 +1841,9 @@
    tree->priv->search_func = func;
    }
    +gpointer gnt_tree_get_parent_key(GntTree *tree, gpointer key)
    +{
    + GntTreeRow *row = g_hash_table_lookup(tree->hash, key);
    + return row ? row->parent : NULL;
    +}
    +
    --- a/gnttree.h Wed Jan 16 22:26:59 2008 +0000
    +++ b/gnttree.h Tue Jan 22 07:28:11 2008 +0000
    @@ -575,6 +575,17 @@
    void gnt_tree_set_search_function(GntTree *tree,
    gboolean (*func)(GntTree *tree, gpointer key, const char *search, const char *current));
    +/**
    + * Get the parent key for a row.
    + *
    + * @param tree The tree
    + * @param key The key for the row.
    + *
    + * @return The key of the parent row.
    + * @since 2.4.0
    + */
    +gpointer gnt_tree_get_parent_key(GntTree *tree, gpointer key);
    +
    G_END_DECLS
    #endif /* GNT_TREE_H */