scrwrap.c

来自「linux网络编程实例程序 socket程序 适合初学者。」· C语言 代码 · 共 38 行

C
38
字号
/* scrwrap.c - scrwrap */#include <sys/file.h>#include <termios.h>#include <stdio.h>#include <string.h>#include "local.h"extern struct termios	tntty;extern char		scrname[];extern int		scrindex, errno;/*------------------------------------------------------------------------ * scrwrap - wrap-up script filename collection *------------------------------------------------------------------------ */intscrwrap(FILE *sfp, FILE *tfp, int c){	int	fd;	if (scrindex) {		scrname[scrindex] = '\0';		scrindex = 0;		fd = open(scrname, O_WRONLY|O_CREAT|O_TRUNC, 0644);		if (fd < 0)			fprintf(tfp, "\ncan't write \"%s\": %s\n",				scrname, strerror(errno));		else			scrfp = fdopen(fd, "w");	}	if (tcsetattr(0, TCSADRAIN, &tntty) < 0)		errexit("tcsetattr: %s\n", strerror(errno));	return 0;}

⌨️ 快捷键说明

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