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

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

?? ptp-pack.c

?? USB Host 開發(fā)中支持?jǐn)?shù)碼相機(jī)的源碼。即Picture To Picture協(xié)議的完整實現(xiàn)
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* curently this file is included into ptp.c */static inline uint16_thtod16p (PTPParams *params, uint16_t var){	return ((params->byteorder==PTP_DL_LE)?htole16(var):htobe16(var));}static inline uint32_thtod32p (PTPParams *params, uint32_t var){	return ((params->byteorder==PTP_DL_LE)?htole32(var):htobe32(var));}static inline voidhtod16ap (PTPParams *params, unsigned char *a, uint16_t val){	if (params->byteorder==PTP_DL_LE)		htole16a(a,val); else 		htobe16a(a,val);}static inline voidhtod32ap (PTPParams *params, unsigned char *a, uint32_t val){	if (params->byteorder==PTP_DL_LE)		htole32a(a,val); else 		htobe32a(a,val);}static inline uint16_tdtoh16p (PTPParams *params, uint16_t var){	return ((params->byteorder==PTP_DL_LE)?le16toh(var):be16toh(var));}static inline uint32_tdtoh32p (PTPParams *params, uint32_t var){	return ((params->byteorder==PTP_DL_LE)?le32toh(var):be32toh(var));}static inline uint16_tdtoh16ap (PTPParams *params, unsigned char *a){	return ((params->byteorder==PTP_DL_LE)?le16atoh(a):be16atoh(a));}static inline uint32_tdtoh32ap (PTPParams *params, unsigned char *a){	return ((params->byteorder==PTP_DL_LE)?le32atoh(a):be32atoh(a));}#define htod8a(a,x)	*(uint8_t*)(a) = x#define htod16a(a,x)	htod16ap(params,a,x)#define htod32a(a,x)	htod32ap(params,a,x)#define htod16(x)	htod16p(params,x)#define htod32(x)	htod32p(params,x)#define dtoh8a(x)	(*(uint8_t*)(x))#define dtoh16a(a)	dtoh16ap(params,a)#define dtoh32a(a)	dtoh32ap(params,a)#define dtoh16(x)	dtoh16p(params,x)#define dtoh32(x)	dtoh32p(params,x)static inline char*ptp_unpack_string(PTPParams *params, char* data, uint16_t offset, uint8_t *len){	int i;	char *string=NULL;	*len=dtoh8a(&data[offset]);	if (*len) {		string=malloc(*len);		memset(string, 0, *len);		for (i=0;i<*len && i< PTP_MAXSTRLEN; i++) {			string[i]=(char)dtoh16a(&data[offset+i*2+1]);		}		/* be paranoid! :( */		string[*len-1]=0;	}	return (string);}static inline voidptp_pack_string(PTPParams *params, char *string, char* data, uint16_t offset, uint8_t *len){	int i;	*len = (uint8_t)strlen(string);		/* XXX: check strlen! */	htod8a(&data[offset],*len+1);	for (i=0;i<*len && i< PTP_MAXSTRLEN; i++) {		htod16a(&data[offset+i*2+1],(uint16_t)string[i]);	}}static inline uint32_tptp_unpack_uint32_t_array(PTPParams *params, char* data, uint16_t offset, uint32_t **array){	uint32_t n, i=0;	n=dtoh32a(&data[offset]);	*array = malloc (n*sizeof(uint32_t));	while (n>i) {		(*array)[i]=dtoh32a(&data[offset+(sizeof(uint32_t)*(i+1))]);		i++;	}	return n;}static inline uint32_tptp_unpack_uint16_t_array(PTPParams *params, char* data, uint16_t offset, uint16_t **array){	uint32_t n, i=0;	n=dtoh32a(&data[offset]);	*array = malloc (n*sizeof(uint16_t));	while (n>i) {		(*array)[i]=dtoh16a(&data[offset+(sizeof(uint16_t)*(i+2))]);		i++;	}	return n;}/* DeviceInfo pack/unpack */#define PTP_di_StandardVersion		 0#define PTP_di_VendorExtensionID	 2#define PTP_di_VendorExtensionVersion	 6#define PTP_di_VendorExtensionDesc	 8#define PTP_di_FunctionalMode		 8#define PTP_di_OperationsSupported	10static inline voidptp_unpack_DI (PTPParams *params, char* data, PTPDeviceInfo *di){	uint8_t len;	unsigned int totallen;		di->StaqndardVersion = dtoh16a(&data[PTP_di_StandardVersion]);	di->VendorExtensionID =		dtoh32a(&data[PTP_di_VendorExtensionID]);	di->VendorExtensionVersion =		dtoh16a(&data[PTP_di_VendorExtensionVersion]);	di->VendorExtensionDesc = 		ptp_unpack_string(params, data,		PTP_di_VendorExtensionDesc, &len); 	totallen=len*2+1;	di->FunctionalMode = 		dtoh16a(&data[PTP_di_FunctionalMode+totallen]);	di->OperationsSupported_len = ptp_unpack_uint16_t_array(params, data,		PTP_di_OperationsSupported+totallen,		&di->OperationsSupported);	totallen=totallen+di->OperationsSupported_len*sizeof(uint16_t)+sizeof(uint32_t);	di->EventsSupported_len = ptp_unpack_uint16_t_array(params, data,		PTP_di_OperationsSupported+totallen,		&di->EventsSupported);	totallen=totallen+di->EventsSupported_len*sizeof(uint16_t)+sizeof(uint32_t);	di->DevicePropertiesSupported_len =		ptp_unpack_uint16_t_array(params, data,		PTP_di_OperationsSupported+totallen,		&di->DevicePropertiesSupported);	totallen=totallen+di->DevicePropertiesSupported_len*sizeof(uint16_t)+sizeof(uint32_t);	di->CaptureFormats_len = ptp_unpack_uint16_t_array(params, data,		PTP_di_OperationsSupported+totallen,		&di->CaptureFormats);	totallen=totallen+di->CaptureFormats_len*sizeof(uint16_t)+sizeof(uint32_t);	di->ImageFormats_len = ptp_unpack_uint16_t_array(params, data,		PTP_di_OperationsSupported+totallen,		&di->ImageFormats);	totallen=totallen+di->ImageFormats_len*sizeof(uint16_t)+sizeof(uint32_t);	di->Manufacturer = ptp_unpack_string(params, data,		PTP_di_OperationsSupported+totallen,		&len);	totallen+=len*2+1;	di->Model = ptp_unpack_string(params, data,		PTP_di_OperationsSupported+totallen,		&len);	totallen+=len*2+1;	di->DeviceVersion = ptp_unpack_string(params, data,		PTP_di_OperationsSupported+totallen,		&len);	totallen+=len*2+1;	di->SerialNumber = ptp_unpack_string(params, data,		PTP_di_OperationsSupported+totallen,		&len);}	/* ObjectHandles array pack/unpack */#define PTP_oh				 0static inline voidptp_unpack_OH (PTPParams *params, char* data, PTPObjectHandles *oh){	oh->n = ptp_unpack_uint32_t_array(params, data, PTP_oh, &oh->Handler);}/* StoreIDs array pack/unpack */#define PTP_sids			 0static inline voidptp_unpack_SIDs (PTPParams *params, char* data, PTPStorageIDs *sids){	sids->n = ptp_unpack_uint32_t_array(params, data, PTP_sids,	&sids->Storage);}/* StorageInfo pack/unpack */#define PTP_si_StorageType		 0#define PTP_si_FilesystemType		 2#define PTP_si_AccessCapability		 4#define PTP_si_MaxCapability		 6#define PTP_si_FreeSpaceInBytes		14#define PTP_si_FreeSpaceInImages	22#define PTP_si_StorageDescription	26static inline voidptp_unpack_SI (PTPParams *params, char* data, PTPStorageInfo *si){	uint8_t storagedescriptionlen;	si->StorageType=dtoh16a(&data[PTP_si_StorageType]);	si->FilesystemType=dtoh16a(&data[PTP_si_FilesystemType]);	si->AccessCapability=dtoh16a(&data[PTP_si_AccessCapability]);	/* XXX no dtoh64a !!! skiping next two */	si->FreeSpaceInImages=dtoh32a(&data[PTP_si_FreeSpaceInImages]);	si->StorageDescription=ptp_unpack_string(params, data,		PTP_si_StorageDescription, &storagedescriptionlen);	si->VolumeLabel=ptp_unpack_string(params, data,		PTP_si_StorageDescription+storagedescriptionlen*2+1,		&storagedescriptionlen);}/* ObjectInfo pack/unpack */#define PTP_oi_StorageID		 0#define PTP_oi_ObjectFormat		 4#define PTP_oi_ProtectionStatus		 6#define PTP_oi_ObjectCompressedSize	 8#define PTP_oi_ThumbFormat		12#define PTP_oi_ThumbCompressedSize	14#define PTP_oi_ThumbPixWidth		18#define PTP_oi_ThumbPixHeight		22#define PTP_oi_ImagePixWidth		26#define PTP_oi_ImagePixHeight		30#define PTP_oi_ImageBitDepth		34#define PTP_oi_ParentObject		38#define PTP_oi_AssociationType		42#define PTP_oi_AssociationDesc		44#define PTP_oi_SequenceNumber		48#define PTP_oi_filenamelen		52#define PTP_oi_Filename			53static inline uint32_tptp_pack_OI (PTPParams *params, PTPObjectInfo *oi, char** oidataptr){	char* oidata;	uint8_t filenamelen;	uint8_t capturedatelen=0;	/* let's allocate some memory first; XXX i'm sure it's wrong */	oidata=malloc(PTP_oi_Filename+(strlen(oi->Filename)+1)*2+4);	/* the caller should free it after use! */#if 0	char *capture_date="20020101T010101"; /* XXX Fake date */#endif	memset (oidata, 0, (PTP_oi_Filename+(strlen(oi->Filename)+1)*2+4));	htod32a(&oidata[PTP_oi_StorageID],oi->StorageID);	htod16a(&oidata[PTP_oi_ObjectFormat],oi->ObjectFormat);	htod16a(&oidata[PTP_oi_ProtectionStatus],oi->ProtectionStatus);	htod32a(&oidata[PTP_oi_ObjectCompressedSize],oi->ObjectCompressedSize);	htod16a(&oidata[PTP_oi_ThumbFormat],oi->ThumbFormat);	htod32a(&oidata[PTP_oi_ThumbCompressedSize],oi->ThumbCompressedSize);	htod32a(&oidata[PTP_oi_ThumbPixWidth],oi->ThumbPixWidth);	htod32a(&oidata[PTP_oi_ThumbPixHeight],oi->ThumbPixHeight);	htod32a(&oidata[PTP_oi_ImagePixWidth],oi->ImagePixWidth);	htod32a(&oidata[PTP_oi_ImagePixHeight],oi->ImagePixHeight);	htod32a(&oidata[PTP_oi_ImageBitDepth],oi->ImageBitDepth);	htod32a(&oidata[PTP_oi_ParentObject],oi->ParentObject);	htod16a(&oidata[PTP_oi_AssociationType],oi->AssociationType);	htod32a(&oidata[PTP_oi_AssociationDesc],oi->AssociationDesc);	htod32a(&oidata[PTP_oi_SequenceNumber],oi->SequenceNumber);		ptp_pack_string(params, oi->Filename, oidata, PTP_oi_filenamelen, &filenamelen);/*	filenamelen=(uint8_t)strlen(oi->Filename);	htod8a(&req->data[PTP_oi_filenamelen],filenamelen+1);	for (i=0;i<filenamelen && i< PTP_MAXSTRLEN; i++) {		req->data[PTP_oi_Filename+i*2]=oi->Filename[i];	}*/	/*	 *XXX Fake date.	 * for example Kodak sets Capture date on the basis of EXIF data.	 * Spec says that this field is from perspective of Initiator.	 */#if 0	/* seems now we don't need any data packed in OI dataset... for now ;)*/	capturedatelen=strlen(capture_date);	htod8a(&data[PTP_oi_Filename+(filenamelen+1)*2],		capturedatelen+1);	for (i=0;i<capturedatelen && i< PTP_MAXSTRLEN; i++) {		data[PTP_oi_Filename+(i+filenamelen+1)*2+1]=capture_date[i];	}	htod8a(&data[PTP_oi_Filename+(filenamelen+capturedatelen+2)*2+1],		capturedatelen+1);	for (i=0;i<capturedatelen && i< PTP_MAXSTRLEN; i++) {		data[PTP_oi_Filename+(i+filenamelen+capturedatelen+2)*2+2]=		  capture_date[i];	}#endif	/* XXX this function should return dataset length */		*oidataptr=oidata;	return (PTP_oi_Filename+(filenamelen+1)*2+(capturedatelen+1)*4);}static inline voidptp_unpack_OI (PTPParams *params, char* data, PTPObjectInfo *oi){	uint8_t filenamelen;	uint8_t capturedatelen;	char *capture_date;	char tmp[16];	struct tm tm;	memset(&tm,0,sizeof(tm));	oi->StorageID=dtoh32a(&data[PTP_oi_StorageID]);	oi->ObjectFormat=dtoh16a(&data[PTP_oi_ObjectFormat]);	oi->ProtectionStatus=dtoh16a(&data[PTP_oi_ProtectionStatus]);	oi->ObjectCompressedSize=dtoh32a(&data[PTP_oi_ObjectCompressedSize]);	oi->ThumbFormat=dtoh16a(&data[PTP_oi_ThumbFormat]);	oi->ThumbCompressedSize=dtoh32a(&data[PTP_oi_ThumbCompressedSize]);	oi->ThumbPixWidth=dtoh32a(&data[PTP_oi_ThumbPixWidth]);	oi->ThumbPixHeight=dtoh32a(&data[PTP_oi_ThumbPixHeight]);	oi->ImagePixWidth=dtoh32a(&data[PTP_oi_ImagePixWidth]);	oi->ImagePixHeight=dtoh32a(&data[PTP_oi_ImagePixHeight]);	oi->ImageBitDepth=dtoh32a(&data[PTP_oi_ImageBitDepth]);	oi->ParentObject=dtoh32a(&data[PTP_oi_ParentObject]);	oi->AssociationType=dtoh16a(&data[PTP_oi_AssociationType]);	oi->AssociationDesc=dtoh32a(&data[PTP_oi_AssociationDesc]);	oi->SequenceNumber=dtoh32a(&data[PTP_oi_SequenceNumber]);	oi->Filename= ptp_unpack_string(params, data, PTP_oi_filenamelen, &filenamelen);	capture_date = ptp_unpack_string(params, data,		PTP_oi_filenamelen+filenamelen*2+1, &capturedatelen);	/* subset of ISO 8601, without '.s' tenths of second and 	 * time zone	 */	if (capturedatelen>15)	{		strncpy (tmp, capture_date, 4);		tmp[4] = 0;		tm.tm_year=atoi (tmp) - 1900;		strncpy (tmp, capture_date + 4, 2);		tmp[2] = 0;		tm.tm_mon = atoi (tmp) - 1;		strncpy (tmp, capture_date + 6, 2);		tmp[2] = 0;		tm.tm_mday = atoi (tmp);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本大道av伊人久久综合| 亚洲乱码精品一二三四区日韩在线| 成人动漫一区二区在线| 久久男人中文字幕资源站| 蜜臀av性久久久久av蜜臀妖精| 欧美精品丝袜久久久中文字幕| 三级影片在线观看欧美日韩一区二区| 在线影院国内精品| 有码一区二区三区| 欧美性色黄大片| 日本网站在线观看一区二区三区| 欧美一区二区三区公司| 麻豆精品久久精品色综合| 精品精品欲导航| 国产精品自在在线| 亚洲人成伊人成综合网小说| 在线观看亚洲一区| 肉肉av福利一精品导航| 欧美精品一区二区久久久| 国产精品亚洲视频| 综合婷婷亚洲小说| 欧美日韩午夜在线| 免费看黄色91| 国产精品久久久久毛片软件| 欧美无砖砖区免费| 久久精品国产一区二区三区免费看| 久久精品视频在线免费观看| 91在线免费播放| 亚洲成a人v欧美综合天堂下载| 日韩精品资源二区在线| 成人性生交大合| 亚洲午夜久久久| 亚洲精品一区二区精华| 成人福利在线看| 日本欧美一区二区在线观看| 国产亚洲美州欧州综合国| 色综合天天综合狠狠| 蜜桃视频一区二区| 《视频一区视频二区| 777亚洲妇女| 99麻豆久久久国产精品免费| 丝袜诱惑制服诱惑色一区在线观看 | 中文字幕综合网| 欧美一级免费大片| 一本大道久久精品懂色aⅴ| 欧美精品一区男女天堂| 伊人性伊人情综合网| 久久久高清一区二区三区| 精品一区免费av| 亚洲综合色自拍一区| 久久久美女毛片| 欧美日韩一区高清| www.亚洲色图.com| 极品少妇xxxx偷拍精品少妇| 亚洲一区电影777| 中文无字幕一区二区三区| 日韩色视频在线观看| 在线视频综合导航| 国产91对白在线观看九色| 久久国产生活片100| 亚洲一区二三区| 中文字幕一区二区三区在线不卡| 日韩网站在线看片你懂的| 欧美最新大片在线看| 99精品欧美一区二区三区综合在线| 精品在线一区二区| 亚洲不卡av一区二区三区| 亚洲丝袜美腿综合| 亚洲国产精品成人综合 | 国产午夜精品久久久久久免费视 | 26uuuu精品一区二区| 欧美三级三级三级| 91浏览器入口在线观看| 成人美女视频在线看| 国产一区高清在线| 激情五月婷婷综合| 九九**精品视频免费播放| 日韩av一二三| 婷婷国产在线综合| 色婷婷久久99综合精品jk白丝| 东方欧美亚洲色图在线| 国产成人在线免费观看| 精品制服美女丁香| 狠狠色狠狠色综合系列| 国产一区欧美二区| 国产在线精品一区二区| 国产精品99久久不卡二区| 国内精品第一页| 黄色精品一二区| 国产一区 二区 三区一级| 国产乱理伦片在线观看夜一区| 九色综合国产一区二区三区| 国产一区免费电影| 波多野结衣在线一区| 不卡的av中国片| 色综合久久综合网欧美综合网 | 欧美mv日韩mv国产网站app| 日韩区在线观看| 精品av久久707| 欧美极品少妇xxxxⅹ高跟鞋| 国产精品福利电影一区二区三区四区| 亚洲视频狠狠干| 亚洲国产精品久久不卡毛片| 欧美性xxxxxxxx| 91精品国产色综合久久不卡蜜臀| 日韩一区二区三区四区| 久久综合狠狠综合| 国产精品视频麻豆| 一区二区三区精品在线观看| 日韩精品福利网| 国产一区高清在线| 色播五月激情综合网| 欧美一区二区三区四区五区 | 一本大道av一区二区在线播放| 欧美乱妇23p| 久久先锋影音av鲁色资源网| 中文字幕免费不卡在线| 亚洲成精国产精品女| 国内精品免费在线观看| 91网站黄www| 亚洲精品在线电影| 一区二区三区欧美日韩| 精品在线播放免费| 成人美女在线观看| 日韩一区二区三区高清免费看看 | 884aa四虎影成人精品一区| 国产亚洲美州欧州综合国| 亚洲精品视频一区| 激情六月婷婷久久| 色欧美片视频在线观看| 欧美va亚洲va在线观看蝴蝶网| 国产精品久久久久精k8| 丝袜国产日韩另类美女| 国产福利一区二区三区视频在线| 在线观看www91| 中文字幕精品综合| 美日韩黄色大片| 在线亚洲欧美专区二区| 欧美成人video| 欧美在线啊v一区| 欧美三级在线播放| 欧美国产成人在线| 麻豆精品精品国产自在97香蕉| 97se亚洲国产综合自在线| 日韩精品一区二区三区在线观看| 亚洲综合一区二区精品导航| 国产**成人网毛片九色| 日韩美女一区二区三区| 视频一区二区中文字幕| 色综合久久88色综合天天6| 久久久久久久久一| 美女诱惑一区二区| 欧美日韩国产a| 亚洲精品国产视频| 99精品视频在线观看| 国产调教视频一区| 国产在线不卡一区| 日韩欧美激情四射| 三级一区在线视频先锋| 欧美日韩亚洲综合| 亚洲香蕉伊在人在线观| 色综合中文字幕| 亚洲人成亚洲人成在线观看图片| 国产一区二区三区黄视频| 精品国产青草久久久久福利| 日韩成人av影视| 91精品一区二区三区久久久久久| 亚洲一区影音先锋| 日本久久精品电影| 一区二区三区资源| 色婷婷av一区二区三区之一色屋| 国产精品美女久久久久久久久| 国产成人综合在线| 国产欧美日韩不卡免费| 成人午夜电影小说| 一区二区中文视频| 91美女片黄在线观看91美女| 自拍偷自拍亚洲精品播放| 91麻豆.com| 亚洲大片在线观看| 欧美日韩一区国产| 日本女优在线视频一区二区| 欧美一级二级三级蜜桃| 精品在线你懂的| 日本一区二区三区高清不卡| 成人免费福利片| 亚洲精品视频免费看| 精品视频色一区| 久久er99精品| 久久免费看少妇高潮| 成人丝袜高跟foot| 亚洲精品欧美综合四区| 在线观看欧美黄色| 美女视频黄频大全不卡视频在线播放| 精品久久久网站| 不卡在线视频中文字幕| 亚洲国产一区二区a毛片| 91精品国产综合久久婷婷香蕉 | 美女免费视频一区二区| 精品国产乱码久久久久久免费|