TTY.dcl 821 Bytes
Newer Older
Mart Lubbers's avatar
Mart Lubbers committed
1
2
3
4
5
6
7
definition module TTY

from StdClass import class zero

:: *TTY

:: ByteSize = BytesizeFive | BytesizeSix | BytesizeSeven | BytesizeEight
8
:: Parity = ParityNone | ParityOdd | ParityEven | ParitySpace | ParityMark
Mart Lubbers's avatar
Mart Lubbers committed
9
10
11
12
13
14
15
16
:: BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 |
	B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400 | B57600 |
	B115200 | B230400

:: TTYSettings = {
		baudrate :: BaudRate,
		bytesize :: ByteSize,
		parity :: Parity,
Mart Lubbers's avatar
Mart Lubbers committed
17
		stop2bits :: Bool,
Mart Lubbers's avatar
Mart Lubbers committed
18
19
20
21
22
23
		xonxoff :: Bool
	}

instance zero TTYSettings

TTYclose :: !*TTY !*env -> (!Bool, !*env)
Mart Lubbers's avatar
Mart Lubbers committed
24
25
TTYerror :: !*env -> (!String, !*env)
TTYopen :: !String !TTYSettings !*env -> (!Bool,!*TTY,!*env)
Mart Lubbers's avatar
Mart Lubbers committed
26
TTYread :: !*TTY -> (!Int, !*TTY)
Mart Lubbers's avatar
Mart Lubbers committed
27
TTYreadline :: !*TTY -> (!String, !*TTY)
Mart Lubbers's avatar
Mart Lubbers committed
28
TTYavailable :: !*TTY -> (!Bool, !*TTY)
Mart Lubbers's avatar
Mart Lubbers committed
29
TTYwrite :: !String !*TTY -> *TTY