152
<refsect1 role="details">
150
<refsect1 id="glib-Hash-Tables.details" role="details">
153
151
<title role="details.title">Details</title>
155
<title><anchor id="GHashTable" role="struct"/>GHashTable</title>
156
<indexterm><primary>GHashTable</primary></indexterm><programlisting>typedef struct _GHashTable GHashTable;</programlisting>
152
<refsect2 id="GHashTable" role="struct">
153
<title>GHashTable</title>
154
<indexterm zone="GHashTable"><primary sortas="GHashTable">GHashTable</primary></indexterm><programlisting>typedef struct _GHashTable GHashTable;</programlisting>
158
156
The <structname>GHashTable</structname> struct is an opaque data structure to represent a
159
157
<link linkend="glib-Hash-Tables">Hash Table</link>.
160
158
It should only be accessed via the following functions.
161
159
</para></refsect2>
163
<title><anchor id="g-hash-table-new" role="function"/>g_hash_table_new ()</title>
164
<indexterm><primary>g_hash_table_new</primary></indexterm><programlisting><link linkend="GHashTable">GHashTable</link>* g_hash_table_new (<link linkend="GHashFunc">GHashFunc</link> hash_func,
160
<refsect2 id="g-hash-table-new" role="function">
161
<title>g_hash_table_new ()</title>
162
<indexterm zone="g-hash-table-new"><primary sortas="g_hash_table_new">g_hash_table_new</primary></indexterm><programlisting><link linkend="GHashTable">GHashTable</link>* g_hash_table_new (<link linkend="GHashFunc">GHashFunc</link> hash_func,
165
163
<link linkend="GEqualFunc">GEqualFunc</link> key_equal_func);</programlisting>
167
165
Creates a new <link linkend="GHashTable"><type>GHashTable</type></link> with a reference count of 1.</para>
170
167
</para><variablelist role="params">
171
<varlistentry><term><parameter>hash_func</parameter> :</term>
168
<varlistentry><term><parameter>hash_func</parameter> :</term>
172
169
<listitem><simpara> a function to create a hash value from a key.
173
170
Hash values are used to determine where keys are stored within the
174
171
<link linkend="GHashTable"><type>GHashTable</type></link> data structure. The <link linkend="g-direct-hash"><function>g_direct_hash()</function></link>, <link linkend="g-int-hash"><function>g_int_hash()</function></link> and
175
172
<link linkend="g-str-hash"><function>g_str_hash()</function></link> functions are provided for some common types of keys.
176
If hash_func is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, <link linkend="g-direct-hash"><function>g_direct_hash()</function></link> is used.
173
If hash_func is <link linkend="NULL--CAPS"><literal>NULL</literal></link>, <link linkend="g-direct-hash"><function>g_direct_hash()</function></link> is used.
177
174
</simpara></listitem></varlistentry>
178
<varlistentry><term><parameter>key_equal_func</parameter> :</term>
175
<varlistentry><term><parameter>key_equal_func</parameter> :</term>
179
176
<listitem><simpara> a function to check two keys for equality. This is
180
177
used when looking up keys in the <link linkend="GHashTable"><type>GHashTable</type></link>. The <link linkend="g-direct-equal"><function>g_direct_equal()</function></link>,
181
178
<link linkend="g-int-equal"><function>g_int_equal()</function></link> and <link linkend="g-str-equal"><function>g_str_equal()</function></link> functions are provided for the most
182
common types of keys. If <parameter>key_equal_func</parameter> is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, keys are compared
179
common types of keys. If <parameter>key_equal_func</parameter> is <link linkend="NULL--CAPS"><literal>NULL</literal></link>, keys are compared
183
180
directly in a similar fashion to <link linkend="g-direct-equal"><function>g_direct_equal()</function></link>, but without the
184
181
overhead of a function call.
185
182
</simpara></listitem></varlistentry>
186
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a new <link linkend="GHashTable"><type>GHashTable</type></link>.
183
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a new <link linkend="GHashTable"><type>GHashTable</type></link>.
187
184
</simpara></listitem></varlistentry>
188
185
</variablelist></refsect2>
190
<title><anchor id="g-hash-table-new-full" role="function"/>g_hash_table_new_full ()</title>
191
<indexterm><primary>g_hash_table_new_full</primary></indexterm><programlisting><link linkend="GHashTable">GHashTable</link>* g_hash_table_new_full (<link linkend="GHashFunc">GHashFunc</link> hash_func,
186
<refsect2 id="g-hash-table-new-full" role="function">
187
<title>g_hash_table_new_full ()</title>
188
<indexterm zone="g-hash-table-new-full"><primary sortas="g_hash_table_new_full">g_hash_table_new_full</primary></indexterm><programlisting><link linkend="GHashTable">GHashTable</link>* g_hash_table_new_full (<link linkend="GHashFunc">GHashFunc</link> hash_func,
192
189
<link linkend="GEqualFunc">GEqualFunc</link> key_equal_func,
193
190
<link linkend="GDestroyNotify">GDestroyNotify</link> key_destroy_func,
194
191
<link linkend="GDestroyNotify">GDestroyNotify</link> value_destroy_func);</programlisting>
197
194
of 1 and allows to specify functions to free the memory allocated for the
198
195
key and value that get called when removing the entry from the <link linkend="GHashTable"><type>GHashTable</type></link>.</para>
201
197
</para><variablelist role="params">
202
<varlistentry><term><parameter>hash_func</parameter> :</term>
198
<varlistentry><term><parameter>hash_func</parameter> :</term>
203
199
<listitem><simpara> a function to create a hash value from a key.
204
200
</simpara></listitem></varlistentry>
205
<varlistentry><term><parameter>key_equal_func</parameter> :</term>
201
<varlistentry><term><parameter>key_equal_func</parameter> :</term>
206
202
<listitem><simpara> a function to check two keys for equality.
207
203
</simpara></listitem></varlistentry>
208
<varlistentry><term><parameter>key_destroy_func</parameter> :</term>
204
<varlistentry><term><parameter>key_destroy_func</parameter> :</term>
209
205
<listitem><simpara> a function to free the memory allocated for the key
210
used when removing the entry from the <link linkend="GHashTable"><type>GHashTable</type></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if you
206
used when removing the entry from the <link linkend="GHashTable"><type>GHashTable</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if you
211
207
don't want to supply such a function.
212
208
</simpara></listitem></varlistentry>
213
<varlistentry><term><parameter>value_destroy_func</parameter> :</term>
209
<varlistentry><term><parameter>value_destroy_func</parameter> :</term>
214
210
<listitem><simpara> a function to free the memory allocated for the
215
value used when removing the entry from the <link linkend="GHashTable"><type>GHashTable</type></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if
211
value used when removing the entry from the <link linkend="GHashTable"><type>GHashTable</type></link> or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if
216
212
you don't want to supply such a function.
217
213
</simpara></listitem></varlistentry>
218
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a new <link linkend="GHashTable"><type>GHashTable</type></link>.
214
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a new <link linkend="GHashTable"><type>GHashTable</type></link>.
219
215
</simpara></listitem></varlistentry>
220
216
</variablelist></refsect2>
222
<title><anchor id="GHashFunc" role="function"/>GHashFunc ()</title>
223
<indexterm><primary>GHashFunc</primary></indexterm><programlisting><link linkend="guint">guint</link> (*GHashFunc) (<link linkend="gconstpointer">gconstpointer</link> key);</programlisting>
217
<refsect2 id="GHashFunc" role="function">
218
<title>GHashFunc ()</title>
219
<indexterm zone="GHashFunc"><primary sortas="GHashFunc">GHashFunc</primary></indexterm><programlisting><link linkend="guint">guint</link> (*GHashFunc) (<link linkend="gconstpointer">gconstpointer</link> key);</programlisting>
225
221
Specifies the type of the hash function which is passed to
226
222
<link linkend="g-hash-table-new"><function>g_hash_table_new()</function></link> when a <link linkend="GHashTable"><type>GHashTable</type></link> is created.
239
235
The function should also be very fast, since it is called for each key
241
237
</para><variablelist role="params">
242
<varlistentry><term><parameter>key</parameter> :</term>
238
<varlistentry><term><parameter>key</parameter> :</term>
243
239
<listitem><simpara>a key.
244
240
</simpara></listitem></varlistentry>
245
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>the hash value corresponding to the key.
241
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>the hash value corresponding to the key.
248
242
</simpara></listitem></varlistentry>
249
243
</variablelist></refsect2>
251
<title><anchor id="GEqualFunc" role="function"/>GEqualFunc ()</title>
252
<indexterm><primary>GEqualFunc</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> (*GEqualFunc) (<link linkend="gconstpointer">gconstpointer</link> a,
244
<refsect2 id="GEqualFunc" role="function">
245
<title>GEqualFunc ()</title>
246
<indexterm zone="GEqualFunc"><primary sortas="GEqualFunc">GEqualFunc</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> (*GEqualFunc) (<link linkend="gconstpointer">gconstpointer</link> a,
253
247
<link linkend="gconstpointer">gconstpointer</link> b);</programlisting>
255
249
Specifies the type of a function used to test two values for
256
equality. The function should return <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if both values are equal and
257
<link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
250
equality. The function should return <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if both values are equal and
251
<link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
258
252
</para><variablelist role="params">
259
<varlistentry><term><parameter>a</parameter> :</term>
253
<varlistentry><term><parameter>a</parameter> :</term>
260
254
<listitem><simpara>a value.
261
255
</simpara></listitem></varlistentry>
262
<varlistentry><term><parameter>b</parameter> :</term>
256
<varlistentry><term><parameter>b</parameter> :</term>
263
257
<listitem><simpara>a value to compare with.
264
258
</simpara></listitem></varlistentry>
265
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>a</parameter> = <parameter>b</parameter>; <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> otherwise.
259
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>%TRUE if <parameter>a</parameter> = <parameter>b</parameter>; <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise.
268
260
</simpara></listitem></varlistentry>
269
261
</variablelist></refsect2>
271
<title><anchor id="g-hash-table-insert" role="function"/>g_hash_table_insert ()</title>
272
<indexterm><primary>g_hash_table_insert</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_insert (<link linkend="GHashTable">GHashTable</link> *hash_table,
262
<refsect2 id="g-hash-table-insert" role="function">
263
<title>g_hash_table_insert ()</title>
264
<indexterm zone="g-hash-table-insert"><primary sortas="g_hash_table_insert">g_hash_table_insert</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_insert (<link linkend="GHashTable">GHashTable</link> *hash_table,
273
265
<link linkend="gpointer">gpointer</link> key,
274
266
<link linkend="gpointer">gpointer</link> value);</programlisting>
307
298
using that function. If you supplied a <parameter>key_destroy_func</parameter> when creating the
308
299
<link linkend="GHashTable"><type>GHashTable</type></link>, the old key is freed using that function.</para>
311
301
</para><variablelist role="params">
312
<varlistentry><term><parameter>hash_table</parameter> :</term>
302
<varlistentry><term><parameter>hash_table</parameter> :</term>
313
303
<listitem><simpara> a <link linkend="GHashTable"><type>GHashTable</type></link>.
314
304
</simpara></listitem></varlistentry>
315
<varlistentry><term><parameter>key</parameter> :</term>
305
<varlistentry><term><parameter>key</parameter> :</term>
316
306
<listitem><simpara> a key to insert.
317
307
</simpara></listitem></varlistentry>
318
<varlistentry><term><parameter>value</parameter> :</term>
308
<varlistentry><term><parameter>value</parameter> :</term>
319
309
<listitem><simpara> the value to associate with the key.
320
310
</simpara></listitem></varlistentry>
321
311
</variablelist></refsect2>
323
<title><anchor id="g-hash-table-size" role="function"/>g_hash_table_size ()</title>
324
<indexterm><primary>g_hash_table_size</primary></indexterm><programlisting><link linkend="guint">guint</link> g_hash_table_size (<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
312
<refsect2 id="g-hash-table-size" role="function">
313
<title>g_hash_table_size ()</title>
314
<indexterm zone="g-hash-table-size"><primary sortas="g_hash_table_size">g_hash_table_size</primary></indexterm><programlisting><link linkend="guint">guint</link> g_hash_table_size (<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
326
316
Returns the number of elements contained in the <link linkend="GHashTable"><type>GHashTable</type></link>.</para>
329
318
</para><variablelist role="params">
330
<varlistentry><term><parameter>hash_table</parameter> :</term>
319
<varlistentry><term><parameter>hash_table</parameter> :</term>
331
320
<listitem><simpara> a <link linkend="GHashTable"><type>GHashTable</type></link>.
332
321
</simpara></listitem></varlistentry>
333
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the number of key/value pairs in the <link linkend="GHashTable"><type>GHashTable</type></link>.
322
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the number of key/value pairs in the <link linkend="GHashTable"><type>GHashTable</type></link>.
334
323
</simpara></listitem></varlistentry>
335
324
</variablelist></refsect2>
337
<title><anchor id="g-hash-table-lookup" role="function"/>g_hash_table_lookup ()</title>
338
<indexterm><primary>g_hash_table_lookup</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link> g_hash_table_lookup (<link linkend="GHashTable">GHashTable</link> *hash_table,
325
<refsect2 id="g-hash-table-lookup" role="function">
326
<title>g_hash_table_lookup ()</title>
327
<indexterm zone="g-hash-table-lookup"><primary sortas="g_hash_table_lookup">g_hash_table_lookup</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link> g_hash_table_lookup (<link linkend="GHashTable">GHashTable</link> *hash_table,
339
328
<link linkend="gconstpointer">gconstpointer</link> key);</programlisting>
341
330
Looks up a key in a <link linkend="GHashTable"><type>GHashTable</type></link>. Note that this function cannot
342
331
distinguish between a key that is not present and one which is present
343
and has the value <link linkend="NULL:CAPS"><literal>NULL</literal></link>. If you need this distinction, use
332
and has the value <link linkend="NULL--CAPS"><literal>NULL</literal></link>. If you need this distinction, use
344
333
<link linkend="g-hash-table-lookup-extended"><function>g_hash_table_lookup_extended()</function></link>.</para>
347
335
</para><variablelist role="params">
348
<varlistentry><term><parameter>hash_table</parameter> :</term>
336
<varlistentry><term><parameter>hash_table</parameter> :</term>
349
337
<listitem><simpara> a <link linkend="GHashTable"><type>GHashTable</type></link>.
350
338
</simpara></listitem></varlistentry>
351
<varlistentry><term><parameter>key</parameter> :</term>
339
<varlistentry><term><parameter>key</parameter> :</term>
352
340
<listitem><simpara> the key to look up.
353
341
</simpara></listitem></varlistentry>
354
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the associated value, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if the key is not found.
342
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the associated value, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the key is not found.
355
343
</simpara></listitem></varlistentry>
356
344
</variablelist></refsect2>
358
<title><anchor id="g-hash-table-lookup-extended" role="function"/>g_hash_table_lookup_extended ()</title>
359
<indexterm><primary>g_hash_table_lookup_extended</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g_hash_table_lookup_extended (<link linkend="GHashTable">GHashTable</link> *hash_table,
345
<refsect2 id="g-hash-table-lookup-extended" role="function">
346
<title>g_hash_table_lookup_extended ()</title>
347
<indexterm zone="g-hash-table-lookup-extended"><primary sortas="g_hash_table_lookup_extended">g_hash_table_lookup_extended</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g_hash_table_lookup_extended (<link linkend="GHashTable">GHashTable</link> *hash_table,
360
348
<link linkend="gconstpointer">gconstpointer</link> lookup_key,
361
349
<link linkend="gpointer">gpointer</link> *orig_key,
362
350
<link linkend="gpointer">gpointer</link> *value);</programlisting>
364
352
Looks up a key in the <link linkend="GHashTable"><type>GHashTable</type></link>, returning the original key and the
365
associated value and a <link linkend="gboolean"><type>gboolean</type></link> which is <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the key was found. This
353
associated value and a <link linkend="gboolean"><type>gboolean</type></link> which is <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the key was found. This
366
354
is useful if you need to free the memory allocated for the original key,
367
355
for example before calling <link linkend="g-hash-table-remove"><function>g_hash_table_remove()</function></link>.</para>
370
357
</para><variablelist role="params">
371
<varlistentry><term><parameter>hash_table</parameter> :</term>
358
<varlistentry><term><parameter>hash_table</parameter> :</term>
372
359
<listitem><simpara> a <link linkend="GHashTable"><type>GHashTable</type></link>.
373
360
</simpara></listitem></varlistentry>
374
<varlistentry><term><parameter>lookup_key</parameter> :</term>
361
<varlistentry><term><parameter>lookup_key</parameter> :</term>
375
362
<listitem><simpara> the key to look up.
376
363
</simpara></listitem></varlistentry>
377
<varlistentry><term><parameter>orig_key</parameter> :</term>
364
<varlistentry><term><parameter>orig_key</parameter> :</term>
378
365
<listitem><simpara> returns the original key.
379
366
</simpara></listitem></varlistentry>
380
<varlistentry><term><parameter>value</parameter> :</term>
367
<varlistentry><term><parameter>value</parameter> :</term>
381
368
<listitem><simpara> returns the value associated with the key.
382
369
</simpara></listitem></varlistentry>
383
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the key was found in the <link linkend="GHashTable"><type>GHashTable</type></link>.
370
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the key was found in the <link linkend="GHashTable"><type>GHashTable</type></link>.
384
371
</simpara></listitem></varlistentry>
385
372
</variablelist></refsect2>
387
<title><anchor id="g-hash-table-foreach" role="function"/>g_hash_table_foreach ()</title>
388
<indexterm><primary>g_hash_table_foreach</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_foreach (<link linkend="GHashTable">GHashTable</link> *hash_table,
373
<refsect2 id="g-hash-table-foreach" role="function">
374
<title>g_hash_table_foreach ()</title>
375
<indexterm zone="g-hash-table-foreach"><primary sortas="g_hash_table_foreach">g_hash_table_foreach</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_foreach (<link linkend="GHashTable">GHashTable</link> *hash_table,
389
376
<link linkend="GHFunc">GHFunc</link> func,
390
377
<link linkend="gpointer">gpointer</link> user_data);</programlisting>
400
387
See <link linkend="g-hash-table-find"><function>g_hash_table_find()</function></link> for performance caveats for linear
401
388
order searches in contrast to <link linkend="g-hash-table-lookup"><function>g_hash_table_lookup()</function></link>.</para>
404
390
</para><variablelist role="params">
405
<varlistentry><term><parameter>hash_table</parameter> :</term>
391
<varlistentry><term><parameter>hash_table</parameter> :</term>
406
392
<listitem><simpara> a <link linkend="GHashTable"><type>GHashTable</type></link>.
407
393
</simpara></listitem></varlistentry>
408
<varlistentry><term><parameter>func</parameter> :</term>
394
<varlistentry><term><parameter>func</parameter> :</term>
409
395
<listitem><simpara> the function to call for each key/value pair.
410
396
</simpara></listitem></varlistentry>
411
<varlistentry><term><parameter>user_data</parameter> :</term>
397
<varlistentry><term><parameter>user_data</parameter> :</term>
412
398
<listitem><simpara> user data to pass to the function.
413
399
</simpara></listitem></varlistentry>
414
400
</variablelist></refsect2>
416
<title><anchor id="g-hash-table-find" role="function" condition="since:2.4"/>g_hash_table_find ()</title>
417
<indexterm role="2.4"><primary>g_hash_table_find</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link> g_hash_table_find (<link linkend="GHashTable">GHashTable</link> *hash_table,
401
<refsect2 id="g-hash-table-find" role="function" condition="since:2.4">
402
<title>g_hash_table_find ()</title>
403
<indexterm zone="g-hash-table-find" role="2.4"><primary sortas="g_hash_table_find">g_hash_table_find</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link> g_hash_table_find (<link linkend="GHashTable">GHashTable</link> *hash_table,
418
404
<link linkend="GHRFunc">GHRFunc</link> predicate,
419
405
<link linkend="gpointer">gpointer</link> user_data);</programlisting>
421
407
Calls the given function for key/value pairs in the <link linkend="GHashTable"><type>GHashTable</type></link> until
422
<parameter>predicate</parameter> returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>. The function is passed the key and value of
408
<parameter>predicate</parameter> returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>. The function is passed the key and value of
423
409
each pair, and the given <parameter>user_data</parameter> parameter. The hash table may not
424
410
be modified while iterating over it (you can't add/remove items).
433
419
operation issued for all n values in a hash table ends up needing O(n*n)
434
420
operations).</para>
437
422
</para><variablelist role="params">
438
<varlistentry><term><parameter>hash_table</parameter> :</term>
423
<varlistentry><term><parameter>hash_table</parameter> :</term>
439
424
<listitem><simpara> a <link linkend="GHashTable"><type>GHashTable</type></link>.
440
425
</simpara></listitem></varlistentry>
441
<varlistentry><term><parameter>predicate</parameter> :</term>
426
<varlistentry><term><parameter>predicate</parameter> :</term>
442
427
<listitem><simpara> function to test the key/value pairs for a certain property.
443
428
</simpara></listitem></varlistentry>
444
<varlistentry><term><parameter>user_data</parameter> :</term>
429
<varlistentry><term><parameter>user_data</parameter> :</term>
445
430
<listitem><simpara> user data to pass to the function.
446
431
</simpara></listitem></varlistentry>
447
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> The value of the first key/value pair is returned, for which
448
func evaluates to <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>. If no pair with the requested property is found,
449
<link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned.
432
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> The value of the first key/value pair is returned, for which
433
func evaluates to <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>. If no pair with the requested property is found,
434
<link linkend="NULL--CAPS"><literal>NULL</literal></link> is returned.
451
436
</simpara></listitem></varlistentry>
452
</variablelist><para role="since">Since 2.4
455
<title><anchor id="GHFunc" role="function"/>GHFunc ()</title>
456
<indexterm><primary>GHFunc</primary></indexterm><programlisting><link linkend="void">void</link> (*GHFunc) (<link linkend="gpointer">gpointer</link> key,
437
</variablelist><para role="since">Since 2.4</para></refsect2>
438
<refsect2 id="GHFunc" role="function">
439
<title>GHFunc ()</title>
440
<indexterm zone="GHFunc"><primary sortas="GHFunc">GHFunc</primary></indexterm><programlisting><link linkend="void">void</link> (*GHFunc) (<link linkend="gpointer">gpointer</link> key,
457
441
<link linkend="gpointer">gpointer</link> value,
458
442
<link linkend="gpointer">gpointer</link> user_data);</programlisting>
486
468
you have to make sure that any dynamically allocated values are freed
490
471
</para><variablelist role="params">
491
<varlistentry><term><parameter>hash_table</parameter> :</term>
472
<varlistentry><term><parameter>hash_table</parameter> :</term>
492
473
<listitem><simpara> a <link linkend="GHashTable"><type>GHashTable</type></link>.
493
474
</simpara></listitem></varlistentry>
494
<varlistentry><term><parameter>key</parameter> :</term>
475
<varlistentry><term><parameter>key</parameter> :</term>
495
476
<listitem><simpara> the key to remove.
496
477
</simpara></listitem></varlistentry>
497
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the key was found and removed from the <link linkend="GHashTable"><type>GHashTable</type></link>.
478
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the key was found and removed from the <link linkend="GHashTable"><type>GHashTable</type></link>.
498
479
</simpara></listitem></varlistentry>
499
480
</variablelist></refsect2>
501
<title><anchor id="g-hash-table-steal" role="function"/>g_hash_table_steal ()</title>
502
<indexterm><primary>g_hash_table_steal</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g_hash_table_steal (<link linkend="GHashTable">GHashTable</link> *hash_table,
481
<refsect2 id="g-hash-table-steal" role="function">
482
<title>g_hash_table_steal ()</title>
483
<indexterm zone="g-hash-table-steal"><primary sortas="g_hash_table_steal">g_hash_table_steal</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g_hash_table_steal (<link linkend="GHashTable">GHashTable</link> *hash_table,
503
484
<link linkend="gconstpointer">gconstpointer</link> key);</programlisting>
505
486
Removes a key and its associated value from a <link linkend="GHashTable"><type>GHashTable</type></link> without
506
487
calling the key and value destroy functions.</para>
509
489
</para><variablelist role="params">
510
<varlistentry><term><parameter>hash_table</parameter> :</term>
490
<varlistentry><term><parameter>hash_table</parameter> :</term>
511
491
<listitem><simpara> a <link linkend="GHashTable"><type>GHashTable</type></link>.
512
492
</simpara></listitem></varlistentry>
513
<varlistentry><term><parameter>key</parameter> :</term>
493
<varlistentry><term><parameter>key</parameter> :</term>
514
494
<listitem><simpara> the key to remove.
515
495
</simpara></listitem></varlistentry>
516
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the key was found and removed from the <link linkend="GHashTable"><type>GHashTable</type></link>.
496
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the key was found and removed from the <link linkend="GHashTable"><type>GHashTable</type></link>.
517
497
</simpara></listitem></varlistentry>
518
498
</variablelist></refsect2>
520
<title><anchor id="g-hash-table-foreach-remove" role="function"/>g_hash_table_foreach_remove ()</title>
521
<indexterm><primary>g_hash_table_foreach_remove</primary></indexterm><programlisting><link linkend="guint">guint</link> g_hash_table_foreach_remove (<link linkend="GHashTable">GHashTable</link> *hash_table,
499
<refsect2 id="g-hash-table-foreach-remove" role="function">
500
<title>g_hash_table_foreach_remove ()</title>
501
<indexterm zone="g-hash-table-foreach-remove"><primary sortas="g_hash_table_foreach_remove">g_hash_table_foreach_remove</primary></indexterm><programlisting><link linkend="guint">guint</link> g_hash_table_foreach_remove (<link linkend="GHashTable">GHashTable</link> *hash_table,
522
502
<link linkend="GHRFunc">GHRFunc</link> func,
523
503
<link linkend="gpointer">gpointer</link> user_data);</programlisting>
525
505
Calls the given function for each key/value pair in the <link linkend="GHashTable"><type>GHashTable</type></link>.
526
If the function returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, then the key/value pair is removed from the
506
If the function returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, then the key/value pair is removed from the
527
507
<link linkend="GHashTable"><type>GHashTable</type></link>. If you supplied key or value destroy functions when creating
528
508
the <link linkend="GHashTable"><type>GHashTable</type></link>, they are used to free the memory allocated for the removed
532
See <link linkend="GHashTableIterator"><type>GHashTableIterator</type></link> for an alternative way to loop over the
512
See <link linkend="GHashTableIter"><type>GHashTableIter</type></link> for an alternative way to loop over the
533
513
key/value pairs in the hash table.</para>
536
515
</para><variablelist role="params">
537
<varlistentry><term><parameter>hash_table</parameter> :</term>
516
<varlistentry><term><parameter>hash_table</parameter> :</term>
538
517
<listitem><simpara> a <link linkend="GHashTable"><type>GHashTable</type></link>.
539
518
</simpara></listitem></varlistentry>
540
<varlistentry><term><parameter>func</parameter> :</term>
519
<varlistentry><term><parameter>func</parameter> :</term>
541
520
<listitem><simpara> the function to call for each key/value pair.
542
521
</simpara></listitem></varlistentry>
543
<varlistentry><term><parameter>user_data</parameter> :</term>
522
<varlistentry><term><parameter>user_data</parameter> :</term>
544
523
<listitem><simpara> user data to pass to the function.
545
524
</simpara></listitem></varlistentry>
546
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the number of key/value pairs removed.
525
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the number of key/value pairs removed.
547
526
</simpara></listitem></varlistentry>
548
527
</variablelist></refsect2>
550
<title><anchor id="g-hash-table-foreach-steal" role="function"/>g_hash_table_foreach_steal ()</title>
551
<indexterm><primary>g_hash_table_foreach_steal</primary></indexterm><programlisting><link linkend="guint">guint</link> g_hash_table_foreach_steal (<link linkend="GHashTable">GHashTable</link> *hash_table,
528
<refsect2 id="g-hash-table-foreach-steal" role="function">
529
<title>g_hash_table_foreach_steal ()</title>
530
<indexterm zone="g-hash-table-foreach-steal"><primary sortas="g_hash_table_foreach_steal">g_hash_table_foreach_steal</primary></indexterm><programlisting><link linkend="guint">guint</link> g_hash_table_foreach_steal (<link linkend="GHashTable">GHashTable</link> *hash_table,
552
531
<link linkend="GHRFunc">GHRFunc</link> func,
553
532
<link linkend="gpointer">gpointer</link> user_data);</programlisting>
555
534
Calls the given function for each key/value pair in the <link linkend="GHashTable"><type>GHashTable</type></link>.
556
If the function returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, then the key/value pair is removed from the
535
If the function returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, then the key/value pair is removed from the
557
536
<link linkend="GHashTable"><type>GHashTable</type></link>, but no key or value destroy functions are called.
560
See <link linkend="GHashTableIterator"><type>GHashTableIterator</type></link> for an alternative way to loop over the
539
See <link linkend="GHashTableIter"><type>GHashTableIter</type></link> for an alternative way to loop over the
561
540
key/value pairs in the hash table.</para>
564
542
</para><variablelist role="params">
565
<varlistentry><term><parameter>hash_table</parameter> :</term>
543
<varlistentry><term><parameter>hash_table</parameter> :</term>
566
544
<listitem><simpara> a <link linkend="GHashTable"><type>GHashTable</type></link>.
567
545
</simpara></listitem></varlistentry>
568
<varlistentry><term><parameter>func</parameter> :</term>
546
<varlistentry><term><parameter>func</parameter> :</term>
569
547
<listitem><simpara> the function to call for each key/value pair.
570
548
</simpara></listitem></varlistentry>
571
<varlistentry><term><parameter>user_data</parameter> :</term>
549
<varlistentry><term><parameter>user_data</parameter> :</term>
572
550
<listitem><simpara> user data to pass to the function.
573
551
</simpara></listitem></varlistentry>
574
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the number of key/value pairs removed.
552
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the number of key/value pairs removed.
575
553
</simpara></listitem></varlistentry>
576
554
</variablelist></refsect2>
578
<title><anchor id="g-hash-table-remove-all" role="function" condition="since:2.12"/>g_hash_table_remove_all ()</title>
579
<indexterm role="2.12"><primary>g_hash_table_remove_all</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_remove_all (<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
555
<refsect2 id="g-hash-table-remove-all" role="function" condition="since:2.12">
556
<title>g_hash_table_remove_all ()</title>
557
<indexterm zone="g-hash-table-remove-all" role="2.12"><primary sortas="g_hash_table_remove_all">g_hash_table_remove_all</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_remove_all (<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
581
559
Removes all keys and their associated values from a <link linkend="GHashTable"><type>GHashTable</type></link>.
586
564
have to make sure that any dynamically allocated values are freed
590
567
</para><variablelist role="params">
591
<varlistentry><term><parameter>hash_table</parameter> :</term>
568
<varlistentry><term><parameter>hash_table</parameter> :</term>
592
569
<listitem><simpara> a <link linkend="GHashTable"><type>GHashTable</type></link>
593
570
</simpara></listitem></varlistentry>
594
</variablelist><para role="since">Since 2.12
597
<title><anchor id="g-hash-table-steal-all" role="function" condition="since:2.12"/>g_hash_table_steal_all ()</title>
598
<indexterm role="2.12"><primary>g_hash_table_steal_all</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_steal_all (<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
571
</variablelist><para role="since">Since 2.12</para></refsect2>
572
<refsect2 id="g-hash-table-steal-all" role="function" condition="since:2.12">
573
<title>g_hash_table_steal_all ()</title>
574
<indexterm zone="g-hash-table-steal-all" role="2.12"><primary sortas="g_hash_table_steal_all">g_hash_table_steal_all</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_steal_all (<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
600
576
Removes all keys and their associated values from a <link linkend="GHashTable"><type>GHashTable</type></link>
601
577
without calling the key and value destroy functions.</para>
604
579
</para><variablelist role="params">
605
<varlistentry><term><parameter>hash_table</parameter> :</term>
580
<varlistentry><term><parameter>hash_table</parameter> :</term>
606
581
<listitem><simpara> a <link linkend="GHashTable"><type>GHashTable</type></link>.
607
582
</simpara></listitem></varlistentry>
608
</variablelist><para role="since">Since 2.12
611
<title><anchor id="g-hash-table-get-keys" role="function" condition="since:2.14"/>g_hash_table_get_keys ()</title>
612
<indexterm role="2.14"><primary>g_hash_table_get_keys</primary></indexterm><programlisting><link linkend="GList">GList</link>* g_hash_table_get_keys (<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
583
</variablelist><para role="since">Since 2.12</para></refsect2>
584
<refsect2 id="g-hash-table-get-keys" role="function" condition="since:2.14">
585
<title>g_hash_table_get_keys ()</title>
586
<indexterm zone="g-hash-table-get-keys" role="2.14"><primary sortas="g_hash_table_get_keys">g_hash_table_get_keys</primary></indexterm><programlisting><link linkend="GList">GList</link> * g_hash_table_get_keys (<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
614
588
Retrieves every key inside <parameter>hash_table</parameter>. The returned data is valid
615
589
until <parameter>hash_table</parameter> is modified.</para>
618
591
</para><variablelist role="params">
619
<varlistentry><term><parameter>hash_table</parameter> :</term>
592
<varlistentry><term><parameter>hash_table</parameter> :</term>
620
593
<listitem><simpara> a <link linkend="GHashTable"><type>GHashTable</type></link>
621
594
</simpara></listitem></varlistentry>
622
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a <link linkend="GList"><type>GList</type></link> containing all the keys inside the hash
595
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a <link linkend="GList"><type>GList</type></link> containing all the keys inside the hash
623
596
table. The content of the list is owned by the hash table and
624
597
should not be modified or freed. Use <link linkend="g-list-free"><function>g_list_free()</function></link> when done
627
600
</simpara></listitem></varlistentry>
628
</variablelist><para role="since">Since 2.14
631
<title><anchor id="g-hash-table-get-values" role="function" condition="since:2.14"/>g_hash_table_get_values ()</title>
632
<indexterm role="2.14"><primary>g_hash_table_get_values</primary></indexterm><programlisting><link linkend="GList">GList</link>* g_hash_table_get_values (<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
601
</variablelist><para role="since">Since 2.14</para></refsect2>
602
<refsect2 id="g-hash-table-get-values" role="function" condition="since:2.14">
603
<title>g_hash_table_get_values ()</title>
604
<indexterm zone="g-hash-table-get-values" role="2.14"><primary sortas="g_hash_table_get_values">g_hash_table_get_values</primary></indexterm><programlisting><link linkend="GList">GList</link> * g_hash_table_get_values (<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
634
606
Retrieves every value inside <parameter>hash_table</parameter>. The returned data is
635
607
valid until <parameter>hash_table</parameter> is modified.</para>
638
609
</para><variablelist role="params">
639
<varlistentry><term><parameter>hash_table</parameter> :</term>
610
<varlistentry><term><parameter>hash_table</parameter> :</term>
640
611
<listitem><simpara> a <link linkend="GHashTable"><type>GHashTable</type></link>
641
612
</simpara></listitem></varlistentry>
642
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a <link linkend="GList"><type>GList</type></link> containing all the values inside the hash
613
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a <link linkend="GList"><type>GList</type></link> containing all the values inside the hash
643
614
table. The content of the list is owned by the hash table and
644
615
should not be modified or freed. Use <link linkend="g-list-free"><function>g_list_free()</function></link> when done
647
618
</simpara></listitem></varlistentry>
648
</variablelist><para role="since">Since 2.14
651
<title><anchor id="GHRFunc" role="function"/>GHRFunc ()</title>
652
<indexterm><primary>GHRFunc</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> (*GHRFunc) (<link linkend="gpointer">gpointer</link> key,
619
</variablelist><para role="since">Since 2.14</para></refsect2>
620
<refsect2 id="GHRFunc" role="function">
621
<title>GHRFunc ()</title>
622
<indexterm zone="GHRFunc"><primary sortas="GHRFunc">GHRFunc</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> (*GHRFunc) (<link linkend="gpointer">gpointer</link> key,
653
623
<link linkend="gpointer">gpointer</link> value,
654
624
<link linkend="gpointer">gpointer</link> user_data);</programlisting>
656
626
Specifies the type of the function passed to <link linkend="g-hash-table-foreach-remove"><function>g_hash_table_foreach_remove()</function></link>.
657
627
It is called with each key/value pair, together with the <parameter>user_data</parameter> parameter
658
628
passed to <link linkend="g-hash-table-foreach-remove"><function>g_hash_table_foreach_remove()</function></link>.
659
It should return <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the key/value pair should be removed from the
629
It should return <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the key/value pair should be removed from the
660
630
<link linkend="GHashTable"><type>GHashTable</type></link>.
661
631
</para><variablelist role="params">
662
<varlistentry><term><parameter>key</parameter> :</term>
632
<varlistentry><term><parameter>key</parameter> :</term>
663
633
<listitem><simpara>a key.
664
634
</simpara></listitem></varlistentry>
665
<varlistentry><term><parameter>value</parameter> :</term>
635
<varlistentry><term><parameter>value</parameter> :</term>
666
636
<listitem><simpara>the value associated with the key.
667
637
</simpara></listitem></varlistentry>
668
<varlistentry><term><parameter>user_data</parameter> :</term>
638
<varlistentry><term><parameter>user_data</parameter> :</term>
669
639
<listitem><simpara>user data passed to <link linkend="g-hash-table-remove"><function>g_hash_table_remove()</function></link>.
670
640
</simpara></listitem></varlistentry>
671
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the key/value pair should be removed from the <link linkend="GHashTable"><type>GHashTable</type></link>.
641
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>%TRUE if the key/value pair should be removed from the <link linkend="GHashTable"><type>GHashTable</type></link>.
674
642
</simpara></listitem></varlistentry>
675
643
</variablelist></refsect2>
677
<title><anchor id="g-hash-table-freeze" role="macro" condition="deprecated:"/>g_hash_table_freeze()</title>
678
<indexterm role="deprecated"><primary>g_hash_table_freeze</primary></indexterm><programlisting>#define g_hash_table_freeze(hash_table)</programlisting>
644
<refsect2 id="g-hash-table-freeze" role="macro" condition="deprecated:">
645
<title>g_hash_table_freeze()</title>
646
<indexterm zone="g-hash-table-freeze" role="deprecated"><primary sortas="g_hash_table_freeze">g_hash_table_freeze</primary></indexterm><programlisting>#define g_hash_table_freeze(hash_table)</programlisting>
679
647
<warning><para><literal>g_hash_table_freeze</literal> is deprecated and should not be used in newly-written code.</para></warning>
681
649
This function is deprecated and will be removed in the next major
682
650
release of GLib. It does nothing.
683
651
</para><variablelist role="params">
684
<varlistentry><term><parameter>hash_table</parameter> :</term>
652
<varlistentry><term><parameter>hash_table</parameter> :</term>
685
653
<listitem><simpara>a <link linkend="GHashTable"><type>GHashTable</type></link>
688
654
</simpara></listitem></varlistentry>
689
655
</variablelist></refsect2>
691
<title><anchor id="g-hash-table-thaw" role="macro" condition="deprecated:"/>g_hash_table_thaw()</title>
692
<indexterm role="deprecated"><primary>g_hash_table_thaw</primary></indexterm><programlisting>#define g_hash_table_thaw(hash_table)</programlisting>
656
<refsect2 id="g-hash-table-thaw" role="macro" condition="deprecated:">
657
<title>g_hash_table_thaw()</title>
658
<indexterm zone="g-hash-table-thaw" role="deprecated"><primary sortas="g_hash_table_thaw">g_hash_table_thaw</primary></indexterm><programlisting>#define g_hash_table_thaw(hash_table)</programlisting>
693
659
<warning><para><literal>g_hash_table_thaw</literal> is deprecated and should not be used in newly-written code.</para></warning>
695
661
This function is deprecated and will be removed in the next major
696
662
release of GLib. It does nothing.
697
663
</para><variablelist role="params">
698
<varlistentry><term><parameter>hash_table</parameter> :</term>
664
<varlistentry><term><parameter>hash_table</parameter> :</term>
699
665
<listitem><simpara>a <link linkend="GHashTable"><type>GHashTable</type></link>
702
666
</simpara></listitem></varlistentry>
703
667
</variablelist></refsect2>
705
<title><anchor id="g-hash-table-destroy" role="function"/>g_hash_table_destroy ()</title>
706
<indexterm><primary>g_hash_table_destroy</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_destroy (<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
668
<refsect2 id="g-hash-table-destroy" role="function">
669
<title>g_hash_table_destroy ()</title>
670
<indexterm zone="g-hash-table-destroy"><primary sortas="g_hash_table_destroy">g_hash_table_destroy</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_destroy (<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
708
672
Destroys all keys and values in the <link linkend="GHashTable"><type>GHashTable</type></link> and decrements its
709
673
reference count by 1. If keys and/or values are dynamically allocated,
712
676
functions you supplied will be called on all keys and values during the
713
677
destruction phase.</para>
716
679
</para><variablelist role="params">
717
<varlistentry><term><parameter>hash_table</parameter> :</term>
680
<varlistentry><term><parameter>hash_table</parameter> :</term>
718
681
<listitem><simpara> a <link linkend="GHashTable"><type>GHashTable</type></link>.
719
682
</simpara></listitem></varlistentry>
720
683
</variablelist></refsect2>
722
<title><anchor id="g-hash-table-ref" role="function" condition="since:2.10"/>g_hash_table_ref ()</title>
723
<indexterm role="2.10"><primary>g_hash_table_ref</primary></indexterm><programlisting><link linkend="GHashTable">GHashTable</link>* g_hash_table_ref (<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
684
<refsect2 id="g-hash-table-ref" role="function" condition="since:2.10">
685
<title>g_hash_table_ref ()</title>
686
<indexterm zone="g-hash-table-ref" role="2.10"><primary sortas="g_hash_table_ref">g_hash_table_ref</primary></indexterm><programlisting><link linkend="GHashTable">GHashTable</link>* g_hash_table_ref (<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
725
688
Atomically increments the reference count of <parameter>hash_table</parameter> by one.
726
689
This function is MT-safe and may be called from any thread.</para>
729
691
</para><variablelist role="params">
730
<varlistentry><term><parameter>hash_table</parameter> :</term>
692
<varlistentry><term><parameter>hash_table</parameter> :</term>
731
693
<listitem><simpara> a valid <link linkend="GHashTable"><type>GHashTable</type></link>.
732
694
</simpara></listitem></varlistentry>
733
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the passed in <link linkend="GHashTable"><type>GHashTable</type></link>.
695
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the passed in <link linkend="GHashTable"><type>GHashTable</type></link>.
735
697
</simpara></listitem></varlistentry>
736
</variablelist><para role="since">Since 2.10
739
<title><anchor id="g-hash-table-unref" role="function" condition="since:2.10"/>g_hash_table_unref ()</title>
740
<indexterm role="2.10"><primary>g_hash_table_unref</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_unref (<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
698
</variablelist><para role="since">Since 2.10</para></refsect2>
699
<refsect2 id="g-hash-table-unref" role="function" condition="since:2.10">
700
<title>g_hash_table_unref ()</title>
701
<indexterm zone="g-hash-table-unref" role="2.10"><primary sortas="g_hash_table_unref">g_hash_table_unref</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_unref (<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
742
703
Atomically decrements the reference count of <parameter>hash_table</parameter> by one.
743
704
If the reference count drops to 0, all keys and values will be
744
705
destroyed, and all memory allocated by the hash table is released.
745
706
This function is MT-safe and may be called from any thread.</para>
748
708
</para><variablelist role="params">
749
<varlistentry><term><parameter>hash_table</parameter> :</term>
709
<varlistentry><term><parameter>hash_table</parameter> :</term>
750
710
<listitem><simpara> a valid <link linkend="GHashTable"><type>GHashTable</type></link>.
751
711
</simpara></listitem></varlistentry>
752
</variablelist><para role="since">Since 2.10
755
<title><anchor id="GHashTableIter" role="struct"/>GHashTableIter</title>
756
<indexterm><primary>GHashTableIter</primary></indexterm><programlisting>typedef struct {
712
</variablelist><para role="since">Since 2.10</para></refsect2>
713
<refsect2 id="GHashTableIter" role="struct">
714
<title>GHashTableIter</title>
715
<indexterm zone="GHashTableIter"><primary sortas="GHashTableIter">GHashTableIter</primary></indexterm><programlisting>typedef struct {
757
716
} GHashTableIter;
758
717
</programlisting>
719
A GHashTableIter structure represents an iterator that can be
720
used to iterate over the elements of a <link linkend="GHashTable"><type>GHashTable</type></link>. GHashTableIter
721
structures are typically allocated on the stack and then initialized
722
with <link linkend="g-hash-table-iter-init"><function>g_hash_table_iter_init()</function></link>.
761
723
</para></refsect2>
763
<title><anchor id="g-hash-table-iter-init" role="function" condition="since:2.16"/>g_hash_table_iter_init ()</title>
764
<indexterm role="2.16"><primary>g_hash_table_iter_init</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_iter_init (<link linkend="GHashTableIter">GHashTableIter</link> *iter,
724
<refsect2 id="g-hash-table-iter-init" role="function" condition="since:2.16">
725
<title>g_hash_table_iter_init ()</title>
726
<indexterm zone="g-hash-table-iter-init" role="2.16"><primary sortas="g_hash_table_iter_init">g_hash_table_iter_init</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_iter_init (<link linkend="GHashTableIter">GHashTableIter</link> *iter,
765
727
<link linkend="GHashTable">GHashTable</link> *hash_table);</programlisting>
767
729
Initializes a key/value pair iterator and associates it with
779
741
</programlisting></informalexample></para>
782
743
</para><variablelist role="params">
783
<varlistentry><term><parameter>iter</parameter> :</term>
744
<varlistentry><term><parameter>iter</parameter> :</term>
784
745
<listitem><simpara> an uninitialized <link linkend="GHashTableIter"><type>GHashTableIter</type></link>.
785
746
</simpara></listitem></varlistentry>
786
<varlistentry><term><parameter>hash_table</parameter> :</term>
747
<varlistentry><term><parameter>hash_table</parameter> :</term>
787
748
<listitem><simpara> a <link linkend="GHashTable"><type>GHashTable</type></link>.
788
749
</simpara></listitem></varlistentry>
789
</variablelist><para role="since">Since 2.16
792
<title><anchor id="g-hash-table-iter-next" role="function" condition="since:2.16"/>g_hash_table_iter_next ()</title>
793
<indexterm role="2.16"><primary>g_hash_table_iter_next</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g_hash_table_iter_next (<link linkend="GHashTableIter">GHashTableIter</link> *iter,
750
</variablelist><para role="since">Since 2.16</para></refsect2>
751
<refsect2 id="g-hash-table-iter-next" role="function" condition="since:2.16">
752
<title>g_hash_table_iter_next ()</title>
753
<indexterm zone="g-hash-table-iter-next" role="2.16"><primary sortas="g_hash_table_iter_next">g_hash_table_iter_next</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g_hash_table_iter_next (<link linkend="GHashTableIter">GHashTableIter</link> *iter,
794
754
<link linkend="gpointer">gpointer</link> *key,
795
755
<link linkend="gpointer">gpointer</link> *value);</programlisting>
797
757
Advances <parameter>iter</parameter> and retrieves the key and/or value that are now
798
pointed to as a result of this advancement. If <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> is returned,
758
pointed to as a result of this advancement. If <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> is returned,
799
759
<parameter>key</parameter> and <parameter>value</parameter> are not set, and the iterator becomes invalid.</para>
802
761
</para><variablelist role="params">
803
<varlistentry><term><parameter>iter</parameter> :</term>
762
<varlistentry><term><parameter>iter</parameter> :</term>
804
763
<listitem><simpara> an initialized <link linkend="GHashTableIter"><type>GHashTableIter</type></link>.
805
764
</simpara></listitem></varlistentry>
806
<varlistentry><term><parameter>key</parameter> :</term>
807
<listitem><simpara> a location to store the key, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>.
808
</simpara></listitem></varlistentry>
809
<varlistentry><term><parameter>value</parameter> :</term>
810
<listitem><simpara> a location to store the value, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>.
811
</simpara></listitem></varlistentry>
812
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if the end of the <link linkend="GHashTable"><type>GHashTable</type></link> has been reached.
765
<varlistentry><term><parameter>key</parameter> :</term>
766
<listitem><simpara> a location to store the key, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
767
</simpara></listitem></varlistentry>
768
<varlistentry><term><parameter>value</parameter> :</term>
769
<listitem><simpara> a location to store the value, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
770
</simpara></listitem></varlistentry>
771
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> if the end of the <link linkend="GHashTable"><type>GHashTable</type></link> has been reached.
814
773
</simpara></listitem></varlistentry>
815
</variablelist><para role="since">Since 2.16
818
<title><anchor id="g-hash-table-iter-get-hash-table" role="function" condition="since:2.16"/>g_hash_table_iter_get_hash_table ()</title>
819
<indexterm role="2.16"><primary>g_hash_table_iter_get_hash_table</primary></indexterm><programlisting><link linkend="GHashTable">GHashTable</link>* g_hash_table_iter_get_hash_table (<link linkend="GHashTableIter">GHashTableIter</link> *iter);</programlisting>
774
</variablelist><para role="since">Since 2.16</para></refsect2>
775
<refsect2 id="g-hash-table-iter-get-hash-table" role="function" condition="since:2.16">
776
<title>g_hash_table_iter_get_hash_table ()</title>
777
<indexterm zone="g-hash-table-iter-get-hash-table" role="2.16"><primary sortas="g_hash_table_iter_get_hash_table">g_hash_table_iter_get_hash_table</primary></indexterm><programlisting><link linkend="GHashTable">GHashTable</link>* g_hash_table_iter_get_hash_table (<link linkend="GHashTableIter">GHashTableIter</link> *iter);</programlisting>
821
779
Returns the <link linkend="GHashTable"><type>GHashTable</type></link> associated with <parameter>iter</parameter>.</para>
824
781
</para><variablelist role="params">
825
<varlistentry><term><parameter>iter</parameter> :</term>
782
<varlistentry><term><parameter>iter</parameter> :</term>
826
783
<listitem><simpara> an initialized <link linkend="GHashTableIter"><type>GHashTableIter</type></link>.
827
784
</simpara></listitem></varlistentry>
828
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the <link linkend="GHashTable"><type>GHashTable</type></link> associated with <parameter>iter</parameter>.
785
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the <link linkend="GHashTable"><type>GHashTable</type></link> associated with <parameter>iter</parameter>.
830
787
</simpara></listitem></varlistentry>
831
</variablelist><para role="since">Since 2.16
834
<title><anchor id="g-hash-table-iter-remove" role="function" condition="since:2.16"/>g_hash_table_iter_remove ()</title>
835
<indexterm role="2.16"><primary>g_hash_table_iter_remove</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_iter_remove (<link linkend="GHashTableIter">GHashTableIter</link> *iter);</programlisting>
788
</variablelist><para role="since">Since 2.16</para></refsect2>
789
<refsect2 id="g-hash-table-iter-remove" role="function" condition="since:2.16">
790
<title>g_hash_table_iter_remove ()</title>
791
<indexterm zone="g-hash-table-iter-remove" role="2.16"><primary sortas="g_hash_table_iter_remove">g_hash_table_iter_remove</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_iter_remove (<link linkend="GHashTableIter">GHashTableIter</link> *iter);</programlisting>
837
793
Removes the key/value pair currently pointed to by the iterator
838
794
from its associated <link linkend="GHashTable"><type>GHashTable</type></link>. Can only be called after
839
<link linkend="g-hash-table-iter-next"><function>g_hash_table_iter_next()</function></link> returned <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, and cannot be called more
795
<link linkend="g-hash-table-iter-next"><function>g_hash_table_iter_next()</function></link> returned <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, and cannot be called more
840
796
than once for the same key/value pair.
845
801
you have to make sure that any dynamically allocated values are freed
849
804
</para><variablelist role="params">
850
<varlistentry><term><parameter>iter</parameter> :</term>
805
<varlistentry><term><parameter>iter</parameter> :</term>
851
806
<listitem><simpara> an initialized <link linkend="GHashTableIter"><type>GHashTableIter</type></link>.
852
807
</simpara></listitem></varlistentry>
853
</variablelist><para role="since">Since 2.16
856
<title><anchor id="g-hash-table-iter-steal" role="function" condition="since:2.16"/>g_hash_table_iter_steal ()</title>
857
<indexterm role="2.16"><primary>g_hash_table_iter_steal</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_iter_steal (<link linkend="GHashTableIter">GHashTableIter</link> *iter);</programlisting>
808
</variablelist><para role="since">Since 2.16</para></refsect2>
809
<refsect2 id="g-hash-table-iter-steal" role="function" condition="since:2.16">
810
<title>g_hash_table_iter_steal ()</title>
811
<indexterm zone="g-hash-table-iter-steal" role="2.16"><primary sortas="g_hash_table_iter_steal">g_hash_table_iter_steal</primary></indexterm><programlisting><link linkend="void">void</link> g_hash_table_iter_steal (<link linkend="GHashTableIter">GHashTableIter</link> *iter);</programlisting>
859
813
Removes the key/value pair currently pointed to by the iterator
860
814
from its associated <link linkend="GHashTable"><type>GHashTable</type></link>, without calling the key and value
861
815
destroy functions. Can only be called after
862
<link linkend="g-hash-table-iter-next"><function>g_hash_table_iter_next()</function></link> returned <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, and cannot be called more
816
<link linkend="g-hash-table-iter-next"><function>g_hash_table_iter_next()</function></link> returned <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, and cannot be called more
863
817
than once for the same key/value pair.</para>
866
819
</para><variablelist role="params">
867
<varlistentry><term><parameter>iter</parameter> :</term>
820
<varlistentry><term><parameter>iter</parameter> :</term>
868
821
<listitem><simpara> an initialized <link linkend="GHashTableIter"><type>GHashTableIter</type></link>.
869
822
</simpara></listitem></varlistentry>
870
</variablelist><para role="since">Since 2.16
873
<title><anchor id="g-direct-equal" role="function"/>g_direct_equal ()</title>
874
<indexterm><primary>g_direct_equal</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g_direct_equal (<link linkend="gconstpointer">gconstpointer</link> v1,
823
</variablelist><para role="since">Since 2.16</para></refsect2>
824
<refsect2 id="g-direct-equal" role="function">
825
<title>g_direct_equal ()</title>
826
<indexterm zone="g-direct-equal"><primary sortas="g_direct_equal">g_direct_equal</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g_direct_equal (<link linkend="gconstpointer">gconstpointer</link> v1,
875
827
<link linkend="gconstpointer">gconstpointer</link> v2);</programlisting>
877
Compares two <link linkend="gpointer"><type>gpointer</type></link> arguments and returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if they are equal.
829
Compares two <link linkend="gpointer"><type>gpointer</type></link> arguments and returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if they are equal.
878
830
It can be passed to <link linkend="g-hash-table-new"><function>g_hash_table_new()</function></link> as the <parameter>key_equal_func</parameter>
879
831
parameter, when using pointers as keys in a <link linkend="GHashTable"><type>GHashTable</type></link>.</para>
882
833
</para><variablelist role="params">
883
<varlistentry><term><parameter>v1</parameter> :</term>
834
<varlistentry><term><parameter>v1</parameter> :</term>
884
835
<listitem><simpara> a key.
885
836
</simpara></listitem></varlistentry>
886
<varlistentry><term><parameter>v2</parameter> :</term>
837
<varlistentry><term><parameter>v2</parameter> :</term>
887
838
<listitem><simpara> a key to compare with <parameter>v1</parameter>.
888
839
</simpara></listitem></varlistentry>
889
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the two keys match.
840
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the two keys match.
890
841
</simpara></listitem></varlistentry>
891
842
</variablelist></refsect2>
893
<title><anchor id="g-direct-hash" role="function"/>g_direct_hash ()</title>
894
<indexterm><primary>g_direct_hash</primary></indexterm><programlisting><link linkend="guint">guint</link> g_direct_hash (<link linkend="gconstpointer">gconstpointer</link> v);</programlisting>
843
<refsect2 id="g-direct-hash" role="function">
844
<title>g_direct_hash ()</title>
845
<indexterm zone="g-direct-hash"><primary sortas="g_direct_hash">g_direct_hash</primary></indexterm><programlisting><link linkend="guint">guint</link> g_direct_hash (<link linkend="gconstpointer">gconstpointer</link> v);</programlisting>
896
847
Converts a gpointer to a hash value.
897
848
It can be passed to <link linkend="g-hash-table-new"><function>g_hash_table_new()</function></link> as the <parameter>hash_func</parameter> parameter,
898
849
when using pointers as keys in a <link linkend="GHashTable"><type>GHashTable</type></link>.</para>
901
851
</para><variablelist role="params">
902
<varlistentry><term><parameter>v</parameter> :</term>
852
<varlistentry><term><parameter>v</parameter> :</term>
903
853
<listitem><simpara> a <link linkend="gpointer"><type>gpointer</type></link> key
904
854
</simpara></listitem></varlistentry>
905
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a hash value corresponding to the key.
855
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a hash value corresponding to the key.
906
856
</simpara></listitem></varlistentry>
907
857
</variablelist></refsect2>
909
<title><anchor id="g-int-equal" role="function"/>g_int_equal ()</title>
910
<indexterm><primary>g_int_equal</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g_int_equal (<link linkend="gconstpointer">gconstpointer</link> v1,
858
<refsect2 id="g-int-equal" role="function">
859
<title>g_int_equal ()</title>
860
<indexterm zone="g-int-equal"><primary sortas="g_int_equal">g_int_equal</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g_int_equal (<link linkend="gconstpointer">gconstpointer</link> v1,
911
861
<link linkend="gconstpointer">gconstpointer</link> v2);</programlisting>
913
863
Compares the two <link linkend="gint"><type>gint</type></link> values being pointed to and returns
914
<link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if they are equal.
864
<link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if they are equal.
915
865
It can be passed to <link linkend="g-hash-table-new"><function>g_hash_table_new()</function></link> as the <parameter>key_equal_func</parameter>
916
866
parameter, when using pointers to integers as keys in a <link linkend="GHashTable"><type>GHashTable</type></link>.</para>
919
868
</para><variablelist role="params">
920
<varlistentry><term><parameter>v1</parameter> :</term>
869
<varlistentry><term><parameter>v1</parameter> :</term>
921
870
<listitem><simpara> a pointer to a <link linkend="gint"><type>gint</type></link> key.
922
871
</simpara></listitem></varlistentry>
923
<varlistentry><term><parameter>v2</parameter> :</term>
872
<varlistentry><term><parameter>v2</parameter> :</term>
924
873
<listitem><simpara> a pointer to a <link linkend="gint"><type>gint</type></link> key to compare with <parameter>v1</parameter>.
925
874
</simpara></listitem></varlistentry>
926
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the two keys match.
875
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the two keys match.
927
876
</simpara></listitem></varlistentry>
928
877
</variablelist></refsect2>
930
<title><anchor id="g-int-hash" role="function"/>g_int_hash ()</title>
931
<indexterm><primary>g_int_hash</primary></indexterm><programlisting><link linkend="guint">guint</link> g_int_hash (<link linkend="gconstpointer">gconstpointer</link> v);</programlisting>
878
<refsect2 id="g-int-hash" role="function">
879
<title>g_int_hash ()</title>
880
<indexterm zone="g-int-hash"><primary sortas="g_int_hash">g_int_hash</primary></indexterm><programlisting><link linkend="guint">guint</link> g_int_hash (<link linkend="gconstpointer">gconstpointer</link> v);</programlisting>
933
882
Converts a pointer to a <link linkend="gint"><type>gint</type></link> to a hash value.
934
883
It can be passed to <link linkend="g-hash-table-new"><function>g_hash_table_new()</function></link> as the <parameter>hash_func</parameter> parameter,
935
884
when using pointers to integers values as keys in a <link linkend="GHashTable"><type>GHashTable</type></link>.</para>
938
886
</para><variablelist role="params">
939
<varlistentry><term><parameter>v</parameter> :</term>
887
<varlistentry><term><parameter>v</parameter> :</term>
940
888
<listitem><simpara> a pointer to a <link linkend="gint"><type>gint</type></link> key
941
889
</simpara></listitem></varlistentry>
942
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a hash value corresponding to the key.
890
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a hash value corresponding to the key.
943
891
</simpara></listitem></varlistentry>
944
892
</variablelist></refsect2>
946
<title><anchor id="g-str-equal" role="function"/>g_str_equal ()</title>
947
<indexterm><primary>g_str_equal</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g_str_equal (<link linkend="gconstpointer">gconstpointer</link> v1,
893
<refsect2 id="g-str-equal" role="function">
894
<title>g_str_equal ()</title>
895
<indexterm zone="g-str-equal"><primary sortas="g_str_equal">g_str_equal</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> g_str_equal (<link linkend="gconstpointer">gconstpointer</link> v1,
948
896
<link linkend="gconstpointer">gconstpointer</link> v2);</programlisting>
950
Compares two strings for byte-by-byte equality and returns <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>
898
Compares two strings for byte-by-byte equality and returns <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>
951
899
if they are equal. It can be passed to <link linkend="g-hash-table-new"><function>g_hash_table_new()</function></link> as the
952
900
<parameter>key_equal_func</parameter> parameter, when using strings as keys in a <link linkend="GHashTable"><type>GHashTable</type></link>.</para>
954
902
</para><variablelist role="params">
955
<varlistentry><term><parameter>v1</parameter> :</term>
903
<varlistentry><term><parameter>v1</parameter> :</term>
956
904
<listitem><simpara> a key
957
905
</simpara></listitem></varlistentry>
958
<varlistentry><term><parameter>v2</parameter> :</term>
906
<varlistentry><term><parameter>v2</parameter> :</term>
959
907
<listitem><simpara> a key to compare with <parameter>v1</parameter>
960
908
</simpara></listitem></varlistentry>
961
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the two keys match
909
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the two keys match
962
910
</simpara></listitem></varlistentry>
963
911
</variablelist></refsect2>
965
<title><anchor id="g-str-hash" role="function"/>g_str_hash ()</title>
966
<indexterm><primary>g_str_hash</primary></indexterm><programlisting><link linkend="guint">guint</link> g_str_hash (<link linkend="gconstpointer">gconstpointer</link> v);</programlisting>
912
<refsect2 id="g-str-hash" role="function">
913
<title>g_str_hash ()</title>
914
<indexterm zone="g-str-hash"><primary sortas="g_str_hash">g_str_hash</primary></indexterm><programlisting><link linkend="guint">guint</link> g_str_hash (<link linkend="gconstpointer">gconstpointer</link> v);</programlisting>
968
916
Converts a string to a hash value.
969
917
It can be passed to <link linkend="g-hash-table-new"><function>g_hash_table_new()</function></link> as the <parameter>hash_func</parameter>
970
918
parameter, when using strings as keys in a <link linkend="GHashTable"><type>GHashTable</type></link>.</para>
972
920
</para><variablelist role="params">
973
<varlistentry><term><parameter>v</parameter> :</term>
921
<varlistentry><term><parameter>v</parameter> :</term>
974
922
<listitem><simpara> a string key
975
923
</simpara></listitem></varlistentry>
976
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a hash value corresponding to the key
924
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> a hash value corresponding to the key
977
925
</simpara></listitem></varlistentry>
978
926
</variablelist></refsect2>