Definition in file kvp-util.h.
Go to the source code of this file.
Data Structures | |
struct | GHashTableKVPair |
Hash Utilities | |
GSList * | g_hash_table_key_value_pairs (GHashTable *table) |
void | g_hash_table_kv_pair_free_gfunc (gpointer data, gpointer user_data) |
|
Returns a GSList* of all the keys and values in a given hash table. Data elements of lists are actual hash elements, so be careful, and deallocation of the GHashTableKVPairs in the result list are the caller's responsibility. A typical sequence might look like this: GSList *kvps = g_hash_table_key_value_pairs(hash); ... use kvps->data->key and kvps->data->val, etc. here ... g_slist_foreach(kvps, g_hash_table_kv_pair_free_gfunc, NULL); g_slist_free(kvps); Definition at line 221 of file kvp-util.c. 00222 { 00223 GSList *result_list = NULL; 00224 g_hash_table_foreach(table, kv_pair_helper, &result_list); 00225 return result_list; 00226 }
|