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

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

?? lzss.c

?? 匯編源代碼大全
?? C
字號(hào):
/**************************************************************
	LZSS.C -- A Data Compression Program
	(tab = 4 spaces)
***************************************************************
	4/6/1989 Haruhiko Okumura
	Use, distribute, and modify this program freely.
	Please send me your improved versions.
		PC-VAN		SCIENCE
		NIFTY-Serve	PAF01022
		CompuServe	74050,1022
**************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

#define N		 4096	/* size of ring buffer */
#define F		   18	/* upper limit for match_length */
#define THRESHOLD	2   /* encode string into position and length
						   if match_length is greater than this */
#define NIL			N	/* index for root of binary search trees */

unsigned long int
		textsize = 0,	/* text size counter */
		codesize = 0,	/* code size counter */
		printcount = 0;	/* counter for reporting progress every 1K bytes */
unsigned char
		text_buf[N + F - 1];	/* ring buffer of size N,
			with extra F-1 bytes to facilitate string comparison */
int		match_position, match_length,  /* of longest match.  These are
			set by the InsertNode() procedure. */
		lson[N + 1], rson[N + 257], dad[N + 1];  /* left & right children &
			parents -- These constitute binary search trees. */
FILE	*infile, *outfile;  /* input & output files */

void InitTree(void)  /* initialize trees */
{
	int  i;

	/* For i = 0 to N - 1, rson[i] and lson[i] will be the right and
	   left children of node i.  These nodes need not be initialized.
	   Also, dad[i] is the parent of node i.  These are initialized to
	   NIL (= N), which stands for 'not used.'
	   For i = 0 to 255, rson[N + i + 1] is the root of the tree
	   for strings that begin with character i.  These are initialized
	   to NIL.  Note there are 256 trees. */

	for (i = N + 1; i <= N + 256; i++) rson[i] = NIL;
	for (i = 0; i < N; i++) dad[i] = NIL;
}

void InsertNode(int r)
	/* Inserts string of length F, text_buf[r..r+F-1], into one of the
	   trees (text_buf[r]'th tree) and returns the longest-match position
	   and length via the global variables match_position and match_length.
	   If match_length = F, then removes the old node in favor of the new
	   one, because the old one will be deleted sooner.
	   Note r plays double role, as tree node and position in buffer. */
{
	int  i, p, cmp;
	unsigned char  *key;

	cmp = 1;  key = &text_buf[r];  p = N + 1 + key[0];
	rson[r] = lson[r] = NIL;  match_length = 0;
	for ( ; ; ) {
		if (cmp >= 0) {
			if (rson[p] != NIL) p = rson[p];
			else {  rson[p] = r;  dad[r] = p;  return;  }
		} else {
			if (lson[p] != NIL) p = lson[p];
			else {  lson[p] = r;  dad[r] = p;  return;  }
		}
		for (i = 1; i < F; i++)
			if ((cmp = key[i] - text_buf[p + i]) != 0)  break;
		if (i > match_length) {
			match_position = p;
			if ((match_length = i) >= F)  break;
		}
	}
	dad[r] = dad[p];  lson[r] = lson[p];  rson[r] = rson[p];
	dad[lson[p]] = r;  dad[rson[p]] = r;
	if (rson[dad[p]] == p) rson[dad[p]] = r;
	else                   lson[dad[p]] = r;
	dad[p] = NIL;  /* remove p */
}

void DeleteNode(int p)  /* deletes node p from tree */
{
	int  q;
	
	if (dad[p] == NIL) return;  /* not in tree */
	if (rson[p] == NIL) q = lson[p];
	else if (lson[p] == NIL) q = rson[p];
	else {
		q = lson[p];
		if (rson[q] != NIL) {
			do {  q = rson[q];  } while (rson[q] != NIL);
			rson[dad[q]] = lson[q];  dad[lson[q]] = dad[q];
			lson[q] = lson[p];  dad[lson[p]] = q;
		}
		rson[q] = rson[p];  dad[rson[p]] = q;
	}
	dad[q] = dad[p];
	if (rson[dad[p]] == p) rson[dad[p]] = q;  else lson[dad[p]] = q;
	dad[p] = NIL;
}

