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

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

?? quick.c

?? linux下閱讀源碼的好工具
?? C
字號:
/* Copyright (c) 1994 Burra Gopal, Udi Manber.  All Rights Reserved. *//* * quick.c:	Used to search for a pattern in a compressed file. * * Algorithm: if the file (or stdin) is a compressed file, then: * +  a. Read in the hash-table-index file. * +  b. For each page in which the words of the pattern can be found: *	 build the hash-table using the words in exactly those pages. * +  c. Now, call compress with the given pattern. * * +  d. Call the normal search routines with the compressed pattern on *	 the input file. * +  e. If the option is to count number of matches, just exit. *	 Otherwise we have to modify the r_output/output routines: * * +  f. Read in the string-table-index file. * +  g. For each page in which the word numbers of the input file can *	 be found: build the string-table using the words in exactly *	 those pages. * +  h. Call uncompress with the input file line to be output and *	 output THIS line instead of the original matched line. * * Part of this will be in agrep and part of this here. */#include "defs.h"#include <sys/types.h>#include <sys/stat.h>/* * The quick-functions can be called multiple number of times -- * they however open the hash, string and freq files only once. */hash_entry *compress_hash_table[HASH_TABLE_SIZE];	/* used for compress: assume it is zeroed by C */char	loaded_hash_table[HASH_FILE_BLOCKS];		/* bit mask of loaded pages in hash-table: store chars since just 4K: speed is most imp. */char	*hashindexbuf;int	hashindexsize;/* returns length of compressed pattern after filling up the compressed pattern in the user-supplied newpattern buffer */intquick_tcompress(freq_file, hash_file, pattern, len, newpattern, maxnewlen, flags)	char	*freq_file;	char	*hash_file;	CHAR	*pattern;	int	len;	void	*newpattern;	/* can be FILE* or CHAR* */	int	*maxnewlen;	int	flags;{	static FILE	*hashfp = NULL, *hashindexfp = NULL;	static char	old_freq_file[MAX_LINE_LEN] = "", old_hash_file[MAX_LINE_LEN] = "";	static int	blocksize;	int		newlen;	if ((hashfp == NULL) || (strcmp(freq_file, old_freq_file)) || (strcmp(hash_file, old_hash_file)))	{	/* Have to do some initializations */		char	s[256];		struct stat statbuf;		if (hashfp != NULL) {			uninitialize_tcompress();			fclose(hashfp);			hashfp = NULL;		}		else memset(loaded_hash_table, '\0', HASH_FILE_BLOCKS);		if (!initialize_common(freq_file, flags)) return 0;	/* don't call initialize_tcompress since that will load the FULL hash table */		if ((hashfp = fopen(hash_file, "r")) == NULL) {			if (flags & TC_ERRORMSGS) {				fprintf(stderr, "cannot open cast-dictionary file: %s\n", hash_file);				fprintf(stderr, "(use -H to give a dictionary-dir or run 'buildcast' to make a dictionary)\n");			}			return 0;		}		sprintf(s, "%s.index", hash_file);		if ((hashindexfp = fopen(s, "r")) == NULL) {			if (flags & TC_ERRORMSGS)				fprintf(stderr, "cannot open for reading: %s\n", s);			fclose(hashfp);			hashfp = NULL;			return 0;		}		blocksize = 0;		fscanf(hashindexfp, "%d\n", &blocksize);		if (blocksize == 0) blocksize = DEF_BLOCKSIZE;		if (fstat(fileno(hashindexfp), &statbuf) == -1) {			fprintf(stderr, "error in quick_tcompress/fstat on '%s.index'\n", hash_file);			fclose(hashfp);			hashfp = NULL;			fclose(hashindexfp);			hashindexfp = NULL;			return 0;		}		if ((hashindexbuf = (char *)malloc(statbuf.st_size + 1)) == NULL) {			if (flags & TC_ERRORMSGS)				fprintf(stderr, "quick_tcompress: malloc failure!\n");			fclose(hashfp);			hashfp = NULL;			fclose(hashindexfp);			hashindexfp = NULL;			return 0;		}		if ((hashindexsize = fread(hashindexbuf, 1, statbuf.st_size, hashindexfp)) == -1) {			fprintf(stderr, "error in quick_tcompress/fread on '%s.index'\n", hash_file);			fclose(hashfp);			hashfp = NULL;			fclose(hashindexfp);			hashindexfp = NULL;			return 0;		}		hashindexsize ++;	/* st_size - bytes used up for blocksize in file + 1 <= st_size */		hashindexbuf[hashindexsize] = '\0';		fclose(hashindexfp);		strcpy(old_freq_file, freq_file);		strcpy(old_hash_file, hash_file);	}	else rewind(hashfp);	/* Don't do it first time */	if (pattern[len-1] == '\0') len--;	build_partial_hash(compress_hash_table, hashfp, hashindexbuf, hashindexsize, pattern, len, blocksize, loaded_hash_table);	newlen = tcompress(pattern, len, newpattern, maxnewlen, flags);#if	0	printf("quick_tcompress: pat=%s len=%d newlen=%d newpat=", pattern, len, newlen);	for (i=0; i<newlen; i++) printf("%d ", newpattern[i]);	printf("\n");#endif	/*0*/	return newlen;}char	*compress_string_table[DEF_MAX_WORDS]; /*[MAX_WORD_LEN+2]; */char	loaded_string_table[STRING_FILE_BLOCKS];		/* bit mask of loaded pages in string-table: store chars since just 4K: speed is most imp. */char	*stringindexbuf;int	stringindexsize;/* returns length of uncompressed pattern after filling up the uncompressed pattern in the user-supplied newpattern buffer */intquick_tuncompress(freq_file, string_file, pattern, len, newpattern, maxnewlen, flags)	char	*string_file;	char	*freq_file;	CHAR	*pattern;	int	len;	void	*newpattern;	/* can be FILE* or CHAR* */	int	*maxnewlen;	int	flags;{	static FILE	*stringfp = NULL, *stringindexfp = NULL;	static char	old_freq_file[MAX_LINE_LEN] = "", old_string_file[MAX_LINE_LEN] = "";	static int	blocksize;	int		newlen;	int		dummy;	if ((stringfp == NULL) || (strcmp(freq_file, old_freq_file)) || (strcmp(string_file, old_string_file)))	{	/* Have to do some initializations */		char	s[256];		struct stat statbuf;		if (stringfp != NULL) {			uninitialize_tuncompress();			fclose(stringfp);			stringfp = NULL;		}		else memset(loaded_string_table, '\0', STRING_FILE_BLOCKS);		if (!initialize_common(freq_file, flags)) return 0;	/* don't call initialize_tuncompress since that will load the FULL string table */		if ((stringfp = fopen(string_file, "r")) == NULL) {			if (flags & TC_ERRORMSGS) {				fprintf(stderr, "cannot open cast-dictionary file: %s\n", string_file);				fprintf(stderr, "(use -H to give a dictionary-dir or run 'buildcast' to make a dictionary)\n");			}			return 0;		}		sprintf(s, "%s.index", string_file);		if ((stringindexfp = fopen(s, "r")) == NULL) {			if (flags & TC_ERRORMSGS)				fprintf(stderr, "cannot open for reading: %s\n", s);			fclose(stringfp);			stringfp = NULL;			return 0;		}		blocksize = 0;		fscanf(stringindexfp, "%d\n", &blocksize);		if (blocksize == 0) blocksize = DEF_BLOCKSIZE;		if (fstat(fileno(stringindexfp), &statbuf) == -1) {			fprintf(stderr, "error in quick_tuncompress/fstat on '%s.index'\n", string_file);			fclose(stringfp);			stringfp = NULL;			fclose(stringindexfp);			stringindexfp = NULL;			return 0;		}		if ((stringindexbuf = (char *)malloc(statbuf.st_size + 1)) == NULL) {			if (flags & TC_ERRORMSGS)				fprintf(stderr, "quick_tuncompress: malloc failure!\n");			fclose(stringfp);			stringfp = NULL;			fclose(stringindexfp);			stringindexfp = NULL;			return 0;		}		stringindexsize = 0;		while(fscanf(stringindexfp, "%d\n", &dummy) == 1) {			*((unsigned short *)(stringindexbuf+stringindexsize)) = (unsigned short)dummy;			stringindexsize+=sizeof(unsigned short);		}		fclose(stringindexfp);		strcpy(old_freq_file, freq_file);		strcpy(old_string_file, string_file);	}	else rewind(stringfp);	build_partial_string(compress_string_table, stringfp, stringindexbuf, stringindexsize, pattern, len, blocksize, loaded_string_table);	newlen = tuncompress(pattern, len, newpattern, maxnewlen, flags);#if	0	printf("quick_tuncompress: len=%d newlen=%d newpat=%s pat=", len, newlen, newpattern);	for (i=0; i<len; i++) printf("%d ", pattern[i]);	printf("\n");#endif	/*0*/	return newlen;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区黄| 一本一本大道香蕉久在线精品| 中文字幕一区二区三区不卡在线| 久久综合久久综合九色| 欧美成人三级电影在线| 精品日韩99亚洲| 日韩精品一区二区三区在线播放| 精品国产麻豆免费人成网站| 久久午夜老司机| 国产精品久久久久一区二区三区共| 国产网站一区二区| 中文字幕一区二区三区在线不卡 | 亚洲欧美另类小说| 国产精品美女一区二区| 亚洲精品中文在线观看| 亚洲一区免费视频| 日韩专区欧美专区| 国产一区在线看| 99re热这里只有精品视频| 91精品1区2区| 日韩丝袜美女视频| 国产精品久久久久久久久快鸭| 亚洲美女淫视频| 美女性感视频久久| 粉嫩高潮美女一区二区三区 | 亚洲午夜一二三区视频| 丝瓜av网站精品一区二区| 久久机这里只有精品| bt欧美亚洲午夜电影天堂| 91久久人澡人人添人人爽欧美| 欧美日韩国产一级二级| 精品播放一区二区| 亚洲午夜在线视频| 国产98色在线|日韩| 欧美无人高清视频在线观看| 日韩视频免费观看高清在线视频| 国产精品三级电影| 午夜精品福利视频网站| 国产成人精品亚洲午夜麻豆| 欧美三级日韩在线| 国产日韩欧美综合一区| 日韩一区精品视频| 99r精品视频| 国产亚洲一区二区三区| 午夜日韩在线电影| 99久久精品免费看国产| 欧美成人aa大片| 亚洲一区二区在线观看视频| 国产在线精品一区二区夜色 | 国内精品视频666| 欧洲视频一区二区| 国产精品久久久久一区| 国产精品一区三区| 精品国产网站在线观看| 日韩精品视频网| 欧美性videosxxxxx| 一色桃子久久精品亚洲| 国产成人在线色| 精品国产一区二区三区av性色 | 国产精品一区二区三区99| 在线不卡a资源高清| 一区二区三区在线观看视频 | 亚洲另类一区二区| 大桥未久av一区二区三区中文| 日韩免费福利电影在线观看| 天堂午夜影视日韩欧美一区二区| 一本大道久久精品懂色aⅴ| 日本一二三不卡| 国产成人亚洲综合a∨婷婷图片| 日韩一区二区三区精品视频| 欧美aⅴ一区二区三区视频| 欧美日本在线一区| 日韩精品亚洲一区| 日韩精品一区二区三区在线播放| 日本系列欧美系列| 日韩三级av在线播放| 蜜臀久久久99精品久久久久久| 91精品欧美一区二区三区综合在| 午夜一区二区三区视频| 欧美日韩美女一区二区| 日产欧产美韩系列久久99| 欧美一级片在线看| 国产在线不卡一区| 国产精品网站在线观看| 99久久夜色精品国产网站| 亚洲乱码中文字幕| 精品视频在线视频| 另类中文字幕网| 欧美国产日本韩| 欧美性极品少妇| 久久99国产乱子伦精品免费| 国产日韩欧美精品在线| 97aⅴ精品视频一二三区| 亚洲在线成人精品| 91精品国产乱| 成人高清视频在线观看| 夜夜揉揉日日人人青青一国产精品 | 日韩欧美高清在线| 成人污视频在线观看| 一区二区三区在线免费观看| 欧美一级一区二区| 国产盗摄女厕一区二区三区| 亚洲另类色综合网站| 欧美一区二区三区影视| 国产尤物一区二区在线| 亚洲美女视频一区| 欧美一区二区三区人| 国产二区国产一区在线观看| 亚洲精品高清在线观看| 久久综合久久综合九色| 色狠狠av一区二区三区| 精品亚洲免费视频| 亚洲美女偷拍久久| 久久婷婷成人综合色| 91久久一区二区| 国产河南妇女毛片精品久久久| 亚洲精品日产精品乱码不卡| 欧美电视剧在线观看完整版| 99国产精品一区| 国产主播一区二区三区| 婷婷综合在线观看| 成人欧美一区二区三区小说| 日韩一区二区电影在线| 色老汉一区二区三区| 国产精品综合网| 免费在线观看一区二区三区| 亚洲欧美日韩国产成人精品影院 | 国产精品久久久久婷婷二区次| 91麻豆精品国产91久久久资源速度 | 色婷婷av一区| 粉嫩蜜臀av国产精品网站| 奇米影视7777精品一区二区| 亚洲乱码国产乱码精品精98午夜| 国产欧美一区在线| 精品久久久久久久一区二区蜜臀| 欧美久久一二区| 欧美伊人久久大香线蕉综合69| 不卡一卡二卡三乱码免费网站| 国产永久精品大片wwwapp| 蜜桃在线一区二区三区| 五月天视频一区| 婷婷夜色潮精品综合在线| 亚洲精品日日夜夜| 日韩理论在线观看| 国产精品久久毛片av大全日韩| 久久久久久久久久电影| 久久一区二区三区四区| 2020国产成人综合网| 精品欧美乱码久久久久久| 欧美一卡2卡三卡4卡5免费| 91麻豆精品91久久久久久清纯| 欧美亚洲一区三区| 在线观看欧美日本| 欧美另类videos死尸| 欧美精品久久99久久在免费线| 欧美日韩国产乱码电影| 欧美日韩亚洲不卡| 欧美精品自拍偷拍动漫精品| 欧美日韩国产另类不卡| 日韩美女视频一区二区在线观看| 日韩午夜av电影| 久久美女艺术照精彩视频福利播放| 久久久久国产成人精品亚洲午夜| 久久久久久麻豆| 亚洲你懂的在线视频| 五月激情丁香一区二区三区| 免费观看成人鲁鲁鲁鲁鲁视频| 日韩vs国产vs欧美| 国产在线视视频有精品| 成人在线视频一区二区| 一本色道久久综合亚洲aⅴ蜜桃 | 一个色综合av| 全国精品久久少妇| 久久超碰97人人做人人爱| 国产成人在线免费观看| aaa国产一区| 制服视频三区第一页精品| 久久久久久久久久看片| 亚洲欧美另类小说视频| 视频一区二区三区中文字幕| 国产一本一道久久香蕉| 91成人免费在线视频| 欧美大度的电影原声| 国产精品久线观看视频| 午夜激情一区二区| 成人午夜又粗又硬又大| 在线一区二区视频| 欧美成人aa大片| 一区二区三区中文免费| 国产尤物一区二区| 欧美三级欧美一级| 久久久激情视频| 亚洲成人av资源| av资源网一区| 精品福利一区二区三区免费视频| 亚洲视频一区在线| 久久精工是国产品牌吗| 欧美性猛片aaaaaaa做受| 国产亚洲欧美在线| 日韩av中文在线观看|