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

📄 scrinit.c

📁 &#61599 Douglas Comer
💻 C
字号:
/* scrinit.c - scrinit */#include <unistd.h>#include <termios.h>#include <string.h>#include <stdio.h>#include "telnet.h"#include "local.h"extern int		scrindex;extern struct termios	tntty;/*------------------------------------------------------------------------ * scrinit - initialize tty modes for script file collection *------------------------------------------------------------------------ */intscrinit(FILE *sfp, FILE *tfp, int c){	struct termios	newtty;	if (!doecho) {		fprintf(tfp, "\nscripting requires remote ECHO.\n");		return -1;	}	if (scrfp) {		fprintf(tfp,"\nalready scripting to \"%s\".\n", scrname);		return -1;	}	scrindex = 0;	if (tcgetattr(0, &tntty))	/* save current tty settings	*/		errexit("can't get tty modes: %s\n", strerror(errno));	newtty = oldtty;	newtty.c_cc[VINTR] = _POSIX_VDISABLE;	/* disable interrupt	*/	newtty.c_cc[VQUIT] = _POSIX_VDISABLE;	/* disable interrupt	*/	newtty.c_cc[VSUSP] = _POSIX_VDISABLE;	/* disable suspend	*/#ifdef VDSUSP	newtty.c_cc[VDSUSP] = _POSIX_VDISABLE;	/* disable suspend	*/#endif	if (tcsetattr(0, TCSADRAIN, &newtty))		errexit("can't set tty modes: %s\n", strerror(errno));	fprintf(tfp, "\nscript file: ");	(void) fflush(tfp);	return 0;}

⌨️ 快捷键说明

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