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 0x01000103
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
436 #define LIBUSB_ISO_SYNC_TYPE_MASK 0x0C
457 #define LIBUSB_ISO_USAGE_TYPE_MASK 0x30
735 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
766 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
896 #define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup))
903 struct libusb_hotplug_callback;
1105 #define LIBUSB_ERROR_COUNT 14
1260 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
1299 LIBUSB_LOG_LEVEL_NONE = 0,
1300 LIBUSB_LOG_LEVEL_ERROR,
1301 LIBUSB_LOG_LEVEL_WARNING,
1302 LIBUSB_LOG_LEVEL_INFO,
1303 LIBUSB_LOG_LEVEL_DEBUG,
1369 unsigned char endpoint);
1371 unsigned char endpoint);
1380 int interface_number);
1382 int interface_number);
1388 int interface_number,
int alternate_setting);
1390 unsigned char endpoint);
1394 uint32_t num_streams,
unsigned char *endpoints,
int num_endpoints);
1396 unsigned char *endpoints,
int num_endpoints);
1399 int interface_number);
1401 int interface_number);
1403 int interface_number);
1424 return transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE;
1527 transfer->
buffer = buffer;
1529 transfer->
length = (int) (LIBUSB_CONTROL_SETUP_SIZE
1551 void *user_data,
unsigned int timeout)
1557 transfer->
buffer = buffer;
1558 transfer->
length = length;
1581 unsigned char endpoint, uint32_t stream_id,
1583 void *user_data,
unsigned int timeout)
1586 length, callback, user_data, timeout);
1606 unsigned char endpoint,
unsigned char *buffer,
int length,
1613 transfer->
buffer = buffer;
1614 transfer->
length = length;
1635 unsigned char *buffer,
int length,
int num_iso_packets,
1642 transfer->
buffer = buffer;
1643 transfer->
length = length;
1691 if (packet > INT_MAX)
1693 _packet = (int) packet;
1698 for (i = 0; i < _packet; i++)
1701 return transfer->
buffer + offset;
1731 if (packet > INT_MAX)
1733 _packet = (int) packet;
1745 unsigned char *data, uint16_t
wLength,
unsigned int timeout);
1748 unsigned char endpoint,
unsigned char *data,
int length,
1749 int *actual_length,
unsigned int timeout);
1752 unsigned char endpoint,
unsigned char *data,
int length,
1753 int *actual_length,
unsigned int timeout);
1768 uint8_t desc_type, uint8_t desc_index,
unsigned char *data,
int length)
1772 0, data, (uint16_t) length, 1000);
1790 uint8_t desc_index, uint16_t langid,
unsigned char *data,
int length)
1794 langid, data, (uint16_t) length, 1000);
1798 uint8_t desc_index,
unsigned char *data,
int length);
1812 struct timeval *tv);
1814 struct timeval *tv,
int *completed);
1818 struct timeval *tv);
1821 struct timeval *tv);
1908 #define LIBUSB_HOTPLUG_MATCH_ANY -1
1974 int vendor_id,
int product_id,
1978 libusb_hotplug_callback_handle *handle);
1992 libusb_hotplug_callback_handle handle);