Function

GLibHashTableget_keys_as_ptr_array

since: 2.76

Declaration [src]

GPtrArray*
g_hash_table_get_keys_as_ptr_array (
  GHashTable* hash_table
)

Description [src]

Retrieves every key inside hash_table, as a GPtrArray. The returned data is valid until changes to the hash release those keys.

This iterates over every entry in the hash table to build its return value. To iterate over the entries in a GHashTable more efficiently, use a GHashTableIter.

You should always unref the returned array with g_ptr_array_unref().

Available since: 2.76

This function is not directly available to language bindings.

Parameters

hash_table

Type: GHashTable

A GHashTable.

The data is owned by the caller of the function.

Return value

Type: An array of gpointer

A GPtrArray containing each key from the table. Unref with with g_ptr_array_unref() when done.

The caller of the function takes ownership of the data container, but not the data inside it.