Core: update version struct for ABI compatibility
authorPete Batard <pete@akeo.ie>
Wed, 25 Apr 2012 23:30:57 +0000 (00:30 +0100)
committerPete Batard <pete@akeo.ie>
Wed, 25 Apr 2012 23:39:17 +0000 (00:39 +0100)
* Adds a static string for describe
* Also update version documentation

libusb/core.c
libusb/libusb.h
libusb/version.h

index b50af56..1a95dd4 100644 (file)
@@ -43,7 +43,8 @@ const struct usbi_os_backend * const usbi_backend = &windows_backend;
 
 struct libusb_context *usbi_default_context = NULL;
 const struct libusb_version libusb_version_internal =
-       { LIBUSB_MAJOR, LIBUSB_MINOR, LIBUSB_MICRO, LIBUSB_NANO};
+       { LIBUSB_MAJOR, LIBUSB_MINOR, LIBUSB_MICRO, LIBUSB_NANO,
+         LIBUSB_RC, "unused - please use the nano" };
 static int default_context_refcnt = 0;
 static usbi_mutex_static_t default_context_lock = USBI_MUTEX_INITIALIZER;
 
@@ -1764,8 +1765,8 @@ DEFAULT_VISIBILITY const char * LIBUSB_CALL libusb_error_name(int error_code)
 }
 
 /** \ingroup misc
- * Fills a libusb_version struct with the full version (major, minor,
- * micro, nano) of this library
+ * Returns a pointer to const struct libusb_version with the version
+ * (major, minor, micro, nano and rc) of the running library.
  */
 DEFAULT_VISIBILITY
 const struct libusb_version * LIBUSB_CALL libusb_get_version(void)
index da4683c..3e91275 100644 (file)
@@ -639,13 +639,26 @@ struct libusb_device;
 struct libusb_device_handle;
 
 /** \ingroup lib
- * Structure providing the version of libusbx currently in use
+ * Structure providing the version of the libusbx runtime
  */
 struct libusb_version {
-       uint16_t major;
-       uint16_t minor;
-       uint16_t micro;
-       uint16_t nano;
+       /** Library major version. */
+       const uint16_t major;
+
+       /** Library minor version. */
+       const uint16_t minor;
+
+       /** Library micro version. */
+       const uint16_t micro;
+
+       /** Library nano version. */
+       const uint16_t nano;
+
+       /** Library release candidate suffix string, e.g. "-rc4". */
+       const char *rc;
+
+       /** For ABI compatibility only. */
+       const char* describe;
 };
 
 /** \ingroup lib
index 583e128..e20a303 100644 (file)
@@ -9,7 +9,7 @@
 #define LIBUSB_MICRO 10
 #endif
 #ifndef LIBUSB_NANO
-#define LIBUSB_NANO 10484
+#define LIBUSB_NANO 10485
 #endif
 /* LIBUSB_RC is the release candidate suffix. Should normally be empty. */
 #ifndef LIBUSB_RC