ctx->debug = (enum libusb_log_level)arg;
#endif
break;
+ /* Handle all backend-specific options here */
+#if 0
+ /* This code is compiled out until the first backend-specific option is
+ * added to the library. When this time comes, remove the #if/#endif
+ * lines and this comment, then replace the case statement with the
+ * valid option name. */
+ case LIBUSB_OPTION_<...>:
+ if (usbi_backend.set_option)
+ r = usbi_backend.set_option(ctx, option, ap);
+ else
+ r = LIBUSB_ERROR_NOT_SUPPORTED;
+ break;
+#endif
default:
r = LIBUSB_ERROR_INVALID_PARAM;
}
*/
void (*exit)(struct libusb_contex *ctx);
+ /* Set a backend-specific option. Optional.
+ *
+ * This function is called when the user calls libusb_set_option() and
+ * the option is not handled by the core library.
+ *
+ * Return 0 on success, or a LIBUSB_ERROR code on failure.
+ */
+ int (*set_option)(struct libusb_context *ctx, enum libusb_option option,
+ va_list args);
+
/* Enumerate all the USB devices on the system, returning them in a list
* of discovered devices.
*
/*.caps =*/ 0,
/*.init =*/ haiku_init,
/*.exit =*/ haiku_exit,
+ /*.set_option =*/ NULL,
/*.get_device_list =*/ NULL,
/*.hotplug_poll =*/ NULL,
/*.open =*/ haiku_open,
0,
NULL, /* init() */
NULL, /* exit() */
+ NULL, /* set_option() */
netbsd_get_device_list,
NULL, /* hotplug_poll */
netbsd_open,
0,
NULL, /* init() */
NULL, /* exit() */
+ NULL, /* set_option() */
obsd_get_device_list,
NULL, /* hotplug_poll */
obsd_open,
0,
wince_init,
wince_exit,
+ NULL, /* set_option() */
wince_get_device_list,
NULL, /* hotplug_poll */
USBI_CAP_HAS_HID_ACCESS,
usbdk_init,
usbdk_exit,
+ NULL, // set_option()
usbdk_get_device_list,
NULL,
USBI_CAP_HAS_HID_ACCESS,
windows_init,
windows_exit,
+ NULL, /* set_option */
windows_get_device_list,
NULL, /* hotplug_poll */
-#define LIBUSB_NANO 11212
+#define LIBUSB_NANO 11213