Examples: Fix device leak in hotplugtest
[platform/upstream/libusb.git] / libusb / hotplug.h
index 614ddbc..2bec81b 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- Mode: C; indent-tabs-mode:t ; c-basic-offset:8 -*- */
 /*
- * Hotplug support for libusbx
+ * Hotplug support for libusb
  * Copyright © 2012-2013 Nathan Hjelm <hjelmn@mac.com>
  * Copyright © 2012-2013 Peter Stuge <peter@stuge.se>
  *
@@ -69,8 +69,14 @@ struct libusb_hotplug_callback {
 typedef struct libusb_hotplug_callback libusb_hotplug_callback;
 
 struct libusb_hotplug_message {
+       /** The hotplug event that occurred */
        libusb_hotplug_event event;
+
+       /** The device for which this hotplug event occurred */
        struct libusb_device *device;
+
+       /** List this message is contained in (ctx->hotplug_msgs) */
+       struct list_head list;
 };
 
 typedef struct libusb_hotplug_message libusb_hotplug_message;
@@ -78,5 +84,7 @@ typedef struct libusb_hotplug_message libusb_hotplug_message;
 void usbi_hotplug_deregister_all(struct libusb_context *ctx);
 void usbi_hotplug_match(struct libusb_context *ctx, struct libusb_device *dev,
                        libusb_hotplug_event event);
+void usbi_hotplug_notification(struct libusb_context *ctx, struct libusb_device *dev,
+                       libusb_hotplug_event event);
 
 #endif