1 /****************************************************************************
2 * Copyright (c) 2011-2014,2017 Free Software Foundation, Inc. *
4 * Permission is hereby granted, free of charge, to any person obtaining a *
5 * copy of this software and associated documentation files (the *
6 * "Software"), to deal in the Software without restriction, including *
7 * without limitation the rights to use, copy, modify, merge, publish, *
8 * distribute, distribute with modifications, sublicense, and/or sell *
9 * copies of the Software, and to permit persons to whom the Software is *
10 * furnished to do so, subject to the following conditions: *
12 * The above copyright notice and this permission notice shall be included *
13 * in all copies or substantial portions of the Software. *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23 * Except as contained in this notice, the name(s) of the above copyright *
24 * holders shall not be used in advertising or otherwise to promote the *
25 * sale, use or other dealings in this Software without prior written *
27 ****************************************************************************/
29 /****************************************************************************
30 * Author: Thomas E. Dickey 2011 *
31 ****************************************************************************/
33 /* $Id: nc_termios.h,v 1.5 2017/07/23 00:02:08 tom Exp $ */
35 #ifndef NC_TERMIOS_included
36 #define NC_TERMIOS_included 1
38 #include <ncurses_cfg.h>
40 #if HAVE_TERMIOS_H && HAVE_TCGETATTR
42 #else /* !HAVE_TERMIOS_H */
46 /* Add definitions to make termio look like termios.
47 * But ifdef it, since there are some implementations
48 * that try to do this for us in a fake <termio.h>.
51 #define TCSADRAIN TCSETAW
54 #define TCSAFLUSH TCSETAF
57 #define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg)
60 #define tcgetattr(fd, arg) ioctl(fd, TCGETA, arg)
63 #define cfgetospeed(t) ((t)->c_cflag & CBAUD)
69 #define tcflush(fd, arg) ioctl(fd, TCFLSH, arg)
72 #else /* !HAVE_TERMIO_H */
95 #define IGNBRK 0x00001
96 #define BRKINT 0x00002
97 #define IGNPAR 0x00004
99 #define ISTRIP 0x00020
100 #define INLCR 0x00040
101 #define IGNCR 0x00080
102 #define ICRNL 0x00100
104 #define IXOFF 0x01000
105 #define PARMRK 0x10000
108 #define OPOST 0x00001
111 #define CBAUD 0x0100f
121 #define B1200 0x00009
122 #define B1800 0x0000a
123 #define B2400 0x0000b
124 #define B4800 0x0000c
125 #define B9600 0x0000d
127 #define CSIZE 0x00030
129 #define CSTOPB 0x00040
130 #define CREAD 0x00080
131 #define PARENB 0x00100
132 #define PARODD 0x00200
133 #define HUPCL 0x00400
134 #define CLOCAL 0x00800
140 #define cfgetospeed(t) ((t)->c_cflag & CBAUD)
144 #define tcsetattr(fd, opt, arg) _nc_mingw_tcsetattr(fd, opt, arg)
148 #define tcgetattr(fd, arg) _nc_mingw_tcgetattr(fd, arg)
152 #define tcflush(fd, queue) _nc_mingw_tcflush(fd, queue)
156 #define ttyname(fd) NULL
158 #endif /* __MINGW32__ */
159 #endif /* HAVE_TERMIO_H */
161 #endif /* HAVE_TERMIOS_H */
163 #endif /* NC_TERMIOS_included */