Re: g_hash_table_find()



Russell Shaw wrote:
David Necas (Yeti) wrote:

On Sun, Jun 20, 2004 at 07:03:44PM +1000, Russell Shaw wrote:

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.

g_hash_table_find() returns the *value* (as is written in the
cited docs).

You can get the key only as a side effect by passing
something where the key can be stored as user_data, and
storing it the in predicate when it succeeds.

That api is a bit clunky. It would be better if the key
was returned.

I should have used: g_hash_table_lookup_extended()



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