28 #define inline __inline
30 #ifndef _SSIZE_T_DEFINED
31 #define _SSIZE_T_DEFINED
34 typedef __int64 ssize_t;
42 #if defined(_MSC_VER) && (_MSC_VER < 1600) && (!defined(_STDINT)) && (!defined(_STDINT_H))
43 typedef unsigned __int8 uint8_t;
44 typedef unsigned __int16 uint16_t;
45 typedef unsigned __int32 uint32_t;
50 #include <sys/types.h>
54 #if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__)
63 #if defined(_WIN32) || defined(__CYGWIN__)
65 #if defined(interface)
102 #if defined(_WIN32) || defined(__CYGWIN__)
103 #define LIBUSB_CALL WINAPI
120 static inline uint16_t libusb_cpu_to_le16(
const uint16_t x)
127 _tmp.b8[0] = x & 0xff;
139 #define libusb_le16_to_cpu libusb_cpu_to_le16
169 LIBUSB_CLASS_IMAGE = 6,
237 #define LIBUSB_DT_DEVICE_SIZE 18
238 #define LIBUSB_DT_CONFIG_SIZE 9
239 #define LIBUSB_DT_INTERFACE_SIZE 9
240 #define LIBUSB_DT_ENDPOINT_SIZE 7
241 #define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9
242 #define LIBUSB_DT_HUB_NONVAR_SIZE 7
244 #define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f
245 #define LIBUSB_ENDPOINT_DIR_MASK 0x80
259 #define LIBUSB_TRANSFER_TYPE_MASK 0x03
356 #define LIBUSB_ISO_SYNC_TYPE_MASK 0x0C
377 #define LIBUSB_ISO_USAGE_TYPE_MASK 0x30
635 #define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup))
936 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
986 unsigned char endpoint);
988 unsigned char endpoint);
997 int interface_number);
999 int interface_number);
1005 int interface_number,
int alternate_setting);
1007 unsigned char endpoint);
1011 int interface_number);
1013 int interface_number);
1015 int interface_number);
1034 return transfer->
buffer + LIBUSB_CONTROL_SETUP_SIZE;
1084 setup->
wValue = libusb_cpu_to_le16(wValue);
1085 setup->
wIndex = libusb_cpu_to_le16(wIndex);
1086 setup->
wLength = libusb_cpu_to_le16(wLength);
1131 transfer->
buffer = buffer;
1133 transfer->
length = LIBUSB_CONTROL_SETUP_SIZE
1155 void *user_data,
unsigned int timeout)
1161 transfer->
buffer = buffer;
1162 transfer->
length = length;
1182 unsigned char endpoint,
unsigned char *buffer,
int length,
1189 transfer->
buffer = buffer;
1190 transfer->
length = length;
1211 unsigned char *buffer,
int length,
int num_iso_packets,
1218 transfer->
buffer = buffer;
1219 transfer->
length = length;
1267 if (packet > INT_MAX)
1274 for (i = 0; i < _packet; i++)
1277 return transfer->
buffer + offset;
1307 if (packet > INT_MAX)
1321 unsigned char *data, uint16_t
wLength,
unsigned int timeout);
1324 unsigned char endpoint,
unsigned char *data,
int length,
1325 int *actual_length,
unsigned int timeout);
1328 unsigned char endpoint,
unsigned char *data,
int length,
1329 int *actual_length,
unsigned int timeout);
1344 uint8_t desc_type, uint8_t desc_index,
unsigned char *data,
int length)
1348 (uint16_t) length, 1000);
1366 uint8_t desc_index, uint16_t langid,
unsigned char *data,
int length)
1370 langid, data, (uint16_t) length, 1000);
1374 uint8_t desc_index,
unsigned char *data,
int length);
1388 struct timeval *tv);
1390 struct timeval *tv,
int *completed);
1394 struct timeval *tv);
1397 struct timeval *tv);