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__)
69 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
71 #if defined(interface)
74 #if !defined(__CYGWIN__)
79 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
80 #define LIBUSB_DEPRECATED_FOR(f) \
81 __attribute__((deprecated("Use " #f " instead")))
83 #define LIBUSB_DEPRECATED_FOR(f)
118 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
119 #define LIBUSB_CALL WINAPI
147 #define LIBUSBX_API_VERSION 0x01000102
167 _tmp.b8[1] = (uint8_t) (x >> 8);
168 _tmp.b8[0] = (uint8_t) (x & 0xff);
180 #define libusb_le16_to_cpu libusb_cpu_to_le16
210 LIBUSB_CLASS_IMAGE = 6,
290 #define LIBUSB_DT_DEVICE_SIZE 18
291 #define LIBUSB_DT_CONFIG_SIZE 9
292 #define LIBUSB_DT_INTERFACE_SIZE 9
293 #define LIBUSB_DT_ENDPOINT_SIZE 7
294 #define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9
295 #define LIBUSB_DT_HUB_NONVAR_SIZE 7
296 #define LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE 6
297 #define LIBUSB_DT_BOS_SIZE 5
298 #define LIBUSB_DT_DEVICE_CAPABILITY_SIZE 3
301 #define LIBUSB_BT_USB_2_0_EXTENSION_SIZE 7
302 #define LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE 10
303 #define LIBUSB_BT_CONTAINER_ID_SIZE 20
306 #define LIBUSB_DT_BOS_MAX_SIZE ((LIBUSB_DT_BOS_SIZE) +\
307 (LIBUSB_BT_USB_2_0_EXTENSION_SIZE) +\
308 (LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE) +\
309 (LIBUSB_BT_CONTAINER_ID_SIZE))
311 #define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f
312 #define LIBUSB_ENDPOINT_DIR_MASK 0x80
326 #define LIBUSB_TRANSFER_TYPE_MASK 0x03
430 #define LIBUSB_ISO_SYNC_TYPE_MASK 0x0C
451 #define LIBUSB_ISO_USAGE_TYPE_MASK 0x30
729 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
760 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
890 #define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup))
897 struct libusb_hotplug_callback;
1099 #define LIBUSB_ERROR_COUNT 14
1254 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
1293 LIBUSB_LOG_LEVEL_NONE = 0,
1294 LIBUSB_LOG_LEVEL_ERROR,
1295 LIBUSB_LOG_LEVEL_WARNING,
1296 LIBUSB_LOG_LEVEL_INFO,
1297 LIBUSB_LOG_LEVEL_DEBUG,
1363 unsigned char endpoint);
1365 unsigned char endpoint);
1374 int interface_number);
1376 int interface_number);
1382 int interface_number,
int alternate_setting);
1384 unsigned char endpoint);
1388 int interface_number);
1390 int interface_number);
1392 int interface_number);
1413 return transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE;
1512 transfer->
buffer = buffer;
1514 transfer->
length = (int) (LIBUSB_CONTROL_SETUP_SIZE
1536 void *user_data,
unsigned int timeout)
1542 transfer->
buffer = buffer;
1543 transfer->
length = length;
1563 unsigned char endpoint,
unsigned char *buffer,
int length,
1570 transfer->
buffer = buffer;
1571 transfer->
length = length;
1592 unsigned char *buffer,
int length,
int num_iso_packets,
1599 transfer->
buffer = buffer;
1600 transfer->
length = length;
1648 if (packet > INT_MAX)
1650 _packet = (int) packet;
1655 for (i = 0; i < _packet; i++)
1658 return transfer->
buffer + offset;
1688 if (packet > INT_MAX)
1690 _packet = (int) packet;
1702 unsigned char *data, uint16_t
wLength,
unsigned int timeout);
1705 unsigned char endpoint,
unsigned char *data,
int length,
1706 int *actual_length,
unsigned int timeout);
1709 unsigned char endpoint,
unsigned char *data,
int length,
1710 int *actual_length,
unsigned int timeout);
1725 uint8_t desc_type, uint8_t desc_index,
unsigned char *data,
int length)
1729 0, data, (uint16_t) length, 1000);
1747 uint8_t desc_index, uint16_t langid,
unsigned char *data,
int length)
1751 langid, data, (uint16_t) length, 1000);
1755 uint8_t desc_index,
unsigned char *data,
int length);
1769 struct timeval *tv);
1771 struct timeval *tv,
int *completed);
1775 struct timeval *tv);
1778 struct timeval *tv);
1865 #define LIBUSB_HOTPLUG_MATCH_ANY -1
1931 int vendor_id,
int product_id,
1935 libusb_hotplug_callback_handle *handle);
1949 libusb_hotplug_callback_handle handle);