unscript.c

来自「tcp/ip原理的第三卷」· C语言 代码 · 共 34 行

C
34
字号
/* unscript.c - unscript */

#include <sys/types.h>
#include <sys/stat.h>

#include <stdio.h>

#include "local.h"

/*------------------------------------------------------------------------
 * unscript - end session scripting
 *------------------------------------------------------------------------
 */
/*ARGSUSED*/
int
unscript(sfp, tfp, c)
FILE	*sfp, *tfp;
int	c;
{
	struct stat	statb;

	if (scrfp == 0) {
		fprintf(tfp, "\nNot scripting.\n");
		return 0;
	}
	(void) fflush(scrfp);
	if (fstat(fileno(scrfp), &statb) == 0)
		fprintf(tfp, "\n\"%s\": %d bytes.\n", scrname,
				statb.st_size);
	(void) fclose(scrfp);
	scrfp = 0;
	return 0;
}

⌨️ 快捷键说明

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