diff options
author | Hans de Goede <hdegoede@redhat.com> | 2013-05-17 10:36:32 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2013-05-17 10:36:32 +0200 |
commit | 4d7789be7e317fb2e89557f959c1a1a69cc01b26 (patch) | |
tree | 8b0ce23db030bd57435d8b741cf910e718de067f /libusb/libusb.h | |
parent | fa27f99772e9200d97518fe2aa7332e892949132 (diff) | |
download | android_external_libusbx-4d7789be7e317fb2e89557f959c1a1a69cc01b26.tar.gz android_external_libusbx-4d7789be7e317fb2e89557f959c1a1a69cc01b26.tar.bz2 android_external_libusbx-4d7789be7e317fb2e89557f959c1a1a69cc01b26.zip |
core: Add a new public libusb_get_port_numbers function
This new function replaces the now deprecated libusb_get_port_path function,
as that is the only function operating on a libusb_device which also takes
a libusb_context, which is rather inconsistent.
Note we will keep libusb_get_port_path around in the 1.0.x for the forseeable
future for ABI compatibility reasons, but it should not be used in any new
code.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'libusb/libusb.h')
-rw-r--r-- | libusb/libusb.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libusb/libusb.h b/libusb/libusb.h index 6915875..a67cbcb 100644 --- a/libusb/libusb.h +++ b/libusb/libusb.h @@ -76,6 +76,13 @@ typedef unsigned __int32 uint32_t; #endif #endif +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +#define LIBUSB_DEPRECATED_FOR(f) \ + __attribute__((deprecated("Use " #f " instead"))) +#else +#define LIBUSB_DEPRECATED_FOR(f) +#endif /* __GNUC__ */ + /** \def LIBUSB_CALL * \ingroup misc * libusbx's Windows calling convention. @@ -1055,8 +1062,10 @@ void LIBUSB_CALL libusb_free_config_descriptor( struct libusb_config_descriptor *config); uint8_t LIBUSB_CALL libusb_get_bus_number(libusb_device *dev); uint8_t LIBUSB_CALL libusb_get_port_number(libusb_device *dev); -libusb_device * LIBUSB_CALL libusb_get_parent(libusb_device *dev); +int LIBUSB_CALL libusb_get_port_numbers(libusb_device *dev, uint8_t* port_numbers, int port_numbers_len); +LIBUSB_DEPRECATED_FOR(libusb_get_port_numbers) int LIBUSB_CALL libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t* path, uint8_t path_length); +libusb_device * LIBUSB_CALL libusb_get_parent(libusb_device *dev); uint8_t LIBUSB_CALL libusb_get_device_address(libusb_device *dev); int LIBUSB_CALL libusb_get_device_speed(libusb_device *dev); int LIBUSB_CALL libusb_get_max_packet_size(libusb_device *dev, |