UnixFileDescriptorStream.mesa
Copyright Ó 1990, 1992 by Xerox Corporation. All rights reserved.
Norman Adams, February 23, 1990 1:21 pm PST
This degenerate stream implementation provides a way for the terminal emulator to see if more characters will be sent from Plumber soon. Plumber provides a way to run a Unix process with its terminal IO connected to a viewer. Plumber communicates with the Unix process via Unix file descriptors. The terminal emulator is an additional layer that interprets the characters sent through it to a viewer the way a terminal would. For performance reasons, the terminal emulator wants to know if more characters are ready on its input. In the case of Plumber, that is the Unix file descriptor, but the terminal emulator wants an IO stream to do its CharsAvail on.
Willie-s, June 12, 1992 2:42 pm PDT
DIRECTORY IO, UnixTypes;
UnixFileDescriptorStream: CEDAR DEFINITIONS = {
Create: PROC [ fd: UnixTypes.FileDescriptor ¬ UnixTypes.FileDescriptor.error]
RETURNS [IO.STREAM];
SetTerminalSize: PROC [self: IO.STREAM, r,c: INT];
SetFD: PROC [self: IO.STREAM, fd: UnixTypes.FileDescriptor];
}.