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

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

?? htbind.c

?? www工具包. 這是W3C官方支持的www支撐庫. 其中提供通用目的的客戶端的WebAPI: complete HTTP/1.1 (with caching, pipelining, PUT, POS
?? C
字號:
/*								     Htbind.c**	FILE SUFFIX BIND MANAGER****	(c) COPYRIGHT MIT 1995**	Please first read the full copyright statement in the file COPYRIGH.**	@(#) $Id: HTBind.c,v 2.34 2000/08/09 10:43:08 kahan Exp $****	This module sets up the binding between a file Bind and a media**	type, language, encoding etc. In a client application the Binds**	are used in protocols that does not support media types etc., like**	FTP, and in server applications they are used to make the bindings**	between the server and the local file store that the server can**	serve to the rest of the world (well almost). The HTFormat module**	holds this information against the accept headers received in a**	request and uses if for format negotiation. All the binding management**	can all be replace by a database interface. **** History:**	   Feb 91	Written Tim Berners-Lee CERN/CN**	   Apr 91	vms-vms access included using DECnet syntax**	26 Jun 92 (JFG) When running over DECnet, suppressed FTP.**			Fixed access bug for relative names on VMS.**	   Sep 93 (MD)  Access to VMS files allows sharing.**	15 Nov 93 (MD)	Moved HTVMSname to HTVMSUTILS.C**	22 Feb 94 (MD)  Excluded two routines if we are not READING directories**	18 May 94 (HF)	Directory stuff removed and stream handling updated,**			error messages introduced etc.**	10 Maj 95 HF	Spawned off from HTFile in order to make it easier to**			override by a new module. It's now based on anchors**			and hash tables** Bugs:*//* Library Includes */#include "wwwsys.h"#include "WWWUtil.h"#include "HTAnchor.h"#include "HTResponse.h"#include "HTParse.h"#include "HTBind.h"					 /* Implemented here */typedef struct _HTBind {    char *	suffix;    HTFormat	type;			/* Content-Type */    HTEncoding	encoding;		/* Content-Encoding */    HTEncoding	transfer;		/* Content-Transfer-Encoding */    HTLanguage	language;		/* Content-Language */    double	quality;} HTBind;/* Suffix registration */PRIVATE BOOL HTCaseSen = YES;		      /* Are suffixes case sensitive */PRIVATE char *HTDelimiters = NULL;			  /* Set of suffixes */PRIVATE HTList **HTBindings = NULL;   /* Point to table of lists of bindings */PRIVATE HTBind no_suffix = { "*", NULL, NULL, NULL, NULL, 0.5 };PRIVATE HTBind unknown_suffix = { "*.*", NULL, NULL, NULL, NULL, 0.5 };/* ------------------------------------------------------------------------- *//*	**	Set up the list of suffix bindings. Done by HTLibInit*/PUBLIC BOOL HTBind_init (void){    if (!HTBindings) {	if (!(HTBindings = (HTList **) HT_CALLOC(HT_L_HASH_SIZE, sizeof(HTList *))))	    HT_OUTOFMEM("HTBind_init");    }    StrAllocCopy(HTDelimiters, DEFAULT_SUFFIXES);    no_suffix.type = WWW_UNKNOWN;    no_suffix.encoding = WWW_CODING_BINARY;    unknown_suffix.type = WWW_UNKNOWN;    unknown_suffix.encoding = WWW_CODING_BINARY;    return YES;}/***	Cleans up the memory allocated by file bindings**	Done by HTLibTerminate().**	Written by Eric Sink, eric@spyglass.com, and Henrik*/PUBLIC BOOL HTBind_deleteAll (void){    int cnt;    HTList *cur;    if (!HTBindings)	return NO;    for (cnt=0; cnt<HT_L_HASH_SIZE; cnt++) {	if ((cur = HTBindings[cnt])) { 	    HTBind *pres;	    while ((pres = (HTBind *) HTList_nextObject(cur)) != NULL) {		HT_FREE(pres->suffix);		HT_FREE(pres);	    }	}	HTList_delete(HTBindings[cnt]);	HTBindings[cnt] = NULL;    }    HT_FREE(HTBindings);    HT_FREE(HTDelimiters);    return YES;}/*	Make suffix bindings case sensitive**	-----------------------------------*/PUBLIC void HTBind_caseSensitive (BOOL sensitive){    HTCaseSen = sensitive;}/*	Get set of suffixes**	-------------------*/PUBLIC const char *HTBind_delimiters (void){    return HTDelimiters;}/*	Change set of suffixes**	----------------------*/PUBLIC void HTBind_setDelimiters (const char * new_suffixes){    if (new_suffixes && *new_suffixes)	StrAllocCopy(HTDelimiters, new_suffixes);}/*	Define the representation associated with a file suffix**	-------------------------------------------------------****	Calling this with suffix set to "*" will set the default**	representation.**	Calling this with suffix set to "*.*" will set the default**	representation for unknown suffix files which contain a "."****	If filename suffix is already defined its previous**	definition is overridden (or modified)*/PUBLIC BOOL HTBind_addType (const char *	suffix,			    const char *	representation,			    double		value){    return HTBind_add(suffix, representation, NULL, NULL, NULL, value);}PUBLIC BOOL HTBind_addEncoding (const char *	suffix,				const char *	encoding,				double		value){    return HTBind_add(suffix, NULL, encoding, NULL, NULL, value);}PUBLIC BOOL HTBind_addTransfer (const char *	suffix,				const char *	transfer,				double		value){    return HTBind_add(suffix, NULL, NULL, transfer, NULL, value);}PUBLIC BOOL HTBind_addLanguage (const char *	suffix,				const char *	language,				double		value){    return HTBind_add(suffix, NULL, NULL, NULL, language, value);}PUBLIC BOOL HTBind_add (const char *	suffix,			const char *	representation,			const char *	encoding,			const char *	transfer,			const char *	language,			double		value){    HTBind * suff;    if (!suffix)	return NO;    if (!strcmp(suffix, "*"))	suff = &no_suffix;    else if (!strcmp(suffix, "*.*"))	suff = &unknown_suffix;    else {	HTList * suflist;	int hash;	const unsigned char * p;	/* Select list from hash table */	for (p=suffix, hash=0; *p; p++) {	    hash = (hash * 3 + TOLOWER(*p)) % HT_L_HASH_SIZE;	}	if (!HTBindings) HTBind_init();	if (!HTBindings[hash]) HTBindings[hash] = HTList_new();	suflist = HTBindings[hash];	/* Look for existing binding */	{	    HTList *cur = suflist;	    while ((suff = (HTBind *) HTList_nextObject(cur)) != NULL) {		if (!strcmp(suff->suffix, suffix))		    break;	    }	}	/* If not found -- create a new node */	if (!suff) {	    if ((suff = (HTBind *) HT_CALLOC(1, sizeof(HTBind))) == NULL)	        HT_OUTOFMEM("HTBind_add");	    HTList_addObject(suflist, (void *) suff);	    StrAllocCopy(suff->suffix, suffix);	}    }    /* Set the appropriate values */    {	HTChunk * chunk = HTChunk_new(32);	char *ptr;	if (representation) {	    HTChunk_puts(chunk, representation);	    ptr = HTChunk_data(chunk);	    for (; *ptr; ptr++)		*ptr = TOLOWER(*ptr);	    suff->type = HTAtom_for(HTChunk_data(chunk));	    HTChunk_truncate(chunk,0);	}	if (encoding) {	    HTChunk_puts(chunk, encoding);	    ptr = HTChunk_data(chunk);	    for (; *ptr; ptr++)		*ptr = TOLOWER(*ptr);	    suff->encoding = HTAtom_for(HTChunk_data(chunk));	    HTChunk_truncate(chunk,0);	}	if (transfer) {	    HTChunk_puts(chunk, transfer);	    ptr = HTChunk_data(chunk);	    for (; *ptr; ptr++)		*ptr = TOLOWER(*ptr);	    suff->transfer = HTAtom_for(HTChunk_data(chunk));	    HTChunk_truncate(chunk,0);	}	if (language) {	    HTChunk_puts(chunk, language);	    ptr = HTChunk_data(chunk);	    for (; *ptr; ptr++)		*ptr = TOLOWER(*ptr);	    suff->language = HTAtom_for(HTChunk_data(chunk));	    HTChunk_truncate(chunk,0);	}	HTChunk_delete(chunk);	suff->quality = value;    }    return YES;}/*	Determine a suitable suffix**	---------------------------**  Use the set of bindings to find a suitable suffix (or index)**  for a certain combination of language, media type and encoding**  given in the anchor.****  Returns a pointer to a suitable suffix string that must be freed **  by the caller. If more than one suffix is found they are all**  concatenated using the first delimiter in HTDelimiters.**  If no suffix is found, NULL is returned.*/PUBLIC char * HTBind_getSuffix (HTParentAnchor * anchor){    int cnt;    HTList * cur;    HTChunk * suffix = HTChunk_new(48);    char delimiter = *HTDelimiters;    char * ct=NULL, * ce=NULL, * cl=NULL;    HTFormat format = HTAnchor_format(anchor);    HTList * encoding = HTAnchor_encoding(anchor);    HTList * language = HTAnchor_language(anchor);    if (!HTBindings) HTBind_init();    if (anchor) {	for (cnt=0; cnt<HT_L_HASH_SIZE; cnt++) {	    if ((cur = HTBindings[cnt])) { 		HTBind *pres;		while ((pres = (HTBind *) HTList_nextObject(cur))) {		    if (!ct && (pres->type && pres->type == format)){			ct = pres->suffix;		    } else if (!ce && pres->encoding && encoding) {			HTList * cur_enc = encoding;			HTEncoding pres_enc;			while ((pres_enc = (HTEncoding) HTList_nextObject(cur_enc))) {			    if (pres_enc == pres->encoding) {				ce = pres->suffix;				break;			    }			}		    } else if (!cl && pres->language && language) {			HTList * cur_lang = language;			HTLanguage pres_lang;			while ((pres_lang = (HTLanguage) HTList_nextObject(cur_lang))) {			    if (pres_lang == pres->language) {				cl = pres->suffix;				break;			    }			}		    }		}	    }	}	/* Put the found suffixes together */	if (ct) {	    HTChunk_putc(suffix, delimiter);	    HTChunk_puts(suffix, ct);	}	if (ce) {	    HTChunk_putc(suffix, delimiter);	    HTChunk_puts(suffix, ce);	}	if (cl) {	    HTChunk_putc(suffix, delimiter);	    HTChunk_puts(suffix, cl);	}    }    return HTChunk_toCString(suffix);}/***  Use the set of bindings to find the combination of language,**  media type and encoding of a given object. This information can either be**  stored in the anchor obejct or in the response object depending on which**  function is called.****  We comprise here as bindings only can have one language and one encoding.**  If more than one suffix is found they are all searched. The last suffix**  has highest priority, the first one lowest. See also HTBind_getFormat()*/PUBLIC BOOL HTBind_getAnchorBindings (HTParentAnchor * anchor){    BOOL status = NO;    double quality=1.0;		  /* @@@ Should we add this into the anchor? */    if (anchor) {	char *addr = HTAnchor_address((HTAnchor *) anchor);	char *path = HTParse(addr, "", PARSE_PATH+PARSE_PUNCTUATION);	char *file;	char *end;	if ((end = strchr(path, ';')) || (end = strchr(path, '?')) ||	    (end = strchr(path, '#')))	    *end = '\0';	if ((file = strrchr(path, '/'))) {	    HTFormat format = NULL;	    HTEncoding encoding = NULL;	    HTEncoding transfer = NULL;	    HTLanguage language = NULL; 	    HTTRACE(BIND_TRACE, "Anchor...... Get bindings for `%s\'\n" _ path);	    status = HTBind_getFormat(file, &format, &encoding, &transfer,				      &language, &quality);	    if (status) {		HTAnchor_setFormat(anchor, format);		HTAnchor_setContentTransferEncoding(anchor, transfer);                HTAnchor_deleteEncodingAll(anchor);                HTAnchor_addEncoding(anchor, encoding);                HTAnchor_deleteLanguageAll(anchor);                HTAnchor_addLanguage(anchor, language);	    }	}        HT_FREE(addr);        HT_FREE(path);    }    return status;}PUBLIC BOOL HTBind_getResponseBindings (HTResponse * response, const char * url){    BOOL status = NO;    double quality = 1.0;    if (response) {	char * path = HTParse(url, "", PARSE_PATH + PARSE_PUNCTUATION);	char * file;	char * end;	if ((end = strchr(path, ';')) || (end = strchr(path, '?')) ||	    (end = strchr(path, '#')))	    *end = '\0';	if ((file = strrchr(path, '/'))) {	    HTFormat format = NULL;	    HTEncoding encoding = NULL;	    HTEncoding transfer = NULL;	    HTLanguage language = NULL; 	    HTTRACE(BIND_TRACE, "Response.... Get Bindings for `%s\'\n" _ path);	    status = HTBind_getFormat(file, &format, &encoding, &transfer,				      &language, &quality);	    if (status) {		HTResponse_setFormat(response, format);		HTResponse_setContentTransferEncoding(response, transfer);		HTResponse_addEncoding(response, encoding);#if 0		HTResponse_addLanguage(response, language);#endif	    }	}	HT_FREE(path);    }    return status;}/*	Determine the content of an file name**	-------------------------------------**  Use the set of bindings to find the combination of language,**  media type, encoding, and transfer encoding  of a given anchor.**  If more than one suffix is found they are all searched. The last suffix**  has highest priority, the first one lowest. See also HTBind_getBindings()**  Either of format, encoding, or language can be NULL**  Returns the format, encoding, and language found*/PUBLIC BOOL HTBind_getFormat (const char *	filename,			      HTFormat *	format,			      HTEncoding *	enc,			      HTEncoding *	cte,			      HTLanguage *	lang,			      double *		quality){    int sufcnt=0;    char *file=NULL;#ifdef HT_REENTRANT    char *lasts;					     /* For strtok_r */#endif    if (!HTBindings) HTBind_init();    if (*quality < HT_EPSILON)	*quality = 1.0;			           /* Set to a neutral value */    StrAllocCopy(file, filename);    HTUnEscape(file);				   /* Unescape the file name */#ifdef HT_REENTRANT    if (strtok_r(file, HTDelimiters, &lasts)) {	 /* Do we have any suffixes? */#else    if (strtok(file, HTDelimiters)) { 		 /* Do we have any suffixes? */#endif /* HT_REENTRANT */	char *suffix;#ifdef HT_REENTRANT	while ((suffix=(char*)strtok_r(NULL, HTDelimiters, &lasts)) != NULL) {#else	while ((suffix=strtok(NULL, HTDelimiters)) != NULL) {#endif /* HT_REENTRANT */	    HTBind *suff=NULL;	    int hash;	    unsigned char * p;	    HTTRACE(BIND_TRACE, "Get Binding. Look for '%s\' " _ suffix);	    sufcnt++;	    /* Select list from hash table */	    for (p=suffix, hash=0; *p; p++) {		hash = (hash * 3 + TOLOWER(*p)) % HT_L_HASH_SIZE;	    }	    /* Now search list for entries (case or non case sensitive) */	    if (HTBindings[hash]) {		HTList *cur = HTBindings[hash];		while ((suff = (HTBind *) HTList_nextObject(cur))) {		    if ((HTCaseSen && !strcmp(suff->suffix, suffix)) ||			!strcasecomp(suff->suffix, suffix)) {			HTTRACE(BIND_TRACE, "Found!\n");			if (suff->type && format) *format = suff->type;			if (suff->encoding && enc) *enc = suff->encoding;			if (suff->transfer && cte) *cte = suff->transfer;			if (suff->language && lang) *lang = suff->language;			if (suff->quality > HT_EPSILON)			    *quality *= suff->quality;			break;		    }		}	    }	    if (!suff) {	/* We don't have this suffix - use default */		HTTRACE(BIND_TRACE, "Not found - use default for \'*.*\'\n");		if (format) *format = unknown_suffix.type;		if (enc) *enc = unknown_suffix.encoding;		if (cte) *cte = unknown_suffix.transfer;		if (lang) *lang = unknown_suffix.language;		*quality = unknown_suffix.quality;	    }	} /* while we still have suffixes */    }    if (!sufcnt) {		/* No suffix so use default value */	HTTRACE(BIND_TRACE, "Get Binding. No suffix found - using default '%s\'\n" _ filename);	if (format) *format = no_suffix.type;	if (enc) *enc = no_suffix.encoding;	if (cte) *cte = no_suffix.transfer;	if (lang) *lang = no_suffix.language;	*quality = no_suffix.quality;    }    HTTRACE(BIND_TRACE, "Get Binding. Result for '%s\' is: type='%s\', encoding='%s\', cte='%s\', language='%s\' with quality %.2f\n" _ 		filename _ 		(format && *format) ? HTAtom_name(*format) : "unknown" _ 		(enc && *enc) ? HTAtom_name(*enc) : "unknown" _ 		(cte && *cte) ? HTAtom_name(*cte) : "unknown" _ 		(lang && *lang) ? HTAtom_name(*lang) : "unknown" _ 		*quality);    HT_FREE(file);    return YES;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
三级欧美韩日大片在线看| 不卡视频在线看| 不卡的电影网站| 91麻豆精品国产91久久久资源速度 | 欧美高清视频www夜色资源网| 2020国产精品| 日日摸夜夜添夜夜添精品视频| 国产精品一区二区久激情瑜伽| 欧美裸体一区二区三区| 亚洲品质自拍视频| 国产成人午夜精品影院观看视频 | 视频一区中文字幕国产| 成人综合婷婷国产精品久久免费| 91麻豆精品国产91久久久使用方法 | 欧美国产国产综合| 美女一区二区三区| 欧美裸体bbwbbwbbw| 有坂深雪av一区二区精品| 成人av网站免费观看| 久久久美女艺术照精彩视频福利播放| 日韩精品电影在线观看| 欧美四级电影网| 亚洲黄色小视频| 91美女片黄在线观看| 国产精品久久久久久久久免费丝袜| 国内精品久久久久影院色| 91麻豆精品国产91| 视频在线在亚洲| 337p亚洲精品色噜噜噜| 日韩高清中文字幕一区| 91精品在线免费| 奇米777欧美一区二区| 91精品国产91综合久久蜜臀| 日本不卡一区二区三区| 51精品视频一区二区三区| 丝袜国产日韩另类美女| 欧美一区二区三区小说| 日本91福利区| 国产亚洲精品久| 成人综合在线观看| 亚洲精品五月天| 欧美日韩亚洲综合一区二区三区| 香港成人在线视频| 日韩女优电影在线观看| 国产精品1区二区.| 国产精品白丝在线| 欧美在线观看视频一区二区| 亚洲成人av电影在线| 日韩一区二区视频| 国产精品一级片在线观看| 亚洲视频香蕉人妖| 欧美午夜精品久久久久久孕妇| 天天操天天色综合| 精品免费国产一区二区三区四区| 国产激情视频一区二区在线观看 | 91在线视频播放地址| 亚洲乱码国产乱码精品精小说| 在线观看av一区| 日本伊人色综合网| 久久综合av免费| 91久久免费观看| 美女网站在线免费欧美精品| 国产蜜臀97一区二区三区| 色综合天天综合在线视频| 亚洲第一福利视频在线| 精品国产免费人成电影在线观看四季 | 日本欧美一区二区三区乱码| 久久久久久久久97黄色工厂| 色综合色狠狠综合色| 午夜国产不卡在线观看视频| 国产欧美一区二区三区沐欲| 欧美日韩中文一区| 韩国午夜理伦三级不卡影院| 亚洲男人的天堂一区二区| 欧美一区二区三区在线视频| aaa亚洲精品| 五月天亚洲精品| 亚洲国产精品二十页| 欧美高清视频一二三区| 成人国产在线观看| 蜜臀久久99精品久久久久久9 | 国产欧美日韩精品一区| 欧美三级电影在线观看| 成人免费毛片aaaaa**| 五月婷婷久久综合| 又紧又大又爽精品一区二区| 久久久不卡网国产精品二区| 欧美日韩国产美| 91丨porny丨户外露出| 国产麻豆一精品一av一免费| 亚洲高清在线视频| 亚洲区小说区图片区qvod| 26uuu国产日韩综合| 日韩欧美色综合| 欧美午夜精品免费| 99久久99久久精品免费看蜜桃| 国产伦精品一区二区三区在线观看 | 国产精品自拍av| 视频一区在线视频| 亚洲一区在线电影| 亚洲人xxxx| 日韩伦理电影网| 国产蜜臀av在线一区二区三区| 精品国产髙清在线看国产毛片| 另类小说一区二区三区| 亚洲高清免费一级二级三级| 亚洲日本在线视频观看| 亚洲国产精品成人综合色在线婷婷| 欧美电影免费观看高清完整版在| 欧美久久高跟鞋激| 欧美人狂配大交3d怪物一区| 在线观看亚洲a| 欧美性生交片4| 一本久道久久综合中文字幕| 99re66热这里只有精品3直播| 成人综合激情网| 成人av免费在线播放| 99久久久国产精品免费蜜臀| 99久久夜色精品国产网站| aaa亚洲精品| 日本精品裸体写真集在线观看| 欧美在线观看一区二区| 欧美日韩不卡视频| 日韩无一区二区| 久久精品视频一区二区| 亚洲国产精品高清| 国产精品每日更新| 国内外成人在线| 国产aⅴ综合色| 成人av网站免费观看| 色婷婷综合久久| 欧美精品一级二级| 欧美本精品男人aⅴ天堂| 国产欧美一区在线| 一区二区在线观看视频| 亚洲电影欧美电影有声小说| 久久精品国产成人一区二区三区| 精品无人区卡一卡二卡三乱码免费卡 | 亚洲国产精品自拍| 日韩国产欧美在线播放| 狠狠色狠狠色综合系列| 99精品热视频| 欧美日韩国产经典色站一区二区三区| 91精品国产一区二区人妖| 精品久久久久香蕉网| 欧美韩国一区二区| 亚洲国产一区二区三区| 精品亚洲aⅴ乱码一区二区三区| 成人国产在线观看| 337p亚洲精品色噜噜噜| 国产精品日韩成人| 天堂蜜桃一区二区三区| 国产福利一区二区三区在线视频| 在线免费av一区| 久久无码av三级| 亚洲自拍偷拍图区| 国产成人亚洲综合a∨猫咪| 在线观看日韩一区| 久久久国产精品麻豆| 午夜精品一区二区三区电影天堂| 国产成人一区在线| 欧美精品日韩综合在线| 国产精品理论在线观看| 美女任你摸久久| 色综合 综合色| 国产清纯在线一区二区www| 日韩成人精品在线| 91精品福利视频| 国产亚洲欧洲一区高清在线观看| 一区二区三区欧美久久| 国产成人综合网站| 99精品偷自拍| 99精品国产一区二区三区不卡| 欧美电影免费观看高清完整版在线观看| 亚洲少妇屁股交4| 国产一区二区美女诱惑| 欧美片网站yy| 亚洲一区在线看| 成人av手机在线观看| 久久你懂得1024| 日本亚洲免费观看| 欧美日韩一级片在线观看| **性色生活片久久毛片| 国产乱码精品一品二品| 日韩欧美综合一区| 日韩一区精品视频| 欧美三级日韩在线| 亚洲一区在线电影| 91久久一区二区| 亚洲男女毛片无遮挡| 91在线视频在线| 中文字幕成人av| 国产福利一区二区三区视频在线| 亚洲精品一线二线三线无人区| 午夜精品福利一区二区蜜股av| 91久久精品国产91性色tv| 18涩涩午夜精品.www| av一二三不卡影片| 亚洲欧洲三级电影| 94色蜜桃网一区二区三区|