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

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

?? lzss.c

?? 這是資料最全的有關(guān)匯編語言的示例源代碼
?? C
字號:
/**************************************************************
	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
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩三级视频| 欧美色老头old∨ideo| 欧美私人免费视频| 91精品久久久久久久99蜜桃| 日韩一区二区三区视频| 精品99999| 中文字幕乱码久久午夜不卡| 亚洲少妇30p| 久久er99热精品一区二区| 国产精品一二三区在线| 日本视频一区二区三区| 国产91精品精华液一区二区三区 | 99久久免费视频.com| 欧美综合一区二区| 26uuu另类欧美亚洲曰本| 亚洲婷婷综合色高清在线| 亚洲成人777| 国v精品久久久网| 91麻豆精品国产无毒不卡在线观看| 精品999在线播放| 亚洲午夜电影网| 91小视频免费观看| 337p日本欧洲亚洲大胆精品| 亚洲成人综合视频| 一道本成人在线| 日韩美女视频19| 国产精品综合一区二区| 91精品国产综合久久久久久| 亚洲精品国产a| av中文字幕一区| 日本一区免费视频| 国产成a人亚洲精| 国产午夜精品一区二区三区视频| 天堂精品中文字幕在线| 欧美日韩午夜在线| 日本不卡不码高清免费观看| 欧美一区二区在线播放| 免费高清不卡av| 精品久久久久久久久久久久包黑料| 天堂蜜桃91精品| 97久久精品人人做人人爽50路| 欧美电影免费观看高清完整版在 | 99久久精品费精品国产一区二区| 中文字幕欧美国产| 91网址在线看| 日韩不卡免费视频| 2017欧美狠狠色| 97se亚洲国产综合自在线观| 亚洲乱码国产乱码精品精98午夜| 色综合久久久久综合体| 亚洲第一成年网| 国产亚洲美州欧州综合国| 99久久久久久99| 午夜伦欧美伦电影理论片| 久久这里只有精品6| 91原创在线视频| 美女视频一区在线观看| 亚洲日本护士毛茸茸| 日韩视频一区二区| 色综合一个色综合| 久久成人久久鬼色| 亚洲动漫第一页| 欧美高清在线精品一区| 3atv在线一区二区三区| 91女人视频在线观看| 国内偷窥港台综合视频在线播放| 亚洲国产精品人人做人人爽| 精品福利一二区| 欧美zozo另类异族| 日韩一区二区麻豆国产| 欧美日韩国产综合视频在线观看| jizz一区二区| 波多野结衣亚洲一区| 国产不卡视频一区二区三区| 国产精品一区在线| 亚洲成人动漫在线观看| 亚洲精品免费一二三区| 一区在线观看免费| ...xxx性欧美| 亚洲国产日韩精品| 夜夜揉揉日日人人青青一国产精品| 欧美国产日本韩| ...av二区三区久久精品| 综合av第一页| 亚洲午夜成aⅴ人片| 偷拍自拍另类欧美| 看电视剧不卡顿的网站| 国产乱码精品一区二区三区av| 精彩视频一区二区| aaa欧美日韩| 欧美日本一道本在线视频| 欧美一级二级三级乱码| 2020日本不卡一区二区视频| 中文字幕av一区二区三区免费看 | 欧美视频一区二区三区四区| 欧美视频一区二区在线观看| 91精品国产91久久久久久一区二区| 精品视频一区三区九区| 久久老女人爱爱| 亚洲美女精品一区| 国产成人久久精品77777最新版本| 国产91清纯白嫩初高中在线观看| 91老司机福利 在线| 日韩女优av电影| 亚洲美女区一区| 懂色av中文一区二区三区| 欧美日韩激情一区| 久久一区二区三区国产精品| 五月天婷婷综合| 99久久久无码国产精品| 久久只精品国产| 精品影院一区二区久久久| 日本久久精品电影| 中文字幕高清不卡| 国产成人免费视频一区| 日韩免费福利电影在线观看| 亚洲最快最全在线视频| av网站一区二区三区| 国产欧美一区二区精品久导航 | 欧美日韩一级黄| 亚洲一区二区三区四区五区中文| 国产成人精品www牛牛影视| 精品国产人成亚洲区| 久久99这里只有精品| 欧美精品色综合| 婷婷综合久久一区二区三区| 欧美色倩网站大全免费| 亚洲一二三四久久| 欧美亚日韩国产aⅴ精品中极品| 亚洲天堂福利av| 色婷婷综合久久久久中文 | 99久久婷婷国产综合精品电影 | 欧美性大战久久久久久久| 亚洲一区二区三区爽爽爽爽爽 | 1区2区3区欧美| 欧美中文字幕一二三区视频| 亚洲成人福利片| 久久久午夜精品理论片中文字幕| 成人午夜视频在线| 亚洲一区二区三区中文字幕| 777精品伊人久久久久大香线蕉| 日韩电影免费在线看| 国产亚洲自拍一区| 欧美性色综合网| 国产精品资源网| 亚洲一区二区不卡免费| 精品国产乱码久久| 91老司机福利 在线| 美国毛片一区二区| 国产精品第四页| 精品国产91乱码一区二区三区| 99久久99久久综合| 久久99久久久欧美国产| 亚洲免费毛片网站| 久久久99久久| 日韩欧美一区二区视频| 99re66热这里只有精品3直播 | 久久精品一区二区三区不卡牛牛| 99精品欧美一区| 国产一区二区精品久久| 日日夜夜免费精品| 一区二区三区产品免费精品久久75| 26uuu亚洲综合色欧美| 91精品蜜臀在线一区尤物| 在线观看不卡视频| 色婷婷久久一区二区三区麻豆| 风间由美性色一区二区三区| 国产一级精品在线| 国产揄拍国内精品对白| 久久精品国产第一区二区三区| 日韩二区三区四区| 日韩不卡一二三区| 亚洲第一在线综合网站| 亚洲一二三四在线| 免费观看成人av| 韩国成人在线视频| 东方欧美亚洲色图在线| 菠萝蜜视频在线观看一区| 成人福利在线看| 欧美在线观看禁18| 欧美一区二视频| 国产精品视频观看| 最新高清无码专区| 日韩在线卡一卡二| 国产毛片精品视频| 色婷婷久久一区二区三区麻豆| 99麻豆久久久国产精品免费优播| 国产色一区二区| 亚洲日本中文字幕区| 国产999精品久久久久久绿帽| 91精品国产入口在线| 一区二区三区免费看视频| 奇米四色…亚洲| 在线观看视频一区二区欧美日韩| 亚洲精品一线二线三线无人区| 亚洲精品成人a在线观看| 国产激情91久久精品导航| 正在播放亚洲一区| 亚洲精品一卡二卡| 91在线国产福利|