亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? libusbi.h

?? 最新的libusb庫
?? H
?? 第 1 頁 / 共 2 頁
字號:
/* * Internal header for libusb * Copyright (C) 2007-2008 Daniel Drake <dsd@gentoo.org> * Copyright (c) 2001 Johannes Erdfelt <johannes@erdfelt.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */#ifndef __LIBUSBI_H__#define __LIBUSBI_H__#include <config.h>#include <poll.h>#include <pthread.h>#include <stddef.h>#include <time.h>#include <libusb.h>#define DEVICE_DESC_LENGTH		18#define USB_MAXENDPOINTS	32#define USB_MAXINTERFACES	32#define USB_MAXCONFIG		8struct list_head {	struct list_head *prev, *next;};/* Get an entry from the list  * 	ptr - the address of this list_head element in "type"  * 	type - the data type that contains "member" * 	member - the list_head element in "type"  */#define list_entry(ptr, type, member) \	((type *)((char *)(ptr) - (unsigned long)(&((type *)0L)->member)))/* Get each entry from a list *	pos - A structure pointer has a "member" element *	head - list head *	member - the list_head element in "pos" */#define list_for_each_entry(pos, head, member)				\	for (pos = list_entry((head)->next, typeof(*pos), member);	\	     &pos->member != (head);					\	     pos = list_entry(pos->member.next, typeof(*pos), member))#define list_for_each_entry_safe(pos, n, head, member)			\        for (pos = list_entry((head)->next, typeof(*pos), member),	\		n = list_entry(pos->member.next, typeof(*pos), member);	\	     &pos->member != (head);					\	     pos = n, n = list_entry(n->member.next, typeof(*n), member))#define list_empty(entry) ((entry)->next == (entry))static inline void list_init(struct list_head *entry){	entry->prev = entry->next = entry;}static inline void list_add(struct list_head *entry, struct list_head *head){	entry->next = head->next;	entry->prev = head;	head->next->prev = entry;	head->next = entry;}static inline void list_add_tail(struct list_head *entry,	struct list_head *head){	entry->next = head;	entry->prev = head->prev;	head->prev->next = entry;	head->prev = entry;}static inline void list_del(struct list_head *entry){	entry->next->prev = entry->prev;	entry->prev->next = entry->next;}#define container_of(ptr, type, member) ({                      \        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \        (type *)( (char *)__mptr - offsetof(type,member) );})#define MIN(a, b)	((a) < (b) ? (a) : (b))#define MAX(a, b)	((a) > (b) ? (a) : (b))#define TIMESPEC_IS_SET(ts) ((ts)->tv_sec != 0 || (ts)->tv_nsec != 0)enum usbi_log_level {	LOG_LEVEL_DEBUG,	LOG_LEVEL_INFO,	LOG_LEVEL_WARNING,	LOG_LEVEL_ERROR,};void usbi_log(struct libusb_context *ctx, enum usbi_log_level,	const char *function, const char *format, ...);#ifdef ENABLE_LOGGING#define _usbi_log(ctx, level, fmt...) usbi_log(ctx, level, __FUNCTION__, fmt)#else#define _usbi_log(ctx, level, fmt...)#endif#ifdef ENABLE_DEBUG_LOGGING#define usbi_dbg(fmt...) _usbi_log(NULL, LOG_LEVEL_DEBUG, fmt)#else#define usbi_dbg(fmt...)#endif#define usbi_info(ctx, fmt...) _usbi_log(ctx, LOG_LEVEL_INFO, fmt)#define usbi_warn(ctx, fmt...) _usbi_log(ctx, LOG_LEVEL_WARNING, fmt)#define usbi_err(ctx, fmt...) _usbi_log(ctx, LOG_LEVEL_ERROR, fmt)#define USBI_GET_CONTEXT(ctx) if (!(ctx)) (ctx) = usbi_default_context#define DEVICE_CTX(dev) ((dev)->ctx)#define HANDLE_CTX(handle) (DEVICE_CTX((handle)->dev))#define TRANSFER_CTX(transfer) (HANDLE_CTX((transfer)->dev_handle))#define ITRANSFER_CTX(transfer) \	(TRANSFER_CTX(__USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer)))extern struct libusb_context *usbi_default_context;struct libusb_context {	int debug;	int debug_fixed;	struct list_head usb_devs;	pthread_mutex_t usb_devs_lock;	/* A list of open handles. Backends are free to traverse this if required.	 */	struct list_head open_devs;	pthread_mutex_t open_devs_lock;	/* this is a list of in-flight transfer handles, sorted by timeout 	 * expiration. URBs to timeout the soonest are placed at the beginning of	 * the list, URBs that will time out later are placed after, and urbs with	 * infinite timeout are always placed at the very end. */	struct list_head flying_transfers;	pthread_mutex_t flying_transfers_lock;	/* list of poll fd's */	struct list_head pollfds;	pthread_mutex_t pollfds_lock;	/* user callbacks for pollfd changes */	libusb_pollfd_added_cb fd_added_cb;	libusb_pollfd_removed_cb fd_removed_cb;	void *fd_cb_user_data;	/* ensures that only one thread is handling events at any one time */	pthread_mutex_t events_lock;	/* used to see if there is an active thread doing event handling */	int event_handler_active;	/* used to wait for event completion in threads other than the one that is	 * event handling */	pthread_mutex_t event_waiters_lock;	pthread_cond_t event_waiters_cond;};struct libusb_device {	/* lock protects refcnt, everything else is finalized at initialization	 * time */	pthread_mutex_t lock;	int refcnt;	struct libusb_context *ctx;	uint8_t bus_number;	uint8_t device_address;	uint8_t num_configurations;	struct list_head list;	unsigned long session_data;	unsigned char os_priv[0];};struct libusb_device_handle {	/* lock protects claimed_interfaces */	pthread_mutex_t lock;	unsigned long claimed_interfaces;	struct list_head list;	struct libusb_device *dev;	unsigned char os_priv[0];};#define USBI_TRANSFER_TIMED_OUT	 			(1<<0)/* in-memory transfer layout: * * 1. struct usbi_transfer * 2. struct libusb_transfer (which includes iso packets) [variable size] * 3. os private data [variable size] * * from a libusb_transfer, you can get the usbi_transfer by rewinding the * appropriate number of bytes. * the usbi_transfer includes the number of allocated packets, so you can * determine the size of the transfer and hence the start and length of the * OS-private data. */struct usbi_transfer {	int num_iso_packets;	struct list_head list;	struct timeval timeout;	int transferred;	uint8_t flags;};#define __USBI_TRANSFER_TO_LIBUSB_TRANSFER(transfer) \	((struct libusb_transfer *)(((void *)(transfer)) \		+ sizeof(struct usbi_transfer)))#define __LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer) \	((struct usbi_transfer *)(((void *)(transfer)) \		- sizeof(struct usbi_transfer)))static inline void *usbi_transfer_get_os_priv(struct usbi_transfer *transfer){	return ((void *)transfer) + sizeof(struct usbi_transfer)		+ sizeof(struct libusb_transfer)		+ (transfer->num_iso_packets			* sizeof(struct libusb_iso_packet_descriptor));}/* bus structures *//* All standard descriptors have these 2 fields in common */struct usb_descriptor_header {	uint8_t  bLength;	uint8_t  bDescriptorType;};/* shared data and functions */void usbi_io_init(struct libusb_context *ctx);struct libusb_device *usbi_alloc_device(struct libusb_context *ctx,	unsigned long session_id);struct libusb_device *usbi_get_device_by_session_id(struct libusb_context *ctx,	unsigned long session_id);int usbi_sanitize_device(struct libusb_device *dev);void usbi_handle_disconnect(struct libusb_device_handle *handle);void usbi_handle_transfer_completion(struct usbi_transfer *itransfer,	enum libusb_transfer_status status);void usbi_handle_transfer_cancellation(struct usbi_transfer *transfer);int usbi_parse_descriptor(unsigned char *source, char *descriptor, void *dest,	int host_endian);int usbi_get_config_index_by_value(struct libusb_device *dev,	uint8_t bConfigurationValue, int *idx);/* polling */struct usbi_pollfd {	/* must come first */	struct libusb_pollfd pollfd;	struct list_head list;};int usbi_add_pollfd(struct libusb_context *ctx, int fd, short events);void usbi_remove_pollfd(struct libusb_context *ctx, int fd);/* device discovery *//* we traverse usbfs without knowing how many devices we are going to find. * so we create this discovered_devs model which is similar to a linked-list * which grows when required. it can be freed once discovery has completed, * eliminating the need for a list node in the libusb_device structure * itself. */struct discovered_devs {	size_t len;	size_t capacity;	struct libusb_device *devices[0];};struct discovered_devs *discovered_devs_append(	struct discovered_devs *discdevs, struct libusb_device *dev);/* OS abstraction *//* This is the interface that OS backends need to implement. * All fields are mandatory, except ones explicitly noted as optional. */struct usbi_os_backend {	/* A human-readable name for your backend, e.g. "Linux usbfs" */	const char *name;	/* Perform initialization of your backend. You might use this function	 * to determine specific capabilities of the system, allocate required	 * data structures for later, etc.	 *	 * This function is called when a libusb user initializes the library	 * prior to use.	 *	 * Return 0 on success, or a LIBUSB_ERROR code on failure.	 */	int (*init)(struct libusb_context *ctx);	/* Deinitialization. Optional. This function should destroy anything	 * that was set up by init.	 *	 * This function is called when the user deinitializes the library.	 */	void (*exit)(void);	/* Enumerate all the USB devices on the system, returning them in a list	 * of discovered devices.	 *	 * Your implementation should enumerate all devices on the system,	 * regardless of whether they have been seen before or not.	 *	 * When you have found a device, compute a session ID for it. The session	 * ID should uniquely represent that particular device for that particular	 * connection session since boot (i.e. if you disconnect and reconnect a	 * device immediately after, it should be assigned a different session ID).	 * If your OS cannot provide a unique session ID as described above,	 * presenting a session ID of (bus_number << 8 | device_address) should	 * be sufficient. Bus numbers and device addresses wrap and get reused,	 * but that is an unlikely case.	 *	 * After computing a session ID for a device, call	 * usbi_get_device_by_session_id(). This function checks if libusb already	 * knows about the device, and if so, it provides you with a libusb_device	 * structure for it.	 *	 * If usbi_get_device_by_session_id() returns NULL, it is time to allocate	 * a new device structure for the device. Call usbi_alloc_device() to	 * obtain a new libusb_device structure with reference count 1. Populate	 * the bus_number and device_address attributes of the new device, and	 * perform any other internal backend initialization you need to do. At	 * this point, you should be ready to provide device descriptors and so	 * on through the get_*_descriptor functions. Finally, call	 * usbi_sanitize_device() to perform some final sanity checks on the	 * device. Assuming all of the above succeeded, we can now continue.	 * If any of the above failed, remember to unreference the device that	 * was returned by usbi_alloc_device().	 *	 * At this stage we have a populated libusb_device structure (either one	 * that was found earlier, or one that we have just allocated and	 * populated). This can now be added to the discovered devices list	 * using discovered_devs_append(). Note that discovered_devs_append()	 * may reallocate the list, returning a new location for it, and also	 * note that reallocation can fail. Your backend should handle these	 * error conditions appropriately.	 *

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久中文综合久久97| 亚洲va国产va欧美va观看| 免费观看30秒视频久久| 欧美日韩高清一区二区三区| 亚洲小说春色综合另类电影| 欧美日韩午夜精品| 日本vs亚洲vs韩国一区三区 | 成人爽a毛片一区二区免费| 久久久久亚洲综合| www.欧美色图| 亚洲小少妇裸体bbw| 日韩免费性生活视频播放| 国产一区福利在线| 国产精品色呦呦| 在线观看视频91| 老司机精品视频在线| 欧美极品美女视频| 欧美在线小视频| 极品销魂美女一区二区三区| 中文字幕免费不卡| 欧美亚洲一区二区在线观看| 免费欧美日韩国产三级电影| 久久综合一区二区| 色婷婷国产精品| 久久精品久久综合| 国产精品久久久一区麻豆最新章节| 色婷婷亚洲婷婷| 久久99久久99小草精品免视看| 亚洲国产高清aⅴ视频| 在线亚洲精品福利网址导航| 久久国产成人午夜av影院| 国产精品国产成人国产三级| 4438x成人网最大色成网站| 国产aⅴ综合色| 亚洲va国产va欧美va观看| 国产日产亚洲精品系列| 欧美日韩不卡一区二区| 大白屁股一区二区视频| 午夜久久久影院| 国产精品久久久久久久浪潮网站| 欧美美女网站色| 成人福利视频网站| 久久国产福利国产秒拍| 伊人开心综合网| 久久久久久久性| 欧美一区二区三区视频免费播放| 91在线国产观看| 国模冰冰炮一区二区| 亚洲综合成人网| 中文字幕一区二区三区不卡| 日韩一区二区精品在线观看| 日本高清不卡一区| 风间由美中文字幕在线看视频国产欧美| 日一区二区三区| 亚洲精品视频观看| 中文字幕亚洲综合久久菠萝蜜| 精品乱码亚洲一区二区不卡| 在线观看亚洲成人| 91丨porny丨户外露出| 国产成人免费av在线| 久久不见久久见免费视频7| 亚洲国产你懂的| 国产精品第五页| 日本一区二区三区四区| 久久久久久久久久久电影| 日韩一级二级三级| 4438x成人网最大色成网站| 精品视频免费在线| 欧美三级视频在线| 91日韩在线专区| 91丨porny丨在线| 91影院在线免费观看| www.性欧美| jlzzjlzz欧美大全| 99视频精品在线| 99久久精品免费| 94-欧美-setu| 日本电影亚洲天堂一区| 972aa.com艺术欧美| 一本色道久久综合亚洲精品按摩| 99免费精品视频| 91丝袜呻吟高潮美腿白嫩在线观看| 91亚洲国产成人精品一区二区三 | 欧美日韩一二区| 欧美亚洲一区二区三区四区| 91高清在线观看| 精品1区2区3区| 日韩欧美在线综合网| 精品99一区二区| 国产欧美日韩卡一| 日韩美女视频一区二区| 亚洲在线成人精品| 日韩精品电影在线| 国产自产2019最新不卡| 国产精品亚洲成人| 99久久国产免费看| 欧美在线一区二区三区| 日韩免费一区二区| 国产精品久久毛片a| 亚洲一区二区三区四区五区中文| 亚洲电影在线免费观看| 另类小说欧美激情| 99视频热这里只有精品免费| 欧美视频在线不卡| 欧美tk—视频vk| 国产精品视频一二三| 亚洲国产成人av好男人在线观看| 蜜桃在线一区二区三区| 国产一区二区三区在线观看免费视频 | 国产精品美女一区二区三区| 亚洲免费观看高清完整版在线观看 | 日韩中文字幕av电影| 久久精品理论片| 97久久超碰精品国产| 欧美老人xxxx18| 久久久.com| 午夜电影一区二区三区| 国产精品一区在线观看乱码| 日本韩国欧美三级| 久久午夜羞羞影院免费观看| 亚洲欧美激情一区二区| 蜜臀精品一区二区三区在线观看| 国产激情91久久精品导航| 色嗨嗨av一区二区三区| 欧美精品一区二区精品网| 亚洲视频 欧洲视频| 久久国产精品免费| 日本道色综合久久| 久久人人超碰精品| 亚洲国产精品嫩草影院| 国产91在线|亚洲| 69久久夜色精品国产69蝌蚪网| 国产精品成人免费精品自在线观看| 日韩激情视频网站| 色猫猫国产区一区二在线视频| 精品久久人人做人人爰| 亚洲宅男天堂在线观看无病毒| 国产河南妇女毛片精品久久久 | 日韩情涩欧美日韩视频| 亚洲摸摸操操av| 成人黄色大片在线观看| 精品少妇一区二区三区免费观看 | 精品一区二区在线视频| 欧美午夜影院一区| 国产精品乱人伦一区二区| 久久99精品一区二区三区三区| 欧美亚洲高清一区| 成人欧美一区二区三区白人| 另类调教123区 | 国产欧美日韩一区二区三区在线观看| 图片区小说区区亚洲影院| 色综合天天视频在线观看| 久久久精品2019中文字幕之3| 男女男精品视频网| 欧美日韩国产电影| 亚洲国产精品久久久久婷婷884| 成人在线一区二区三区| 久久精品人人做人人综合| 久久成人av少妇免费| 日韩一级片网站| 日韩av电影天堂| 884aa四虎影成人精品一区| 亚洲大尺度视频在线观看| 日本二三区不卡| 一区二区三区成人在线视频| 北岛玲一区二区三区四区| 中文字幕一区二区三区四区不卡| 国产黑丝在线一区二区三区| 久久精品人人做人人综合| 国产乱人伦偷精品视频免下载 | 国产最新精品精品你懂的| 欧美大黄免费观看| 极品美女销魂一区二区三区| 日韩一级黄色大片| 国产在线麻豆精品观看| 精品久久一二三区| 国产成人在线影院| 久久久久久久久久看片| 成人一区在线看| 亚洲男帅同性gay1069| 91黄色激情网站| 偷拍日韩校园综合在线| 日韩欧美亚洲另类制服综合在线| 美国三级日本三级久久99| 久久亚洲影视婷婷| 国产91精品免费| 一区二区三区四区视频精品免费 | 亚洲男人的天堂网| 欧美日韩中文字幕精品| 毛片av一区二区| 国产午夜精品一区二区三区视频 | 国产午夜精品一区二区| 成人一区二区三区中文字幕| 亚洲精品综合在线| 日韩三级高清在线| 成人av网站大全| 亚洲成人tv网| 中文子幕无线码一区tr| 欧美日韩一区二区欧美激情| 国产一区二区福利|