158713Sjhb/****************************************************************************
258713Sjhb * Copyright 2018-2020,2021 Thomas E. Dickey                                *
3125537Sru * Copyright 2008-2014,2017 Free Software Foundation, Inc.                  *
4125537Sru *                                                                          *
558713Sjhb * Permission is hereby granted, free of charge, to any person obtaining a  *
6128649Sobrien * copy of this software and associated documentation files (the            *
7125621Sru * "Software"), to deal in the Software without restriction, including      *
8125537Sru * without limitation the rights to use, copy, modify, merge, publish,      *
9125537Sru * distribute, distribute with modifications, sublicense, and/or sell       *
10125693Sru * copies of the Software, and to permit persons to whom the Software is    *
11125537Sru * furnished to do so, subject to the following conditions:                 *
1258713Sjhb *                                                                          *
13125537Sru * The above copyright notice and this permission notice shall be included  *
14125537Sru * in all copies or substantial portions of the Software.                   *
15125537Sru *                                                                          *
16125537Sru * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
1758713Sjhb * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
1869391Sps * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19125693Sru * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
2069391Sps * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
2158713Sjhb * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22119714Sphk * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23125693Sru *                                                                          *
24119714Sphk * Except as contained in this notice, the name(s) of the above copyright   *
25119714Sphk * holders shall not be used in advertising or otherwise to promote the     *
26235219Savg * sale, use or other dealings in this Software without prior written       *
27235219Savg * authorization.                                                           *
28125537Sru ****************************************************************************/
2958713Sjhb
30125537Sru/****************************************************************************
31102591Speter * Author: Juergen Pfeifer, 2008-on                                         *
3258713Sjhb ****************************************************************************/
3358713Sjhb
3458713Sjhb/* $Id: win32_curses.h,v 1.3 2021/06/17 21:26:02 tom Exp $ */
3558713Sjhb
3658713Sjhb/*
37209162Srdivacky * This is the interface we use on Windows to mimic the control of the settings
3858713Sjhb * of what acts like the classic TTY - the Windows Console.
39125537Sru */
4058713Sjhb
41125537Sru#if (defined(_WIN32) || defined(_WIN64))
42125537Sru#ifndef _NC_WIN32_CURSES_H
43125537Sru#define _NC_WIN32_CURSES_H 1
44125537Sru
4558713Sjhbstruct winconmode
46232263Sdim{
47232263Sdim  unsigned long dwFlagIn;
48232263Sdim  unsigned long dwFlagOut;
49232263Sdim};
50
51extern NCURSES_EXPORT(void*) _nc_console_fd2handle(int fd);
52extern NCURSES_EXPORT(int)   _nc_console_setmode(void* handle, const struct winconmode* arg);
53extern NCURSES_EXPORT(int)   _nc_console_getmode(void* handle, struct winconmode* arg);
54extern NCURSES_EXPORT(int)   _nc_console_flush(void* handle);
55
56/*
57  A few definitions of Unix functions we need to emulate
58*/
59#define SIGHUP  1
60#define SIGKILL 9
61
62#undef  getlogin
63#define getlogin() getenv("USERNAME")
64
65#undef  ttyname
66#define ttyname(fd) NULL
67
68#undef sleep
69#define sleep(n) Sleep((n) * 1000)
70
71#undef gettimeofday
72#define gettimeofday(tv,tz) _nc_gettimeofday(tv,tz)
73
74#endif /* _NC_WIN32_CURSES_H */
75#endif /* _WIN32||_WIN64 */
76