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

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

?? sgml.c

?? firtext搜索引擎源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*									 SGML.c**	GENERAL SGML PARSER CODE****	(c) COPYRIGHT MIT 1995.**	Please first read the full copyright statement in the file COPYRIGH.**	@(#) $Id: SGML.c,v 1.53 1999/05/18 21:38:57 frystyk Exp $****	This module implements an HTStream object. To parse an**	SGML file, create this object which is a parser. The object**	is (currently) created by being passed a DTD structure,**	and a target HTStructured oject at which to throw the parsed stuff.**	**	 6 Feb 93  	Binary seraches used. Intreface modified.**	 8 Jul 94  FM	Insulate free() from _free structure element.**	Nov 1996   msa	Strip down the parser to minimal HTML tokenizer,**			Stop allocating space for the attribute values,**			use pointers to the string chunk instead.*/#include <assert.h>/* Library include files */#include "wwwsys.h"#include "HTUtils.h"#include "HTString.h"#include "HTChunk.h"#include "SGML.h"#define INVALID (-1)#define IS_SPACE(c) ((c>0)?isspace(c):0)#define IS_ALNUM(c) ((c>0)?isalnum(c):0)/*	The State (context) of the parser****	This is passed with each call to make the parser reentrant***/typedef enum _sgml_state    {	S_text, S_literal, S_tag, S_tag_gap, 	S_attr, S_attr_gap, S_equals, S_value, S_after_open,	S_nl, S_nl_tago,	S_ero, S_cro,#ifdef ISO_2022_JP	S_esc, S_dollar, S_paren, S_nonascii_text,#endif	S_squoted, S_dquoted, S_end, S_entity, S_junk_tag,	S_md, S_md_sqs, S_md_dqs, S_com_1, S_com, S_com_2, S_com_2a    } sgml_state;/*	Internal Context Data Structure**	-------------------------------*/struct _HTStream    {	const HTStreamClass *isa;	/* inherited from HTStream */	const SGML_dtd *dtd;	HTStructuredClass *actions;	/* target class  */	HTStructured *target;		/* target object */	HTTag *current_tag;	int current_attribute_number;	SGMLContent contents;		/* current content mode */	HTChunk *string;	int token;			/* ptr into string buffer */	sgml_state state;	BOOL present[MAX_ATTRIBUTES];	/* Flags: attribute is present? */	int value[MAX_ATTRIBUTES];	/* Offset pointers to the string */    };#define PUTC(ch) ((*context->actions->put_character)(context->target, ch))#define PUTB(b,l) ((*context->actions->put_block)(context->target, b, l))/*	Find Attribute Number**	---------------------*/PRIVATE int SGMLFindAttribute  (HTTag* tag, const char * s)    {	HTAttr* attributes = tag->attributes;	int high, low, i, diff;		/* Binary search for attribute name */	assert(tag->number_of_attributes <= MAX_ATTRIBUTES);	for(low=0, high=tag->number_of_attributes;	    high > low ;	    diff < 0 ? (low = i+1) : (high = i) )	    {		i = (low + (high-low)/2);		diff = strcasecomp(attributes[i].name, s);		if (diff==0)			return i;	/* success: found it */	    }	return -1;    }/*	Handle Attribute**	----------------*//* PUBLIC const char * SGML_default = "";   ?? */PRIVATE void handle_attribute_name (HTStream * context, const char * s)    {	HTTag * tag = context->current_tag;	/* Note: if tag==NULL, we are skipping unknown tag... */	if (tag)	    {		int i = SGMLFindAttribute(tag, s);		if (i >= 0)		    {			context->current_attribute_number = i;			context->present[i] = YES;			return;		    }		HTTRACE(SGML_TRACE, "Unknown attribute %s for tag %s\n" _			s _ context->current_tag->name);	    }	context->current_attribute_number = INVALID;	/* Invalid */    }/*	Handle attribute value**	----------------------*/PRIVATE void handle_attribute_value (HTStream * context)    {	/* Deal with attributes only if tag is known,	   ignore silently otherwise */	if (context->current_tag)	    {		if (context->current_attribute_number != INVALID)			context->value[context->current_attribute_number] =				context->token;		else {		    char * data = HTChunk_data(context->string);		    HTTRACE(SGML_TRACE, "Attribute value %s ignored\n" _			   data ? data+context->token : "<null>");		}	    }	context->current_attribute_number = INVALID; /* can't have two assignments! */    }/*	Handle entity**	-------------**** On entry,**	s	contains the entity name zero terminated*/PRIVATE void handle_entity (HTStream * context)    {	const char ** entities = context->dtd->entity_names;	const char *s = HTChunk_data(context->string);	int high, low, i, diff;	for(low=0, high = context->dtd->number_of_entities;	    high > low ;	    diff < 0 ? (low = i+1) : (high = i))	    {		i = (low + (high-low)/2);		diff = strcmp(entities[i], s);	/* Case sensitive! */		if (diff==0)		    {	/* success: found it */			(*context->actions->put_entity)(context->target, i);			return;		    }	    }	/* If entity string not found */	HTTRACE(SGML_TRACE, "Unknown entity %s\n" _ s);	(*context->actions->unparsed_entity)	    (context->target, HTChunk_data(context->string), HTChunk_size(context->string));    }/*	End element**	-----------*/PRIVATE void end_element (HTStream * context, HTTag *tag)    {	HTTRACE(SGML_TRACE, "End   </%s>\n" _ tag->name);	(*context->actions->end_element)		(context->target, tag - context->dtd->tags);    }/*	Start an element**	----------------*/PRIVATE void start_element (HTStream * context)    {	int i;	char *value[MAX_ATTRIBUTES];	HTTag *tag = context->current_tag;	HTTRACE(SGML_TRACE, "Start <%s>\n" _ tag->name);	context->contents = tag->contents;	/*	** Build the actual pointers to the value strings stored in the	** chunk buffer. (Must use offsets while collecting the values,	** because the string chunk may get resized during the collection	** and potentially relocated).	*/	for (i = 0; i < MAX_ATTRIBUTES; ++i)		value[i] = context->value[i] < 0 ? NULL :			HTChunk_data(context->string) + context->value[i];	(*context->actions->start_element)		(context->target,		 tag - context->dtd->tags,		 context->present,		 (const char**)value);  /* coerce type for think c */    }/*		Find Tag in DTD tag list**		------------------------**** On entry,**	dtd	points to dtd structire including valid tag list**	string	points to name of tag in question**** On exit,**	returns:**		NULL		tag not found**		else		address of tag structure in dtd*/PRIVATE HTTag * SGMLFindTag (const SGML_dtd* dtd, const char * string)    {	int high, low, i, diff;	for(low=0, high=dtd->number_of_tags;	    high > low ;	    diff < 0 ? (low = i+1) : (high = i))	    {  /* Binary serach */		i = (low + (high-low)/2);		diff = strcasecomp(dtd->tags[i].name, string);	/* Case insensitive */		if (diff==0)			/* success: found it */			return &dtd->tags[i];	    }	return NULL;    }/*________________________________________________________________________**			Public Methods*//*	Could check that we are back to bottom of stack! @@  */PRIVATE int SGML_flush  (HTStream * context)    {	return (*context->actions->flush)(context->target);    }PRIVATE int SGML_free  (HTStream * context)    {	int status;	if ((status = (*context->actions->_free)(context->target)) != HT_OK)		return status;	HTChunk_delete(context->string);	HT_FREE(context);	return HT_OK;    }PRIVATE int SGML_abort  (HTStream * context, HTList * e)    {	(*context->actions->abort)(context->target, e);	HTChunk_delete(context->string);	HT_FREE(context);	return HT_ERROR;    }PRIVATE int SGML_write (HTStream * context, const char * b, int l)    {	const SGML_dtd	*dtd = context->dtd;	HTChunk	*string = context->string;	const char *text = b;	int count = 0;		while (l-- > 0)	    {		char c = *b++;		switch(context->state)		    {		    got_element_open:			/*			** The label is jumped when the '>' of a the element			** start tag has been detected. This DOES NOT FALL TO			** THE CODE S_after_open, only processes the tag and			** sets the state (c should still contain the			** terminating character of the tag ('>'))			*/			if (context->current_tag && context->current_tag->name)				start_element(context);			context->state = S_after_open;			break;		    case S_after_open:			/*			** State S_after_open is entered only for single			** character after the element opening tag to test			** against newline. Strip one trainling newline only			** after opening nonempty element.  - SGML: Ugh!			*/			text = b;			count = 0;			if (c == '\n' && (context->contents != SGML_EMPTY))			    {				context->state = S_text;				break;			    }			--text;			goto S_text;		    S_text:			context->state = S_text;		    case S_text:#ifdef ISO_2022_JP			if (c == '\033')			    {				context->state = S_esc;				++count;				break;			    }#endif /* ISO_2022_JP */			if (c == '&')			    {				if (count > 0)					PUTB(text, count);				count = 0;				HTChunk_clear(string);				context->state = S_ero;			    }			else if (c == '<')			    {				if (count > 0)					PUTB(text, count);				count = 0;				HTChunk_clear(string);				/* should scrap LITERAL, and use CDATA and				   RCDATA -- msa */				context->state =					(context->contents == SGML_LITERAL) ?						S_literal : S_tag;			    }			else if (c == '\n')			    	/* Newline - ignore if before end tag! */				context->state = S_nl;			else				++count;			break;		    case S_nl:			if (c == '<')			    {				if (count > 0)					PUTB(text, count);				count = 0;				HTChunk_clear(string);				context->state =					(context->contents == SGML_LITERAL) ?						S_literal : S_nl_tago;			    }			else			    {				++count;				goto S_text;			    }			break;		    case S_nl_tago:	/* Had newline and tag opener */			if (c != '/')				PUTC('\n'); /* Only ignore newline before </ */			context->state = S_tag;			goto handle_S_tag;#ifdef ISO_2022_JP		    case S_esc:			if (c=='$')				context->state = S_dollar;			else if (c=='(')				context->state = S_paren;			else				context->state = S_text;			++count;			break;		    case S_dollar:			if (c=='@' || c=='B')				context->state = S_nonascii_text;			else				context->state = S_text;			++count;			break;		    case S_paren:			if (c=='B' || c=='J')				context->state = S_text;			else				context->state = S_text;			++count;			break;		    case S_nonascii_text:			if (c == '\033')				context->state = S_esc;			++count;			break;#endif /* ISO_2022_JP */			/* In literal mode, waits only for specific end tag!			** Only foir compatibility with old servers.			*/		    case S_literal:			HTChunk_putc(string, c);			if ( TOUPPER(c) !=			    ((HTChunk_size(string) == 1) ? '/'			     : context->current_tag->name[HTChunk_size(string)-2]))			    {				/* If complete match, end literal */				if ((c == '>') &&				    (!context->current_tag->name[HTChunk_size(string)-2]))				    {					end_element						(context,context->current_tag);					/*					  ...setting SGML_MIXED below is a					  bit of kludge, but a good guess that					  currently works, anything other than					  SGML_LITERAL would work... -- msa */					context->contents = SGML_MIXED;				    }				else				    {					/* If Mismatch: recover string. */					PUTC( '<');					PUTB(HTChunk_data(string), HTChunk_size(string));				    }				context->state = S_text;				text = b;				count = 0;			    }			break;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产自产v一区二区三区c| 亚洲福利视频一区| 在线看一区二区| 国产一区二区剧情av在线| 亚洲综合色自拍一区| 国产精品伦理在线| 精品美女被调教视频大全网站| 色婷婷久久久亚洲一区二区三区| 激情久久五月天| 五月天丁香久久| 一区二区三区在线免费播放| 久久久精品国产99久久精品芒果| 欧美久久婷婷综合色| 色综合网站在线| 不卡电影一区二区三区| 精品一区二区三区香蕉蜜桃| 亚洲一区二区三区四区在线观看 | 中日韩av电影| 精品三级在线看| 91精品国产一区二区三区| 91丝袜国产在线播放| 国产大陆亚洲精品国产| 黄色资源网久久资源365| 婷婷久久综合九色综合绿巨人| 亚洲女与黑人做爰| 国产精品免费视频网站| 国产亚洲精品超碰| 久久精品网站免费观看| www激情久久| 欧美v日韩v国产v| 欧美一区二区三区日韩视频| 777色狠狠一区二区三区| 欧美精品色综合| 欧美日韩免费高清一区色橹橹| 色香色香欲天天天影视综合网| 成人午夜激情视频| 粉嫩aⅴ一区二区三区四区五区| 国产精品自在欧美一区| 国产一区二区福利| 国产aⅴ综合色| 成人污视频在线观看| 成人黄色网址在线观看| 99在线精品免费| 色吊一区二区三区| 欧美日韩在线亚洲一区蜜芽| 欧美日韩精品一二三区| 3d成人h动漫网站入口| 欧美一区二区三区免费在线看| 欧美一级二级三级乱码| 2021久久国产精品不只是精品| 2020国产成人综合网| 欧美激情自拍偷拍| 中文字幕五月欧美| 玉米视频成人免费看| 偷拍一区二区三区| 久久不见久久见免费视频7| 国产一区二区日韩精品| eeuss鲁片一区二区三区| 色偷偷久久一区二区三区| 欧美日韩免费一区二区三区视频| 91精品国产一区二区三区蜜臀 | 日韩欧美中文一区| 精品第一国产综合精品aⅴ| 国产亚洲精品超碰| 一区二区免费在线| 奇米四色…亚洲| 国产成人免费在线观看不卡| 色婷婷久久久久swag精品| 7777女厕盗摄久久久| 国产婷婷色一区二区三区| 亚洲天堂福利av| 日本欧美大码aⅴ在线播放| 国产福利一区在线| 91国模大尺度私拍在线视频| 日韩欧美在线1卡| 国产精品成人一区二区三区夜夜夜| 樱花影视一区二区| 久久99精品一区二区三区| 91蜜桃婷婷狠狠久久综合9色| 欧美美女一区二区三区| 久久精品日产第一区二区三区高清版 | 91网上在线视频| 日韩一区二区三区免费观看| 中文字幕欧美国产| 日日夜夜精品免费视频| 成人高清视频在线观看| 正在播放一区二区| 18成人在线观看| 韩日欧美一区二区三区| 在线亚洲精品福利网址导航| xfplay精品久久| 亚洲妇熟xx妇色黄| 国产a久久麻豆| 日韩视频免费直播| 亚洲综合一区在线| 国产91在线|亚洲| 日韩一区二区免费在线电影| 欧美精品一区二区三区在线播放| 日韩精品一区二区三区四区视频| 久久综合久久综合久久综合| 欧美日本在线看| 欧美激情综合网| 日av在线不卡| 一本大道久久a久久精二百| 精品国产免费人成电影在线观看四季 | 久久综合狠狠综合久久综合88 | 视频在线观看一区| 波多野结衣91| 久久精品亚洲国产奇米99| 五月天亚洲婷婷| 在线观看中文字幕不卡| 成人免费在线视频观看| 国内成人免费视频| 91精品国产欧美一区二区| 一区二区三区在线视频播放| 成人精品一区二区三区四区| 久久日韩粉嫩一区二区三区| 日韩不卡一二三区| 欧美日韩欧美一区二区| 亚洲一二三四在线| 在线观看视频一区| 一区在线观看免费| 99久久777色| 国产精品第13页| 成人激情文学综合网| 国产欧美一区二区三区网站| 国产中文一区二区三区| 精品久久国产字幕高潮| 久久精品国产99| 精品国产伦一区二区三区观看体验| 午夜精品久久久久久久久久久| 在线观看免费视频综合| 亚洲大型综合色站| 欧美猛男超大videosgay| 亚洲成av人片| 欧美一区二区三区影视| 日本欧美韩国一区三区| 欧美成人bangbros| 激情图区综合网| 久久久久久久久久看片| 国产高清不卡二三区| 国产精品欧美精品| 91在线看国产| 亚洲综合图片区| 91精品欧美久久久久久动漫| 秋霞电影网一区二区| 精品免费日韩av| 成人免费视频免费观看| 亚洲精品ww久久久久久p站| 91成人免费电影| 偷拍日韩校园综合在线| 日韩精品一区二区三区三区免费 | 国产欧美日韩精品在线| 成人少妇影院yyyy| 一级日本不卡的影视| 欧美猛男gaygay网站| 韩国av一区二区| 欧美激情一区二区三区不卡| 91视频国产资源| 香港成人在线视频| 久久久久亚洲蜜桃| 色综合婷婷久久| 日本欧美久久久久免费播放网| 久久久噜噜噜久久人人看| 91麻豆免费观看| 奇米一区二区三区av| 日本一二三不卡| 欧美专区日韩专区| 精东粉嫩av免费一区二区三区| 国产精品午夜免费| 在线精品视频免费播放| 久久精品亚洲一区二区三区浴池| 久久伊人蜜桃av一区二区| 2欧美一区二区三区在线观看视频| 欧美一区二区精品| 欧美成人性福生活免费看| 国产丝袜在线精品| 国产一区二区电影| 国产三级精品在线| 欧美日韩一区二区三区视频| 免费观看日韩av| 亚洲欧洲成人自拍| 日韩一区二区视频| 91丝袜美腿高跟国产极品老师 | 日本不卡视频在线| 亚洲欧洲色图综合| 欧美大白屁股肥臀xxxxxx| a在线播放不卡| 美女久久久精品| 一区二区三区高清在线| 精品久久久三级丝袜| 欧美日韩一区二区欧美激情| 国产成人自拍高清视频在线免费播放 | 日本一区二区不卡视频| 欧美一区日本一区韩国一区| 亚瑟在线精品视频| 久久久久九九视频| 亚洲va国产va欧美va观看| 国产欧美中文在线| 精品奇米国产一区二区三区|