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

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

?? 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)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕乱码久久午夜不卡| 在线视频观看一区| 日韩无一区二区| 午夜精品久久久| 欧美乱熟臀69xxxxxx| 日韩二区三区四区| 日韩欧美123| 国产成人日日夜夜| 国产精品国产三级国产三级人妇 | 日韩成人午夜精品| 日韩视频国产视频| 国产精品18久久久久| 国产精品你懂的| 欧美影视一区在线| 美国精品在线观看| 国产三级精品三级| 91久久精品一区二区| 午夜精品久久久久久久| 26uuu欧美| 91丨porny丨户外露出| 亚洲国产日产av| 欧美一区二区免费视频| 国产精品一区二区x88av| 午夜精品一区二区三区免费视频| 成人污污视频在线观看| 色综合久久久久综合99| 56国语精品自产拍在线观看| 麻豆久久久久久久| 最新国产成人在线观看| 欧美片网站yy| 国产69精品久久777的优势| 亚洲综合网站在线观看| 欧美成va人片在线观看| 91看片淫黄大片一级在线观看| 亚洲成av人在线观看| 久久精品男人天堂av| 欧美亚洲高清一区二区三区不卡| 久久精品久久久精品美女| 综合中文字幕亚洲| 日韩视频在线一区二区| 97精品国产露脸对白| 麻豆精品蜜桃视频网站| 亚洲精品成人少妇| 久久综合狠狠综合| 欧美日本国产一区| 丰满白嫩尤物一区二区| 婷婷一区二区三区| 国产精品久久久久久久浪潮网站| 7777精品伊人久久久大香线蕉超级流畅 | 丁香一区二区三区| 青青草国产精品亚洲专区无| 一区在线观看视频| 亚洲精品一区二区三区在线观看| 色诱视频网站一区| 国产成人在线网站| 麻豆精品在线视频| 亚洲国产成人高清精品| 成人欧美一区二区三区黑人麻豆 | 国产精品乱码一区二区三区软件| 精品人在线二区三区| 欧美日本一区二区三区四区| 99国产欧美另类久久久精品| 丁香六月久久综合狠狠色| 国产一区二区三区免费看| 免费成人你懂的| 性做久久久久久| 亚洲综合区在线| 亚洲天堂久久久久久久| 国产精品大尺度| 日本一二三不卡| 国产亚洲欧美日韩俺去了| 精品国产免费久久 | 欧美一区午夜视频在线观看 | 亚洲免费视频中文字幕| 久久综合丝袜日本网| 欧美精品乱码久久久久久按摩| 岛国av在线一区| 麻豆国产精品官网| 日韩二区三区四区| 视频一区在线播放| 一区二区三区国产| 专区另类欧美日韩| 中文无字幕一区二区三区 | 日韩欧美国产一二三区| 91国模大尺度私拍在线视频| 成人免费毛片app| 国产精品99久| 国产在线精品免费| 国内精品免费在线观看| 奇米精品一区二区三区四区 | 91精品国产免费久久综合| 日本精品视频一区二区| 成人黄色免费短视频| 国产精品一区二区在线看| 亚洲成a人v欧美综合天堂下载| 日韩国产一区二| 青青草97国产精品免费观看 | 欧美揉bbbbb揉bbbbb| eeuss鲁一区二区三区| 福利一区二区在线观看| 蜜臀av性久久久久蜜臀aⅴ流畅| 韩国欧美国产1区| 紧缚捆绑精品一区二区| 精品无码三级在线观看视频 | 日韩制服丝袜先锋影音| 午夜视频在线观看一区二区| 一级特黄大欧美久久久| 亚洲一区成人在线| 亚洲丰满少妇videoshd| 天天色天天操综合| 日本中文字幕一区二区有限公司| 日韩高清不卡在线| 蜜桃视频一区二区三区在线观看| 丝袜脚交一区二区| 麻豆精品视频在线观看视频| 国产一区二区看久久| 99视频一区二区| 欧美三级中文字| 欧美电影免费观看高清完整版在线| 精品日韩在线观看| 国产精品久久久久久久久免费樱桃| 最新国产の精品合集bt伙计| 自拍偷拍亚洲激情| 韩国成人精品a∨在线观看| 福利91精品一区二区三区| 91在线视频播放| 欧美日韩在线直播| 精品福利二区三区| 国产精品免费网站在线观看| 亚洲电影一区二区三区| 亚洲一二三级电影| 日本在线不卡视频| 国产成a人亚洲精| 91免费版pro下载短视频| 3d成人动漫网站| 久久久久国产精品免费免费搜索| 亚洲黄色免费电影| 国产在线国偷精品产拍免费yy | 国产视频一区在线播放| 伊人色综合久久天天人手人婷| 日日摸夜夜添夜夜添国产精品| 国模娜娜一区二区三区| 在线一区二区三区做爰视频网站| 日韩精品最新网址| 亚洲欧美日韩国产综合在线| 久久99九九99精品| 色屁屁一区二区| 精品卡一卡二卡三卡四在线| 亚洲美女少妇撒尿| 丝袜亚洲另类欧美| 欧美亚洲自拍偷拍| 国产欧美视频在线观看| 三级在线观看一区二区| 国产成人aaaa| 日韩免费电影一区| 亚洲高清久久久| 成人av片在线观看| 精品日韩成人av| 日韩精品亚洲一区| av不卡在线观看| 久久久久高清精品| 蜜臀久久久99精品久久久久久| 成人视屏免费看| 国产精品沙发午睡系列990531| 免费观看91视频大全| 欧美影片第一页| 亚洲免费成人av| 不卡av免费在线观看| 精品久久久久久久一区二区蜜臀| 中文字幕在线观看一区| 波多野结衣在线aⅴ中文字幕不卡| 日韩免费观看2025年上映的电影 | 久久成人免费电影| 欧美日韩精品一区二区在线播放| 国产精品日产欧美久久久久| 国产综合久久久久久久久久久久| 欧美高清视频不卡网| 香蕉影视欧美成人| 色国产综合视频| 亚洲欧洲中文日韩久久av乱码| 成人免费视频网站在线观看| 国产色产综合色产在线视频| 国产综合久久久久影院| 精品国产乱子伦一区| 亚洲成人免费观看| 91精品婷婷国产综合久久 | 在线视频国内自拍亚洲视频| 亚洲欧美一区二区三区久本道91| 99riav久久精品riav| 国产精品欧美一区二区三区| 国产成人在线电影| 亚洲天堂2014| 色偷偷久久一区二区三区| 亚洲欧洲日韩一区二区三区| 麻豆成人av在线| 精品国产免费一区二区三区香蕉| 精品一二三四在线| 欧美国产日韩在线观看| 色婷婷av一区二区| 亚洲国产一二三|