Add hash table iterators. (#500507, Jean-Yves Lefort)

2007-12-14  Matthias Clasen  <mclasen@redhat.com>

        * glib/glib.symbols:
        * glib/ghash.[hc]: Add hash table iterators.  (#500507,
        Jean-Yves Lefort)

        * tests/hash-test.c: Test iterators.



svn path=/trunk/; revision=6130
This commit is contained in:
Matthias Clasen
2007-12-15 03:54:09 +00:00
committed by Matthias Clasen
parent f506365079
commit d741d3e7a3
8 changed files with 421 additions and 18 deletions

View File

@@ -1,3 +1,8 @@
2007-12-14 Matthias Clasen <mclasen@redhat.com>
* glib/tmpl/hash_tables.sgml:
* glib/glib-sections.txt: Add hash iterator functions
2007-12-10 Matthias Clasen <mclasen@redhat.com>
* gio/gio-sections.txt:

View File

@@ -2015,6 +2015,12 @@ g_hash_table_thaw
g_hash_table_destroy
g_hash_table_ref
g_hash_table_unref
GHashTableIter
g_hash_table_iter_init
g_hash_table_iter_next
g_hash_table_iter_get_hash_table
g_hash_table_iter_remove
g_hash_table_iter_steal
<SUBSECTION>
g_direct_equal

View File

@@ -40,7 +40,9 @@ and g_hash_table_lookup_extended().
To remove a key and value, use g_hash_table_remove().
</para>
<para>
To call a function for each key and value pair use g_hash_table_foreach().
To call a function for each key and value pair use g_hash_table_foreach()
or use a iterator to iterate over the key/value pairs in the hash table, see
#GHashTableIter.
</para>
<para>
To destroy a #GHashTable use g_hash_table_destroy().
@@ -96,7 +98,7 @@ hash functions which can be used when the key is a #gpointer, #gint, and
#gchar* respectively.
</para>
<para>
FIXME: Need more here.
<!-- FIXME: Need more here. -->
The hash values should be evenly distributed over a fairly large range?
The modulus is taken with the hash table size (a prime number)
to find the 'bucket' to place each key into.
@@ -338,6 +340,51 @@ This function is deprecated and will be removed in the next major
@hash_table:
<!-- ##### FUNCTION g_hash_table_iter_init ##### -->
<para>
</para>
@iter:
@hash_table:
<!-- ##### FUNCTION g_hash_table_iter_next ##### -->
<para>
</para>
@iter:
@key:
@value:
@Returns:
<!-- ##### FUNCTION g_hash_table_iter_get_hash_table ##### -->
<para>
</para>
@iter:
@Returns:
<!-- ##### FUNCTION g_hash_table_iter_remove ##### -->
<para>
</para>
@iter:
<!-- ##### FUNCTION g_hash_table_iter_steal ##### -->
<para>
</para>
@iter:
<!-- ##### FUNCTION g_direct_equal ##### -->
<para>