doc: Explain default options in libusb_set_option documentation
authorTormod Volden <debian.tormod@gmail.com>
Sat, 2 Oct 2021 14:34:46 +0000 (16:34 +0200)
committerTormod Volden <debian.tormod@gmail.com>
Mon, 1 Nov 2021 22:22:56 +0000 (23:22 +0100)
References #942

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
libusb/core.c
libusb/libusb.h
libusb/version_nano.h

index e6dca8b..03acdd8 100644 (file)
@@ -2166,6 +2166,9 @@ void API_EXPORTED libusb_set_log_cb(libusb_context *ctx, libusb_log_cb cb,
  * Some options require one or more arguments to be provided. Consult each
  * option's documentation for specific requirements.
  *
+ * If the context ctx is NULL, the option will be added to a list of default
+ * options that will be applied to all subsequently created contexts.
+ *
  * Since version 1.0.22, \ref LIBUSB_API_VERSION >= 0x01000106
  *
  * \param ctx context on which to operate
index 2825b41..7ec3fcf 100644 (file)
@@ -982,8 +982,9 @@ struct libusb_version {
  * Sessions are created by libusb_init() and destroyed through libusb_exit().
  * If your application is guaranteed to only ever include a single libusb
  * user (i.e. you), you do not have to worry about contexts: pass NULL in
- * every function call where a context is required. The default context
- * will be used.
+ * every function call where a context is required, and the default context
+ * will be used. Note that libusb_set_option(NULL, ...) is special, and adds
+ * an option to a list of default options for new contexts.
  *
  * For more information, see \ref libusb_contexts.
  */
index af4599a..bb7f8c0 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11667
+#define LIBUSB_NANO 11668