From cd9c81c1063db0db838b34f85cbd24f2b9739202 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Mon, 20 Feb 2023 20:54:16 +0000 Subject: [PATCH] trivial: Add the closure user_data to the introspection --- libfwupd/fwupd-client.c | 90 ++++++++++++++++++------------------- libfwupdplugin/fu-archive.c | 2 +- libfwupdplugin/fu-context.c | 2 +- libfwupdplugin/fu-device.c | 4 +- libfwupdplugin/fu-device.h | 2 +- libfwupdplugin/fu-quirks.c | 2 +- libfwupdplugin/fu-quirks.h | 2 +- libfwupdplugin/fu-string.c | 2 +- libfwupdplugin/fu-string.h | 2 +- src/fu-spawn.c | 12 ++--- src/fu-spawn.h | 4 +- 11 files changed, 62 insertions(+), 62 deletions(-) diff --git a/libfwupd/fwupd-client.c b/libfwupd/fwupd-client.c index d9ab8f5d4..f364eef98 100644 --- a/libfwupd/fwupd-client.c +++ b/libfwupd/fwupd-client.c @@ -855,7 +855,7 @@ fwupd_client_connect_get_connection_cb(GObject *source, GAsyncResult *res, gpoin * fwupd_client_connect_async: * @self: a #FwupdClient * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Sets up the client ready for use. This is probably the first method you call @@ -1006,7 +1006,7 @@ fwupd_client_quit_cb(GObject *source, GAsyncResult *res, gpointer user_data) * fwupd_client_quit_async: * @self: a #FwupdClient * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Asks the daemon to quit. This can only be called by the root user. @@ -1112,7 +1112,7 @@ fwupd_client_get_host_security_attrs_cb(GObject *source, GAsyncResult *res, gpoi * fwupd_client_get_host_security_attrs_async: * @self: a #FwupdClient * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets all the host security attributes from the daemon. @@ -1191,7 +1191,7 @@ fwupd_client_modify_bios_setting_cb(GObject *source, GAsyncResult *res, gpointer * @self: a #FwupdClient * @settings: (transfer container): BIOS settings * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Modifies a BIOS setting using kernel API. @@ -1282,7 +1282,7 @@ fwupd_client_get_bios_settings_cb(GObject *source, GAsyncResult *res, gpointer u * fwupd_client_get_bios_settings_async: * @self: a #FwupdClient * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets all the host security attributes from the daemon. @@ -1363,7 +1363,7 @@ fwupd_client_get_host_security_events_cb(GObject *source, GAsyncResult *res, gpo * @self: a #FwupdClient * @limit: maximum number of events, or 0 for no limit * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets all the host security events from the daemon. @@ -1465,7 +1465,7 @@ fwupd_client_get_report_metadata_cb(GObject *source, GAsyncResult *res, gpointer * fwupd_client_get_report_metadata_async: * @self: a #FwupdClient * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets all the report metadata from the daemon. @@ -1545,7 +1545,7 @@ fwupd_client_get_devices_cb(GObject *source, GAsyncResult *res, gpointer user_da * fwupd_client_get_devices_async: * @self: a #FwupdClient * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets all the devices registered with the daemon. @@ -1625,7 +1625,7 @@ fwupd_client_get_plugins_cb(GObject *source, GAsyncResult *res, gpointer user_da * fwupd_client_get_plugins_async: * @self: a #FwupdClient * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets all the plugins being used by the daemon. @@ -1705,7 +1705,7 @@ fwupd_client_get_history_cb(GObject *source, GAsyncResult *res, gpointer user_da * fwupd_client_get_history_async: * @self: a #FwupdClient * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets all the history. @@ -1815,7 +1815,7 @@ fwupd_client_get_device_by_id_cb(GObject *source, GAsyncResult *res, gpointer us * @self: a #FwupdClient * @device_id: (not nullable): the device ID * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets a device by it's device ID. @@ -1913,7 +1913,7 @@ fwupd_client_get_devices_by_guid_cb(GObject *source, GAsyncResult *res, gpointer * @self: a #FwupdClient * @guid: the GUID, e.g. `e22c4520-43dc-5bb3-8245-5787fead9b63` * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets any devices that provide a specific GUID. An error is returned if no @@ -1994,7 +1994,7 @@ fwupd_client_get_releases_cb(GObject *source, GAsyncResult *res, gpointer user_d * @self: a #FwupdClient * @device_id: (not nullable): the device ID * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets all the releases for a specific device @@ -2077,7 +2077,7 @@ fwupd_client_get_downgrades_cb(GObject *source, GAsyncResult *res, gpointer user * @self: a #FwupdClient * @device_id: (not nullable): the device ID * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets all the downgrades for a specific device. @@ -2160,7 +2160,7 @@ fwupd_client_get_upgrades_cb(GObject *source, GAsyncResult *res, gpointer user_d * @self: a #FwupdClient * @device_id: (not nullable): the device ID * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets all the upgrades for a specific device. @@ -2242,7 +2242,7 @@ fwupd_client_modify_config_cb(GObject *source, GAsyncResult *res, gpointer user_ * @key: config key, e.g. `DisabledPlugins` * @value: config value, e.g. `*` * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Modifies a daemon config option. @@ -2323,7 +2323,7 @@ fwupd_client_activate_cb(GObject *source, GAsyncResult *res, gpointer user_data) * @self: a #FwupdClient * @device_id: a device * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Activates up a device, which normally means the device switches to a new @@ -2402,7 +2402,7 @@ fwupd_client_verify_cb(GObject *source, GAsyncResult *res, gpointer user_data) * @self: a #FwupdClient * @device_id: (not nullable): the device ID * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Verify a specific device. @@ -2480,7 +2480,7 @@ fwupd_client_verify_update_cb(GObject *source, GAsyncResult *res, gpointer user_ * @self: a #FwupdClient * @device_id: (not nullable): the device ID * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Update the verification record for a specific device. @@ -2558,7 +2558,7 @@ fwupd_client_unlock_cb(GObject *source, GAsyncResult *res, gpointer user_data) * @self: a #FwupdClient * @device_id: (not nullable): the device ID * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Unlocks a specific device so firmware can be read or wrote. @@ -2636,7 +2636,7 @@ fwupd_client_clear_results_cb(GObject *source, GAsyncResult *res, gpointer user_ * @self: a #FwupdClient * @device_id: a device * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Clears the results for a specific device. @@ -2716,7 +2716,7 @@ fwupd_client_get_results_cb(GObject *source, GAsyncResult *res, gpointer user_da * @self: a #FwupdClient * @device_id: (not nullable): the device ID * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets the results of a previous firmware update for a specific device. @@ -2888,7 +2888,7 @@ fwupd_client_install_stream_async(FwupdClient *self, * @bytes: cabinet archive * @install_flags: install flags, e.g. %FWUPD_INSTALL_FLAG_ALLOW_REINSTALL * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Install firmware onto a specific device. @@ -2971,7 +2971,7 @@ fwupd_client_install_bytes_finish(FwupdClient *self, GAsyncResult *res, GError * * @filename: the filename to install * @install_flags: install flags, e.g. %FWUPD_INSTALL_FLAG_ALLOW_REINSTALL * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Install firmware onto a specific device. @@ -3271,7 +3271,7 @@ fwupd_client_filter_locations(GPtrArray *locations, * @install_flags: install flags, e.g. %FWUPD_INSTALL_FLAG_ALLOW_REINSTALL * @download_flags: download flags, e.g. %FWUPD_CLIENT_DOWNLOAD_FLAG_DISABLE_IPFS * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Installs a new release on a device, downloading the firmware if required. @@ -3339,7 +3339,7 @@ fwupd_client_install_release2_async(FwupdClient *self, * @release: (not nullable): a release * @install_flags: install flags, e.g. %FWUPD_INSTALL_FLAG_ALLOW_REINSTALL * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Installs a new release on a device, downloading the firmware if required. @@ -3460,7 +3460,7 @@ fwupd_client_get_details_stream_async(FwupdClient *self, * @self: a #FwupdClient * @bytes: firmware archive * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets details about a specific firmware file. @@ -3833,7 +3833,7 @@ fwupd_client_update_metadata_stream_async(FwupdClient *self, * @metadata: XML metadata data * @signature: signature data * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Updates the metadata. This allows a session process to download the metadata @@ -4038,7 +4038,7 @@ fwupd_client_refresh_remote_signature_cb(GObject *source, GAsyncResult *res, gpo * @self: a #FwupdClient * @remote: a #FwupdRemote * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Refreshes a remote by downloading new metadata. @@ -4135,7 +4135,7 @@ fwupd_client_get_remotes_cb(GObject *source, GAsyncResult *res, gpointer user_da * fwupd_client_get_remotes_async: * @self: a #FwupdClient * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets the list of remotes that have been configured for the system. @@ -4219,7 +4219,7 @@ fwupd_client_get_approved_firmware_cb(GObject *source, GAsyncResult *res, gpoint * fwupd_client_get_approved_firmware_async: * @self: a #FwupdClient * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets the list of approved firmware. @@ -4298,7 +4298,7 @@ fwupd_client_set_approved_firmware_cb(GObject *source, GAsyncResult *res, gpoint * @self: a #FwupdClient * @checksums: (element-type utf8): firmware checksums * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Sets the list of approved firmware. @@ -4386,7 +4386,7 @@ fwupd_client_get_blocked_firmware_cb(GObject *source, GAsyncResult *res, gpointe * fwupd_client_get_blocked_firmware_async: * @self: a #FwupdClient * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets the list of blocked firmware. @@ -4465,7 +4465,7 @@ fwupd_client_set_blocked_firmware_cb(GObject *source, GAsyncResult *res, gpointe * @self: a #FwupdClient * @checksums: (element-type utf8): firmware checksums * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Sets the list of blocked firmware. @@ -4548,7 +4548,7 @@ fwupd_client_set_feature_flags_cb(GObject *source, GAsyncResult *res, gpointer u * @self: a #FwupdClient * @feature_flags: feature flags, e.g. %FWUPD_FEATURE_FLAG_UPDATE_TEXT * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Sets the features the client supports. This allows firmware to depend on @@ -4630,7 +4630,7 @@ fwupd_client_self_sign_cb(GObject *source, GAsyncResult *res, gpointer user_data * @value: a string to sign, typically a JSON blob * @flags: signing flags, e.g. %FWUPD_SELF_SIGN_FLAG_ADD_TIMESTAMP * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Signs the data using the client self-signed certificate. @@ -4727,7 +4727,7 @@ fwupd_client_modify_remote_cb(GObject *source, GAsyncResult *res, gpointer user_ * @key: the key, e.g. `Enabled` * @value: the key, e.g. `true` * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Modifies a system remote in a specific way. @@ -4811,7 +4811,7 @@ fwupd_client_modify_device_cb(GObject *source, GAsyncResult *res, gpointer user_ * @key: (not nullable): the key, e.g. `Flags` * @value: (not nullable): the value, e.g. `reported` * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Modifies a device in a specific way. Not all properties on the #FwupdDevice @@ -4916,7 +4916,7 @@ fwupd_client_get_remote_by_id_cb(GObject *source, GAsyncResult *res, gpointer us * @self: a #FwupdClient * @remote_id: (not nullable): the remote ID, e.g. `lvfs-testing` * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets a specific remote that has been configured for the system. @@ -5275,7 +5275,7 @@ fwupd_client_download_bytes2_async(FwupdClient *self, * @url: (not nullable): the remote URL * @flags: download flags, e.g. %FWUPD_CLIENT_DOWNLOAD_FLAG_NONE * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Downloads data from a remote server. The [method@Client.set_user_agent] function @@ -5384,7 +5384,7 @@ fwupd_client_upload_bytes_thread_cb(GTask *task, * @signature: (nullable): signature string * @flags: download flags, e.g. %FWUPD_CLIENT_DOWNLOAD_FLAG_NONE * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Uploads data to a remote server. The [method@Client.set_user_agent] function @@ -5510,7 +5510,7 @@ fwupd_client_inhibit_cb(GObject *source, GAsyncResult *res, gpointer user_data) * @self: a #FwupdClient * @reason: (not nullable): the inhibit reason, e.g. `user active` * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Marks all devices as unavailable for update. Update is only available if there is no other @@ -5592,7 +5592,7 @@ fwupd_client_uninhibit_cb(GObject *source, GAsyncResult *res, gpointer user_data * @self: a #FwupdClient * @inhibit_id: (not nullable): the inhibit ID * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Removes the inhibit token added by the application. @@ -5691,7 +5691,7 @@ fwupd_client_emulation_load_cb(GObject *source, GAsyncResult *res, gpointer user * @self: a #FwupdClient * @data: archive data of JSON files * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Loads an emulated device into the daemon backend that has the phases set by the JSON data, @@ -5774,7 +5774,7 @@ fwupd_client_emulation_save_cb(GObject *source, GAsyncResult *res, gpointer user * fwupd_client_emulation_save_async: * @self: a #FwupdClient * @cancellable: (nullable): optional #GCancellable - * @callback: the function to run on completion + * @callback: (scope async) (closure callback_data): the function to run on completion * @callback_data: the data to pass to @callback * * Gets the captured data from all filtered devices for all recorded phases. The data is returned diff --git a/libfwupdplugin/fu-archive.c b/libfwupdplugin/fu-archive.c index 5940e363b..7bc41e27b 100644 --- a/libfwupdplugin/fu-archive.c +++ b/libfwupdplugin/fu-archive.c @@ -290,7 +290,7 @@ fu_archive_lookup_by_fn(FuArchive *self, const gchar *fn, GError **error) /** * fu_archive_iterate: * @self: a #FuArchive - * @callback: (scope call): a #FuArchiveIterateFunc. + * @callback: (scope call) (closure user_data): a #FuArchiveIterateFunc. * @user_data: user data * @error: (nullable): optional return location for an error * diff --git a/libfwupdplugin/fu-context.c b/libfwupdplugin/fu-context.c index 8bc10e90f..a1501b091 100644 --- a/libfwupdplugin/fu-context.c +++ b/libfwupdplugin/fu-context.c @@ -730,7 +730,7 @@ fu_context_lookup_quirk_by_id(FuContext *self, const gchar *guid, const gchar *k * fu_context_lookup_quirk_by_id_iter: * @self: a #FuContext * @guid: GUID to lookup - * @iter_cb: (scope async): a function to call for each result + * @iter_cb: (scope call) (closure user_data): a function to call for each result * @user_data: user data passed to @iter_cb * * Looks up all entries in the hardware database using a GUID value. diff --git a/libfwupdplugin/fu-device.c b/libfwupdplugin/fu-device.c index 4a42a75da..34bd2396d 100644 --- a/libfwupdplugin/fu-device.c +++ b/libfwupdplugin/fu-device.c @@ -603,7 +603,7 @@ fu_device_retry_set_delay(FuDevice *self, guint delay) /** * fu_device_retry_full: * @self: a #FuDevice - * @func: (scope async): a function to execute + * @func: (scope async) (closure user_data): a function to execute * @count: the number of tries to try the function * @delay: the delay between each try in ms * @user_data: (nullable): a helper to pass to @func @@ -695,7 +695,7 @@ fu_device_retry_full(FuDevice *self, /** * fu_device_retry: * @self: a #FuDevice - * @func: (scope async): a function to execute + * @func: (scope async) (closure user_data): a function to execute * @count: the number of tries to try the function * @user_data: (nullable): a helper to pass to @func * @error: (nullable): optional return location for an error diff --git a/libfwupdplugin/fu-device.h b/libfwupdplugin/fu-device.h index 0da7e1846..7fba3ec7f 100644 --- a/libfwupdplugin/fu-device.h +++ b/libfwupdplugin/fu-device.h @@ -123,7 +123,7 @@ typedef enum { /** * FuDeviceRetryFunc: * @self: a #FuDevice - * @user_data: user data + * @user_data: (closure): user data * @error: (nullable): optional return location for an error * * The device retry iteration callback. diff --git a/libfwupdplugin/fu-quirks.c b/libfwupdplugin/fu-quirks.c index 71e8a6362..2cc642bd3 100644 --- a/libfwupdplugin/fu-quirks.c +++ b/libfwupdplugin/fu-quirks.c @@ -506,7 +506,7 @@ fu_quirks_lookup_by_id(FuQuirks *self, const gchar *guid, const gchar *key) * fu_quirks_lookup_by_id_iter: * @self: a #FuQuirks * @guid: GUID to lookup - * @iter_cb: (scope async): a function to call for each result + * @iter_cb: (scope call) (closure user_data): a function to call for each result * @user_data: user data passed to @iter_cb * * Looks up all entries in the hardware database using a GUID value. diff --git a/libfwupdplugin/fu-quirks.h b/libfwupdplugin/fu-quirks.h index eb5f4a9aa..d8744acb0 100644 --- a/libfwupdplugin/fu-quirks.h +++ b/libfwupdplugin/fu-quirks.h @@ -35,7 +35,7 @@ typedef enum { * @self: a #FuQuirks * @key: a key * @value: a value - * @user_data: user data + * @user_data: (closure): user data * * The quirks iteration callback. */ diff --git a/libfwupdplugin/fu-string.c b/libfwupdplugin/fu-string.c index ca1060561..5c8cc7d2e 100644 --- a/libfwupdplugin/fu-string.c +++ b/libfwupdplugin/fu-string.c @@ -434,7 +434,7 @@ fu_strsplit(const gchar *str, gsize sz, const gchar *delimiter, gint max_tokens) * @str: a string to split * @sz: size of @str, or -1 for unknown * @delimiter: a string which specifies the places at which to split the string - * @callback: (scope call): a #FuStrsplitFunc. + * @callback: (scope call) (closure user_data): a #FuStrsplitFunc. * @user_data: user data * @error: (nullable): optional return location for an error * diff --git a/libfwupdplugin/fu-string.h b/libfwupdplugin/fu-string.h index 19deca1a6..65e8febaa 100644 --- a/libfwupdplugin/fu-string.h +++ b/libfwupdplugin/fu-string.h @@ -40,7 +40,7 @@ fu_strdup(const gchar *str, gsize bufsz, gsize offset); * FuStrsplitFunc: * @token: a #GString * @token_idx: the token number - * @user_data: user data + * @user_data: (closure): user data * @error: a #GError or NULL * * The fu_strsplit_full() iteration callback. diff --git a/src/fu-spawn.c b/src/fu-spawn.c index 8b332bf2d..cc1443135 100644 --- a/src/fu-spawn.c +++ b/src/fu-spawn.c @@ -12,7 +12,7 @@ typedef struct { FuSpawnOutputHandler handler_cb; - gpointer handler_user_data; + gpointer user_data; GMainLoop *loop; GSource *source; GInputStream *stream; @@ -56,7 +56,7 @@ fu_spawn_source_pollable_cb(GObject *stream, gpointer user_data) for (guint i = 0; split[i] != NULL; i++) { if (split[i][0] == '\0') continue; - helper->handler_cb(split[i], helper->handler_user_data); + helper->handler_cb(split[i], helper->user_data); } } @@ -122,8 +122,8 @@ fu_spawn_cancelled_cb(GCancellable *cancellable, FuSpawnHelper *helper) /** * fu_spawn_sync: * @argv: the argument list to run - * @handler_cb: (scope call) (nullable): optional #FuSpawnOutputHandler - * @handler_user_data: (nullable): the user data to pass to @handler_cb + * @handler_cb: (scope call) (closure user_data) (nullable): optional #FuSpawnOutputHandler + * @user_data: (nullable): the user data to pass to @handler_cb * @timeout_ms: a timeout in ms, or 0 for no limit * @cancellable: (nullable): optional #GCancellable * @error: (nullable): optional return location for an error @@ -138,7 +138,7 @@ fu_spawn_cancelled_cb(GCancellable *cancellable, FuSpawnHelper *helper) gboolean fu_spawn_sync(const gchar *const *argv, FuSpawnOutputHandler handler_cb, - gpointer handler_user_data, + gpointer user_data, guint timeout_ms, GCancellable *cancellable, GError **error) @@ -168,7 +168,7 @@ fu_spawn_sync(const gchar *const *argv, /* watch for process to exit */ helper = g_new0(FuSpawnHelper, 1); helper->handler_cb = handler_cb; - helper->handler_user_data = handler_user_data; + helper->user_data = user_data; helper->loop = g_main_loop_new(NULL, FALSE); helper->stream = g_subprocess_get_stdout_pipe(subprocess); diff --git a/src/fu-spawn.h b/src/fu-spawn.h index cb9992b55..55f3b2243 100644 --- a/src/fu-spawn.h +++ b/src/fu-spawn.h @@ -11,7 +11,7 @@ /** * FuSpawnOutputHandler: * @line: text data - * @user_data: user data + * @user_data: (closure): user data * * The process spawn iteration callback. */ @@ -20,7 +20,7 @@ typedef void (*FuSpawnOutputHandler)(const gchar *line, gpointer user_data); gboolean fu_spawn_sync(const gchar *const *argv, FuSpawnOutputHandler handler_cb, - gpointer handler_user_data, + gpointer user_data, guint timeout_ms, GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT;