summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2023-01-25 12:07:27 +0000
committerRichard Hughes <richard@hughsie.com>2023-01-25 14:38:48 +0000
commit8a671b4b51d1841b333e0b7cb7c811b58bbe20dc (patch)
treee0443386f7561e1c09cc405d654e127e006c6eb4
parentce7e4fba5766b86630499f7568d60d85857b6425 (diff)
downloadgusb-8a671b4b51d1841b333e0b7cb7c811b58bbe20dc.tar.gz
Add g_usb_device_clear_events() for future use
-rw-r--r--gusb/gusb-device.c16
-rw-r--r--gusb/gusb-device.h2
-rw-r--r--gusb/libgusb.ver1
3 files changed, 19 insertions, 0 deletions
diff --git a/gusb/gusb-device.c b/gusb/gusb-device.c
index ba777f6..db3a79c 100644
--- a/gusb/gusb-device.c
+++ b/gusb/gusb-device.c
@@ -1100,6 +1100,22 @@ g_usb_device_get_events(GUsbDevice *self)
}
/**
+ * g_usb_device_clear_events:
+ * @self: a #GUsbDevice
+ *
+ * Clear all the events saved by the device.
+ *
+ * Since: 0.4.4
+ **/
+void
+g_usb_device_clear_events(GUsbDevice *self)
+{
+ GUsbDevicePrivate *priv = GET_PRIVATE(self);
+ g_return_if_fail(G_USB_IS_DEVICE(self));
+ g_ptr_array_set_size(priv->events, 0);
+}
+
+/**
* g_usb_device_invalidate:
* @self: a #GUsbDevice
*
diff --git a/gusb/gusb-device.h b/gusb/gusb-device.h
index 17621e3..7d034a1 100644
--- a/gusb/gusb-device.h
+++ b/gusb/gusb-device.h
@@ -207,6 +207,8 @@ g_usb_device_get_interfaces(GUsbDevice *self, GError **error);
GPtrArray *
g_usb_device_get_events(GUsbDevice *self);
+void
+g_usb_device_clear_events(GUsbDevice *self);
GPtrArray *
g_usb_device_get_bos_descriptors(GUsbDevice *self, GError **error);
diff --git a/gusb/libgusb.ver b/gusb/libgusb.ver
index 92655a5..2e85f0b 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_clear_events;
g_usb_device_get_tags;
g_usb_device_is_emulated;
g_usb_device_remove_tag;