ttynew.c,v
来自「TCP-IP红宝书源代码」· C,V 代码 · 共 68 行
C,V
68 行
head 1.1;
access;
symbols;
locks
dls:1.1; strict;
comment @ * @;
1.1
date 97.09.21.19.30.23; author dls; state Dist;
branches;
next ;
desc
@@
1.1
log
@pre-3e code
@
text
@/* ttynew.c - ttynew */
#include <conf.h>
#include <kernel.h>
#include <tty.h>
extern struct tchars dfltchars;
/*------------------------------------------------------------------------
* ttynew - allocate and initialize a tty structure
*------------------------------------------------------------------------
*/
struct tty *
ttynew()
{
struct tty *ptty, *ttyalloc();
ptty = ttyalloc();
if(ptty == 0)
return 0;
ptty->tty_tchars = dfltchars; /* struct copy */
ptty->tty_cpid = getpid();
ptty->tty_isema = screate(0);
ptty->tty_iflags = 0;
ptty->tty_istart = 0;
ptty->tty_icount = 0;
ptty->tty_osema = screate(OBLEN);
ptty->tty_oflags = 0;
ptty->tty_ostart = 0;
ptty->tty_ocount = 0;
return ptty;
}
#define CNTRL(c) ((c) - 'a' + 1)
struct tchars dfltchars = {
'\b', CNTRL('c'), CNTRL('x'), CNTRL('v'), CNTRL('r'),
CNTRL('d'), CNTRL('s'), CNTRL('q'), CNTRL('z'), CNTRL('w'),
'\n'
};
@
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?