void Encode(void)
{
	int  i, c, len, r, s, last_match_length, code_buf_ptr;
	unsigned char  code_buf[17], mask;
	
	InitTree();  /* initialize trees */
	code_buf[0] = 0;  /* code_buf[1..16] saves eight units of code, and
		code_buf[0] works as eight flags, "1" representing that the unit
		is an unencoded letter (1 byte), "0" a position-and-length pair
		(2 bytes).  Thus, eight units require at most 16 bytes of code. */
	code_buf_ptr = mask = 1;
	s = 0;  r = N - F;
	for (i = s; i < r; i++) text_buf[i] = ' ';  /* Clear the buffer with
		any character that will appear often. */
	for (len = 0; len < F && (c = getc(infile)) != EOF; len++)
		text_buf[r + len] = c;  /* Read F bytes into the last F bytes of
			the buffer */
	if ((textsize = len) == 0) return;  /* text of size zero */
	for (i = 1; i <= F; i++) InsertNode(r - i);  /* Insert the F strings,
		each of which begins with one or more 'space' characters.  Note
		the order in which these strings are inserted.  This way,
		degenerate trees will be less likely to occur. */
	InsertNode(r);  /* Finally, insert the whole string just read.  The
		global variables match_length and match_position are set. */
	do {
		if (match_length > len) match_length = len;  /* match_length
			may be spuriously long near the end of text. */
		if (match_length <= THRESHOLD) {
			match_length = 1;  /* Not long enough match.  Send one byte. */
			code_buf[0] |= mask;  /* 'send one byte' flag */
			code_buf[code_buf_ptr++] = text_buf[r];  /* Send uncoded. */
		} else {
			code_buf[code_buf_ptr++] = (unsigned char) match_position;
			code_buf[code_buf_ptr++] = (unsigned char)
				(((match_position >> 4) & 0xf0)
			  | (match_length - (THRESHOLD + 1)));  /* Send position and
					length pair. Note match_length > THRESHOLD. */
		}
		if ((mask <<= 1) == 0) {  /* Shift mask left one bit. */
			for (i = 0; i < code_buf_ptr; i++)  /* Send at most 8 units of */
				putc(code_buf[i], outfile);     /* code together */
			codesize += code_buf_ptr;
			code_buf[0] = 0;  code_buf_ptr = mask = 1;
		}
		last_match_length = match_length;
		for (i = 0; i < last_match_length &&
				(c = getc(infile)) != EOF; i++) {
			DeleteNode(s);		/* Delete old strings and */
			text_buf[s] = c;	/* read new bytes */
			if (s < F - 1) text_buf[s + N] = c;  /* If the position is
				near the end of buffer, extend the buffer to make
				string comparison easier. */
			s = (s + 1) & (N - 1);  r = (r + 1) & (N - 1);
				/* Since this is a ring buffer, increment the position
				   modulo N. */
			InsertNode(r);	/* Register the string in text_buf[r..r+F-1] */
		}
		if ((textsize += i) > printcount) {
			printf("%12ld\r", textsize);  printcount += 1024;
				/* Reports progress each time the textsize exceeds
				   multiples of 1024. */
		}
		while (i++ < last_match_length) {	/* After the end of text, */
			DeleteNode(s);					/* no need to read, but */
			s = (s + 1) & (N - 1);  r = (r + 1) & (N - 1);
			if (--len) InsertNode(r);		/* buffer may not be empty. */
		}
	} while (len > 0);	/* until length of string to be processed is zero */
	if (code_buf_ptr > 1) {		/* Send remaining code. */
		for (i = 0; i < code_buf_ptr; i++) putc(code_buf[i], outfile);
		codesize += code_buf_ptr;
	}
	printf("In : %ld bytes\n", textsize);	/* Encoding is done. */
	printf("Out: %ld bytes\n", codesize);
	printf("Out/In: %.3f\n", (double)codesize / textsize);
}

