1 /****************************************************************************
2 * Copyright (c) 2011,2014 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.3 2014/05/03 19:40:10 juergen Exp $ */
35 #ifndef NC_TERMIOS_included
36 #define NC_TERMIOS_included 1
38 #if HAVE_TERMIOS_H && HAVE_TCGETATTR
40 #else /* !HAVE_TERMIOS_H */
44 /* Add definitions to make termio look like termios.
45 * But ifdef it, since there are some implementations
46 * that try to do this for us in a fake <termio.h>.
49 #define TCSADRAIN TCSETAW
52 #define TCSAFLUSH TCSETAF
55 #define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg)
58 #define tcgetattr(fd, arg) ioctl(fd, TCGETA, arg)
61 #define cfgetospeed(t) ((t)->c_cflag & CBAUD)
67 #define tcflush(fd, arg) ioctl(fd, TCFLSH, arg)
70 #else /* !HAVE_TERMIO_H */
93 #define IGNBRK 0x00001
94 #define BRKINT 0x00002
95 #define IGNPAR 0x00004
97 #define ISTRIP 0x00020
100 #define ICRNL 0x00100
102 #define IXOFF 0x01000
103 #define PARMRK 0x10000
106 #define OPOST 0x00001
109 #define CBAUD 0x0100f
119 #define B1200 0x00009
120 #define B1800 0x0000a
121 #define B2400 0x0000b
122 #define B4800 0x0000c
123 #define B9600 0x0000d
125 #define CSIZE 0x00030
127 #define CSTOPB 0x00040
128 #define CREAD 0x00080
129 #define PARENB 0x00100
130 #define PARODD 0x00200
131 #define HUPCL 0x00400
132 #define CLOCAL 0x00800
138 #define cfgetospeed(t) ((t)->c_cflag & CBAUD)
142 #define tcsetattr(fd, opt, arg) _nc_mingw_tcsetattr(fd, opt, arg)
146 #define tcgetattr(fd, arg) _nc_mingw_tcgetattr(fd, arg)
150 #define tcflush(fd, queue) _nc_mingw_tcflush(fd, queue)
154 #define ttyname(fd) NULL
156 #endif /* __MINGW32__ */
157 #endif /* HAVE_TERMIO_H */
159 #endif /* HAVE_TERMIOS_H */
161 #endif /* NC_TERMIOS_included */