X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=include%2Fnc_win32.h;h=f069d5043ef6541af341b6c47b034bcd6cb51b9b;hb=e607aef87171fae9359b0c43a04d8d932719bc71;hp=d7a23038d5a73eb748091cbab93b747c0ff9509f;hpb=1f7a36fe16b11bb4aab51be89bbc1b0f75936b78;p=ncurses.git diff --git a/include/nc_win32.h b/include/nc_win32.h index d7a23038..f069d504 100644 --- a/include/nc_win32.h +++ b/include/nc_win32.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 2018-2023,2024 Thomas E. Dickey * * Copyright 2008-2010,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -31,7 +31,7 @@ * Author: Thomas Dickey, 2008-on * ****************************************************************************/ -/* $Id: nc_win32.h,v 1.3 2020/08/29 20:56:43 tom Exp $ */ +/* $Id: nc_win32.h,v 1.12 2024/05/04 19:17:03 tom Exp $ */ #ifndef NC_WIN32_H #define NC_WIN32_H 1 @@ -73,19 +73,25 @@ #include /* for struct timeval */ #endif +#include /* for uint32_t */ + #ifdef __cplusplus extern "C" { #endif #include +#if !HAVE_CLOCK_GETTIME && !HAVE_GETTIMEOFDAY #undef HAVE_GETTIMEOFDAY -#define HAVE_GETTIMEOFDAY 1 +#define HAVE_GETTIMEOFDAY 2 extern NCURSES_EXPORT(int) _nc_gettimeofday(struct timeval *, void *); - +#endif + #undef wcwidth #define wcwidth(ucs) _nc_wcwidth((wchar_t)(ucs)) -extern NCURSES_EXPORT(int) _nc_wcwidth(wchar_t); +extern NCURSES_EXPORT(int) _nc_wcwidth(uint32_t); + +#ifdef EVENTLIST_2nd /* test.priv.h just needs the preceding */ extern NCURSES_EXPORT(void) _nc_console_size(int* Lines, int* Cols); extern NCURSES_EXPORT(HANDLE) _nc_console_handle(int fd); @@ -102,16 +108,20 @@ extern NCURSES_EXPORT(int) _nc_console_keyok(int keycode,int flag); extern NCURSES_EXPORT(bool) _nc_console_keyExist(int keycode); extern NCURSES_EXPORT(bool) _nc_console_checkinit(bool initFlag, bool assumeTermInfo); extern NCURSES_EXPORT(int) _nc_console_vt_supported(void); + #ifdef _NC_CHECK_MINTTY extern NCURSES_EXPORT(int) _nc_console_checkmintty(int fd, LPHANDLE pMinTTY); #endif -#undef CHECK_TERM_ENV +#undef VALID_TERM_ENV #define MS_TERMINAL "ms-terminal" -#define CHECK_TERM_ENV(env,isNull,NOTERM) (isNull = ((env==0)||(*env==0)), \ - (env = (isNull ? \ - _nc_console_vt_supported() ? MS_TERMINAL: NOTERM : env) , \ - (isNull = ((env==0)||(*env==0))))) +#define VALID_TERM_ENV(term_env, no_terminal) \ + (term_env = (NonEmpty(term_env) \ + ? term_env \ + : (_nc_console_vt_supported() \ + ? MS_TERMINAL \ + : no_terminal)), \ + NonEmpty(term_env)) /* * Various Console mode definitions @@ -129,7 +139,7 @@ extern NCURSES_EXPORT(int) _nc_console_checkmintty(int fd, LPHANDLE pMinTTY); #define CONMODE_NORAW (ENABLE_PROCESSED_INPUT|ENABLE_LINE_INPUT) #define CONMODE_NOCBREAK (ENABLE_LINE_INPUT) - + #if defined(USE_TERM_DRIVER) && defined(USE_WIN32CON_DRIVER) extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_WIN_DRIVER; #endif @@ -161,11 +171,13 @@ typedef struct { TTY originalMode; } ConsoleInfo; -extern NCURSES_EXPORT_VAR(ConsoleInfo) _nc_CONSOLE; +extern NCURSES_EXPORT_VAR(ConsoleInfo) _nc_CONSOLE; #define WINCONSOLE _nc_CONSOLE #define TypeAlloca(type,count)(type*) _alloca(sizeof(type)*(size_t)(count)) +#endif /* EVENTLIST_2nd */ + #ifdef __cplusplus } #endif