Function

GLibHashTableget_values_as_ptr_array

since: 2.76

Declaration

GPtrArray*
g_hash_table_get_values_as_ptr_array (
  GHashTable* hash_table
)

Description

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

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 value 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.