void Decode(void)	/* Just the reverse of Encode(). */
{
	int  i, j, k, r, c;
	unsigned int  flags;
	
	for (i = 0; i < N - F; i++) text_buf[i] = ' ';
	r = N - F;  flags = 0;
	for ( ; ; ) {
		if (((flags >>= 1) & 256) == 0) {
			if ((c = getc(infile)) == EOF) break;
			flags = c | 0xff00;		/* uses higher byte cleverly */
		}							/* to count eight */
		if (flags & 1) {
			if ((c = getc(infile)) == EOF) break;
			putc(c, outfile);  text_buf[r++] = c;  r &= (N - 1);
		} else {
			if ((i = getc(infile)) == EOF) break;
			if ((j = getc(infile)) == EOF) break;
			i |= ((j & 0xf0) << 4);  j = (j & 0x0f) + THRESHOLD;
			for (k = 0; k <= j; k++) {
				c = text_buf[(i + k) & (N - 1)];
				putc(c, outfile);  text_buf[r++] = c;  r &= (N - 1);
			}
		}
	}
}

int main(int argc, char *argv[])
{
	char  *s;
	
	if (argc != 4) {
		printf("'lzss e file1 file2' encodes file1 into file2.\n"
			   "'lzss d file2 file1' decodes file2 into file1.\n");
		return EXIT_FAILURE;
	}
	if ((s = argv[1], s[1] || strpbrk(s, "DEde") == NULL)
	 || (s = argv[2], (infile  = fopen(s, "rb")) == NULL)
	 || (s = argv[3], (outfile = fopen(s, "wb")) == NULL)) {
		printf("??? %s\n", s);  return EXIT_FAILURE;
	}
	if (toupper(*argv[1]) == 'E') Encode();  else Decode();
	fclose(infile);  fclose(outfile);
	return EXIT_SUCCESS;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩高清一级片| 亚洲精品国产一区二区三区四区在线| 五月天网站亚洲| 欧美在线999| 亚洲成人自拍网| 欧美一区二区在线播放| 奇米亚洲午夜久久精品| www激情久久| 99精品视频在线观看免费| 亚洲人成网站色在线观看| 欧美日韩精品一区二区天天拍小说 | 精品国产91久久久久久久妲己| 美国十次综合导航| 久久久久久久久免费| 成人a区在线观看| 亚洲制服丝袜av| 日韩欧美国产一区二区在线播放| 国产一区二区三区免费观看| 国产精品视频观看| 欧美三级电影一区| 激情综合网激情| 国产精品不卡在线观看| 欧美乱妇20p| 高清成人免费视频| 亚洲一区二区三区在线看 | 日韩一区二区麻豆国产| 成人自拍视频在线观看| 亚洲影院在线观看| 国产亚洲精品中文字幕| 欧美在线你懂得| 国产精品系列在线观看| 亚洲第一会所有码转帖| 日本一区二区免费在线观看视频 | 亚洲精品一区二区三区精华液 | 国产亚洲人成网站| 欧洲在线/亚洲| 国产成人av一区| 婷婷久久综合九色综合绿巨人| 国产亚洲欧美色| 91精品午夜视频| 色呦呦一区二区三区| 精油按摩中文字幕久久| 亚洲成人先锋电影| 1区2区3区精品视频| 欧美成人精品二区三区99精品| 日本高清不卡视频| 国产成人精品亚洲日本在线桃色 | 国产一区二区免费在线| 洋洋av久久久久久久一区| 久久久国产精品不卡| 欧美日韩成人在线| 色综合激情久久| 粉嫩aⅴ一区二区三区四区五区 | 宅男噜噜噜66一区二区66| 成人av网在线| 国产高清精品网站| 蜜乳av一区二区三区| 亚洲大片精品永久免费| 亚洲视频网在线直播| 国产欧美日韩在线看| 日韩视频一区二区三区| 欧美理论片在线| 欧美日韩一区在线| 欧美视频中文字幕| 在线亚洲一区观看| 色综合久久99| 99国产精品久| 91香蕉视频mp4| 99re视频精品| 色综合久久久久综合| 91性感美女视频| 色先锋资源久久综合| 99久久久久久| 91在线视频播放地址| 成人av综合在线| 成人激情动漫在线观看| 不卡视频一二三| 99re成人精品视频| 91影院在线观看| 欧美午夜精品一区二区三区| 91国产精品成人| 欧美精品v日韩精品v韩国精品v| 欧美日韩国产小视频| 4438亚洲最大| 精品国产露脸精彩对白| 欧美成人精品1314www| 久久精品一二三| 1区2区3区欧美| 亚洲国产精品一区二区久久恐怖片| 亚洲大片在线观看| 精品亚洲成a人| 精品在线免费视频| 国产成人精品免费| 99久久精品国产导航| 色视频欧美一区二区三区| 欧美精选一区二区| 精品三级av在线| 国产精品伦理在线| 亚洲h在线观看| 国产主播一区二区| 91亚洲永久精品| 欧美一区二区三区电影| 国产午夜精品久久久久久免费视 | 成人精品小蝌蚪| 91片黄在线观看| 欧美一区二区三区思思人| 欧美精品一区男女天堂| 国产精品传媒入口麻豆| 日韩国产精品久久| 高清久久久久久| 欧美日本免费一区二区三区| www一区二区| 亚洲小说欧美激情另类| 精品中文字幕一区二区小辣椒| 成人av在线一区二区| 欧美日韩国产免费一区二区| 欧美精品一区二区三区蜜臀| 亚洲激情校园春色| 韩国精品一区二区| 欧美三级韩国三级日本一级| 久久久亚洲精品一区二区三区| 最新国产の精品合集bt伙计| 日韩精品一二三| 91香蕉视频污| 久久麻豆一区二区| 午夜日韩在线电影| 成人黄色av网站在线| 日韩精品一区国产麻豆| 亚洲品质自拍视频| 国产一区在线观看麻豆| 欧美日韩亚洲国产综合| 中文在线一区二区| 久久精工是国产品牌吗| 在线视频亚洲一区| 国产精品久久久久aaaa樱花 | 久色婷婷小香蕉久久| 91久久精品网| 国产精品久久精品日日| 久久99国产乱子伦精品免费| 欧美日韩一区二区在线视频| 欧美精彩视频一区二区三区| 久久超碰97人人做人人爱| 欧美亚洲愉拍一区二区| 亚洲视频在线观看一区| 国产精品白丝jk白祙喷水网站| 欧美日韩一二三| 一区二区高清免费观看影视大全| 欧美日韩国产片| 亚洲福利电影网| 在线视频国内自拍亚洲视频| 国产精品第四页| 成人a免费在线看| 国产精品美女www爽爽爽| 国产精品1024久久| 久久夜色精品国产欧美乱极品| 日本欧美在线看| 欧美日韩小视频| 亚洲国产日韩精品| 欧美性生活大片视频| 一区二区三区欧美| 在线视频亚洲一区| 亚洲午夜免费电影| 欧美日韩免费观看一区二区三区 | 精品影视av免费| 欧美电影免费提供在线观看| 奇米影视一区二区三区小说| 欧美久久久久久久久久| 日韩电影在线观看一区| 欧美丰满少妇xxxbbb| 免费在线观看不卡| 日韩欧美高清一区| 狠狠色狠狠色综合| 久久久精品黄色| 粉嫩蜜臀av国产精品网站| 国产无人区一区二区三区| 国产精品亚洲综合一区在线观看| 久久久夜色精品亚洲| 成人av片在线观看| 亚洲精品视频自拍| 欧美日韩黄色影视| 捆绑调教美女网站视频一区| 久久久99精品久久| 99精品国产99久久久久久白柏| 亚洲激情校园春色| 欧美一区二区三区四区在线观看| 黑人精品欧美一区二区蜜桃| 欧美激情一区二区| 在线观看成人小视频| 美女在线视频一区| 国产亲近乱来精品视频| 91麻豆123| 日韩精品每日更新| 国产亚洲一本大道中文在线| 成人性生交大合| 一区二区三区欧美日| 精品免费国产二区三区| 播五月开心婷婷综合| 午夜av电影一区| 国产午夜精品理论片a级大结局| 一本色道久久综合亚洲aⅴ蜜桃|