106bfebdeSXin LI /**************************************************************************** 2*aae38d10SBaptiste Daroussin * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. * 306bfebdeSXin LI * * 406bfebdeSXin LI * Permission is hereby granted, free of charge, to any person obtaining a * 506bfebdeSXin LI * copy of this software and associated documentation files (the * 606bfebdeSXin LI * "Software"), to deal in the Software without restriction, including * 706bfebdeSXin LI * without limitation the rights to use, copy, modify, merge, publish, * 806bfebdeSXin LI * distribute, distribute with modifications, sublicense, and/or sell * 906bfebdeSXin LI * copies of the Software, and to permit persons to whom the Software is * 1006bfebdeSXin LI * furnished to do so, subject to the following conditions: * 1106bfebdeSXin LI * * 1206bfebdeSXin LI * The above copyright notice and this permission notice shall be included * 1306bfebdeSXin LI * in all copies or substantial portions of the Software. * 1406bfebdeSXin LI * * 1506bfebdeSXin LI * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 1606bfebdeSXin LI * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 1706bfebdeSXin LI * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 1806bfebdeSXin LI * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 1906bfebdeSXin LI * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 2006bfebdeSXin LI * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 2106bfebdeSXin LI * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 2206bfebdeSXin LI * * 2306bfebdeSXin LI * Except as contained in this notice, the name(s) of the above copyright * 2406bfebdeSXin LI * holders shall not be used in advertising or otherwise to promote the * 2506bfebdeSXin LI * sale, use or other dealings in this Software without prior written * 2606bfebdeSXin LI * authorization. * 2706bfebdeSXin LI ****************************************************************************/ 2806bfebdeSXin LI 2906bfebdeSXin LI /**************************************************************************** 3006bfebdeSXin LI * Author: Juergen Pfeifer, 2008-on * 3106bfebdeSXin LI ****************************************************************************/ 3206bfebdeSXin LI 33*aae38d10SBaptiste Daroussin /* $Id: ncurses_mingw.h,v 1.5 2018/06/24 00:07:35 tom Exp $ */ 3406bfebdeSXin LI 3506bfebdeSXin LI /* 3673f0a83dSXin LI * This is a placeholder up to now and describes what needs to be implemented 3706bfebdeSXin LI * to support I/O to external terminals with ncurses on the Windows OS. 3806bfebdeSXin LI */ 3906bfebdeSXin LI 40*aae38d10SBaptiste Daroussin #ifdef _WIN32 4106bfebdeSXin LI #ifndef _NC_MINGWH 4206bfebdeSXin LI #define _NC_MINGWH 4306bfebdeSXin LI 4406bfebdeSXin LI #define USE_CONSOLE_DRIVER 1 4506bfebdeSXin LI 4606bfebdeSXin LI #undef TERMIOS 4706bfebdeSXin LI #define TERMIOS 1 4806bfebdeSXin LI 4906bfebdeSXin LI typedef unsigned char cc_t; 5006bfebdeSXin LI typedef unsigned int tcflag_t; 51*aae38d10SBaptiste Daroussin typedef unsigned int speed_t; 52*aae38d10SBaptiste Daroussin typedef unsigned short otcflag_t; 53*aae38d10SBaptiste Daroussin typedef unsigned char ospeed_t; 5406bfebdeSXin LI 55*aae38d10SBaptiste Daroussin #define NCCS 18 5606bfebdeSXin LI struct termios 5706bfebdeSXin LI { 58*aae38d10SBaptiste Daroussin tcflag_t c_iflag; 59*aae38d10SBaptiste Daroussin tcflag_t c_oflag; 60*aae38d10SBaptiste Daroussin tcflag_t c_cflag; 61*aae38d10SBaptiste Daroussin tcflag_t c_lflag; 62*aae38d10SBaptiste Daroussin char c_line; 63*aae38d10SBaptiste Daroussin cc_t c_cc[NCCS]; 64*aae38d10SBaptiste Daroussin speed_t c_ispeed; 65*aae38d10SBaptiste Daroussin speed_t c_ospeed; 6606bfebdeSXin LI }; 6706bfebdeSXin LI 68*aae38d10SBaptiste Daroussin extern NCURSES_EXPORT(int) _nc_mingw_tcsetattr( 69*aae38d10SBaptiste Daroussin int fd, 70*aae38d10SBaptiste Daroussin int optional_actions, 71*aae38d10SBaptiste Daroussin const struct termios* arg); 72*aae38d10SBaptiste Daroussin extern NCURSES_EXPORT(int) _nc_mingw_tcgetattr( 73*aae38d10SBaptiste Daroussin int fd, 74*aae38d10SBaptiste Daroussin struct termios* arg); 75*aae38d10SBaptiste Daroussin extern NCURSES_EXPORT(int) _nc_mingw_tcflush( 76*aae38d10SBaptiste Daroussin int fd, 77*aae38d10SBaptiste Daroussin int queue); 78*aae38d10SBaptiste Daroussin extern NCURSES_EXPORT(void) _nc_set_term_driver(void* term); 7906bfebdeSXin LI 8073f0a83dSXin LI #endif /* _NC_MINGWH */ 81*aae38d10SBaptiste Daroussin #endif /* _WIN32 */ 82