Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
SysTermIO


NAME

SysTermIO - UNIX System V interface to the terminal driver

SYNOPSIS

(* input modes *)
CONST ignbrk = { 31 };
CONST brkint = { 30 };
CONST ignpar = { 29 };
CONST parmrk = { 28 };
CONST inpck = { 27 };
CONST istrip = { 26 };
CONST inlcr = { 25 };
CONST igncr = { 24 };
CONST icrnl = { 23 };
CONST iuclc = { 22 };
CONST ixon = { 21 };
CONST ixany = { 20 };
CONST ixoff = { 19 };
(* output modes *)
CONST opost = { 31 };
CONST olcuc = { 30 };
CONST onlcr = { 29 };
CONST ocrnl = { 28 };
CONST onocr = { 27 };
CONST onlret = { 26 };
CONST ofill = { 25 };
CONST ofdel = { 24 };
(* delays for newline *)
CONST nldly = { 23 };           (* mask *)
CONST nl0 = { };
CONST nl1 = { 23 };
(* delays for carriage return *)
CONST crdly = { 21, 22 };       (* mask *)
CONST cr0 = { };
CONST cr1 = { 22 };
CONST cr2 = { 21 };
CONST cr3 = { 21, 22 };
(* delays for tabs *)
CONST tabdly = { 19, 20 };      (* mask *)
CONST tab1 = { 20 };
CONST tab2 = { 19 };
CONST tab3 = { 19, 20 };        (* expand tabs to spaces *)
(* delays for backspaces *)
CONST bsdly = { 18 };           (* mask *)
CONST bs0 = { };
CONST bs1 = { 18 };
(* delays for vertical tabs *)
CONST vtdly = { 17 };           (* mask *)
CONST vt0 = { };
CONST vt1 = { 17 };
(* delays for form feeds *)
CONST ffdly = { 16 };
CONST ff0 = { };
CONST ff1 = { 16 };
(* control modes *)
CONST cbaud = { 28..31 };       (* mask *)
CONST b0 = {};
CONST b50 = { 31 };
CONST b75 = { 30 };
CONST b110 = { 29, 30 };
CONST b134 = { 29 };
CONST b150 = { 29, 31 };
CONST b200 = { 29, 30 };
CONST b300 = { 29..31 };
CONST b600 = { 28 };
CONST b1200 = { 28, 31 };
CONST b1800 = { 28, 30 };
CONST b2400 = { 28, 30, 31 };
CONST b4800 = { 28, 29 };
CONST b9600 = { 28, 29, 31 };
CONST exta = { 28..30 };
CONST extb = { 28..31 };
CONST csize = { 26, 27 };       (* mask *)
CONST cs5 = {};
CONST cs6 = { 27 };
CONST cs7 = { 26 };
CONST cs8 = { 26, 27 };
CONST cstopb = { 25 };
CONST cread = { 24 };
CONST parenb = { 23 };
CONST parodd = { 22 };
CONST hupcl = { 21 };
CONST clocal = { 20 };
(* line modes *)
CONST isig = { 31 };
CONST icanon = { 30 };
CONST xcase = { 29 };
CONST echo = { 28 };
CONST echoe = { 27 };
CONST echok = { 26 };
CONST echonl = { 25 };
CONST noflsh = { 24 };
(* control characters *)
CONST vintr = 0;
CONST vquit = 1;
CONST verase = 2;
CONST vkill = 3;
CONST veof = 4;
CONST veol = 5;
CONST veol2 = 6;
CONST vswtch = 7;
CONST vmin = veof; vtime = veol;
CONST controlchars = 8;


TYPE ControlChars = INTEGER; (* vintr..vswtch *) TYPE InputModes = SET; TYPE OutputModes = SET; TYPE ControlModes = SET; TYPE LineModes = SET; TYPE TermIO = RECORD inputmodes: InputModes; outputmodes: OutputModes; controlmodes: ControlModes; linemodes: LineModes; linedisc: CHAR; cc: ARRAY controlchars OF CHAR; END;

PROCEDURE SetTermIO(fd: SysIO.File; termio: TermIO; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE GetTermIO(fd: SysIO.File; VAR termio: TermIO; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE Terminal(fd: SysIO.File) : BOOLEAN; PROCEDURE Baudrate(termio: TermIO) : INTEGER;

DESCRIPTION

SetTermIO and GetTermIO realize the TCSETA and TCGETA ioctl-calls with type conversion for Oberon. Baudrate converts the baudrate information in termio into an integer. Terminal returns TRUE if fd is associated to a terminal device.

DIAGNOSTICS

SetTermIO and GetTermIO return FALSE in error case (e.g. fd is not associated to a terminal device or on invalid parameters). Errors cause the events of SysErrors to be raised. The errors parameter is passed to SysErrors.Raise.

SEE ALSO

ioctl(2)       ioctl system call
termio(7)      termio interface
SysErrors      error handling of failed	system calls

BUGS

A portable interface for terminal settings is not yet implemented.
Edited by: borchert, last change: 1992/03/17, revision: 1.3, converted to HTML: 1997/04/28

Oberon || Library || Module Index || Search Engine || Definition || Module