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

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

?? search.c

?? 一個很有名的瀏覽器
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* Searching in the HTML document *//* $Id: search.c,v 1.305.2.5 2005/04/06 09:11:19 jonas Exp $ */#ifndef _GNU_SOURCE#define _GNU_SOURCE /* XXX: we _WANT_ strcasestr() ! */#endif#ifdef HAVE_CONFIG_H#include "config.h"#endif#include <ctype.h> /* tolower(), isprint() */#include <sys/types.h> /* FreeBSD needs this before regex.h */#ifdef HAVE_REGEX_H#include <regex.h>#endif#include <stdlib.h>#include <string.h>#include "elinks.h"#include "bfu/dialog.h"#include "config/kbdbind.h"#include "document/document.h"#include "document/view.h"#include "intl/gettext/libintl.h"#include "sched/event.h"#include "sched/session.h"#include "terminal/screen.h"#include "terminal/terminal.h"#include "util/color.h"#include "util/error.h"#include "util/memory.h"#include "util/string.h"#include "viewer/text/draw.h"#include "viewer/text/link.h"#include "viewer/text/search.h"#include "viewer/text/view.h"#include "viewer/text/vs.h"#define SEARCH_HISTORY_FILENAME		"searchhist"static INIT_INPUT_HISTORY(search_history);static inline voidadd_srch_chr(struct document *document, unsigned char c, int x, int y, int nn){	assert(document);	if_assert_failed return;	if (c == ' ' && !document->nsearch) return;	if (document->search) {		int n = document->nsearch;		if (c == ' ' && document->search[n - 1].c == ' ')			return;		document->search[n].c = c;		document->search[n].x = x;		document->search[n].y = y;		document->search[n].n = nn;	}	document->nsearch++;}static voidsort_srch(struct document *document){	int i;	int *min, *max;	assert(document);	if_assert_failed return;	document->slines1 = mem_calloc(document->height, sizeof(*document->slines1));	if (!document->slines1) return;	document->slines2 = mem_calloc(document->height, sizeof(*document->slines2));	if (!document->slines2) {		mem_free(document->slines1);		return;	}	min = mem_calloc(document->height, sizeof(*min));	if (!min) {		mem_free(document->slines1);		mem_free(document->slines2);		return;	}	max = mem_calloc(document->height, sizeof(*max));	if (!max) {		mem_free(document->slines1);		mem_free(document->slines2);		mem_free(min);		return;	}	for (i = 0; i < document->height; i++) {		min[i] = INT_MAX;		max[i] = 0;	}	for (i = 0; i < document->nsearch; i++) {		struct search *s = &document->search[i];		int sxn = s->x + s->n;		if (s->x < min[s->y]) {			min[s->y] = s->x;		   	document->slines1[s->y] = s;		}		if (sxn > max[s->y]) {			max[s->y] = sxn;			document->slines2[s->y] = s;		}	}	mem_free(min);	mem_free(max);}static intget_srch(struct document *document){	struct node *node;	assert(document && document->nsearch == 0);	if_assert_failed return 0;	foreachback (node, document->nodes) {		int x, y;		int height = int_min(node->box.y + node->box.height, document->height);		for (y = node->box.y; y < height; y++) {			int width = int_min(node->box.x + node->box.width,					    document->data[y].length);			for (x = node->box.x;			     x < width && document->data[y].chars[x].data <= ' ';			     x++);			for (; x < width; x++) {				unsigned char c = document->data[y].chars[x].data;				int count = 0;				int xx;				if (document->data[y].chars[x].attr & SCREEN_ATTR_UNSEARCHABLE)					continue;				if (c > ' ') {					add_srch_chr(document, c, x, y, 1);					continue;				}				for (xx = x + 1; xx < width; xx++) {					if (document->data[y].chars[xx].data < ' ')						continue;					count = xx - x;					break;				}				add_srch_chr(document, ' ', x, y, count);				x = xx - 1;			}			add_srch_chr(document, ' ', x, y, 0);		}	}	return document->nsearch;}static voidget_search_data(struct document *document){	int n;	assert(document);	if_assert_failed return;	if (document->search) return;	n = get_srch(document);	if (!n) return;	document->nsearch = 0;	document->search = mem_alloc(n * sizeof(*document->search));	if (!document->search) return;	get_srch(document);	while (document->nsearch	       && document->search[--document->nsearch].c == ' ');	sort_srch(document);}/* Returns -1 on assertion failure, 1 if s1 and s2 are not found, * and 0 if they are found. */static intget_range(struct document *document, int y, int height, int l,	  struct search **s1, struct search **s2){	int i;	assert(document && s1 && s2);	if_assert_failed return -1;	*s1 = *s2 = NULL;	int_lower_bound(&y, 0);	for (i = y; i < y + height && i < document->height; i++) {		if (document->slines1[i] && (!*s1 || document->slines1[i] < *s1))			*s1 = document->slines1[i];		if (document->slines2[i] && (!*s2 || document->slines2[i] > *s2))			*s2 = document->slines2[i];	}	if (!*s1 || !*s2) return 1;	*s1 -= l;	if (*s1 < document->search)		*s1 = document->search;	if (*s2 > document->search + document->nsearch - l + 1)		*s2 = document->search + document->nsearch - l + 1;	if (*s1 > *s2)		*s1 = *s2 = NULL;	if (!*s1 || !*s2)		return 1;	return 0;}/* Returns a string |doc| that is a copy of the text in the search nodes * from |s1| to |s1 + doclen - 1| with the space at the end of each line * converted to a new-line character (LF). */static unsigned char *get_search_region_from_search_nodes(struct search *s1, int doclen){	unsigned char *doc;	int i;	doc = mem_alloc(sizeof(unsigned char ) * (doclen + 1));	if (!doc) return NULL;	for (i = 0; i < doclen; i++) {		if (i > 0 && s1[i - 1].c == ' ' && s1[i - 1].y != s1[i].y) {			doc[i - 1] = '\n';		}		doc[i] = s1[i].c;	}	doc[doclen] = 0;	return doc;}#ifdef HAVE_REGEX_Hstatic intis_in_range_regex(struct document *document, int y, int height,		  unsigned char *text, int textlen,		  int *min, int *max,		  struct search *s1, struct search *s2){	int yy = y + height;	unsigned char *doc;	unsigned char *doctmp;	int doclen;	int found = 0;	int regex_flags = REG_NEWLINE;	int regexec_flags = 0;	int i;	int reg_err;	regex_t regex;	regmatch_t regmatch;	int pos = 0;	struct search *search_start = s1;	unsigned char save_c;	if (get_opt_int("document.browse.search.regex") == 2)		regex_flags |= REG_EXTENDED;	if (!get_opt_bool("document.browse.search.case"))		regex_flags |= REG_ICASE;	reg_err = regcomp(&regex, text, regex_flags);	if (reg_err) {		regfree(&regex);		return -2;	}	doclen = s2 - s1 + textlen;	if (!doclen) {		regfree(&regex);		return 0;	}	doc = get_search_region_from_search_nodes(s1, doclen);	if (!doc) {		regfree(&regex);		return -1;	}	doctmp = doc;find_next:	while (pos < doclen && (search_start[pos].y < y - 1				|| search_start[pos].y > yy)) pos++;	doctmp = &doc[pos];	s1 = &search_start[pos];	while (pos < doclen && search_start[pos].y >= y - 1			    && search_start[pos].y <= yy) pos++;	save_c = doc[pos];	doc[pos] = 0;	while (*doctmp && !regexec(&regex, doctmp, 1, &regmatch, regexec_flags)) {		regexec_flags = REG_NOTBOL;		textlen = regmatch.rm_eo - regmatch.rm_so;		if (!textlen) { doc[pos] = save_c; found = 1; goto free_stuff; }		s1 += regmatch.rm_so;		doctmp += regmatch.rm_so;		if (s1[textlen].y < y || s1[textlen].y >= yy)			goto next;		found = 1;		for (i = 0; i < textlen; i++) {			if (!s1[i].n) continue;			int_upper_bound(min, s1[i].x);			int_lower_bound(max, s1[i].x + s1[i].n);		}next:		doctmp += int_max(textlen, 1);		s1 += int_max(textlen, 1);	}	doc[pos] = save_c;	if (pos < doclen)		goto find_next;free_stuff:	regfree(&regex);	mem_free(doc);	return found;}#endif /* HAVE_REGEX_H *//* Returns an allocated string which is a lowered copy of passed one. */static unsigned char *lowered_string(unsigned char *text, int textlen){	unsigned char *ret;	if (textlen < 0) textlen = strlen(text);	ret = mem_calloc(1, textlen + 1);	if (ret && textlen) {		do {			ret[textlen] = tolower(text[textlen]);		} while (textlen--);	}	return ret;}static intis_in_range_plain(struct document *document, int y, int height,		  unsigned char *text, int textlen,		  int *min, int *max,		  struct search *s1, struct search *s2){	int yy = y + height;	unsigned char *txt;	int found = 0;	int case_sensitive = get_opt_bool("document.browse.search.case");	txt = case_sensitive ? stracpy(text) : lowered_string(text, textlen);	if (!txt) return -1;	/* TODO: This is a great candidate for nice optimizations. Fresh CS	 * graduates can use their knowledge of ie. KMP (should be quite	 * trivial, probably a starter; very fast as well) or Turbo-BM (or	 * maybe some other Boyer-Moore variant, I don't feel that strong in	 * this area), hmm?  >:) --pasky */#define maybe_tolower(c) (case_sensitive ? (c) : tolower(c))	for (; s1 <= s2; s1++) {		int i;		if (maybe_tolower(s1->c) != txt[0]) {srch_failed:			continue;		}		for (i = 1; i < textlen; i++)			if (maybe_tolower(s1[i].c) != txt[i])				goto srch_failed;		if (s1[i].y < y || s1[i].y >= yy)			continue;		found = 1;		for (i = 0; i < textlen; i++) {			if (!s1[i].n) continue;			int_upper_bound(min, s1[i].x);			int_lower_bound(max, s1[i].x + s1[i].n);		}	}#undef maybe_tolower	mem_free(txt);	return found;}static intis_in_range(struct document *document, int y, int height,	    unsigned char *text, int *min, int *max){	struct search *s1, *s2;	int textlen;	assert(document && text && min && max);	if_assert_failed return -1;	*min = INT_MAX, *max = 0;	textlen = strlen(text);	if (get_range(document, y, height, textlen, &s1, &s2))		return 0;#ifdef HAVE_REGEX_H	if (get_opt_int("document.browse.search.regex"))		return is_in_range_regex(document, y, height, text, textlen,					 min, max, s1, s2);#endif	return is_in_range_plain(document, y, height, text, textlen,				 min, max, s1, s2);}#define realloc_points(pts, size) \	mem_align_alloc(pts, size, (size) + 1, struct point, 0xFF)static voidget_searched_plain(struct document_view *doc_view, struct point **pt, int *pl,		   int l, struct search *s1, struct search *s2){	unsigned char *txt;	struct point *points = NULL;	struct box *box;	int xoffset, yoffset;	int len = 0;	int case_sensitive = get_opt_bool("document.browse.search.case");	txt = case_sensitive ? stracpy(*doc_view->search_word)			     : lowered_string(*doc_view->search_word, l);	if (!txt) return;	box = &doc_view->box;	xoffset = box->x - doc_view->vs->x;	yoffset = box->y - doc_view->vs->y;#define maybe_tolower(c) (case_sensitive ? (c) : tolower(c))	for (; s1 <= s2; s1++) {		int i;		if (maybe_tolower(s1[0].c) != txt[0]) {srch_failed:			continue;		}		for (i = 1; i < l; i++)			if (maybe_tolower(s1[i].c) != txt[i])				goto srch_failed;		for (i = 0; i < l; i++) {			int j;			int y = s1[i].y + yoffset;			if (!row_is_in_box(box, y))				continue;			for (j = 0; j < s1[i].n; j++) {				int sx = s1[i].x + j;				int x = sx + xoffset;				if (!col_is_in_box(box, x))					continue;				if (!realloc_points(&points, len))					continue;				points[len].x = sx;				points[len++].y = s1[i].y;			}		}	}#undef maybe_tolower	mem_free(txt);	*pt = points;	*pl = len;}#ifdef HAVE_REGEX_Hstatic voidget_searched_regex(struct document_view *doc_view, struct point **pt, int *pl,		   int l, struct search *s1, struct search *s2){	unsigned char *doc;	unsigned char *doctmp;	int doclen;	struct point *points = NULL;	int xoffset, yoffset;	int len = 0;	int regex_flags = REG_NEWLINE;	int regexec_flags = 0;	int reg_err;	int i;	regex_t regex;	regmatch_t regmatch;	int pos = 0;	struct search *search_start = s1;	unsigned char save_c;	struct box *box;	int y1, y2;	if (get_opt_int("document.browse.search.regex") == 2)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品免费视频一区二区| 欧洲一区二区三区免费视频| 欧美成人免费网站| 久久99国产精品成人| 精品成人一区二区| 国产成a人亚洲精| 亚洲欧美综合另类在线卡通| 91在线你懂得| 亚洲成人高清在线| 日韩精品一区二区三区中文精品| 另类小说色综合网站| 精品国产一区二区三区久久影院 | 国产精品久久久久久亚洲伦| 国产99精品国产| 亚洲精品va在线观看| 欧美人妇做爰xxxⅹ性高电影| 视频一区在线播放| 精品1区2区在线观看| 成人免费三级在线| 亚洲综合一二三区| 欧美成人三级电影在线| 成人综合在线网站| 亚洲va国产天堂va久久en| 精品国产3级a| 色婷婷综合在线| 久久国产乱子精品免费女| 国产精品二区一区二区aⅴ污介绍| 欧美日韩三级一区二区| 国产电影精品久久禁18| 亚洲地区一二三色| 国产亚洲精久久久久久| 91黄视频在线观看| 国产一区中文字幕| 亚洲午夜在线电影| 国产日韩欧美精品一区| 在线观看免费一区| 国产一区二区0| 五月激情六月综合| 国产精品毛片无遮挡高清| 欧美乱妇23p| 成人av资源下载| 久久99精品网久久| 亚洲成人你懂的| 国产精品美女久久久久久久| 日韩午夜激情视频| 欧洲国产伦久久久久久久| 国产成人av电影在线观看| 午夜精品福利一区二区蜜股av| 日本一区二区三区国色天香| 91精品国产福利在线观看| www.欧美亚洲| 国产精品一区二区在线看| 天天免费综合色| 亚洲欧美另类久久久精品2019| 久久色成人在线| 91精品国产综合久久小美女| 91蜜桃视频在线| 高清国产一区二区| 精品一区精品二区高清| 午夜国产精品影院在线观看| 亚洲色图欧美在线| 亚洲国产成人午夜在线一区| 欧美xxxx在线观看| 日韩片之四级片| 欧美另类videos死尸| 欧日韩精品视频| 色综合天天综合给合国产| 成人av在线资源网| 国产69精品久久久久毛片| 国内外成人在线| 狠狠色狠狠色综合日日91app| 日本欧美久久久久免费播放网| 一区二区三区不卡在线观看 | 欧美怡红院视频| 97精品电影院| 一本到不卡免费一区二区| 成人福利视频网站| jlzzjlzz欧美大全| 91影视在线播放| 色综合激情五月| 在线视频亚洲一区| 欧美在线观看视频一区二区三区| 色狠狠一区二区三区香蕉| 欧洲日韩一区二区三区| 欧美亚洲国产一区二区三区va| 欧亚洲嫩模精品一区三区| 欧美主播一区二区三区| 欧美日韩在线免费视频| 欧美日韩视频在线一区二区 | 精品日韩一区二区| 欧美精品一区二区三区一线天视频| 日韩欧美国产一区二区三区| 日韩丝袜情趣美女图片| 精品国产伦一区二区三区观看体验 | 激情丁香综合五月| 国产大陆亚洲精品国产| 高清不卡一二三区| 成人aaaa免费全部观看| 欧美在线观看视频在线| 欧美一卡二卡在线观看| 久久免费看少妇高潮| 中文字幕乱码一区二区免费| 亚洲精品久久7777| 麻豆精品在线播放| 国产成人精品aa毛片| 91蜜桃免费观看视频| 4438成人网| 久久欧美中文字幕| 亚洲精品国产精华液| 日本伊人精品一区二区三区观看方式| 老司机精品视频在线| 成人永久aaa| 欧美日韩国产天堂| 国产人久久人人人人爽| 亚洲精品国久久99热| 免费观看在线综合| 91在线观看污| 欧美一区欧美二区| 国产精品另类一区| 天堂av在线一区| 成人午夜视频网站| 欧美日韩成人一区| 国产女同性恋一区二区| 亚洲高清免费一级二级三级| 国产精品18久久久久久久久久久久| 91丨九色丨蝌蚪富婆spa| 3751色影院一区二区三区| 国产欧美日韩三级| 日日骚欧美日韩| 成人听书哪个软件好| 制服丝袜中文字幕亚洲| 国产精品久久久久久久久图文区| 首页国产欧美久久| 成人高清免费观看| 日韩一卡二卡三卡四卡| 亚洲三级小视频| 国产伦理精品不卡| 制服视频三区第一页精品| 国产精品毛片无遮挡高清| 蜜桃精品视频在线| 欧美日韩免费电影| 最好看的中文字幕久久| 精品亚洲免费视频| 欧美日韩在线播| 国产精品国产精品国产专区不片| 麻豆中文一区二区| 欧美精品亚洲一区二区在线播放| 欧美激情在线一区二区| 久久国产婷婷国产香蕉| 欧美人妇做爰xxxⅹ性高电影 | 国产精品免费丝袜| 国模无码大尺度一区二区三区| 欧美日韩一二三区| 亚洲精品乱码久久久久久黑人| 国产电影一区二区三区| 日韩免费一区二区| 日日摸夜夜添夜夜添精品视频| 日本韩国欧美一区| 亚洲色图在线看| 99国产一区二区三精品乱码| 欧美极品美女视频| 国产精品中文字幕欧美| 日韩视频一区二区在线观看| 天堂av在线一区| 欧美一级二级三级乱码| 丝瓜av网站精品一区二区| 91视视频在线观看入口直接观看www | 91麻豆免费看| 国产精品欧美精品| 成人99免费视频| 中文字幕在线不卡国产视频| 丁香天五香天堂综合| 国产日韩亚洲欧美综合| 国产.精品.日韩.另类.中文.在线.播放 | 伊人夜夜躁av伊人久久| av影院午夜一区| 亚洲免费观看视频| 欧美唯美清纯偷拍| 天天av天天翘天天综合网| 欧美精品第一页| 日韩av一区二区三区四区| 91精品国产综合久久久久久漫画 | 日韩一卡二卡三卡| 国精产品一区一区三区mba桃花 | 青青草伊人久久| 精品精品国产高清一毛片一天堂| 激情综合色播激情啊| 久久精品网站免费观看| 97国产一区二区| 亚洲一区二区视频在线观看| 欧美日韩国产123区| 蜜桃在线一区二区三区| 久久久精品免费网站| 94-欧美-setu| 天天色天天操综合| 国产亚洲午夜高清国产拍精品 | 日本vs亚洲vs韩国一区三区| 久久精品欧美日韩精品| 91美女片黄在线观看| 日韩精品一二区|