Function

GLibHashTablelookup_extended

Declaration

gboolean
g_hash_table_lookup_extended (
  GHashTable* hash_table,
  gconstpointer lookup_key,
  gpointer* orig_key,
  gpointer* value
)

Description

Looks up a key in the GHashTable, returning the original key and the associated value and a #gboolean which is TRUE if the key was found. This is useful if you need to free the memory allocated for the original key, for example before calling g_hash_table_remove().

You can actually pass NULL for lookup_key to test whether the NULL key exists, provided the hash and equal functions of hash_table are NULL-safe.

Parameters

hash_table

Type: GHashTable

A GHashTable.

The data is owned by the caller of the function.
lookup_key

Type: gconstpointer

The key to look up.

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

Type: gpointer*

Return location for the original key.

The argument will be set by the function.
The argument can be NULL.
value

Type: gpointer*

Return location for the value associated with the key.

The argument will be set by the function.
The argument can be NULL.

Return value

Type: gboolean

TRUE if the key was found in the GHashTable.