diff --git a/ChangeLog b/ChangeLog index 147d53d9e..19a94687b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-05-02 Matthias Clasen + + * glib/gstring.c (g_str_equal, g_str_hash): Move docs + inline. + 2005-05-01 Matthias Clasen * glib/ghash.h: Rename some parameters to make gtk-doc diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 147d53d9e..19a94687b 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2005-05-02 Matthias Clasen + + * glib/gstring.c (g_str_equal, g_str_hash): Move docs + inline. + 2005-05-01 Matthias Clasen * glib/ghash.h: Rename some parameters to make gtk-doc diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 147d53d9e..19a94687b 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +2005-05-02 Matthias Clasen + + * glib/gstring.c (g_str_equal, g_str_hash): Move docs + inline. + 2005-05-01 Matthias Clasen * glib/ghash.h: Rename some parameters to make gtk-doc diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 147d53d9e..19a94687b 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2005-05-02 Matthias Clasen + + * glib/gstring.c (g_str_equal, g_str_hash): Move docs + inline. + 2005-05-01 Matthias Clasen * glib/ghash.h: Rename some parameters to make gtk-doc diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index c99575b3b..bda5fd3d1 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,5 +1,8 @@ 2005-05-02 Matthias Clasen + * glib/tmpl/hash_tables.sgml: Move some docs inline. + + * glib/tmpl/windows.sgml: * gobject/tmpl/signals.sgml: * gobject/tmpl/generic_values.sgml: * gobject/tmpl/gtype.sgml: diff --git a/docs/reference/glib/tmpl/hash_tables.sgml b/docs/reference/glib/tmpl/hash_tables.sgml index 006b83024..339e80770 100644 --- a/docs/reference/glib/tmpl/hash_tables.sgml +++ b/docs/reference/glib/tmpl/hash_tables.sgml @@ -51,6 +51,9 @@ To destroy a #GHashTable use g_hash_table_destroy(). + + + The GHashTable struct is an opaque data structure to represent a @@ -311,8 +314,6 @@ This function is deprecated and will be removed in the next major @v1: @v2: @Returns: - -@v: @@ -326,26 +327,18 @@ This function is deprecated and will be removed in the next major -Compares two strings and returns %TRUE if they are equal. -It can be passed to g_hash_table_new() as the @key_equal_func -parameter, when using strings as keys in a #GHashTable. @v1: -@v2: a key to compare with @v. -@Returns: %TRUE if the two keys match. - -@v: a key. +@v2: +@Returns: -Converts a string to a hash value. -It can be passed to g_hash_table_new() as the @hash_func parameter, when -using strings as keys in a #GHashTable. -@v: a string key. -@Returns: a hash value corresponding to the key. +@v: +@Returns: diff --git a/docs/reference/glib/tmpl/windows.sgml b/docs/reference/glib/tmpl/windows.sgml index 9f799fdc0..f2e59e831 100644 --- a/docs/reference/glib/tmpl/windows.sgml +++ b/docs/reference/glib/tmpl/windows.sgml @@ -14,6 +14,9 @@ UNIX emulation on Windows. + + + Provided for UNIX emulation on Windows; equivalent to UNIX @@ -23,19 +26,13 @@ macro %MAXPATHLEN, which is the maximum length of a filename - - -Provided for UNIX emulation on Windows; process ID type. - - - Provided for UNIX emulation on Windows; see documentation for pipe() in any UNIX manual. -@phandles: +@phandles: file descriptors, the first one for reading, the second one for writing. @@ -84,6 +81,15 @@ in any UNIX manual. @Returns: + + + + + +@utf8filename: +@Returns: + + On Windows, this macro defines a DllMain() function diff --git a/glib/gstring.c b/glib/gstring.c index 892930ad1..7eec7f91c 100644 --- a/glib/gstring.c +++ b/glib/gstring.c @@ -59,6 +59,17 @@ static GMemChunk *string_mem_chunk = NULL; /* Hash Functions. */ +/** + * g_str_equal: + * @v1: a key. + * @v2: a key to compare with @v1. + * + * Compares two strings and returns %TRUE if they are equal. + * It can be passed to g_hash_table_new() as the @key_equal_func + * parameter, when using strings as keys in a #GHashTable. + * + * Returns: %TRUE if the two keys match. + */ gboolean g_str_equal (gconstpointer v1, gconstpointer v2) @@ -69,11 +80,21 @@ g_str_equal (gconstpointer v1, return strcmp (string1, string2) == 0; } -/* 31 bit hash function */ +/** + * g_str_hash: + * @v: a string key. + * + * Converts a string to a hash value. + * It can be passed to g_hash_table_new() as the @hash_func parameter, + * when using strings as keys in a #GHashTable. + * + * Returns: a hash value corresponding to the key. + */ guint -g_str_hash (gconstpointer key) +g_str_hash (gconstpointer v) { - const char *p = key; + /* 31 bit hash function */ + const char *p = v; guint h = *p; if (h)