From f8314fd1f75a099c3ce0566d1a572cc25ba1f85b Mon Sep 17 00:00:00 2001 From: Sebastian Wilhelmi Date: Mon, 30 Oct 2000 14:50:32 +0000 Subject: [PATCH] second try. second try. --- docs/reference/glib/tmpl/caches.sgml | 5 ++- docs/reference/glib/tmpl/hash_tables.sgml | 42 +++++++------------ .../glib/tmpl/linked_lists_double.sgml | 14 +++++++ .../glib/tmpl/linked_lists_single.sgml | 4 +- docs/reference/glib/tmpl/relations.sgml | 2 +- docs/reference/glib/tmpl/threads.sgml | 2 - 6 files changed, 33 insertions(+), 36 deletions(-) diff --git a/docs/reference/glib/tmpl/caches.sgml b/docs/reference/glib/tmpl/caches.sgml index aad81b57a..fff9fe900 100644 --- a/docs/reference/glib/tmpl/caches.sgml +++ b/docs/reference/glib/tmpl/caches.sgml @@ -51,16 +51,17 @@ called by g_cache_remove() when the object is no longer needed (i.e. its reference count drops to 0). @hash_key_func: a function to create a hash value from a key. @hash_value_func: a function to create a hash value from a value. -@key_compare_func: a function to compare two keys. It should return TRUE if +@key_equal_func: a function to compare two keys. It should return TRUE if the two keys are equivalent. @Returns: a new #GCache. + Gets the value corresponding to the given key, creating it if necessary. It first checks if the value already exists in the #GCache, by using -the @key_compare_func function passed to g_cache_new(). +the @key_equal_func function passed to g_cache_new(). If it does already exist it is returned, and its reference count is increased by one. If the value does not currently exist, if is created by calling the diff --git a/docs/reference/glib/tmpl/hash_tables.sgml b/docs/reference/glib/tmpl/hash_tables.sgml index 33c9abdb9..0f03a9596 100644 --- a/docs/reference/glib/tmpl/hash_tables.sgml +++ b/docs/reference/glib/tmpl/hash_tables.sgml @@ -69,12 +69,12 @@ Hash values are used to determine where keys are stored within the #GHashTable data structure. The g_direct_hash(), g_int_hash() and g_str_hash() functions are provided for some common types of keys. If hash_func is NULL, g_direct_hash() is used. -@key_compare_func: a function to compare two keys to see if they are equal. -This is used when looking up keys in the #GHashTable. -The g_direct_equal(), g_int_equal() and g_str_equal() functions are provided -for the most common types of keys. If compare_func is NULL, keys are compared -directly in a similar fashion to g_direct_equal(), but without the overhead -of a function call. +@key_equal_func: a function to check two keys for equality. This is +used when looking up keys in the #GHashTable. The g_direct_equal(), +g_int_equal() and g_str_equal() functions are provided for the most +common types of keys. If @key_equal_func is NULL, keys are compared +directly in a similar fashion to g_direct_equal(), but without the +overhead of a function call. @Returns: a new #GHashTable. @@ -102,30 +102,16 @@ lookup. @Returns: the hash value corresponding to the key. - + -Specifies the type of a comparison function used to compare two values. -The value which should be returned depends on the context in which the -#GCompareFunc is used. - - -In g_hash_table_new(), g_cache_new(), and g_relation_index() the function -should return TRUE if the two parameters are equal, or FALSE if they are not. - - -In g_list_find_custom() and g_slist_find_custom() the function should return -0 if the two parameters are equal. - - -In g_list_insert_sorted(), g_list_sort(), g_slist_insert_sorted(), -g_slist_sort() and g_tree_new() the function should return a negative integer -if the first value comes before the second, 0 if they are equal, or a positive -integer if the first value comes after the second. +Specifies the type of a function used to test two values for +equality. The function should return TRUE if both values are equal and +FALSE otherwise. @a: a value. @b: a value to compare with. -@Returns: TRUE if the two values are equivalent. +@Returns: TRUE if @a = @b; FALSE otherwise. @@ -285,7 +271,7 @@ first. Compares two #gpointer arguments and returns TRUE if they are equal. -It can be passed to g_hash_table_new() as the @key_compare_func +It can be passed to g_hash_table_new() as the @key_equal_func parameter, when using pointers as keys in a #GHashTable. @@ -309,7 +295,7 @@ using gpointer values as keys in a #GHashTable. Compares the two #gint values being pointed to and returns TRUE if they are equal. -It can be passed to g_hash_table_new() as the @key_compare_func +It can be passed to g_hash_table_new() as the @key_equal_func parameter, when using pointers to integers as keys in a #GHashTable. @@ -332,7 +318,7 @@ using pointers to gint values as keys in a #GHashTable. Compares two strings and returns TRUE if they are equal. -It can be passed to g_hash_table_new() as the @key_compare_func +It can be passed to g_hash_table_new() as the @key_equal_func parameter, when using strings as keys in a #GHashTable. diff --git a/docs/reference/glib/tmpl/linked_lists_double.sgml b/docs/reference/glib/tmpl/linked_lists_double.sgml index e4bf0ada2..ab995f073 100644 --- a/docs/reference/glib/tmpl/linked_lists_double.sgml +++ b/docs/reference/glib/tmpl/linked_lists_double.sgml @@ -268,6 +268,20 @@ value if the first element comes after the second. @Returns: the start of the sorted #GList. + + +Specifies the type of a comparison function used to compare two +values. The function should return a negative integer if the first +value comes before the second, 0 if they are equal, or a positive +integer if the first value comes after the second. + + +@a: a value. +@b: a value to compare with. +@Returns: negative value if @a < @b; zero if @a = @b; positive value +if @a > @b. + + Adds the second #GList onto the end of the first #GList. diff --git a/docs/reference/glib/tmpl/linked_lists_single.sgml b/docs/reference/glib/tmpl/linked_lists_single.sgml index 0076ccdc9..81fa7e537 100644 --- a/docs/reference/glib/tmpl/linked_lists_single.sgml +++ b/docs/reference/glib/tmpl/linked_lists_single.sgml @@ -195,10 +195,8 @@ self-contained list with one element. @list: a #GSList. -@link: -@Returns: the new start of the #GSList, without the element. - @llink: an element in the #GSList. +@Returns: the new start of the #GSList, without the element. diff --git a/docs/reference/glib/tmpl/relations.sgml b/docs/reference/glib/tmpl/relations.sgml index 4c1dd6110..ee34ddea9 100644 --- a/docs/reference/glib/tmpl/relations.sgml +++ b/docs/reference/glib/tmpl/relations.sgml @@ -83,7 +83,7 @@ Note that this must be called before any records are added to the #GRelation. @relation: a #GRelation. @field: the field to index, counting from 0. @hash_func: a function to produce a hash value from the field data. -@key_compare_func: a function to compare two values of the given field. +@key_equal_func: a function to compare two values of the given field. diff --git a/docs/reference/glib/tmpl/threads.sgml b/docs/reference/glib/tmpl/threads.sgml index 68889f4e9..92a6c9b5b 100644 --- a/docs/reference/glib/tmpl/threads.sgml +++ b/docs/reference/glib/tmpl/threads.sgml @@ -1069,8 +1069,6 @@ called and will set @private_key to @data casted to #GPrivate* then. @private_key: a #GPrivate. @data: the new pointer. - -@value: