mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-12-15 12:58:29 +01:00
second try.
second try.
This commit is contained in:
@@ -51,16 +51,17 @@ called by g_cache_remove() when the object is no longer needed (i.e. its
|
|||||||
reference count drops to 0).
|
reference count drops to 0).
|
||||||
@hash_key_func: a function to create a hash value from a key.
|
@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.
|
@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.
|
the two keys are equivalent.
|
||||||
@Returns: a new #GCache.
|
@Returns: a new #GCache.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION g_cache_insert ##### -->
|
<!-- ##### FUNCTION g_cache_insert ##### -->
|
||||||
<para>
|
<para>
|
||||||
Gets the value corresponding to the given key, creating it if necessary.
|
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
|
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
|
If it does already exist it is returned, and its reference count is increased
|
||||||
by one.
|
by one.
|
||||||
If the value does not currently exist, if is created by calling the
|
If the value does not currently exist, if is created by calling the
|
||||||
|
|||||||
@@ -69,12 +69,12 @@ Hash values are used to determine where keys are stored within the
|
|||||||
#GHashTable data structure.
|
#GHashTable data structure.
|
||||||
The g_direct_hash(), g_int_hash() and g_str_hash() functions are provided for
|
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.
|
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.
|
@key_equal_func: a function to check two keys for equality. This is
|
||||||
This is used when looking up keys in the #GHashTable.
|
used when looking up keys in the #GHashTable. The g_direct_equal(),
|
||||||
The g_direct_equal(), g_int_equal() and g_str_equal() functions are provided
|
g_int_equal() and g_str_equal() functions are provided for the most
|
||||||
for the most common types of keys. If compare_func is NULL, keys are compared
|
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
|
directly in a similar fashion to g_direct_equal(), but without the
|
||||||
of a function call.
|
overhead of a function call.
|
||||||
@Returns: a new #GHashTable.
|
@Returns: a new #GHashTable.
|
||||||
|
|
||||||
|
|
||||||
@@ -102,30 +102,16 @@ lookup.
|
|||||||
@Returns: the hash value corresponding to the key.
|
@Returns: the hash value corresponding to the key.
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### USER_FUNCTION GCompareFunc ##### -->
|
<!-- ##### USER_FUNCTION GEqualFunc ##### -->
|
||||||
<para>
|
<para>
|
||||||
Specifies the type of a comparison function used to compare two values.
|
Specifies the type of a function used to test two values for
|
||||||
The value which should be returned depends on the context in which the
|
equality. The function should return TRUE if both values are equal and
|
||||||
#GCompareFunc is used.
|
FALSE otherwise.
|
||||||
</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.
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@a: a value.
|
@a: a value.
|
||||||
@b: a value to compare with.
|
@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 ##### -->
|
<!-- ##### FUNCTION g_hash_table_insert ##### -->
|
||||||
@@ -285,7 +271,7 @@ first.
|
|||||||
<!-- ##### FUNCTION g_direct_equal ##### -->
|
<!-- ##### FUNCTION g_direct_equal ##### -->
|
||||||
<para>
|
<para>
|
||||||
Compares two #gpointer arguments and returns TRUE if they are equal.
|
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.
|
parameter, when using pointers as keys in a #GHashTable.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@@ -309,7 +295,7 @@ using gpointer values as keys in a #GHashTable.
|
|||||||
<para>
|
<para>
|
||||||
Compares the two #gint values being pointed to and returns TRUE if they are
|
Compares the two #gint values being pointed to and returns TRUE if they are
|
||||||
equal.
|
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.
|
parameter, when using pointers to integers as keys in a #GHashTable.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@@ -332,7 +318,7 @@ using pointers to gint values as keys in a #GHashTable.
|
|||||||
<!-- ##### FUNCTION g_str_equal ##### -->
|
<!-- ##### FUNCTION g_str_equal ##### -->
|
||||||
<para>
|
<para>
|
||||||
Compares two strings and returns TRUE if they are equal.
|
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.
|
parameter, when using strings as keys in a #GHashTable.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
|||||||
@@ -268,6 +268,20 @@ value if the first element comes after the second.
|
|||||||
@Returns: the start of the sorted #GList.
|
@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 ##### -->
|
<!-- ##### FUNCTION g_list_concat ##### -->
|
||||||
<para>
|
<para>
|
||||||
Adds the second #GList onto the end of the first #GList.
|
Adds the second #GList onto the end of the first #GList.
|
||||||
|
|||||||
@@ -195,10 +195,8 @@ self-contained list with one element.
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
@list: a #GSList.
|
@list: a #GSList.
|
||||||
@link:
|
|
||||||
@Returns: the new start of the #GSList, without the element.
|
|
||||||
<!-- # Unused Parameters # -->
|
|
||||||
@llink: an element in the #GSList.
|
@llink: an element in the #GSList.
|
||||||
|
@Returns: the new start of the #GSList, without the element.
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### FUNCTION g_slist_delete_link ##### -->
|
<!-- ##### FUNCTION g_slist_delete_link ##### -->
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ Note that this must be called before any records are added to the #GRelation.
|
|||||||
@relation: a #GRelation.
|
@relation: a #GRelation.
|
||||||
@field: the field to index, counting from 0.
|
@field: the field to index, counting from 0.
|
||||||
@hash_func: a function to produce a hash value from the field data.
|
@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 ##### -->
|
<!-- ##### FUNCTION g_relation_insert ##### -->
|
||||||
|
|||||||
@@ -1069,8 +1069,6 @@ called and will set @private_key to @data casted to #GPrivate* then.
|
|||||||
|
|
||||||
@private_key: a #GPrivate.
|
@private_key: a #GPrivate.
|
||||||
@data: the new pointer.
|
@data: the new pointer.
|
||||||
<!-- # Unused Parameters # -->
|
|
||||||
@value:
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ##### STRUCT GStaticPrivate ##### -->
|
<!-- ##### STRUCT GStaticPrivate ##### -->
|
||||||
|
|||||||
Reference in New Issue
Block a user