⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lzh.c

📁 汇编源代码大全
💻 C
字号:
/* $Id: lzh.c,v 1.15 91/07/06 19:18:51 dhesi Exp $ */
/*
lzh compression and uncompression interface module
*/

#include "options.h"
#include "zoo.h"
#include "ar.h"
#include "errors.i"

FILE *arcfile;

extern void prterror();

extern char *out_buf_adr;			/* address of buffer */

int lzh_encode(infile, outfile)
FILE *infile;
FILE *outfile;
{
	extern void encode();
	encode(infile, outfile);
	return 0;
}

/*
lzh_decode decodes its input and sends it to output.
Should return error status or byte count, but currently
returns 0.
*/

#undef COUNT_BYTES		/* define for debugging */

int lzh_decode(infile, outfile)
FILE *infile;
FILE *outfile;
{
	int n;
	extern int decoded;
#ifdef COUNT_BYTES
	int bytes_decoded = 0;		/*debug*/ /* count bytes after decoding */
#endif

	arcfile = infile;					/* stream to be decoded */

	decode_start();
	while (!decoded) {
		n = decode((uint) DICSIZ, out_buf_adr); /* n = count of chars decoded */
#ifdef COUNT_BYTES
		bytes_decoded += n;	/*debug*/
#endif
#ifdef CHECK_BREAK
		check_break();
#endif
		fwrite_crc(out_buf_adr, n, outfile);
#ifdef SHOW_DOTS
		(void) putc('.', stderr);
		(void) fflush(stderr);
#endif
	}
#ifdef COUNT_BYTES
	(void) fprintf(stderr, "bytes decoded = %d\n", bytes_decoded);
#endif
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -