2 * Acess2 POSIX Emulation
3 * - By John Hodge (thePowersGang)
8 #ifndef _LIBPOSIX__TERMIOS_H_
9 #define _LIBPOSIX__TERMIOS_H_
11 typedef unsigned char cc_t;
12 typedef unsigned long speed_t;
13 typedef unsigned short tcflag_t;
16 #define IGNBRK (1 << 0)
17 #define BRKINT (1 << 1)
18 #define IGNPAR (1 << 2) // Ignore parity failures
19 #define PARMRK (1 << 3) // Mark parity failures with FFh 00h
20 #define INPCK (1 << 4) // Enable input parity checks
21 #define ISTRIP (1 << 5) // strip 8th bit
22 #define INLCR (1 << 6) // Translate input newline into CR
23 #define IGNCR (1 << 7) // Ignore input CR
24 #define ICRNL (1 << 8) // Translate input CR into NL
25 // (Linux) IUCLC // Map upper to lower case
26 #define IXON (1 <<10) // Enable input XON/XOFF
27 #define IXANY (1 <<11) // Any character will restart input
33 #define OPOST (1 << 0) // Output processing
35 #define ONLCR (1 << 2) // (XSI) NL->CR
36 #define OCRNL (1 << 3) // CR->NL
37 #define ONOCR (1 << 4) // Don't output CR at column 0
38 #define ONLRET (1 << 5) // Don't output CR
39 #define OFILL (1 << 6) // Send fill chars for a delay, instead of timing
41 #define NLDLY (1 << 8) // Newline delay mask (NL0/NL1)
44 #define NCDLY (3 << 9) // Carriage return delay mask (CR0-CR3)
49 #define TABDLY (3 << 11) // Horizontal tab delay mask
50 #define TAB0 (0 << 11)
51 #define TAB1 (1 << 11)
52 #define TAB2 (2 << 11)
53 #define TAB3 (3 << 11)
54 #define BSDLY (1 << 13) // Backspace delay
57 #define VTDLY (1 << 14) // Vertical tab delay
60 #define FFDLY (1 << 15) // Form feed delay
62 #define VFF1 (1 << 15)
65 #define CBAUD (037 << 0) // Baud speed
75 #define B1200 (9 << 0)
76 #define B1800 (10 << 0)
77 #define B2400 (11 << 0)
78 #define B4800 (12 << 0)
79 #define B9600 (13 << 0)
80 #define B19200 (14 << 0)
81 #define B38400 (15 << 0)
82 #define CSIZE (3 << 5) // Character size mask
87 #define CSTOPB (1 << 7) // 1/2 stop bits
88 #define CREAD (1 << 8) // Enable receiver
89 #define PARENB (1 << 9) // Enable parity generation / checking
90 #define PARODD (1 << 10) // Odd parity
91 #define HUPCL (1 << 11) // Hang up on close
92 #define CLOCAL (1 << 12) // Ignore modem control lines
99 #define ISIG (1 << 0) // Generate signals for INTR, QUIT, SUSP and DSUSP
100 #define ICANON (1 << 1) // Input canonical mode
102 #define ECHO (1 << 3) // Echo input characters
103 #define ECHOE (1 << 4) // Enable ERASE and WERASE on echoed input [ICANON]
104 #define ECHOK (1 << 5) // Enable KILL char on echoed input [ICANON]
105 #define ECHONL (1 << 6) // Echo NL even if ECHO is unset [ICANON]
106 #define ECHOCTL (1 << 7) // (non-POSIX) If ECHO set specials are echoed as val+0x40 (BS=^H)
108 #define ECHOKE (1 << 9) // (non-POSIX) KILL implimented by sequential erase [ICANON]
111 #define NOFLSH (1 << 11) // Disable flush of IO when generating INT, QUIT and SUSP
112 #define TOSTOP (1 << 12) // ?
114 #define IEXTEN (1 << 14)
116 // - Indexes for c_cc
130 // VREPRINT, // (non-POSIX)
132 // VSTATUS, // (non-POSIX)
135 // VSWITCH, // (non-POSIX)
140 #define _POSIX_VDISABLE 255
151 extern speed_t cfgetospeed(const struct termios *termios_p);
153 extern int tcgetattr(int fd, struct termios *termios_p);
156 #define TCSADRAIN 0x02
157 #define TCSAFLUSH 0x04
158 extern int tcsetattr(int fd, int optional_actions, const struct termios *termios_p);
160 // ioctl() calls for terminals
168 unsigned short ws_row;
169 unsigned short ws_col;
170 unsigned short ws_xpixel; /* unused */
171 unsigned short ws_ypixel; /* unused */