29 #if !defined(__cplusplus)
30 #define inline __inline
33 #ifndef _SSIZE_T_DEFINED
34 #define _SSIZE_T_DEFINED
37 typedef __int64 ssize_t;
45 #if defined(_MSC_VER) && (_MSC_VER < 1600) && (!defined(_STDINT)) && (!defined(_STDINT_H))
46 typedef unsigned __int8 uint8_t;
47 typedef unsigned __int16 uint16_t;
48 typedef unsigned __int32 uint32_t;
53 #if !defined(_WIN32_WCE)
54 #include <sys/types.h>
57 #if defined(__linux__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__HAIKU__)
64 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
65 #define ZERO_SIZED_ARRAY
67 #define ZERO_SIZED_ARRAY 0
75 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
77 #if defined(interface)
80 #if !defined(__CYGWIN__)
85 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
86 #define LIBUSB_DEPRECATED_FOR(f) \
87 __attribute__((deprecated("Use " #f " instead")))
89 #define LIBUSB_DEPRECATED_FOR(f) __attribute__((deprecated))
91 #define LIBUSB_DEPRECATED_FOR(f)
126 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
127 #define LIBUSB_CALL WINAPI
152 #define LIBUSB_API_VERSION 0x01000107
155 #define LIBUSBX_API_VERSION LIBUSB_API_VERSION
175 _tmp.b8[1] = (uint8_t) (x >> 8);
176 _tmp.b8[0] = (uint8_t) (x & 0xff);
188 #define libusb_le16_to_cpu libusb_cpu_to_le16
218 LIBUSB_CLASS_IMAGE = 6,
298 #define LIBUSB_DT_DEVICE_SIZE 18
299 #define LIBUSB_DT_CONFIG_SIZE 9
300 #define LIBUSB_DT_INTERFACE_SIZE 9
301 #define LIBUSB_DT_ENDPOINT_SIZE 7
302 #define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9
303 #define LIBUSB_DT_HUB_NONVAR_SIZE 7
304 #define LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE 6
305 #define LIBUSB_DT_BOS_SIZE 5
306 #define LIBUSB_DT_DEVICE_CAPABILITY_SIZE 3
309 #define LIBUSB_BT_USB_2_0_EXTENSION_SIZE 7
310 #define LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE 10
311 #define LIBUSB_BT_CONTAINER_ID_SIZE 20
314 #define LIBUSB_DT_BOS_MAX_SIZE ((LIBUSB_DT_BOS_SIZE) +\
315 (LIBUSB_BT_USB_2_0_EXTENSION_SIZE) +\
316 (LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE) +\
317 (LIBUSB_BT_CONTAINER_ID_SIZE))
319 #define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f
320 #define LIBUSB_ENDPOINT_DIR_MASK 0x80
334 #define LIBUSB_TRANSFER_TYPE_MASK 0x03
441 #define LIBUSB_ISO_SYNC_TYPE_MASK 0x0C
462 #define LIBUSB_ISO_USAGE_TYPE_MASK 0x30
891 #define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup))
1102 #define LIBUSB_ERROR_COUNT 14
1291 LIBUSB_LOG_LEVEL_NONE = 0,
1292 LIBUSB_LOG_LEVEL_ERROR = 1,
1293 LIBUSB_LOG_LEVEL_WARNING = 2,
1294 LIBUSB_LOG_LEVEL_INFO = 3,
1295 LIBUSB_LOG_LEVEL_DEBUG = 4,
1387 unsigned char endpoint);
1389 unsigned char endpoint);
1399 int interface_number);
1401 int interface_number);
1407 int interface_number,
int alternate_setting);
1409 unsigned char endpoint);
1413 uint32_t num_streams,
unsigned char *endpoints,
int num_endpoints);
1415 unsigned char *endpoints,
int num_endpoints);
1420 unsigned char *buffer,
size_t length);
1423 int interface_number);
1425 int interface_number);
1427 int interface_number);
1448 return transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE;
1551 transfer->
buffer = buffer;
1553 transfer->
length = (int) (LIBUSB_CONTROL_SETUP_SIZE
1575 void *user_data,
unsigned int timeout)
1581 transfer->
buffer = buffer;
1582 transfer->
length = length;
1605 unsigned char endpoint, uint32_t stream_id,
1607 void *user_data,
unsigned int timeout)
1610 length, callback, user_data, timeout);
1630 unsigned char endpoint,
unsigned char *buffer,
int length,
1637 transfer->
buffer = buffer;
1638 transfer->
length = length;
1659 unsigned char *buffer,
int length,
int num_iso_packets,
1666 transfer->
buffer = buffer;
1667 transfer->
length = length;
1715 if (packet > INT_MAX)
1717 _packet = (int) packet;
1722 for (i = 0; i < _packet; i++)
1725 return transfer->
buffer + offset;
1755 if (packet > INT_MAX)
1757 _packet = (int) packet;
1769 unsigned char *data, uint16_t
wLength,
unsigned int timeout);
1772 unsigned char endpoint,
unsigned char *data,
int length,
1773 int *actual_length,
unsigned int timeout);
1776 unsigned char endpoint,
unsigned char *data,
int length,
1777 int *actual_length,
unsigned int timeout);
1792 uint8_t desc_type, uint8_t desc_index,
unsigned char *data,
int length)
1796 0, data, (uint16_t) length, 1000);
1814 uint8_t desc_index, uint16_t langid,
unsigned char *data,
int length)
1818 langid, data, (uint16_t) length, 1000);
1822 uint8_t desc_index,
unsigned char *data,
int length);
1837 struct timeval *tv);
1839 struct timeval *tv,
int *completed);
1843 struct timeval *tv);
1846 struct timeval *tv);
1937 #define LIBUSB_HOTPLUG_MATCH_ANY -1
2003 int vendor_id,
int product_id,
2007 libusb_hotplug_callback_handle *callback_handle);
2021 libusb_hotplug_callback_handle callback_handle);