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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 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.	 *

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合一个色综合| 激情丁香综合五月| 亚洲久本草在线中文字幕| 麻豆久久久久久久| 欧美日韩一区二区在线观看| 中文字幕在线一区免费| 欧美精品日韩一区| 午夜电影网一区| 精品1区2区3区| av不卡免费在线观看| 国产精品免费人成网站| 国产精品一区二区视频| 久久久久久97三级| 99九九99九九九视频精品| 国产精品久久久久久久久果冻传媒 | 精品视频在线视频| 亚洲狠狠爱一区二区三区| 欧美伊人久久大香线蕉综合69| 亚洲精品中文字幕在线观看| 99精品桃花视频在线观看| 亚洲天堂av老司机| 99精品1区2区| 日本欧美加勒比视频| 久久伊人中文字幕| jizz一区二区| 婷婷开心激情综合| 国产亚洲精品精华液| 色婷婷av一区二区三区gif| 香蕉久久夜色精品国产使用方法 | 一本久久a久久免费精品不卡| 亚洲男人天堂av| 欧美精品亚洲二区| 国产精品自拍毛片| 亚洲成人激情社区| 国产亚洲视频系列| 欧美网站一区二区| 成人国产精品视频| 国产成人综合自拍| 亚洲精品成人a在线观看| 国产三级精品三级| 亚洲精品一区二区三区精华液| 91丨porny丨户外露出| 久久国产精品一区二区| 亚洲国产综合在线| 1区2区3区国产精品| 精品成人一区二区三区四区| 欧美在线看片a免费观看| 国产成人精品综合在线观看| 精品亚洲欧美一区| 亚洲成人你懂的| 亚洲在线观看免费| 亚洲黄色录像片| 椎名由奈av一区二区三区| 欧美激情在线看| 久久伊99综合婷婷久久伊| 日韩精品一区二区三区蜜臀| 91精品国产美女浴室洗澡无遮挡| 日本久久电影网| 色88888久久久久久影院野外| www.亚洲国产| 成人精品免费网站| 久久99在线观看| 国产一区999| av电影天堂一区二区在线观看| 粉嫩绯色av一区二区在线观看| 国产成人自拍网| www.一区二区| 欧美日韩一区三区| 欧美中文一区二区三区| 欧美精选在线播放| 精品av综合导航| 中文字幕一区不卡| 午夜精品久久久久久久久| 精品一区二区在线播放| 国产麻豆精品在线观看| 99精品国产视频| 日韩一区二区三区精品视频| 久久精品视频在线看| 国产精品二三区| 五月婷婷激情综合网| 日av在线不卡| 国产原创一区二区三区| 欧亚一区二区三区| 久久综合色8888| 一区二区三区在线看| 久99久精品视频免费观看| 色综合久久久网| 国产欧美一区二区精品仙草咪| 亚洲一区在线视频观看| 东方aⅴ免费观看久久av| 91精品国产91综合久久蜜臀| 亚洲婷婷国产精品电影人久久| 日韩成人一级大片| 色狠狠色狠狠综合| 视频一区二区三区入口| 99这里只有久久精品视频| 亚洲精品一区二区在线观看| 中文字幕在线不卡| 成人在线综合网| 国产无人区一区二区三区| 国产专区综合网| 日韩欧美在线123| 亚洲成人免费看| 欧美日韩精品一二三区| 亚洲国产日韩精品| 欧美色爱综合网| 午夜视频在线观看一区二区| 欧美三级午夜理伦三级中视频| 一区二区三区欧美日| 91国内精品野花午夜精品| 亚洲最大成人网4388xx| 色诱视频网站一区| 国产精品久久久久精k8| 国产成人午夜视频| 久久久www免费人成精品| 处破女av一区二区| 国产精品成人网| 91国偷自产一区二区开放时间 | 成人aa视频在线观看| 国产精品伦理在线| 欧美另类久久久品| 精品一区二区精品| 亚洲乱码国产乱码精品精98午夜| 欧美性大战久久久久久久| 午夜av电影一区| 日韩精品中文字幕一区二区三区 | 欧美熟乱第一页| 国产成人综合自拍| 日本vs亚洲vs韩国一区三区二区| 国产欧美在线观看一区| 日韩一区二区三区免费观看| 在线观看亚洲a| 成人午夜视频在线观看| 久久精品国产第一区二区三区| 亚洲精品国产一区二区精华液 | 26uuu色噜噜精品一区二区| 欧亚一区二区三区| 色菇凉天天综合网| 99在线热播精品免费| 大陆成人av片| 成人国产电影网| 成人动漫av在线| 91亚洲国产成人精品一区二区三| 国产aⅴ精品一区二区三区色成熟| 国产一区二区三区在线观看免费视频| 亚洲成va人在线观看| 日韩精品福利网| 黑人精品欧美一区二区蜜桃| 蜜桃视频在线一区| 国产一区二区三区四区五区入口| 奇米色777欧美一区二区| 日本欧美大码aⅴ在线播放| 韩国一区二区三区| 国产一区二区三区免费看| 国产成人免费视| 99热国产精品| 欧美日韩一二三区| 久久综合九色综合欧美98| 久久网这里都是精品| 亚洲麻豆国产自偷在线| 午夜a成v人精品| 国产suv一区二区三区88区| 一本一道波多野结衣一区二区| 91久久精品一区二区三区| 日韩一区二区在线看| 亚洲四区在线观看| 午夜伦理一区二区| 成人在线综合网站| 欧美一级视频精品观看| 国产精品麻豆99久久久久久| 亚洲国产日韩av| 懂色av中文一区二区三区 | 懂色一区二区三区免费观看| 欧美三电影在线| 中文字幕一区二区三区四区| 秋霞午夜鲁丝一区二区老狼| 一本久久a久久精品亚洲| 久久精品亚洲乱码伦伦中文| 日韩精品国产欧美| 欧美在线一二三四区| 国产精品毛片久久久久久久| 九九久久精品视频| 日韩精品一区二区三区三区免费| 亚洲国产婷婷综合在线精品| 91麻豆视频网站| 日韩美女视频一区| 成人禁用看黄a在线| 国产亚洲成av人在线观看导航 | 色吧成人激情小说| 亚洲欧美色图小说| 91福利小视频| 亚洲激情中文1区| 欧美性猛交xxxx黑人交| 亚洲地区一二三色| 欧美日韩亚洲丝袜制服| 婷婷六月综合网| 欧美大片免费久久精品三p| 青青草国产精品亚洲专区无| 日韩欧美中文字幕制服| 国内一区二区在线|