1 /**************************************************************************** 2 * Copyright 2018-2020,2025 Thomas E. Dickey * 3 * Copyright 2011-2014,2017 Free Software Foundation, Inc. * 4 * * 5 * Permission is hereby granted, free of charge, to any person obtaining a * 6 * copy of this software and associated documentation files (the * 7 * "Software"), to deal in the Software without restriction, including * 8 * without limitation the rights to use, copy, modify, merge, publish, * 9 * distribute, distribute with modifications, sublicense, and/or sell * 10 * copies of the Software, and to permit persons to whom the Software is * 11 * furnished to do so, subject to the following conditions: * 12 * * 13 * The above copyright notice and this permission notice shall be included * 14 * in all copies or substantial portions of the Software. * 15 * * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 19 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 21 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 22 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 23 * * 24 * Except as contained in this notice, the name(s) of the above copyright * 25 * holders shall not be used in advertising or otherwise to promote the * 26 * sale, use or other dealings in this Software without prior written * 27 * authorization. * 28 ****************************************************************************/ 29 30 /**************************************************************************** 31 * Author: Thomas E. Dickey 2011 * 32 ****************************************************************************/ 33 34 /* $Id: nc_termios.h,v 1.10 2025/10/18 17:53:13 tom Exp $ */ 35 36 #ifndef NC_TERMIOS_included 37 #define NC_TERMIOS_included 1 38 39 #include <ncurses_cfg.h> 40 41 #if HAVE_TERMIOS_H && HAVE_TCGETATTR 42 43 #else /* !HAVE_TERMIOS_H */ 44 45 #if HAVE_TERMIO_H 46 47 /* Add definitions to make termio look like termios. 48 * But ifdef it, since there are some implementations 49 * that try to do this for us in a fake <termio.h>. 50 */ 51 #ifndef TCSADRAIN 52 #define TCSADRAIN TCSETAW 53 #endif 54 #ifndef TCSAFLUSH 55 #define TCSAFLUSH TCSETAF 56 #endif 57 #ifndef tcsetattr 58 #define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg) 59 #endif 60 #ifndef tcgetattr 61 #define tcgetattr(fd, arg) ioctl(fd, TCGETA, arg) 62 #endif 63 #ifndef cfgetospeed 64 #define cfgetospeed(t) ((t)->c_cflag & CBAUD) 65 #endif 66 #ifndef TCIFLUSH 67 #define TCIFLUSH 0 68 #endif 69 #ifndef tcflush 70 #define tcflush(fd, arg) ioctl(fd, TCFLSH, arg) 71 #endif 72 73 #if defined(_WIN32) 74 #undef TERMIOS 75 #endif 76 77 #else /* !HAVE_TERMIO_H */ 78 79 #undef TERMIOS 80 81 #endif /* HAVE_TERMIO_H */ 82 83 #endif /* HAVE_TERMIOS_H */ 84 85 #endif /* NC_TERMIOS_included */ 86