From 46ec058d2a416082ab054672e2eda60afb0d4e5b Mon Sep 17 00:00:00 2001 From: Adrien Plazas Date: Thu, 15 Aug 2024 10:22:07 +0000 Subject: [PATCH] ghash: Fix the documentation of GHRFunc This function type isn't only used by g_hash_table_foreach_remove(), and what happens to the data when we return TRUE depends on the calling function. Includes a port to modern gi-docgen syntax by Emmanuele Bassi. Signed-off-by: Adrien Plazas --- glib/ghash.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/glib/ghash.c b/glib/ghash.c index fc0a88e55..323dde97b 100644 --- a/glib/ghash.c +++ b/glib/ghash.c @@ -124,16 +124,21 @@ * GHRFunc: * @key: a key * @value: the value associated with the key - * @user_data: user data passed to g_hash_table_remove() + * @user_data: user data passed to the calling function * * Specifies the type of the function passed to - * g_hash_table_foreach_remove(). It is called with each key/value - * pair, together with the @user_data parameter passed to - * g_hash_table_foreach_remove(). It should return %TRUE if the - * key/value pair should be removed from the #GHashTable. + * [func@GLib.HashTable.find], [func@GLib.HashTable.foreach_remove], and + * [func@GLib.HashTable.foreach_steal]. + * + * The function is called with each key/value pair, together with + * the @user_data parameter passed to the calling function. + * + * The function should return true if the key/value pair should be + * selected, meaning it has been found or it should be removed from the + * [struct@GLib.HashTable], depending on the calling function. * - * Returns: %TRUE if the key/value pair should be removed from the - * #GHashTable + * Returns: true if the key/value pair should be selected, and + * false otherwise */ /**