Desktop/xinu_mips-1.0.2.tar/xinu_mips-1.0.2/tty/ttyRead.c File Reference

#include <kernel.h>
#include <device.h>
#include <tty.h>

Include dependency graph for ttyRead.c:

Go to the source code of this file.

Functions

devcall ttyRead (device *pdev, char *buf, ushort len)


Detailed Description

ttyRead

Id
ttyRead.c 226 2007-07-12 01:18:27Z mschul

Definition in file ttyRead.c.


Function Documentation

devcall ttyRead ( device pdev,
char *  buf,
ushort  len 
)

Read characters from a tty.

Characters are read from an underlying device, normally a UART. Input is read from the underlying device in lines. Lines may be terminated with the line feed or carriage return characters. Read requests are not satsified until a full line has been read, or the tty's buffer is full. When the tty is not in raw mode, backspaces are cooked and escape sequences and the null character is ignored. When the end of file (Control+D) character is read, the tty stops reading from the underlying device. Subsquent calls to ttyRead will attempt to staisfy the request from the tty's buffer, otherwise EOF will be returned.

Parameters:
pdev pointer to tty device
buf buffer for read characters
len size of the buffer
Returns:
number of characters read, EOF if end of file was reached

Definition at line 31 of file ttyRead.c.

References ASSERT, dentry::controlblk, EOF, dentry::getc, tty::icount, tty::iflags, tty::inbuf, tty::istart, NULL, tty::state, SYSERR, tty::tty_dev, TTY_IBLEN, TTY_IFLAG_CBREAK, TTY_IFLAG_ECHO, TTY_IFLAG_EOF, TTY_IFLAG_RAW, tty::tty_phw, TTY_STATE_ALLOC, and ttyPutChar().

Referenced by ttyGetChar().


Generated on Thu Oct 9 22:35:24 2008 for xinu by  doxygen 1.5.5