Re: g_hash_table_find()



Vlad GALU wrote:
On Sun, 20 Jun 2004 18:48:55 +1000
Russell Shaw <rjshaw netspace net au> wrote:


Hi,
What does g_hash_table_find() return?
It returns a gpointer, but the api is unclear
on what it is.

Returns: The value of the first key/value pair is returned, for which func
         evaluates to TRUE. If no pair with the requested property is found,
         NULL is returned.

How can it point to a key *and* its value? I'm trying to get the key
value with little success (it's stored as a guint).


        You might want to try g_hash_table_lookup(). You give a key as an argument, and it returns the 
associated value. If there's no value identified by the supplied key, it returns NULL.
        I have written a small software that makes extensive use of the GHashTable structure: 
http://night.rdslink.ro/dudu/glflow/glFlow-0.0.1.tar.gz

Hi,
I have used g_hash_table_lookup() ok. However, i'm trying to
do a reverse lookup now where i can supply the value and find
the matching key.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]