tbyte.c

来自「支持ZModem, Telnet功能的串口通讯程序」· C语言 代码 · 共 40 行

C
40
字号
/* * This function deals with bytes from the telnet end of the connection. * These are scanned for IAC messages and the IAC function called if so, * else the byte is passed into the output queue. */#include "virtmodem.h"#include "blocks.h"extern struct block_list local;voidtelnet_byte(unsigned char c){    static int iac= -1;    static unsigned char ibytes[3];    switch(iac) {    case 0:	if(c==255) {	    add_char(&local,c);	    iac= -1;	} else {	    ibytes[1]=c;	    iac=1;	}	break;    case 1:	ibytes[2]=c;	do_iac(ibytes);	iac= -1;	break;    default:	if(c==255)	    iac=0;	else	    add_char(&local,c);    }}

⌨️ 快捷键说明

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