second try.

second try.
This commit is contained in:
Sebastian Wilhelmi 2000-10-30 14:50:32 +00:00
parent 6ca80ce85f
commit f8314fd1f7
6 changed files with 33 additions and 36 deletions

View File

@ -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.
<!-- ##### FUNCTION g_cache_insert ##### -->
<para>
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

View File

@ -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.
<!-- ##### USER_FUNCTION GCompareFunc ##### -->
<!-- ##### USER_FUNCTION GEqualFunc ##### -->
<para>
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.
</para>
<para>
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.
</para>
<para>
In g_list_find_custom() and g_slist_find_custom() the function should return
0 if the two parameters are equal.
</para>
<para>
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.
</para>
@a: a value.
@b: a value to compare with.
@Returns: TRUE if the two values are equivalent.
@Returns: TRUE if @a = @b; FALSE otherwise.
<!-- ##### FUNCTION g_hash_table_insert ##### -->
@ -285,7 +271,7 @@ first.
<!-- ##### FUNCTION g_direct_equal ##### -->
<para>
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.
</para>
@ -309,7 +295,7 @@ using gpointer values as keys in a #GHashTable.
<para>
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.
</para>
@ -332,7 +318,7 @@ using pointers to gint values as keys in a #GHashTable.
<!-- ##### FUNCTION g_str_equal ##### -->
<para>
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.
</para>

View File

@ -268,6 +268,20 @@ value if the first element comes after the second.
@Returns: the start of the sorted #GList.
<!-- ##### USER_FUNCTION GCompareFunc ##### -->
<para>
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.
</para>
@a: a value.
@b: a value to compare with.
@Returns: negative value if @a < @b; zero if @a = @b; positive value
if @a > @b.
<!-- ##### FUNCTION g_list_concat ##### -->
<para>
Adds the second #GList onto the end of the first #GList.

View File

@ -195,10 +195,8 @@ self-contained list with one element.
</para>
@list: a #GSList.
@link:
@Returns: the new start of the #GSList, without the element.
<!-- # Unused Parameters # -->
@llink: an element in the #GSList.
@Returns: the new start of the #GSList, without the element.
<!-- ##### FUNCTION g_slist_delete_link ##### -->

View File

@ -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.
<!-- ##### FUNCTION g_relation_insert ##### -->

View File

@ -1069,8 +1069,6 @@ called and will set @private_key to @data casted to #GPrivate* then.
@private_key: a #GPrivate.
@data: the new pointer.
<!-- # Unused Parameters # -->
@value:
<!-- ##### STRUCT GStaticPrivate ##### -->