From 91bbef9e27dd1d7bcd4f4d9852c0edd0d3af82e9 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 26 Jul 2019 20:09:48 +0200 Subject: Update glib annotations --- gir/gio-2.0.c | 22 +++++++------------- gir/glib-2.0.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 67 insertions(+), 20 deletions(-) diff --git a/gir/gio-2.0.c b/gir/gio-2.0.c index 7a716b04..df075f50 100644 --- a/gir/gio-2.0.c +++ b/gir/gio-2.0.c @@ -15009,8 +15009,8 @@ * The returned address will be in the * [D-Bus address format](https://dbus.freedesktop.org/doc/dbus-specification.html#addresses). * - * Returns: a valid D-Bus address string for @bus_type or %NULL if - * @error is set + * Returns: (transfer full): a valid D-Bus address string for @bus_type or + * %NULL if @error is set * Since: 2.26 */ @@ -15790,7 +15790,7 @@ * then call g_dbus_connection_new_finish() to get the result of the * operation. * - * This is a asynchronous failable constructor. See + * This is an asynchronous failable constructor. See * g_dbus_connection_new_sync() for the synchronous * version. * @@ -15833,13 +15833,13 @@ * %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags. * * When the operation is finished, @callback will be invoked. You can - * then call g_dbus_connection_new_finish() to get the result of the - * operation. + * then call g_dbus_connection_new_for_address_finish() to get the result of + * the operation. * * If @observer is not %NULL it may be used to control the * authentication process. * - * This is a asynchronous failable constructor. See + * This is an asynchronous failable constructor. See * g_dbus_connection_new_for_address_sync() for the synchronous * version. * @@ -32809,7 +32809,7 @@ * Resets @key to its default value. * * This call resets the key, as much as possible, to its default value. - * That might the value specified in the schema or the one set by the + * That might be the value specified in the schema or the one set by the * administrator. */ @@ -42616,14 +42616,6 @@ */ -/** - * inet_addresses_to_inet_socket_addresses: - * @addresses: (transfer full): #GList of #GInetAddress - * - * Returns: (transfer full): #GList of #GInetSocketAddress - */ - - /************************************************************/ /* THIS FILE IS GENERATED DO NOT EDIT */ diff --git a/gir/glib-2.0.c b/gir/glib-2.0.c index ffee8a48..8f43cf04 100644 --- a/gir/glib-2.0.c +++ b/gir/glib-2.0.c @@ -4863,7 +4863,7 @@ * G_DEFINE_AUTOPTR_CLEANUP_FUNC (MyDataStruct, my_data_struct_release) * ]| * - * Since: 2.58. + * Since: 2.58 */ @@ -7747,7 +7747,7 @@ * G_DEFINE_AUTOPTR_CLEANUP_FUNC (MyDataStruct, my_data_struct_release) * ]| * - * Since: 2.58. + * Since: 2.58 */ @@ -8825,6 +8825,46 @@ */ +/** + * g_array_binary_search: + * @array: a #GArray. + * @target: a pointer to the item to look up. + * @compare_func: A #GCompareFunc used to locate @target. + * @out_match_index: (optional) (out caller-allocates): return location + * for the index of the element, if found. + * + * Checks whether @target exists in @array by performing a binary + * search based on the given comparison function @compare_func which + * get pointers to items as arguments. If the element is found, %TRUE + * is returned and the element’s index is returned in @out_match_index + * (if non-%NULL). Otherwise, %FALSE is returned and @out_match_index + * is undefined. If @target exists multiple times in @array, the index + * of the first instance is returned. This search is using a binary + * search, so the @array must absolutely be sorted to return a correct + * result (if not, the function may produce false-negative). + * + * This example defines a comparison function and search an element in a #GArray: + * |[ + * static gint* + * cmpint (gconstpointer a, gconstpointer b) + * { + * const gint *_a = a; + * const gint *_b = b; + * + * return *_a - *_b; + * } + * ... + * gint i = 424242; + * guint matched_index; + * gboolean result = g_array_binary_search (garray, &i, cmpint, &matched_index); + * ... + * ]| + * + * Returns: %TRUE if @target is one of the elements of @array, %FALSE otherwise. + * Since: 2.62 + */ + + /** * g_array_copy: * @array: A #GArray. @@ -21392,7 +21432,7 @@ /** * g_main_context_prepare: * @context: a #GMainContext - * @priority: location to store priority of highest priority + * @priority: (out) (optional): location to store priority of highest priority * source already ready. * * Prepares to poll sources within a main loop. The resulting information @@ -24521,6 +24561,9 @@ * If @func is %NULL, then only the pointers (and not what they are * pointing to) are copied to the new #GPtrArray. * + * The copy of @array will have the same #GDestroyNotify for its elements as + * @array. + * * Returns: (transfer full): a deep copy of the initial #GPtrArray. * Since: 2.62 */ @@ -32292,6 +32335,18 @@ * * This should be called at the top of a test function. * + * For example: + * |[ + * static void + * test_array_sort (void) + * { + * g_test_summary ("Test my_array_sort() sorts the array correctly and stably, " + * "including testing zero length and one-element arrays."); + * + * … + * } + * ]| + * * Since: 2.62: * See also: g_test_bug() */ @@ -33758,8 +33813,8 @@ * g_tree_lookup_extended: * @tree: a #GTree * @lookup_key: the key to look up - * @orig_key: (optional) (nullable): returns the original key - * @value: (optional) (nullable): returns the value associated with the key + * @orig_key: (out) (optional) (nullable): returns the original key + * @value: (out) (optional) (nullable): returns the value associated with the key * * Looks up a key in the #GTree, returning the original key and the * associated value. This is useful if you need to free the memory -- cgit v1.2.1