📄 tewrite.c
字号:
/* tewrite.c - tewrite */
#include <sys/types.h>
#include <stdio.h>
#include "tnfsm.h"
extern struct fsm_trans testab[];
extern int testate;
extern u_char tefsm[][NCHRS];
/*------------------------------------------------------------------------
* tewrite - do output processing to the TLI descriptor
*------------------------------------------------------------------------
*/
int
tewrite(rfp, tfp, buf, cc)
FILE *rfp, *tfp; /* remote and terminal FILE pointers */
u_char *buf; /* buffer of data to send */
int cc; /* # characters in buf */
{
struct fsm_trans *pt;
int i, ki;
for (i=0; i<cc; ++i) {
int c = buf[i];
ki = tefsm[testate][c];
pt = &testab[ki];
if ((pt->ft_action)(rfp, tfp, c) < 0)
testate = KSREMOTE; /* an error occurred */
else
testate = pt->ft_next;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -