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 LIBUSB_API_VERSION 0x01000102
150 #define LIBUSBX_API_VERSION LIBUSB_API_VERSION
170 _tmp.b8[1] = (uint8_t) (x >> 8);
171 _tmp.b8[0] = (uint8_t) (x & 0xff);
183 #define libusb_le16_to_cpu libusb_cpu_to_le16
213 LIBUSB_CLASS_IMAGE = 6,
293 #define LIBUSB_DT_DEVICE_SIZE 18
294 #define LIBUSB_DT_CONFIG_SIZE 9
295 #define LIBUSB_DT_INTERFACE_SIZE 9
296 #define LIBUSB_DT_ENDPOINT_SIZE 7
297 #define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9
298 #define LIBUSB_DT_HUB_NONVAR_SIZE 7
299 #define LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE 6
300 #define LIBUSB_DT_BOS_SIZE 5
301 #define LIBUSB_DT_DEVICE_CAPABILITY_SIZE 3
304 #define LIBUSB_BT_USB_2_0_EXTENSION_SIZE 7
305 #define LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE 10
306 #define LIBUSB_BT_CONTAINER_ID_SIZE 20
309 #define LIBUSB_DT_BOS_MAX_SIZE ((LIBUSB_DT_BOS_SIZE) +\
310 (LIBUSB_BT_USB_2_0_EXTENSION_SIZE) +\
311 (LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE) +\
312 (LIBUSB_BT_CONTAINER_ID_SIZE))
314 #define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f
315 #define LIBUSB_ENDPOINT_DIR_MASK 0x80
329 #define LIBUSB_TRANSFER_TYPE_MASK 0x03
433 #define LIBUSB_ISO_SYNC_TYPE_MASK 0x0C
454 #define LIBUSB_ISO_USAGE_TYPE_MASK 0x30
732 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
763 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
893 #define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup))
900 struct libusb_hotplug_callback;
1102 #define LIBUSB_ERROR_COUNT 14
1257 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
1296 LIBUSB_LOG_LEVEL_NONE = 0,
1297 LIBUSB_LOG_LEVEL_ERROR,
1298 LIBUSB_LOG_LEVEL_WARNING,
1299 LIBUSB_LOG_LEVEL_INFO,
1300 LIBUSB_LOG_LEVEL_DEBUG,
1366 unsigned char endpoint);
1368 unsigned char endpoint);
1377 int interface_number);
1379 int interface_number);
1385 int interface_number,
int alternate_setting);
1387 unsigned char endpoint);
1391 int interface_number);
1393 int interface_number);
1395 int interface_number);
1416 return transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE;
1515 transfer->
buffer = buffer;
1517 transfer->
length = (int) (LIBUSB_CONTROL_SETUP_SIZE
1539 void *user_data,
unsigned int timeout)
1545 transfer->
buffer = buffer;
1546 transfer->
length = length;
1566 unsigned char endpoint,
unsigned char *buffer,
int length,
1573 transfer->
buffer = buffer;
1574 transfer->
length = length;
1595 unsigned char *buffer,
int length,
int num_iso_packets,
1602 transfer->
buffer = buffer;
1603 transfer->
length = length;
1651 if (packet > INT_MAX)
1653 _packet = (int) packet;
1658 for (i = 0; i < _packet; i++)
1661 return transfer->
buffer + offset;
1691 if (packet > INT_MAX)
1693 _packet = (int) packet;
1705 unsigned char *data, uint16_t
wLength,
unsigned int timeout);
1708 unsigned char endpoint,
unsigned char *data,
int length,
1709 int *actual_length,
unsigned int timeout);
1712 unsigned char endpoint,
unsigned char *data,
int length,
1713 int *actual_length,
unsigned int timeout);
1728 uint8_t desc_type, uint8_t desc_index,
unsigned char *data,
int length)
1732 0, data, (uint16_t) length, 1000);
1750 uint8_t desc_index, uint16_t langid,
unsigned char *data,
int length)
1754 langid, data, (uint16_t) length, 1000);
1758 uint8_t desc_index,
unsigned char *data,
int length);
1772 struct timeval *tv);
1774 struct timeval *tv,
int *completed);
1778 struct timeval *tv);
1781 struct timeval *tv);
1868 #define LIBUSB_HOTPLUG_MATCH_ANY -1
1934 int vendor_id,
int product_id,
1938 libusb_hotplug_callback_handle *handle);
1952 libusb_hotplug_callback_handle handle);