From 7b2cd2fbded8456dc5ee6021a5e74e24f325fe2f Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Tue, 24 Jan 2023 13:54:14 +0000 Subject: Add g_usb_device_get_tags() for future use --- gusb/gusb-device.c | 18 ++++++++++++++++++ gusb/gusb-device.h | 2 ++ gusb/libgusb.ver | 1 + 3 files changed, 21 insertions(+) diff --git a/gusb/gusb-device.c b/gusb/gusb-device.c index 90f1539..ba777f6 100644 --- a/gusb/gusb-device.c +++ b/gusb/gusb-device.c @@ -448,6 +448,24 @@ _g_usb_device_save(GUsbDevice *self, JsonBuilder *json_builder, GError **error) return TRUE; } +/** + * g_usb_device_get_tags: + * @self: a #GUsbDevice + * + * Gets all the tags. + * + * Returns: (transfer container) (element-type utf8): string tags + * + * Since: 0.4.4 + **/ +GPtrArray * +g_usb_device_get_tags(GUsbDevice *self) +{ + GUsbDevicePrivate *priv = GET_PRIVATE(self); + g_return_val_if_fail(G_USB_IS_DEVICE(self), NULL); + return g_ptr_array_ref(priv->tags); +} + /** * g_usb_device_has_tag: * @self: a #GUsbDevice diff --git a/gusb/gusb-device.h b/gusb/gusb-device.h index 124dd57..17621e3 100644 --- a/gusb/gusb-device.h +++ b/gusb/gusb-device.h @@ -178,6 +178,8 @@ void g_usb_device_remove_tag(GUsbDevice *self, const gchar *tag); gboolean g_usb_device_has_tag(GUsbDevice *self, const gchar *tag); +GPtrArray * +g_usb_device_get_tags(GUsbDevice *self); guint8 g_usb_device_get_configuration_index(GUsbDevice *self); diff --git a/gusb/libgusb.ver b/gusb/libgusb.ver index 59c311c..92655a5 100644 --- a/gusb/libgusb.ver +++ b/gusb/libgusb.ver @@ -202,6 +202,7 @@ LIBGUSB_0.4.3 { LIBGUSB_0.4.4 { global: + g_usb_device_get_tags; g_usb_device_is_emulated; g_usb_device_remove_tag; local: *; -- cgit v1.2.1