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

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

?? lzss.c

?? 匯編語言程序的編寫雖然有一定的難度,但是它是一門低級的語言,有很強(qiáng)的基礎(chǔ)性作用,具有廣泛的用途.
?? 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一区二区三区免费野_久草精品视频
日产精品久久久久久久性色| 91在线观看成人| 日韩vs国产vs欧美| 亚洲自拍与偷拍| 亚洲最色的网站| 一个色综合网站| 亚洲一卡二卡三卡四卡| 亚洲精品国产高清久久伦理二区| 综合久久国产九一剧情麻豆| 亚洲欧美在线另类| 亚洲免费在线播放| 亚洲激情综合网| 天堂va蜜桃一区二区三区漫画版| 视频一区中文字幕国产| 日韩av一二三| 九一久久久久久| 国产成人午夜精品5599| 成人免费黄色在线| 一本色道久久综合亚洲aⅴ蜜桃 | 9l国产精品久久久久麻豆| 成人深夜在线观看| 91小视频在线免费看| 欧美欧美欧美欧美首页| 欧美一区三区二区| 久久蜜臀中文字幕| 国产精品久久久久久户外露出| 国产精品激情偷乱一区二区∴| 亚洲精品国产一区二区精华液| 天堂va蜜桃一区二区三区 | 欧美日韩成人综合在线一区二区| 91麻豆精品国产综合久久久久久| 日韩三级免费观看| 国产亚洲欧美色| 亚洲欧美激情一区二区| 亚洲成人av中文| 久久99精品久久只有精品| 国产成人激情av| 欧美在线免费视屏| 日韩欧美高清dvd碟片| 欧美国产日产图区| 一区二区成人在线| 久久99国内精品| 97精品久久久久中文字幕| 欧美日韩一级二级| 国产日产欧产精品推荐色 | 亚洲第一二三四区| 国产资源精品在线观看| 一本久道久久综合中文字幕| 欧美一区二区三区婷婷月色| 国产女同互慰高潮91漫画| 一区二区三区日韩在线观看| 久久99九九99精品| 色8久久精品久久久久久蜜| 日韩一区二区三区高清免费看看 | 精品一区二区三区在线播放 | 亚洲人成网站色在线观看| 日韩电影在线免费| 色综合视频一区二区三区高清| 91精品国产综合久久精品| 中文字幕一区二区三区乱码在线| 日韩影院在线观看| 96av麻豆蜜桃一区二区| 久久免费视频一区| 亚洲国产人成综合网站| 国产**成人网毛片九色 | 一区二区三区精品在线| 激情成人午夜视频| 欧美日韩国产一区二区三区地区| 国产精品色噜噜| 青青草一区二区三区| 91在线免费播放| 久久毛片高清国产| 日韩黄色小视频| 91亚洲永久精品| 久久精品亚洲精品国产欧美| 午夜欧美视频在线观看| 91麻豆福利精品推荐| 欧美极品另类videosde| 久久99精品久久久久婷婷| 777色狠狠一区二区三区| 一区二区中文字幕在线| 国产福利91精品一区二区三区| 欧美一级片免费看| 亚洲国产一二三| av影院午夜一区| 久久精品欧美日韩| 精品无码三级在线观看视频| 欧美人成免费网站| 亚洲色大成网站www久久九九| 国产精品一区免费在线观看| 日韩欧美视频在线| 欧美aaaaaa午夜精品| 欧美日韩在线不卡| 亚洲午夜av在线| 色94色欧美sute亚洲线路一久| 一区在线中文字幕| 99视频有精品| 成人欧美一区二区三区视频网页| 国产成人亚洲综合a∨婷婷| 久久午夜免费电影| 黄页网站大全一区二区| 欧美va天堂va视频va在线| 奇米色一区二区| 欧美一卡在线观看| 日韩电影免费在线看| 午夜久久久影院| 欧美又粗又大又爽| 亚洲午夜在线视频| 欧美日韩一区在线观看| 亚洲国产一区视频| 337p亚洲精品色噜噜狠狠| 丝袜国产日韩另类美女| 日韩一区二区三区视频| 免费三级欧美电影| 久久久久国色av免费看影院| 国产一区二区美女诱惑| 久久久美女毛片| 国产成人精品免费在线| 国产精品乱人伦中文| 91小宝寻花一区二区三区| 一区二区在线观看免费视频播放| 欧美在线观看视频在线| 天使萌一区二区三区免费观看| 欧美一区二区三区在| 国产一二三精品| 国产精品视频一二三| 日本精品免费观看高清观看| 亚洲视频免费观看| 欧美日韩成人一区二区| 久久精品国产亚洲高清剧情介绍| 337p日本欧洲亚洲大胆精品| 国产精品88888| 有坂深雪av一区二区精品| 日本在线观看不卡视频| 国产精一品亚洲二区在线视频| 久久精品国产在热久久| 一区二区三区免费网站| 国产精品成人午夜| 26uuu国产一区二区三区| 欧美老肥妇做.爰bbww视频| 678五月天丁香亚洲综合网| 91精品国产91久久久久久最新毛片| 欧美日韩亚洲综合| 日本精品一区二区三区四区的功能| 91免费小视频| 日韩一区二区精品葵司在线| 色网综合在线观看| 国产99精品在线观看| 狠狠色丁香婷婷综合| 免费在线观看一区| 久久se精品一区二区| 日韩vs国产vs欧美| 亚洲欧美一区二区久久| 中文一区在线播放| 国产精品二区一区二区aⅴ污介绍| 国产欧美精品一区aⅴ影院| 精品视频在线免费| 欧美日韩一二三| 欧美一级片在线观看| 欧美不卡一区二区三区| 欧美色图第一页| 欧美美女直播网站| 日韩西西人体444www| 精品污污网站免费看| 国产91丝袜在线观看| 99r国产精品| 69堂成人精品免费视频| 欧美日韩久久一区| 色哟哟欧美精品| 国产美女精品人人做人人爽| 国内精品久久久久影院薰衣草| 国内成人精品2018免费看| av成人免费在线| 日韩精品一区二区三区在线播放 | 欧美日韩激情在线| 国产精品乱码人人做人人爱| 国产精品无遮挡| 中文字幕在线观看一区二区| 蜜桃视频一区二区三区在线观看| 国产精品二区一区二区aⅴ污介绍| 欧美日韩精品福利| 日韩精品一区国产麻豆| 视频一区国产视频| 欧美一区二视频| 亚洲超碰精品一区二区| 紧缚奴在线一区二区三区| 亚洲欧美一区二区在线观看| 91蝌蚪porny| 亚洲毛片av在线| 欧美三级中文字幕在线观看| 久久精品欧美日韩精品| 国产99精品国产| 日韩成人av影视| 欧美韩日一区二区三区四区| 免费看欧美美女黄的网站| 91精品国产综合久久香蕉麻豆 | 亚洲免费大片在线观看| 免费观看在线综合色| 欧美日韩久久久一区| 亚洲精选在线视频|