36
37
<th width="100%" align="center">GLib Reference Manual</th>
37
38
<td><a accesskey="n" href="glib-Strings.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
39
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3344133" class="shortcut">Top</a>
41
<a href="#id3345239" class="shortcut">Description</a></nobr></td></tr>
40
<tr><td colspan="5" class="shortcuts">
41
<a href="#glib-Hash-Tables.synopsis" class="shortcut">Top</a>
43
<a href="#glib-Hash-Tables.description" class="shortcut">Description</a>
43
46
<div class="refentry" lang="en">
44
47
<a name="glib-Hash-Tables"></a><div class="titlepage"></div>
45
48
<div class="refnamediv"><table width="100%"><tr>
48
<a name="id3344133"></a><span class="refentrytitle">Hash Tables</span>
50
<p>Hash Tables — associations between keys and values so that given a key the value
50
<h2><span class="refentrytitle"><a name="glib-Hash-Tables.top_of_page"></a>Hash Tables</span></h2>
51
<p>Hash Tables — associations between keys and values so that given a key the value
51
52
can be found quickly</p>
53
54
<td valign="top" align="right"></td>
54
55
</tr></table></div>
55
56
<div class="refsynopsisdiv">
57
<a name="glib-Hash-Tables.synopsis"></a><h2>Synopsis</h2>
57
58
<pre class="synopsis">
59
60
#include <glib.h>
62
<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a>;
63
<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a>* <a class="link" href="glib-Hash-Tables.html#g-hash-table-new">g_hash_table_new</a> (<a class="link" href="glib-Hash-Tables.html#GHashFunc">GHashFunc</a> hash_func,
64
<a class="link" href="glib-Hash-Tables.html#GEqualFunc">GEqualFunc</a> key_equal_func);
65
<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a>* <a class="link" href="glib-Hash-Tables.html#g-hash-table-new-full">g_hash_table_new_full</a> (<a class="link" href="glib-Hash-Tables.html#GHashFunc">GHashFunc</a> hash_func,
66
<a class="link" href="glib-Hash-Tables.html#GEqualFunc">GEqualFunc</a> key_equal_func,
67
<a class="link" href="glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> key_destroy_func,
68
<a class="link" href="glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> value_destroy_func);
69
<a class="link" href="glib-Basic-Types.html#guint">guint</a> (<a class="link" href="glib-Hash-Tables.html#GHashFunc">*GHashFunc</a>) (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> key);
70
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> (<a class="link" href="glib-Hash-Tables.html#GEqualFunc">*GEqualFunc</a>) (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> a,
71
<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> b);
72
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-insert">g_hash_table_insert</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table,
73
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> key,
74
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> value);
75
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-replace">g_hash_table_replace</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table,
76
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> key,
77
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> value);
78
<a class="link" href="glib-Basic-Types.html#guint">guint</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-size">g_hash_table_size</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);
79
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-lookup">g_hash_table_lookup</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table,
80
<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> key);
81
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-lookup-extended">g_hash_table_lookup_extended</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table,
82
<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> lookup_key,
83
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> *orig_key,
84
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> *value);
85
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach">g_hash_table_foreach</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table,
86
<a class="link" href="glib-Hash-Tables.html#GHFunc">GHFunc</a> func,
87
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);
88
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-find">g_hash_table_find</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table,
89
<a class="link" href="glib-Hash-Tables.html#GHRFunc">GHRFunc</a> predicate,
90
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);
91
void (<a class="link" href="glib-Hash-Tables.html#GHFunc">*GHFunc</a>) (<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> key,
92
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> value,
93
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);
94
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-remove">g_hash_table_remove</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table,
95
<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> key);
96
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-steal">g_hash_table_steal</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table,
97
<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> key);
98
<a class="link" href="glib-Basic-Types.html#guint">guint</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach-remove">g_hash_table_foreach_remove</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table,
99
<a class="link" href="glib-Hash-Tables.html#GHRFunc">GHRFunc</a> func,
100
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);
101
<a class="link" href="glib-Basic-Types.html#guint">guint</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach-steal">g_hash_table_foreach_steal</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table,
102
<a class="link" href="glib-Hash-Tables.html#GHRFunc">GHRFunc</a> func,
103
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);
104
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-remove-all">g_hash_table_remove_all</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);
105
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-steal-all">g_hash_table_steal_all</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);
106
<a class="link" href="glib-Doubly-Linked-Lists.html#GList">GList</a>* <a class="link" href="glib-Hash-Tables.html#g-hash-table-get-keys">g_hash_table_get_keys</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);
107
<a class="link" href="glib-Doubly-Linked-Lists.html#GList">GList</a>* <a class="link" href="glib-Hash-Tables.html#g-hash-table-get-values">g_hash_table_get_values</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);
108
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> (<a class="link" href="glib-Hash-Tables.html#GHRFunc">*GHRFunc</a>) (<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> key,
109
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> value,
110
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);
111
#define <a class="link" href="glib-Hash-Tables.html#g-hash-table-freeze">g_hash_table_freeze</a> (hash_table)
112
#define <a class="link" href="glib-Hash-Tables.html#g-hash-table-thaw">g_hash_table_thaw</a> (hash_table)
113
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-destroy">g_hash_table_destroy</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);
114
<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a>* <a class="link" href="glib-Hash-Tables.html#g-hash-table-ref">g_hash_table_ref</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);
115
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-unref">g_hash_table_unref</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);
116
<a class="link" href="glib-Hash-Tables.html#GHashTableIter">GHashTableIter</a>;
117
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-iter-init">g_hash_table_iter_init</a> (<a class="link" href="glib-Hash-Tables.html#GHashTableIter">GHashTableIter</a> *iter,
118
<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);
119
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-iter-next">g_hash_table_iter_next</a> (<a class="link" href="glib-Hash-Tables.html#GHashTableIter">GHashTableIter</a> *iter,
120
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> *key,
121
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> *value);
122
<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a>* <a class="link" href="glib-Hash-Tables.html#g-hash-table-iter-get-hash-table">g_hash_table_iter_get_hash_table</a> (<a class="link" href="glib-Hash-Tables.html#GHashTableIter">GHashTableIter</a> *iter);
123
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-iter-remove">g_hash_table_iter_remove</a> (<a class="link" href="glib-Hash-Tables.html#GHashTableIter">GHashTableIter</a> *iter);
124
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-iter-steal">g_hash_table_iter_steal</a> (<a class="link" href="glib-Hash-Tables.html#GHashTableIter">GHashTableIter</a> *iter);
126
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Hash-Tables.html#g-direct-equal">g_direct_equal</a> (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v1,
127
<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v2);
128
<a class="link" href="glib-Basic-Types.html#guint">guint</a> <a class="link" href="glib-Hash-Tables.html#g-direct-hash">g_direct_hash</a> (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v);
129
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Hash-Tables.html#g-int-equal">g_int_equal</a> (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v1,
130
<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v2);
131
<a class="link" href="glib-Basic-Types.html#guint">guint</a> <a class="link" href="glib-Hash-Tables.html#g-int-hash">g_int_hash</a> (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v);
132
<a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> <a class="link" href="glib-Hash-Tables.html#g-str-equal">g_str_equal</a> (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v1,
133
<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v2);
134
<a class="link" href="glib-Basic-Types.html#guint">guint</a> <a class="link" href="glib-Hash-Tables.html#g-str-hash">g_str_hash</a> (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v);
62
<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a>;
63
<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a>* <a class="link" href="glib-Hash-Tables.html#g-hash-table-new" title="g_hash_table_new ()">g_hash_table_new</a> (<a class="link" href="glib-Hash-Tables.html#GHashFunc" title="GHashFunc ()">GHashFunc</a> hash_func,
64
<a class="link" href="glib-Hash-Tables.html#GEqualFunc" title="GEqualFunc ()">GEqualFunc</a> key_equal_func);
65
<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a>* <a class="link" href="glib-Hash-Tables.html#g-hash-table-new-full" title="g_hash_table_new_full ()">g_hash_table_new_full</a> (<a class="link" href="glib-Hash-Tables.html#GHashFunc" title="GHashFunc ()">GHashFunc</a> hash_func,
66
<a class="link" href="glib-Hash-Tables.html#GEqualFunc" title="GEqualFunc ()">GEqualFunc</a> key_equal_func,
67
<a class="link" href="glib-Datasets.html#GDestroyNotify" title="GDestroyNotify ()">GDestroyNotify</a> key_destroy_func,
68
<a class="link" href="glib-Datasets.html#GDestroyNotify" title="GDestroyNotify ()">GDestroyNotify</a> value_destroy_func);
69
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> (<a class="link" href="glib-Hash-Tables.html#GHashFunc" title="GHashFunc ()">*GHashFunc</a>) (<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> key);
70
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> (<a class="link" href="glib-Hash-Tables.html#GEqualFunc" title="GEqualFunc ()">*GEqualFunc</a>) (<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> a,
71
<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> b);
72
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-insert" title="g_hash_table_insert ()">g_hash_table_insert</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table,
73
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> key,
74
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> value);
75
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-replace" title="g_hash_table_replace ()">g_hash_table_replace</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table,
76
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> key,
77
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> value);
78
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-size" title="g_hash_table_size ()">g_hash_table_size</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);
79
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-lookup" title="g_hash_table_lookup ()">g_hash_table_lookup</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table,
80
<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> key);
81
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-lookup-extended" title="g_hash_table_lookup_extended ()">g_hash_table_lookup_extended</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table,
82
<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> lookup_key,
83
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> *orig_key,
84
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> *value);
85
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach" title="g_hash_table_foreach ()">g_hash_table_foreach</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table,
86
<a class="link" href="glib-Hash-Tables.html#GHFunc" title="GHFunc ()">GHFunc</a> func,
87
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);
88
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-find" title="g_hash_table_find ()">g_hash_table_find</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table,
89
<a class="link" href="glib-Hash-Tables.html#GHRFunc" title="GHRFunc ()">GHRFunc</a> predicate,
90
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);
91
void (<a class="link" href="glib-Hash-Tables.html#GHFunc" title="GHFunc ()">*GHFunc</a>) (<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> key,
92
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> value,
93
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);
94
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-remove" title="g_hash_table_remove ()">g_hash_table_remove</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table,
95
<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> key);
96
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-steal" title="g_hash_table_steal ()">g_hash_table_steal</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table,
97
<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> key);
98
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach-remove" title="g_hash_table_foreach_remove ()">g_hash_table_foreach_remove</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table,
99
<a class="link" href="glib-Hash-Tables.html#GHRFunc" title="GHRFunc ()">GHRFunc</a> func,
100
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);
101
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach-steal" title="g_hash_table_foreach_steal ()">g_hash_table_foreach_steal</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table,
102
<a class="link" href="glib-Hash-Tables.html#GHRFunc" title="GHRFunc ()">GHRFunc</a> func,
103
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);
104
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-remove-all" title="g_hash_table_remove_all ()">g_hash_table_remove_all</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);
105
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-steal-all" title="g_hash_table_steal_all ()">g_hash_table_steal_all</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);
106
<a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList">GList</a> * <a class="link" href="glib-Hash-Tables.html#g-hash-table-get-keys" title="g_hash_table_get_keys ()">g_hash_table_get_keys</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);
107
<a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList">GList</a> * <a class="link" href="glib-Hash-Tables.html#g-hash-table-get-values" title="g_hash_table_get_values ()">g_hash_table_get_values</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);
108
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> (<a class="link" href="glib-Hash-Tables.html#GHRFunc" title="GHRFunc ()">*GHRFunc</a>) (<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> key,
109
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> value,
110
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);
111
#define <a class="link" href="glib-Hash-Tables.html#g-hash-table-freeze" title="g_hash_table_freeze()">g_hash_table_freeze</a> (hash_table)
112
#define <a class="link" href="glib-Hash-Tables.html#g-hash-table-thaw" title="g_hash_table_thaw()">g_hash_table_thaw</a> (hash_table)
113
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-destroy" title="g_hash_table_destroy ()">g_hash_table_destroy</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);
114
<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a>* <a class="link" href="glib-Hash-Tables.html#g-hash-table-ref" title="g_hash_table_ref ()">g_hash_table_ref</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);
115
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-unref" title="g_hash_table_unref ()">g_hash_table_unref</a> (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);
116
<a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter">GHashTableIter</a>;
117
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-iter-init" title="g_hash_table_iter_init ()">g_hash_table_iter_init</a> (<a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter">GHashTableIter</a> *iter,
118
<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);
119
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Hash-Tables.html#g-hash-table-iter-next" title="g_hash_table_iter_next ()">g_hash_table_iter_next</a> (<a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter">GHashTableIter</a> *iter,
120
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> *key,
121
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> *value);
122
<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a>* <a class="link" href="glib-Hash-Tables.html#g-hash-table-iter-get-hash-table" title="g_hash_table_iter_get_hash_table ()">g_hash_table_iter_get_hash_table</a> (<a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter">GHashTableIter</a> *iter);
123
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-iter-remove" title="g_hash_table_iter_remove ()">g_hash_table_iter_remove</a> (<a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter">GHashTableIter</a> *iter);
124
void <a class="link" href="glib-Hash-Tables.html#g-hash-table-iter-steal" title="g_hash_table_iter_steal ()">g_hash_table_iter_steal</a> (<a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter">GHashTableIter</a> *iter);
126
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Hash-Tables.html#g-direct-equal" title="g_direct_equal ()">g_direct_equal</a> (<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v1,
127
<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v2);
128
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> <a class="link" href="glib-Hash-Tables.html#g-direct-hash" title="g_direct_hash ()">g_direct_hash</a> (<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v);
129
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Hash-Tables.html#g-int-equal" title="g_int_equal ()">g_int_equal</a> (<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v1,
130
<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v2);
131
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> <a class="link" href="glib-Hash-Tables.html#g-int-hash" title="g_int_hash ()">g_int_hash</a> (<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v);
132
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> <a class="link" href="glib-Hash-Tables.html#g-str-equal" title="g_str_equal ()">g_str_equal</a> (<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v1,
133
<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v2);
134
<a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> <a class="link" href="glib-Hash-Tables.html#g-str-hash" title="g_str_hash ()">g_str_hash</a> (<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v);
137
137
<div class="refsect1" lang="en">
138
<a name="id3345239"></a><h2>Description</h2>
138
<a name="glib-Hash-Tables.description"></a><h2>Description</h2>
140
A <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a> provides associations between keys and values which
140
A <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a> provides associations between keys and values which
141
141
is optimized so that given a key, the associated value can be found
145
145
Note that neither keys nor values are copied when inserted into the
146
<a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>, so they must exist for the lifetime of the <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
146
<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>, so they must exist for the lifetime of the <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.
147
147
This means that the use of static strings is OK, but temporary
148
148
strings (i.e. those created in buffers and those returned by GTK+ widgets)
149
should be copied with <a class="link" href="glib-String-Utility-Functions.html#g-strdup"><code class="function">g_strdup()</code></a> before being inserted.
149
should be copied with <a class="link" href="glib-String-Utility-Functions.html#g-strdup" title="g_strdup ()"><code class="function">g_strdup()</code></a> before being inserted.
152
152
If keys or values are dynamically allocated, you must be careful to ensure
153
that they are freed when they are removed from the <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>, and also
154
when they are overwritten by new insertions into the <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
153
that they are freed when they are removed from the <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>, and also
154
when they are overwritten by new insertions into the <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.
155
155
It is also not advisable to mix static strings and dynamically-allocated
156
strings in a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>, because it then becomes difficult to determine
156
strings in a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>, because it then becomes difficult to determine
157
157
whether the string should be freed.
160
To create a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>, use <a class="link" href="glib-Hash-Tables.html#g-hash-table-new"><code class="function">g_hash_table_new()</code></a>.
163
To insert a key and value into a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>, use <a class="link" href="glib-Hash-Tables.html#g-hash-table-insert"><code class="function">g_hash_table_insert()</code></a>.
166
To lookup a value corresponding to a given key, use <a class="link" href="glib-Hash-Tables.html#g-hash-table-lookup"><code class="function">g_hash_table_lookup()</code></a>
167
and <a class="link" href="glib-Hash-Tables.html#g-hash-table-lookup-extended"><code class="function">g_hash_table_lookup_extended()</code></a>.
170
To remove a key and value, use <a class="link" href="glib-Hash-Tables.html#g-hash-table-remove"><code class="function">g_hash_table_remove()</code></a>.
173
To call a function for each key and value pair use <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach"><code class="function">g_hash_table_foreach()</code></a>
160
To create a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>, use <a class="link" href="glib-Hash-Tables.html#g-hash-table-new" title="g_hash_table_new ()"><code class="function">g_hash_table_new()</code></a>.
163
To insert a key and value into a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>, use <a class="link" href="glib-Hash-Tables.html#g-hash-table-insert" title="g_hash_table_insert ()"><code class="function">g_hash_table_insert()</code></a>.
166
To lookup a value corresponding to a given key, use <a class="link" href="glib-Hash-Tables.html#g-hash-table-lookup" title="g_hash_table_lookup ()"><code class="function">g_hash_table_lookup()</code></a>
167
and <a class="link" href="glib-Hash-Tables.html#g-hash-table-lookup-extended" title="g_hash_table_lookup_extended ()"><code class="function">g_hash_table_lookup_extended()</code></a>.
170
To remove a key and value, use <a class="link" href="glib-Hash-Tables.html#g-hash-table-remove" title="g_hash_table_remove ()"><code class="function">g_hash_table_remove()</code></a>.
173
To call a function for each key and value pair use <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach" title="g_hash_table_foreach ()"><code class="function">g_hash_table_foreach()</code></a>
174
174
or use a iterator to iterate over the key/value pairs in the hash table, see
175
<a class="link" href="glib-Hash-Tables.html#GHashTableIter"><span class="type">GHashTableIter</span></a>.
175
<a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter"><span class="type">GHashTableIter</span></a>.
178
To destroy a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a> use <a class="link" href="glib-Hash-Tables.html#g-hash-table-destroy"><code class="function">g_hash_table_destroy()</code></a>.
178
To destroy a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a> use <a class="link" href="glib-Hash-Tables.html#g-hash-table-destroy" title="g_hash_table_destroy ()"><code class="function">g_hash_table_destroy()</code></a>.
181
181
<div class="refsect1" lang="en">
182
<a name="id3345463"></a><h2>Details</h2>
182
<a name="glib-Hash-Tables.details"></a><h2>Details</h2>
183
183
<div class="refsect2" lang="en">
184
<a name="id3345473"></a><h3>
185
<a name="GHashTable"></a>GHashTable</h3>
186
<a class="indexterm" name="id3345485"></a><pre class="programlisting">typedef struct _GHashTable GHashTable;</pre>
184
<a name="GHashTable"></a><h3>GHashTable</h3>
185
<pre class="programlisting">typedef struct _GHashTable GHashTable;</pre>
188
187
The <span class="structname">GHashTable</span> struct is an opaque data structure to represent a
189
188
<a class="link" href="glib-Hash-Tables.html" title="Hash Tables">Hash Table</a>.
589
565
<div class="refsect2" lang="en">
590
<a name="id3347248"></a><h3>
591
<a name="g-hash-table-find"></a>g_hash_table_find ()</h3>
592
<a class="indexterm" name="id3347264"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> g_hash_table_find (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table,
593
<a class="link" href="glib-Hash-Tables.html#GHRFunc">GHRFunc</a> predicate,
594
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre>
566
<a name="g-hash-table-find"></a><h3>g_hash_table_find ()</h3>
567
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> g_hash_table_find (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table,
568
<a class="link" href="glib-Hash-Tables.html#GHRFunc" title="GHRFunc ()">GHRFunc</a> predicate,
569
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);</pre>
596
Calls the given function for key/value pairs in the <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a> until
597
<em class="parameter"><code>predicate</code></em> returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>. The function is passed the key and value of
571
Calls the given function for key/value pairs in the <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a> until
572
<em class="parameter"><code>predicate</code></em> returns <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a>. The function is passed the key and value of
598
573
each pair, and the given <em class="parameter"><code>user_data</code></em> parameter. The hash table may not
599
574
be modified while iterating over it (you can't add/remove items).
602
577
Note, that hash tables are really only optimized for forward lookups,
603
i.e. <a class="link" href="glib-Hash-Tables.html#g-hash-table-lookup"><code class="function">g_hash_table_lookup()</code></a>.
604
So code that frequently issues <a class="link" href="glib-Hash-Tables.html#g-hash-table-find"><code class="function">g_hash_table_find()</code></a> or
605
<a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach"><code class="function">g_hash_table_foreach()</code></a> (e.g. in the order of once per every entry in a
578
i.e. <a class="link" href="glib-Hash-Tables.html#g-hash-table-lookup" title="g_hash_table_lookup ()"><code class="function">g_hash_table_lookup()</code></a>.
579
So code that frequently issues <a class="link" href="glib-Hash-Tables.html#g-hash-table-find" title="g_hash_table_find ()"><code class="function">g_hash_table_find()</code></a> or
580
<a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach" title="g_hash_table_foreach ()"><code class="function">g_hash_table_foreach()</code></a> (e.g. in the order of once per every entry in a
606
581
hash table) should probably be reworked to use additional or different
607
582
data structures for reverse lookups (keep in mind that an O(n) find/foreach
608
583
operation issued for all n values in a hash table ends up needing O(n*n)
613
587
<div class="variablelist"><table border="0">
614
588
<col align="left" valign="top">
617
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
618
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
591
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
592
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.
622
<td><p><span class="term"><em class="parameter"><code>predicate</code></em> :</span></p></td>
596
<td><p><span class="term"><em class="parameter"><code>predicate</code></em> :</span></p></td>
623
597
<td> function to test the key/value pairs for a certain property.
627
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
601
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
628
602
<td> user data to pass to the function.
632
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
606
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
633
607
<td> The value of the first key/value pair is returned, for which
634
func evaluates to <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>. If no pair with the requested property is found,
635
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned.
608
func evaluates to <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a>. If no pair with the requested property is found,
609
<a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> is returned.
641
<p class="since">Since 2.4
615
<p class="since">Since 2.4</p>
645
618
<div class="refsect2" lang="en">
646
<a name="id3347481"></a><h3>
647
<a name="GHFunc"></a>GHFunc ()</h3>
648
<a class="indexterm" name="id3347494"></a><pre class="programlisting">void (*GHFunc) (<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> key,
649
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> value,
650
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre>
619
<a name="GHFunc"></a><h3>GHFunc ()</h3>
620
<pre class="programlisting">void (*GHFunc) (<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> key,
621
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> value,
622
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);</pre>
652
Specifies the type of the function passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach"><code class="function">g_hash_table_foreach()</code></a>.
624
Specifies the type of the function passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach" title="g_hash_table_foreach ()"><code class="function">g_hash_table_foreach()</code></a>.
653
625
It is called with each key/value pair, together with the <em class="parameter"><code>user_data</code></em> parameter
654
which is passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach"><code class="function">g_hash_table_foreach()</code></a>.
626
which is passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach" title="g_hash_table_foreach ()"><code class="function">g_hash_table_foreach()</code></a>.
656
628
<div class="variablelist"><table border="0">
657
629
<col align="left" valign="top">
660
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
632
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
665
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
637
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
666
638
<td>the value corresponding to the key.
670
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
671
<td>user data passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach"><code class="function">g_hash_table_foreach()</code></a>.
642
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
643
<td>user data passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach" title="g_hash_table_foreach ()"><code class="function">g_hash_table_foreach()</code></a>.
751
717
<div class="refsect2" lang="en">
752
<a name="id3347910"></a><h3>
753
<a name="g-hash-table-foreach-remove"></a>g_hash_table_foreach_remove ()</h3>
754
<a class="indexterm" name="id3347923"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint">guint</a> g_hash_table_foreach_remove (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table,
755
<a class="link" href="glib-Hash-Tables.html#GHRFunc">GHRFunc</a> func,
756
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre>
718
<a name="g-hash-table-foreach-remove"></a><h3>g_hash_table_foreach_remove ()</h3>
719
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> g_hash_table_foreach_remove (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table,
720
<a class="link" href="glib-Hash-Tables.html#GHRFunc" title="GHRFunc ()">GHRFunc</a> func,
721
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);</pre>
758
Calls the given function for each key/value pair in the <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
759
If the function returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, then the key/value pair is removed from the
760
<a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>. If you supplied key or value destroy functions when creating
761
the <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>, they are used to free the memory allocated for the removed
723
Calls the given function for each key/value pair in the <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.
724
If the function returns <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a>, then the key/value pair is removed from the
725
<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>. If you supplied key or value destroy functions when creating
726
the <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>, they are used to free the memory allocated for the removed
765
See <span class="type">GHashTableIterator</span> for an alternative way to loop over the
766
key/value pairs in the hash table.</p>
770
<div class="variablelist"><table border="0">
771
<col align="left" valign="top">
774
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
775
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
779
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
780
<td> the function to call for each key/value pair.
784
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
785
<td> user data to pass to the function.
789
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
790
<td> the number of key/value pairs removed.
797
<div class="refsect2" lang="en">
798
<a name="id3348088"></a><h3>
799
<a name="g-hash-table-foreach-steal"></a>g_hash_table_foreach_steal ()</h3>
800
<a class="indexterm" name="id3348102"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint">guint</a> g_hash_table_foreach_steal (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table,
801
<a class="link" href="glib-Hash-Tables.html#GHRFunc">GHRFunc</a> func,
802
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre>
804
Calls the given function for each key/value pair in the <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
805
If the function returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, then the key/value pair is removed from the
806
<a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>, but no key or value destroy functions are called.
809
See <span class="type">GHashTableIterator</span> for an alternative way to loop over the
810
key/value pairs in the hash table.</p>
814
<div class="variablelist"><table border="0">
815
<col align="left" valign="top">
818
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
819
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
823
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
824
<td> the function to call for each key/value pair.
828
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
829
<td> user data to pass to the function.
833
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
834
<td> the number of key/value pairs removed.
841
<div class="refsect2" lang="en">
842
<a name="id3348256"></a><h3>
843
<a name="g-hash-table-remove-all"></a>g_hash_table_remove_all ()</h3>
844
<a class="indexterm" name="id3348272"></a><pre class="programlisting">void g_hash_table_remove_all (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);</pre>
846
Removes all keys and their associated values from a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
849
If the <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a> was created using <a class="link" href="glib-Hash-Tables.html#g-hash-table-new-full"><code class="function">g_hash_table_new_full()</code></a>, the keys
730
See <a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter"><span class="type">GHashTableIter</span></a> for an alternative way to loop over the
731
key/value pairs in the hash table.</p>
734
<div class="variablelist"><table border="0">
735
<col align="left" valign="top">
738
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
739
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.
743
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
744
<td> the function to call for each key/value pair.
748
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
749
<td> user data to pass to the function.
753
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
754
<td> the number of key/value pairs removed.
761
<div class="refsect2" lang="en">
762
<a name="g-hash-table-foreach-steal"></a><h3>g_hash_table_foreach_steal ()</h3>
763
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> g_hash_table_foreach_steal (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table,
764
<a class="link" href="glib-Hash-Tables.html#GHRFunc" title="GHRFunc ()">GHRFunc</a> func,
765
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);</pre>
767
Calls the given function for each key/value pair in the <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.
768
If the function returns <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a>, then the key/value pair is removed from the
769
<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>, but no key or value destroy functions are called.
772
See <a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter"><span class="type">GHashTableIter</span></a> for an alternative way to loop over the
773
key/value pairs in the hash table.</p>
776
<div class="variablelist"><table border="0">
777
<col align="left" valign="top">
780
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
781
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.
785
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
786
<td> the function to call for each key/value pair.
790
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
791
<td> user data to pass to the function.
795
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
796
<td> the number of key/value pairs removed.
803
<div class="refsect2" lang="en">
804
<a name="g-hash-table-remove-all"></a><h3>g_hash_table_remove_all ()</h3>
805
<pre class="programlisting">void g_hash_table_remove_all (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);</pre>
807
Removes all keys and their associated values from a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.
810
If the <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a> was created using <a class="link" href="glib-Hash-Tables.html#g-hash-table-new-full" title="g_hash_table_new_full ()"><code class="function">g_hash_table_new_full()</code></a>, the keys
850
811
and values are freed using the supplied destroy functions, otherwise you
851
812
have to make sure that any dynamically allocated values are freed
856
816
<div class="variablelist"><table border="0">
857
817
<col align="left" valign="top">
859
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
860
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>
819
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
820
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>
864
<p class="since">Since 2.12
824
<p class="since">Since 2.12</p>
868
827
<div class="refsect2" lang="en">
869
<a name="id3348370"></a><h3>
870
<a name="g-hash-table-steal-all"></a>g_hash_table_steal_all ()</h3>
871
<a class="indexterm" name="id3348386"></a><pre class="programlisting">void g_hash_table_steal_all (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);</pre>
828
<a name="g-hash-table-steal-all"></a><h3>g_hash_table_steal_all ()</h3>
829
<pre class="programlisting">void g_hash_table_steal_all (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);</pre>
873
Removes all keys and their associated values from a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>
831
Removes all keys and their associated values from a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>
874
832
without calling the key and value destroy functions.</p>
878
835
<div class="variablelist"><table border="0">
879
836
<col align="left" valign="top">
881
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
882
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
838
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
839
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.
886
<p class="since">Since 2.12
843
<p class="since">Since 2.12</p>
890
846
<div class="refsect2" lang="en">
891
<a name="id3348460"></a><h3>
892
<a name="g-hash-table-get-keys"></a>g_hash_table_get_keys ()</h3>
893
<a class="indexterm" name="id3348476"></a><pre class="programlisting"><a class="link" href="glib-Doubly-Linked-Lists.html#GList">GList</a>* g_hash_table_get_keys (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);</pre>
847
<a name="g-hash-table-get-keys"></a><h3>g_hash_table_get_keys ()</h3>
848
<pre class="programlisting"><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList">GList</a> * g_hash_table_get_keys (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);</pre>
895
850
Retrieves every key inside <em class="parameter"><code>hash_table</code></em>. The returned data is valid
896
851
until <em class="parameter"><code>hash_table</code></em> is modified.</p>
900
854
<div class="variablelist"><table border="0">
901
855
<col align="left" valign="top">
904
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
905
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>
858
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
859
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>
909
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
910
<td> a <a class="link" href="glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a> containing all the keys inside the hash
863
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
864
<td> a <a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> containing all the keys inside the hash
911
865
table. The content of the list is owned by the hash table and
912
should not be modified or freed. Use <a class="link" href="glib-Doubly-Linked-Lists.html#g-list-free"><code class="function">g_list_free()</code></a> when done
866
should not be modified or freed. Use <a class="link" href="glib-Doubly-Linked-Lists.html#g-list-free" title="g_list_free ()"><code class="function">g_list_free()</code></a> when done
919
<p class="since">Since 2.14
873
<p class="since">Since 2.14</p>
923
876
<div class="refsect2" lang="en">
924
<a name="id3348585"></a><h3>
925
<a name="g-hash-table-get-values"></a>g_hash_table_get_values ()</h3>
926
<a class="indexterm" name="id3348600"></a><pre class="programlisting"><a class="link" href="glib-Doubly-Linked-Lists.html#GList">GList</a>* g_hash_table_get_values (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);</pre>
877
<a name="g-hash-table-get-values"></a><h3>g_hash_table_get_values ()</h3>
878
<pre class="programlisting"><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList">GList</a> * g_hash_table_get_values (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);</pre>
928
880
Retrieves every value inside <em class="parameter"><code>hash_table</code></em>. The returned data is
929
881
valid until <em class="parameter"><code>hash_table</code></em> is modified.</p>
933
884
<div class="variablelist"><table border="0">
934
885
<col align="left" valign="top">
937
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
938
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>
888
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
889
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>
942
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
943
<td> a <a class="link" href="glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a> containing all the values inside the hash
893
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
894
<td> a <a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> containing all the values inside the hash
944
895
table. The content of the list is owned by the hash table and
945
should not be modified or freed. Use <a class="link" href="glib-Doubly-Linked-Lists.html#g-list-free"><code class="function">g_list_free()</code></a> when done
896
should not be modified or freed. Use <a class="link" href="glib-Doubly-Linked-Lists.html#g-list-free" title="g_list_free ()"><code class="function">g_list_free()</code></a> when done
952
<p class="since">Since 2.14
903
<p class="since">Since 2.14</p>
956
906
<div class="refsect2" lang="en">
957
<a name="id3348708"></a><h3>
958
<a name="GHRFunc"></a>GHRFunc ()</h3>
959
<a class="indexterm" name="id3348720"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> (*GHRFunc) (<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> key,
960
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> value,
961
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre>
907
<a name="GHRFunc"></a><h3>GHRFunc ()</h3>
908
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> (*GHRFunc) (<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> key,
909
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> value,
910
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);</pre>
963
Specifies the type of the function passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach-remove"><code class="function">g_hash_table_foreach_remove()</code></a>.
912
Specifies the type of the function passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach-remove" title="g_hash_table_foreach_remove ()"><code class="function">g_hash_table_foreach_remove()</code></a>.
964
913
It is called with each key/value pair, together with the <em class="parameter"><code>user_data</code></em> parameter
965
passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach-remove"><code class="function">g_hash_table_foreach_remove()</code></a>.
966
It should return <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the key/value pair should be removed from the
967
<a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
914
passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-foreach-remove" title="g_hash_table_foreach_remove ()"><code class="function">g_hash_table_foreach_remove()</code></a>.
915
It should return <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the key/value pair should be removed from the
916
<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.
969
918
<div class="variablelist"><table border="0">
970
919
<col align="left" valign="top">
973
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
922
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
978
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
927
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
979
928
<td>the value associated with the key.
983
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
984
<td>user data passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-remove"><code class="function">g_hash_table_remove()</code></a>.
932
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
933
<td>user data passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-remove" title="g_hash_table_remove ()"><code class="function">g_hash_table_remove()</code></a>.
988
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
990
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the key/value pair should be removed from the <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
937
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
938
<td>%TRUE if the key/value pair should be removed from the <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.
1035
977
<div class="variablelist"><table border="0">
1036
978
<col align="left" valign="top">
1038
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
1039
<td>a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>
980
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
981
<td>a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>
1047
987
<div class="refsect2" lang="en">
1048
<a name="id3349039"></a><h3>
1049
<a name="g-hash-table-destroy"></a>g_hash_table_destroy ()</h3>
1050
<a class="indexterm" name="id3349052"></a><pre class="programlisting">void g_hash_table_destroy (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);</pre>
988
<a name="g-hash-table-destroy"></a><h3>g_hash_table_destroy ()</h3>
989
<pre class="programlisting">void g_hash_table_destroy (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);</pre>
1052
Destroys all keys and values in the <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a> and decrements its
991
Destroys all keys and values in the <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a> and decrements its
1053
992
reference count by 1. If keys and/or values are dynamically allocated,
1054
you should either free them first or create the <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a> with destroy
1055
notifiers using <a class="link" href="glib-Hash-Tables.html#g-hash-table-new-full"><code class="function">g_hash_table_new_full()</code></a>. In the latter case the destroy
993
you should either free them first or create the <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a> with destroy
994
notifiers using <a class="link" href="glib-Hash-Tables.html#g-hash-table-new-full" title="g_hash_table_new_full ()"><code class="function">g_hash_table_new_full()</code></a>. In the latter case the destroy
1056
995
functions you supplied will be called on all keys and values during the
1057
996
destruction phase.</p>
1061
999
<div class="variablelist"><table border="0">
1062
1000
<col align="left" valign="top">
1064
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
1065
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
1002
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
1003
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.
1071
1009
<div class="refsect2" lang="en">
1072
<a name="id3349142"></a><h3>
1073
<a name="g-hash-table-ref"></a>g_hash_table_ref ()</h3>
1074
<a class="indexterm" name="id3349157"></a><pre class="programlisting"><a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a>* g_hash_table_ref (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);</pre>
1010
<a name="g-hash-table-ref"></a><h3>g_hash_table_ref ()</h3>
1011
<pre class="programlisting"><a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a>* g_hash_table_ref (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);</pre>
1076
1013
Atomically increments the reference count of <em class="parameter"><code>hash_table</code></em> by one.
1077
1014
This function is MT-safe and may be called from any thread.</p>
1081
1017
<div class="variablelist"><table border="0">
1082
1018
<col align="left" valign="top">
1085
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
1086
<td> a valid <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
1021
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
1022
<td> a valid <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.
1090
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1091
<td> the passed in <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
1026
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1027
<td> the passed in <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.
1097
<p class="since">Since 2.10
1033
<p class="since">Since 2.10</p>
1101
1036
<div class="refsect2" lang="en">
1102
<a name="id3349248"></a><h3>
1103
<a name="g-hash-table-unref"></a>g_hash_table_unref ()</h3>
1104
<a class="indexterm" name="id3349263"></a><pre class="programlisting">void g_hash_table_unref (<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);</pre>
1037
<a name="g-hash-table-unref"></a><h3>g_hash_table_unref ()</h3>
1038
<pre class="programlisting">void g_hash_table_unref (<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);</pre>
1106
1040
Atomically decrements the reference count of <em class="parameter"><code>hash_table</code></em> by one.
1107
1041
If the reference count drops to 0, all keys and values will be
1108
1042
destroyed, and all memory allocated by the hash table is released.
1109
1043
This function is MT-safe and may be called from any thread.</p>
1113
1046
<div class="variablelist"><table border="0">
1114
1047
<col align="left" valign="top">
1116
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
1117
<td> a valid <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
1049
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
1050
<td> a valid <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.
1121
<p class="since">Since 2.10
1054
<p class="since">Since 2.10</p>
1125
1057
<div class="refsect2" lang="en">
1126
<a name="id3349337"></a><h3>
1127
<a name="GHashTableIter"></a>GHashTableIter</h3>
1128
<a class="indexterm" name="id3349349"></a><pre class="programlisting">typedef struct {
1058
<a name="GHashTableIter"></a><h3>GHashTableIter</h3>
1059
<pre class="programlisting">typedef struct {
1129
1060
} GHashTableIter;
1063
A GHashTableIter structure represents an iterator that can be
1064
used to iterate over the elements of a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>. GHashTableIter
1065
structures are typically allocated on the stack and then initialized
1066
with <a class="link" href="glib-Hash-Tables.html#g-hash-table-iter-init" title="g_hash_table_iter_init ()"><code class="function">g_hash_table_iter_init()</code></a>.
1136
1070
<div class="refsect2" lang="en">
1137
<a name="id3349365"></a><h3>
1138
<a name="g-hash-table-iter-init"></a>g_hash_table_iter_init ()</h3>
1139
<a class="indexterm" name="id3349380"></a><pre class="programlisting">void g_hash_table_iter_init (<a class="link" href="glib-Hash-Tables.html#GHashTableIter">GHashTableIter</a> *iter,
1140
<a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a> *hash_table);</pre>
1071
<a name="g-hash-table-iter-init"></a><h3>g_hash_table_iter_init ()</h3>
1072
<pre class="programlisting">void g_hash_table_iter_init (<a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter">GHashTableIter</a> *iter,
1073
<a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a> *hash_table);</pre>
1142
1075
Initializes a key/value pair iterator and associates it with
1143
1076
<em class="parameter"><code>hash_table</code></em>. Modifying the hash table after calling this function
1159
1091
<div class="variablelist"><table border="0">
1160
1092
<col align="left" valign="top">
1163
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
1164
<td> an uninitialized <a class="link" href="glib-Hash-Tables.html#GHashTableIter"><span class="type">GHashTableIter</span></a>.
1095
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
1096
<td> an uninitialized <a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter"><span class="type">GHashTableIter</span></a>.
1168
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
1169
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.
1100
<td><p><span class="term"><em class="parameter"><code>hash_table</code></em> :</span></p></td>
1101
<td> a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.
1174
<p class="since">Since 2.16
1106
<p class="since">Since 2.16</p>
1178
1109
<div class="refsect2" lang="en">
1179
<a name="id3349492"></a><h3>
1180
<a name="g-hash-table-iter-next"></a>g_hash_table_iter_next ()</h3>
1181
<a class="indexterm" name="id3349508"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> g_hash_table_iter_next (<a class="link" href="glib-Hash-Tables.html#GHashTableIter">GHashTableIter</a> *iter,
1182
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> *key,
1183
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> *value);</pre>
1110
<a name="g-hash-table-iter-next"></a><h3>g_hash_table_iter_next ()</h3>
1111
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> g_hash_table_iter_next (<a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter">GHashTableIter</a> *iter,
1112
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> *key,
1113
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> *value);</pre>
1185
1115
Advances <em class="parameter"><code>iter</code></em> and retrieves the key and/or value that are now
1186
pointed to as a result of this advancement. If <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is returned,
1116
pointed to as a result of this advancement. If <a class="link" href="glib-Standard-Macros.html#FALSE--CAPS" title="FALSE"><code class="literal">FALSE</code></a> is returned,
1187
1117
<em class="parameter"><code>key</code></em> and <em class="parameter"><code>value</code></em> are not set, and the iterator becomes invalid.</p>
1191
<div class="variablelist"><table border="0">
1192
<col align="left" valign="top">
1195
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
1196
<td> an initialized <a class="link" href="glib-Hash-Tables.html#GHashTableIter"><span class="type">GHashTableIter</span></a>.
1200
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
1201
<td> a location to store the key, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
1205
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
1206
<td> a location to store the value, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
1210
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1211
<td> <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if the end of the <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a> has been reached.
1217
<p class="since">Since 2.16
1221
<div class="refsect2" lang="en">
1222
<a name="id3349696"></a><h3>
1223
<a name="g-hash-table-iter-get-hash-table"></a>g_hash_table_iter_get_hash_table ()</h3>
1224
<a class="indexterm" name="id3349712"></a><pre class="programlisting"><a class="link" href="glib-Hash-Tables.html#GHashTable">GHashTable</a>* g_hash_table_iter_get_hash_table (<a class="link" href="glib-Hash-Tables.html#GHashTableIter">GHashTableIter</a> *iter);</pre>
1226
Returns the <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a> associated with <em class="parameter"><code>iter</code></em>.</p>
1230
<div class="variablelist"><table border="0">
1231
<col align="left" valign="top">
1234
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
1235
<td> an initialized <a class="link" href="glib-Hash-Tables.html#GHashTableIter"><span class="type">GHashTableIter</span></a>.
1239
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1240
<td> the <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a> associated with <em class="parameter"><code>iter</code></em>.
1246
<p class="since">Since 2.16
1250
<div class="refsect2" lang="en">
1251
<a name="id3349816"></a><h3>
1252
<a name="g-hash-table-iter-remove"></a>g_hash_table_iter_remove ()</h3>
1253
<a class="indexterm" name="id3349832"></a><pre class="programlisting">void g_hash_table_iter_remove (<a class="link" href="glib-Hash-Tables.html#GHashTableIter">GHashTableIter</a> *iter);</pre>
1120
<div class="variablelist"><table border="0">
1121
<col align="left" valign="top">
1124
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
1125
<td> an initialized <a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter"><span class="type">GHashTableIter</span></a>.
1129
<td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
1130
<td> a location to store the key, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>.
1134
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
1135
<td> a location to store the value, or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>.
1139
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1140
<td> <a class="link" href="glib-Standard-Macros.html#FALSE--CAPS" title="FALSE"><code class="literal">FALSE</code></a> if the end of the <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a> has been reached.
1146
<p class="since">Since 2.16</p>
1149
<div class="refsect2" lang="en">
1150
<a name="g-hash-table-iter-get-hash-table"></a><h3>g_hash_table_iter_get_hash_table ()</h3>
1151
<pre class="programlisting"><a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable">GHashTable</a>* g_hash_table_iter_get_hash_table (<a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter">GHashTableIter</a> *iter);</pre>
1153
Returns the <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a> associated with <em class="parameter"><code>iter</code></em>.</p>
1156
<div class="variablelist"><table border="0">
1157
<col align="left" valign="top">
1160
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
1161
<td> an initialized <a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter"><span class="type">GHashTableIter</span></a>.
1165
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1166
<td> the <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a> associated with <em class="parameter"><code>iter</code></em>.
1172
<p class="since">Since 2.16</p>
1175
<div class="refsect2" lang="en">
1176
<a name="g-hash-table-iter-remove"></a><h3>g_hash_table_iter_remove ()</h3>
1177
<pre class="programlisting">void g_hash_table_iter_remove (<a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter">GHashTableIter</a> *iter);</pre>
1255
1179
Removes the key/value pair currently pointed to by the iterator
1256
from its associated <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>. Can only be called after
1257
<a class="link" href="glib-Hash-Tables.html#g-hash-table-iter-next"><code class="function">g_hash_table_iter_next()</code></a> returned <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, and cannot be called more
1180
from its associated <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>. Can only be called after
1181
<a class="link" href="glib-Hash-Tables.html#g-hash-table-iter-next" title="g_hash_table_iter_next ()"><code class="function">g_hash_table_iter_next()</code></a> returned <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a>, and cannot be called more
1258
1182
than once for the same key/value pair.
1261
If the <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a> was created using <a class="link" href="glib-Hash-Tables.html#g-hash-table-new-full"><code class="function">g_hash_table_new_full()</code></a>, the
1185
If the <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a> was created using <a class="link" href="glib-Hash-Tables.html#g-hash-table-new-full" title="g_hash_table_new_full ()"><code class="function">g_hash_table_new_full()</code></a>, the
1262
1186
key and value are freed using the supplied destroy functions, otherwise
1263
1187
you have to make sure that any dynamically allocated values are freed
1268
1191
<div class="variablelist"><table border="0">
1269
1192
<col align="left" valign="top">
1271
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
1272
<td> an initialized <a class="link" href="glib-Hash-Tables.html#GHashTableIter"><span class="type">GHashTableIter</span></a>.
1194
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
1195
<td> an initialized <a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter"><span class="type">GHashTableIter</span></a>.
1276
<p class="since">Since 2.16
1199
<p class="since">Since 2.16</p>
1280
1202
<div class="refsect2" lang="en">
1281
<a name="id3349954"></a><h3>
1282
<a name="g-hash-table-iter-steal"></a>g_hash_table_iter_steal ()</h3>
1283
<a class="indexterm" name="id3349969"></a><pre class="programlisting">void g_hash_table_iter_steal (<a class="link" href="glib-Hash-Tables.html#GHashTableIter">GHashTableIter</a> *iter);</pre>
1203
<a name="g-hash-table-iter-steal"></a><h3>g_hash_table_iter_steal ()</h3>
1204
<pre class="programlisting">void g_hash_table_iter_steal (<a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter">GHashTableIter</a> *iter);</pre>
1285
1206
Removes the key/value pair currently pointed to by the iterator
1286
from its associated <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>, without calling the key and value
1207
from its associated <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>, without calling the key and value
1287
1208
destroy functions. Can only be called after
1288
<a class="link" href="glib-Hash-Tables.html#g-hash-table-iter-next"><code class="function">g_hash_table_iter_next()</code></a> returned <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, and cannot be called more
1209
<a class="link" href="glib-Hash-Tables.html#g-hash-table-iter-next" title="g_hash_table_iter_next ()"><code class="function">g_hash_table_iter_next()</code></a> returned <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a>, and cannot be called more
1289
1210
than once for the same key/value pair.</p>
1293
1213
<div class="variablelist"><table border="0">
1294
1214
<col align="left" valign="top">
1296
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
1297
<td> an initialized <a class="link" href="glib-Hash-Tables.html#GHashTableIter"><span class="type">GHashTableIter</span></a>.
1216
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
1217
<td> an initialized <a class="link" href="glib-Hash-Tables.html#GHashTableIter" title="GHashTableIter"><span class="type">GHashTableIter</span></a>.
1301
<p class="since">Since 2.16
1221
<p class="since">Since 2.16</p>
1305
1224
<div class="refsect2" lang="en">
1306
<a name="id3350068"></a><h3>
1307
<a name="g-direct-equal"></a>g_direct_equal ()</h3>
1308
<a class="indexterm" name="id3350081"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> g_direct_equal (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v1,
1309
<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v2);</pre>
1311
Compares two <a class="link" href="glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> arguments and returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if they are equal.
1312
It can be passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-new"><code class="function">g_hash_table_new()</code></a> as the <em class="parameter"><code>key_equal_func</code></em>
1313
parameter, when using pointers as keys in a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.</p>
1225
<a name="g-direct-equal"></a><h3>g_direct_equal ()</h3>
1226
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> g_direct_equal (<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v1,
1227
<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v2);</pre>
1229
Compares two <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> arguments and returns <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> if they are equal.
1230
It can be passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-new" title="g_hash_table_new ()"><code class="function">g_hash_table_new()</code></a> as the <em class="parameter"><code>key_equal_func</code></em>
1231
parameter, when using pointers as keys in a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.</p>
1317
1234
<div class="variablelist"><table border="0">
1318
1235
<col align="left" valign="top">
1321
<td><p><span class="term"><em class="parameter"><code>v1</code></em> :</span></p></td>
1238
<td><p><span class="term"><em class="parameter"><code>v1</code></em> :</span></p></td>
1326
<td><p><span class="term"><em class="parameter"><code>v2</code></em> :</span></p></td>
1243
<td><p><span class="term"><em class="parameter"><code>v2</code></em> :</span></p></td>
1327
1244
<td> a key to compare with <em class="parameter"><code>v1</code></em>.
1331
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1332
<td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the two keys match.
1248
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1249
<td> <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the two keys match.
1339
1256
<div class="refsect2" lang="en">
1340
<a name="id3350224"></a><h3>
1341
<a name="g-direct-hash"></a>g_direct_hash ()</h3>
1342
<a class="indexterm" name="id3350237"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint">guint</a> g_direct_hash (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v);</pre>
1257
<a name="g-direct-hash"></a><h3>g_direct_hash ()</h3>
1258
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> g_direct_hash (<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v);</pre>
1344
1260
Converts a gpointer to a hash value.
1345
It can be passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-new"><code class="function">g_hash_table_new()</code></a> as the <em class="parameter"><code>hash_func</code></em> parameter,
1346
when using pointers as keys in a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.</p>
1350
<div class="variablelist"><table border="0">
1351
<col align="left" valign="top">
1354
<td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
1355
<td> a <a class="link" href="glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> key
1359
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1360
<td> a hash value corresponding to the key.
1367
<div class="refsect2" lang="en">
1368
<a name="id3350332"></a><h3>
1369
<a name="g-int-equal"></a>g_int_equal ()</h3>
1370
<a class="indexterm" name="id3350344"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> g_int_equal (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v1,
1371
<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v2);</pre>
1373
Compares the two <a class="link" href="glib-Basic-Types.html#gint"><span class="type">gint</span></a> values being pointed to and returns
1374
<a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if they are equal.
1375
It can be passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-new"><code class="function">g_hash_table_new()</code></a> as the <em class="parameter"><code>key_equal_func</code></em>
1376
parameter, when using pointers to integers as keys in a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.</p>
1380
<div class="variablelist"><table border="0">
1381
<col align="left" valign="top">
1384
<td><p><span class="term"><em class="parameter"><code>v1</code></em> :</span></p></td>
1385
<td> a pointer to a <a class="link" href="glib-Basic-Types.html#gint"><span class="type">gint</span></a> key.
1389
<td><p><span class="term"><em class="parameter"><code>v2</code></em> :</span></p></td>
1390
<td> a pointer to a <a class="link" href="glib-Basic-Types.html#gint"><span class="type">gint</span></a> key to compare with <em class="parameter"><code>v1</code></em>.
1394
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1395
<td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the two keys match.
1402
<div class="refsect2" lang="en">
1403
<a name="id3350503"></a><h3>
1404
<a name="g-int-hash"></a>g_int_hash ()</h3>
1405
<a class="indexterm" name="id3350515"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint">guint</a> g_int_hash (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v);</pre>
1407
Converts a pointer to a <a class="link" href="glib-Basic-Types.html#gint"><span class="type">gint</span></a> to a hash value.
1408
It can be passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-new"><code class="function">g_hash_table_new()</code></a> as the <em class="parameter"><code>hash_func</code></em> parameter,
1409
when using pointers to integers values as keys in a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.</p>
1413
<div class="variablelist"><table border="0">
1414
<col align="left" valign="top">
1417
<td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
1418
<td> a pointer to a <a class="link" href="glib-Basic-Types.html#gint"><span class="type">gint</span></a> key
1422
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1423
<td> a hash value corresponding to the key.
1430
<div class="refsect2" lang="en">
1431
<a name="id3350618"></a><h3>
1432
<a name="g-str-equal"></a>g_str_equal ()</h3>
1433
<a class="indexterm" name="id3350630"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a> g_str_equal (<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v1,
1434
<a class="link" href="glib-Basic-Types.html#gconstpointer">gconstpointer</a> v2);</pre>
1436
Compares two strings for byte-by-byte equality and returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>
1437
if they are equal. It can be passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-new"><code class="function">g_hash_table_new()</code></a> as the
1438
<em class="parameter"><code>key_equal_func</code></em> parameter, when using strings as keys in a <a class="link" href="glib-Hash-Tables.html#GHashTable"><span class="type">GHashTable</span></a>.</p>
1441
<div class="variablelist"><table border="0">
1442
<col align="left" valign="top">
1445
<td><p><span class="term"><em class="parameter"><code>v1</code></em> :</span></p></td>
1261
It can be passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-new" title="g_hash_table_new ()"><code class="function">g_hash_table_new()</code></a> as the <em class="parameter"><code>hash_func</code></em> parameter,
1262
when using pointers as keys in a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.</p>
1265
<div class="variablelist"><table border="0">
1266
<col align="left" valign="top">
1269
<td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
1270
<td> a <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> key
1274
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1275
<td> a hash value corresponding to the key.
1282
<div class="refsect2" lang="en">
1283
<a name="g-int-equal"></a><h3>g_int_equal ()</h3>
1284
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> g_int_equal (<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v1,
1285
<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v2);</pre>
1287
Compares the two <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> values being pointed to and returns
1288
<a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> if they are equal.
1289
It can be passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-new" title="g_hash_table_new ()"><code class="function">g_hash_table_new()</code></a> as the <em class="parameter"><code>key_equal_func</code></em>
1290
parameter, when using pointers to integers as keys in a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.</p>
1293
<div class="variablelist"><table border="0">
1294
<col align="left" valign="top">
1297
<td><p><span class="term"><em class="parameter"><code>v1</code></em> :</span></p></td>
1298
<td> a pointer to a <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> key.
1302
<td><p><span class="term"><em class="parameter"><code>v2</code></em> :</span></p></td>
1303
<td> a pointer to a <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> key to compare with <em class="parameter"><code>v1</code></em>.
1307
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1308
<td> <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the two keys match.
1315
<div class="refsect2" lang="en">
1316
<a name="g-int-hash"></a><h3>g_int_hash ()</h3>
1317
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint" title="guint">guint</a> g_int_hash (<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v);</pre>
1319
Converts a pointer to a <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> to a hash value.
1320
It can be passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-new" title="g_hash_table_new ()"><code class="function">g_hash_table_new()</code></a> as the <em class="parameter"><code>hash_func</code></em> parameter,
1321
when using pointers to integers values as keys in a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.</p>
1324
<div class="variablelist"><table border="0">
1325
<col align="left" valign="top">
1328
<td><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
1329
<td> a pointer to a <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> key
1333
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1334
<td> a hash value corresponding to the key.
1341
<div class="refsect2" lang="en">
1342
<a name="g-str-equal"></a><h3>g_str_equal ()</h3>
1343
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean">gboolean</a> g_str_equal (<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v1,
1344
<a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer">gconstpointer</a> v2);</pre>
1346
Compares two strings for byte-by-byte equality and returns <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a>
1347
if they are equal. It can be passed to <a class="link" href="glib-Hash-Tables.html#g-hash-table-new" title="g_hash_table_new ()"><code class="function">g_hash_table_new()</code></a> as the
1348
<em class="parameter"><code>key_equal_func</code></em> parameter, when using strings as keys in a <a class="link" href="glib-Hash-Tables.html#GHashTable" title="GHashTable"><span class="type">GHashTable</span></a>.</p>
1351
<div class="variablelist"><table border="0">
1352
<col align="left" valign="top">
1355
<td><p><span class="term"><em class="parameter"><code>v1</code></em> :</span></p></td>
1450
<td><p><span class="term"><em class="parameter"><code>v2</code></em> :</span></p></td>
1360
<td><p><span class="term"><em class="parameter"><code>v2</code></em> :</span></p></td>
1451
1361
<td> a key to compare with <em class="parameter"><code>v1</code></em>
1455
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1456
<td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the two keys match
1365
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1366
<td> <a class="link" href="glib-Standard-Macros.html#TRUE--CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the two keys match