Daily bump.
[official-gcc.git] / gcc / m2 / gm2-libs / termios.def
blob523e0b9b93c444b83ed32f9f319d8143198d791d
1 (* termios.def provides a procedural interface to termios.
3 Copyright (C) 2005-2024 Free Software Foundation, Inc.
4 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
6 This file is part of GNU Modula-2.
8 GNU Modula-2 is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
13 GNU Modula-2 is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 Under Section 7 of GPL version 3, you are granted additional
19 permissions described in the GCC Runtime Library Exception, version
20 3.1, as published by the Free Software Foundation.
22 You should have received a copy of the GNU General Public License and
23 a copy of the GCC Runtime Library Exception along with this program;
24 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
25 <http://www.gnu.org/licenses/>. *)
27 DEFINITION MODULE termios ;
29 FROM SYSTEM IMPORT ADDRESS ;
31 TYPE
32 TERMIOS = ADDRESS ;
34 ControlChar = (vintr, vquit, verase, vkill, veof, vtime, vmin,
35 vswtc, vstart, vstop, vsusp, veol, vreprint, vdiscard,
36 vwerase, vlnext, veol2) ;
38 Flag = (
39 (* input flag bits *)
40 ignbrk, ibrkint, ignpar, iparmrk, inpck, istrip, inlcr,
41 igncr, icrnl, iuclc, ixon, ixany, ixoff, imaxbel,
42 (* output flag bits *)
43 opost, olcuc, onlcr, ocrnl, onocr, onlret, ofill, ofdel,
44 onl0, onl1, ocr0, ocr1, ocr2, ocr3,
45 otab0, otab1, otab2, otab3, obs0, obs1, off0, off1, ovt0, ovt1,
46 (* baud rate *)
47 b0, b50, b75, b110, b135, b150, b200, b300, b600, b1200,
48 b1800, b2400, b4800, b9600, b19200, b38400,
49 b57600, b115200, b240400, b460800, b500000, b576000,
50 b921600, b1000000, b1152000, b1500000, b2000000, b2500000,
51 b3000000, b3500000, b4000000, maxbaud, crtscts,
52 (* character size *)
53 cs5, cs6, cs7, cs8, cstopb, cread, parenb, parodd, hupcl, clocal,
54 (* local flags *)
55 lisig, licanon, lxcase, lecho, lechoe, lechok, lechonl, lnoflsh,
56 ltopstop, lechoctl, lechoprt, lechoke, lflusho, lpendin, liexten) ;
60 InitTermios - new data structure.
63 PROCEDURE InitTermios () : TERMIOS ;
67 KillTermios - delete data structure.
70 PROCEDURE KillTermios (t: TERMIOS) : TERMIOS ;
74 cfgetospeed - return output baud rate.
77 PROCEDURE cfgetospeed (t: TERMIOS) : INTEGER ;
81 cfgetispeed - return input baud rate.
84 PROCEDURE cfgetispeed (t: TERMIOS) : INTEGER ;
88 cfsetospeed - set output baud rate.
91 PROCEDURE cfsetospeed (t: TERMIOS; b: CARDINAL) : INTEGER ;
95 cfsetispeed - set input baud rate.
98 PROCEDURE cfsetispeed (t: TERMIOS; b: CARDINAL) : INTEGER ;
102 cfsetspeed - set input and output baud rate.
105 PROCEDURE cfsetspeed (t: TERMIOS; b: CARDINAL) : INTEGER ;
109 tcgetattr - get state of, fd, into, t.
112 PROCEDURE tcgetattr (fd: INTEGER; t: TERMIOS) : INTEGER ;
116 The following three functions return the different option values.
119 PROCEDURE tcsnow () : INTEGER ; (* alter fd now *)
120 PROCEDURE tcsdrain () : INTEGER ; (* alter when all output has been sent *)
121 PROCEDURE tcsflush () : INTEGER ; (* like drain, except discard any pending input *)
125 tcsetattr - set state of, fd, to, t, using option.
128 PROCEDURE tcsetattr (fd: INTEGER; option: INTEGER; t: TERMIOS) : INTEGER ;
132 cfmakeraw - sets, t, to raw mode.
135 PROCEDURE cfmakeraw (t: TERMIOS) ;
139 tcsendbreak - send zero bits for duration.
142 PROCEDURE tcsendbreak (fd: INTEGER; duration: INTEGER) : INTEGER ;
146 tcdrain - waits for pending output to be written on, fd.
149 PROCEDURE tcdrain (fd: INTEGER) : INTEGER ;
153 tcflushi - flush input.
156 PROCEDURE tcflushi (fd: INTEGER) : INTEGER ;
160 tcflusho - flush output.
163 PROCEDURE tcflusho (fd: INTEGER) : INTEGER ;
167 tcflushio - flush input and output.
170 PROCEDURE tcflushio (fd: INTEGER) : INTEGER ;
174 tcflowoni - restart input on, fd.
177 PROCEDURE tcflowoni (fd: INTEGER) : INTEGER ;
181 tcflowoffi - stop input on, fd.
184 PROCEDURE tcflowoffi (fd: INTEGER) : INTEGER ;
188 tcflowono - restart output on, fd.
191 PROCEDURE tcflowono (fd: INTEGER) : INTEGER ;
195 tcflowoffo - stop output on, fd.
198 PROCEDURE tcflowoffo (fd: INTEGER) : INTEGER ;
202 GetFlag - sets a flag value from, t, in, b, and returns TRUE
203 if, t, supports, f.
206 PROCEDURE GetFlag (t: TERMIOS; f: Flag; VAR b: BOOLEAN) : BOOLEAN ;
210 SetFlag - sets a flag value in, t, to, b, and returns TRUE if
211 this flag value is supported.
214 PROCEDURE SetFlag (t: TERMIOS; f: Flag; b: BOOLEAN) : BOOLEAN ;
218 GetChar - sets a CHAR, ch, value from, t, and returns TRUE if
219 this value is supported.
222 PROCEDURE GetChar (t: TERMIOS; c: ControlChar; VAR ch: CHAR) : BOOLEAN ;
226 SetChar - sets a CHAR value in, t, and returns TRUE if, c,
227 is supported.
230 PROCEDURE SetChar (t: TERMIOS; c: ControlChar; ch: CHAR) : BOOLEAN ;
233 END termios.