4 #define TTY_BUF_SIZE 1024
6 /* 0x54 is just a magic number to make these relatively uniqe ('T') */
10 #define TCSETSW 0x5403
11 #define TCSETSF 0x5404
14 #define TCSETAW 0x5407
15 #define TCSETAF 0x5408
19 #define TIOCEXCL 0x540C
20 #define TIOCNXCL 0x540D
21 #define TIOCSCTTY 0x540E
22 #define TIOCGPGRP 0x540F
23 #define TIOCSPGRP 0x5410
24 #define TIOCOUTQ 0x5411
25 #define TIOCSTI 0x5412
26 #define TIOCGWINSZ 0x5413
27 #define TIOCSWINSZ 0x5414
28 #define TIOCMGET 0x5415
29 #define TIOCMBIS 0x5416
30 #define TIOCMBIC 0x5417
31 #define TIOCMSET 0x5418
32 #define TIOCGSOFTCAR 0x5419
33 #define TIOCSSOFTCAR 0x541A
36 unsigned short ws_row
;
37 unsigned short ws_col
;
38 unsigned short ws_xpixel
;
39 unsigned short ws_ypixel
;
44 unsigned short c_iflag
; /* input mode flags */
45 unsigned short c_oflag
; /* output mode flags */
46 unsigned short c_cflag
; /* control mode flags */
47 unsigned short c_lflag
; /* local mode flags */
48 unsigned char c_line
; /* line discipline */
49 unsigned char c_cc
[NCC
]; /* control characters */
54 unsigned long c_iflag
; /* input mode flags */
55 unsigned long c_oflag
; /* output mode flags */
56 unsigned long c_cflag
; /* control mode flags */
57 unsigned long c_lflag
; /* local mode flags */
58 unsigned char c_line
; /* line discipline */
59 unsigned char c_cc
[NCCS
]; /* control characters */
82 #define IGNBRK 0000001
83 #define BRKINT 0000002
84 #define IGNPAR 0000004
85 #define PARMRK 0000010
87 #define ISTRIP 0000040
95 #define IMAXBEL 0020000
100 #define ONLCR 0000004
101 #define OCRNL 0000010
102 #define ONOCR 0000020
103 #define ONLRET 0000040
104 #define OFILL 0000100
105 #define OFDEL 0000200
106 #define NLDLY 0000400
109 #define CRDLY 0003000
114 #define TABDLY 0014000
119 #define XTABS 0014000
120 #define BSDLY 0020000
123 #define VTDLY 0040000
126 #define FFDLY 0040000
130 /* c_cflag bit meaning */
131 #define CBAUD 0000017
132 #define B0 0000000 /* hang up */
141 #define B1200 0000011
142 #define B1800 0000012
143 #define B2400 0000013
144 #define B4800 0000014
145 #define B9600 0000015
146 #define B19200 0000016
147 #define B38400 0000017
148 #define CSIZE 0000060
153 #define CSTOPB 0000100
154 #define CREAD 0000200
155 #define CPARENB 0000400
156 #define CPARODD 0001000
157 #define HUPCL 0002000
158 #define CLOCAL 0004000
159 #define CIBAUD 03600000 /* input baud rate (not used) */
160 #define CRTSCTS 020000000000 /* flow control */
164 #define ICANON 0000002
165 #define XCASE 0000004
167 #define ECHOE 0000020
168 #define ECHOK 0000040
169 #define ECHONL 0000100
170 #define NOFLSH 0000200
171 #define TOSTOP 0000400
172 #define ECHOCTL 0001000
173 #define ECHOPRT 0002000
174 #define ECHOKE 0004000
175 #define FLUSHO 0010000
176 #define PENDIN 0040000
177 #define IEXTEN 0100000
180 #define TIOCM_LE 0x001
181 #define TIOCM_DTR 0x002
182 #define TIOCM_RTS 0x004
183 #define TIOCM_ST 0x008
184 #define TIOCM_SR 0x010
185 #define TIOCM_CTS 0x020
186 #define TIOCM_CAR 0x040
187 #define TIOCM_RNG 0x080
188 #define TIOCM_DSR 0x100
189 #define TIOCM_CD TIOCM_CAR
190 #define TIOCM_RI TIOCM_RNG
192 /* tcflow() and TCXONC use these */
198 /* tcflush() and TCFLSH use these */
203 /* tcsetattr uses these */
210 extern speed_t
cfgetispeed(struct termios
*termios_p
);
211 extern speed_t
cfgetospeed(struct termios
*termios_p
);
212 extern int cfsetispeed(struct termios
*termios_p
, speed_t speed
);
213 extern int cfsetospeed(struct termios
*termios_p
, speed_t speed
);
214 extern int tcdrain(int fildes
);
215 extern int tcflow(int fildes
, int action
);
216 extern int tcflush(int fildes
, int queue_selector
);
217 extern int tcgetattr(int fildes
, struct termios
*termios_p
);
218 extern int tcsendbreak(int fildes
, int duration
);
219 extern int tcsetattr(int fildes
, int optional_actions
,
220 struct termios
*termios_p
);