]>
sourceware.org Git - newlib-cygwin.git/blob - winsup/cygwin/include/sys/termios.h
d701e2f72e4fe03226f888be174c799f5fc2cc39
3 This file is part of Cygwin.
5 This software is a copyrighted work licensed under the terms of the
6 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
11 #ifndef _SYS_TERMIOS_H
12 #define _SYS_TERMIOS_H
14 #include <sys/types.h>
16 #define TIOCMGET 0x5415
17 #define TIOCMBIS 0x5416
18 #define TIOCMBIC 0x5417
19 #define TIOCMSET 0x5418
20 #define TIOCINQ 0x541B
21 #define TIOCSCTTY 0x540E
23 /* TIOCINQ is utilized instead of FIONREAD which has been
24 accupied for other purposes under CYGWIN.
25 Other UNIX ioctl requests has been omited because
26 effects of their work one can achive by standard
29 #define TIOCSBRK 0x5427
30 #define TIOCCBRK 0x5428
32 #define TIOCM_DTR 0x002
33 #define TIOCM_RTS 0x004
34 #define TIOCM_CTS 0x020
35 #define TIOCM_CAR 0x040
36 #define TIOCM_RNG 0x080
37 #define TIOCM_DSR 0x100
38 #define TIOCM_CD TIOCM_CAR
39 #define TIOCM_RI TIOCM_RNG
63 #define TIOCPKT_DATA 0
64 #define TIOCPKT_FLUSHREAD 1
65 #define TIOCPKT_FLUSHWRITE 2
66 #define TIOCPKT_STOP 4
67 #define TIOCPKT_START 8
68 #define TIOCPKT_NOSTOP 16
69 #define TIOCPKT_DOSTOP 32
71 /* Compatible with asm/socket.h */
72 #define FIONBIO 0x8004667e /* set/clear non-blocking i/o */
74 #define CTRL(ch) ((ch)&0x1F)
79 #define CINTR CTRL('C')
82 #define CKILL CTRL('U')
83 #define CEOT CTRL('D')
87 #define CEOF CTRL('D')
88 #define CSTART CTRL('Q')
89 #define CSTOP CTRL('S')
90 #define CSWTCH 0x0001a
92 #define CSUSP CTRL('Z')
93 #define CDSUSP CTRL('Y')
94 #define CRPRNT CTRL('R')
95 #define CREPRINT CRPRNT
96 #define CFLUSH CTRL('O')
97 #define CDISCARD CFLUSH
98 #define CWERASE CTRL('W')
99 #define CLNEXT CTRL('V')
104 #define IGNBRK 0x00001
105 #define BRKINT 0x00002
106 #define IGNPAR 0x00004
107 #define IMAXBEL 0x00008
108 #define INPCK 0x00010
109 #define ISTRIP 0x00020
110 #define INLCR 0x00040
111 #define IGNCR 0x00080
112 #define ICRNL 0x00100
114 #define IXOFF 0x01000
115 #define IUCLC 0x04000
116 #define IXANY 0x08000
117 #define PARMRK 0x10000
118 #define IUTF8 0x20000
122 #define OPOST 0x00001
123 #define OLCUC 0x00002
124 #define OCRNL 0x00004
125 #define ONLCR 0x00008
126 #define ONOCR 0x00010
127 #define ONLRET 0x00020
128 #define OFILL 0x00040
129 #define CRDLY 0x00180
134 #define NLDLY 0x00200
137 #define BSDLY 0x00400
140 #define TABDLY 0x01800
145 #define XTABS 0x01800
146 #define VTDLY 0x02000
149 #define FFDLY 0x04000
152 #define OFDEL 0x08000
156 /* Baud rate values. These must fit in speed_t, which is unsigned
157 char. See also the extended baud rates below. These baud rates
158 set an additional bit. */
159 #define CBAUD 0x0100f
169 #define B1200 0x00009
170 #define B1800 0x0000a
171 #define B2400 0x0000b
172 #define B4800 0x0000c
173 #define B9600 0x0000d
174 #define B19200 0x0000e
175 #define B38400 0x0000f
177 #define CSIZE 0x00030
182 #define CSTOPB 0x00040
183 #define CREAD 0x00080
184 #define PARENB 0x00100
185 #define PARODD 0x00200
186 #define HUPCL 0x00400
187 #define CLOCAL 0x00800
189 /* Extended baud rates above 37K. */
190 #define CBAUDEX 0x0100f
191 #define B57600 0x01001
192 #define B115200 0x01002
193 #define B128000 0x01003
194 #define B230400 0x01004
195 #define B256000 0x01005
196 #define B460800 0x01006
197 #define B500000 0x01007
198 #define B576000 0x01008
199 #define B921600 0x01009
200 #define B1000000 0x0100a
201 #define B1152000 0x0100b
202 #define B1500000 0x0100c
203 #define B2000000 0x0100d
204 #define B2500000 0x0100e
205 #define B3000000 0x0100f
207 #define CRTSXOFF 0x04000
208 #define CRTSCTS 0x08000
209 #define CMSPAR 0x40000000 /* Mark or space (stick) parity. */
213 #define ICANON 0x0002
217 #define ECHONL 0x0020
218 #define NOFLSH 0x0040
219 #define TOSTOP 0x0080
220 #define IEXTEN 0x0100
221 #define FLUSHO 0x0200
222 #define ECHOKE 0x0400
223 #define ECHOCTL 0x0800
245 /* Compare a character C to a value VAL from the `c_cc' array in a
246 `struct termios'. If VAL is _POSIX_VDISABLE, no character can match it. */
247 #define CCEQ(val, c) ((c) == (val) && (val) != _POSIX_VDISABLE)
249 #define TTYDEF_IFLAG (BRKINT | ICRNL | IMAXBEL | IXON | IXANY)
250 #define TTYDEF_OFLAG (OPOST | ONLCR)
251 #define TTYDEF_LFLAG (ICANON | ISIG | IEXTEN | ECHO | ECHOE | ECHOKE | ECHOCTL)
252 #define TTYDEF_CFLAG (CREAD | CS8 | HUPCL)
253 #define TTYDEF_SPEED (B9600)
255 typedef unsigned char cc_t
;
256 typedef unsigned int tcflag_t
;
257 typedef unsigned int speed_t
;
258 typedef unsigned short otcflag_t
;
259 typedef unsigned char ospeed_t
;
285 #define termio termios
291 int tcgetattr (int, struct termios
*);
292 int tcsetattr (int, int, const struct termios
*);
293 int tcsendbreak (int, int);
295 int tcflush (int, int);
296 int tcflow (int, int);
297 pid_t
tcgetsid (int);
298 void cfmakeraw (struct termios
*);
299 speed_t
cfgetispeed(const struct termios
*);
300 speed_t
cfgetospeed(const struct termios
*);
301 int cfsetispeed (struct termios
*, speed_t
);
302 int cfsetospeed (struct termios
*, speed_t
);
303 int cfsetspeed (struct termios
*, speed_t
);
310 #define cfgetispeed(tp) ((tp)->c_ispeed)
311 #define cfgetospeed(tp) ((tp)->c_ospeed)
314 /* Extra stuff to make porting stuff easier. */
317 unsigned short ws_row
, ws_col
;
318 unsigned short ws_xpixel
, ws_ypixel
;
321 #define TIOCGWINSZ (('T' << 8) | 1)
322 #define TIOCSWINSZ (('T' << 8) | 2)
323 #define TIOCLINUX (('T' << 8) | 3)
324 #define TIOCGPGRP (('T' << 8) | 0xf)
325 #define TIOCSPGRP (('T' << 8) | 0x10)
327 #endif /* _SYS_TERMIOS_H */
This page took 0.052047 seconds and 6 git commands to generate.