ttyputc.c,v
来自「TCP-IP红宝书源代码」· C,V 代码 · 共 91 行
C,V
91 行
head 1.2;
access;
symbols;
locks
dls:1.2; strict;
comment @ * @;
1.2
date 97.09.21.19.30.23; author dls; state Dist;
branches;
next 1.1;
1.1
date 94.05.08.06.01.42; author dls; state Old;
branches;
next ;
desc
@@
1.2
log
@pre-3e code
@
text
@/* ttyputc.c - ttyputc */
#include <conf.h>
#include <kernel.h>
#include <tty.h>
/*------------------------------------------------------------------------
* ttyputc - write a single character to a tty
*------------------------------------------------------------------------
*/
int
ttyputc(pdev, ch)
struct devsw *pdev;
unsigned char ch;
{
return ttywrite(pdev, &ch, 1);
}
@
1.1
log
@Initial revision
@
text
@a5 5
#include <io.h>
#include <slu.h>
#include <zsreg.h>
extern char *foob2;
d8 1
a8 1
* ttyputc - write one character to a tty device
d11 4
a14 3
ttyputc(devptr, ch )
struct devsw *devptr;
char ch;
d16 1
a16 16
STATWORD ps;
struct tty *iptr;
iptr = &tty[devptr->dvminor];
if ( ch==NEWLINE && iptr->ocrlf )
ttyputc(devptr,RETURN);
disable(ps);
wait(iptr->osem); /* wait for space in queue */
/**foob2++ = ch;*/
iptr->obuff[iptr->ohead++] = ch;
++iptr->ocnt;
if (iptr->ohead >= OBUFLEN)
iptr->ohead = 0;
ttyostart(iptr);
restore(ps);
return(OK);
a17 3
@
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?