TTY.dcl 858 Bytes
Newer Older
Mart Lubbers's avatar
Mart Lubbers committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
definition module TTY

from Data.Maybe import :: Maybe
from StdFile import class FileSystem
from StdClass import class zero

:: *TTY

:: ByteSize = BytesizeFive | BytesizeSix | BytesizeSeven | BytesizeEight
:: Parity = ParityNone | ParityEven | ParityOdd | ParityMark | ParitySpace
:: 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
19
		stop2bits :: Bool,
Mart Lubbers's avatar
Mart Lubbers committed
20
21
22
23
24
25
26
27
28
29
30
31
32
		xonxoff :: Bool
	}

instance zero TTYSettings

TTYopen :: !String !TTYSettings !*env -> (!Bool,!*TTY,!*env)

TTYclose :: !*TTY !*env -> (!Bool, !*env)

TTYreadc :: !*TTY -> (!Char, !*TTY)

TTYreadline :: !*TTY -> (!String, !*TTY)

Mart Lubbers's avatar
Mart Lubbers committed
33
34
TTYwrite :: !*TTY !String -> !*TTY

Mart Lubbers's avatar
Mart Lubbers committed
35
TTYerror :: !*env -> (!String, !*env)