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

📄 ttputc.c

📁 comer s TCPIP-vol3源代码...当然是经典咯
💻 C
字号:
/* ttputc.c - ttputc */#include <sys/types.h>#include <stdio.h>#include "telnet.h"int	tcout(char *cap, FILE *tfp);int	xputc(char ch, FILE *fp);/*------------------------------------------------------------------------ * ttputc - print a single character on a Network Virtual Terminal *------------------------------------------------------------------------ */intttputc(FILE *sfp, FILE *tfp, int c){	static	last_char;	int	tc;	if (rcvbinary) { 		(void) xputc(c, tfp);	/* print uninterpretted	*/		return 0;	}	if (synching)			/* no data, if in SYNCH	*/		return 0;	if ((last_char == VPCR && c == VPLF) ||	    (last_char == VPLF && c == VPCR)) {		(void) xputc(VPLF, tfp);		last_char = 0;		return 0;	}	if (last_char == VPCR)		(void) tcout("cr", tfp);	else if (last_char == VPLF)		(void) tcout("do", tfp);	if (c >= ' ' && c < TCIAC)	/* printable ASCII	*/		(void) xputc(c, tfp);	else {				/* NVT special		*/		switch (c) {		case VPLF: 		/* see if CR follows	*/		case VPCR:	tc = 1;	/* see if LF follows	*/				break;		case VPBEL:	tc = tcout("bl", tfp);				break;		case VPBS:	tc = tcout("bc", tfp);				break;		case VPHT:	tc = tcout("ta", tfp);				break;		case VPVT:	tc = tcout("do", tfp);				break;		case VPFF:	tc = tcout("cl", tfp);				break;		default:			tc = 1;			break;	/* no action */		}		if (!tc)		/* if no termcap, assume ASCII */			(void) xputc(c, tfp);	}	last_char = c;	return 0;}

⌨️ 快捷键说明

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