****************************************************************************/
/*
- * $Id: curses.priv.h,v 1.535 2014/04/26 18:45:36 juergen Exp $
+ * $Id: curses.priv.h,v 1.539 2014/09/04 22:52:07 tom Exp $
*
* curses.priv.h
*
#undef _XOPEN_SOURCE_EXTENDED
#undef _XPG5
#define _nc_bkgd _bkgd
-#define wgetbkgrnd(win, wch) *wch = win->_bkgd
+#define wgetbkgrnd(win, wch) ((*wch = win->_bkgd) != 0 ? OK : ERR)
#define wbkgrnd wbkgd
#endif
AttrOf(dst) |= (attr_t) (ext + 1)
#define if_WIDEC(code) code
-#define Charable(ch) ((SP_PARM->_legacy_coding) \
+#define Charable(ch) (((SP_PARM->_legacy_coding) \
|| (AttrOf(ch) & A_ALTCHARSET) \
- || (!isWidecExt(ch) && \
+ || (!isWidecExt(ch))) && \
(ch).chars[1] == L'\0' && \
- _nc_is_charable(CharOf(ch))))
+ _nc_is_charable(CharOf(ch)))
#define L(ch) L ## ch
#else /* }{ */
sp->jump = outc
#ifdef USE_TERM_DRIVER
-typedef void* TERM_HANDLE;
typedef struct _termInfo
{
typedef struct DriverTCB
{
TERMINAL term; /* needs to be the first Element !!! */
- TERM_HANDLE inp; /* The input handle of the Terminal */
- TERM_HANDLE out; /* The output handle of the Terminal in shell mode */
- TERM_HANDLE hdl; /* The output handle of the Terminal in prog mode */
TERM_DRIVER* drv; /* The driver for that Terminal */
SCREEN* csp; /* The screen that owns that Terminal */
TerminalInfo info; /* Driver independent core capabilities of the Terminal */
extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_WIN_DRIVER;
extern NCURSES_EXPORT(int) _nc_mingw_isatty(int fd);
extern NCURSES_EXPORT(int) _nc_mingw_isconsole(int fd);
+extern NCURSES_EXPORT(int) _nc_mingw_console_read(
+ SCREEN *sp,
+ HANDLE fd,
+ int *buf);
+extern NCURSES_EXPORT(int) _nc_mingw_testmouse(
+ SCREEN * sp,
+ HANDLE fd,
+ int delay);
+#else
#endif
extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_TINFO_DRIVER;
#endif
+#if defined(USE_TERM_DRIVER) && defined(__MINGW32__)
+#define NC_ISATTY(fd) _nc_mingw_isatty(fd)
+#else
+#define NC_ISATTY(fd) isatty(fd)
+#endif
+
#ifdef USE_TERM_DRIVER
-#define IsTermInfo(sp) ((TCBOf(sp) != 0) && ((TCBOf(sp)->drv->isTerminfo)))
-#define HasTInfoTerminal(sp) ((0 != TerminalOf(sp)) && IsTermInfo(sp))
+# define IsTermInfo(sp) ((TCBOf(sp) != 0) && ((TCBOf(sp)->drv->isTerminfo)))
+# define HasTInfoTerminal(sp) ((0 != TerminalOf(sp)) && IsTermInfo(sp))
+# ifdef __MINGW32__
+# define IsTermInfoOnConsole(sp) (IsTermInfo(sp)&&_nc_mingw_isconsole(TerminalOf(sp)->Filedes))
#else
-#define IsTermInfo(sp) TRUE
-#define HasTInfoTerminal(sp) (0 != TerminalOf(sp))
+# define IsTermInfoOnConsole(sp) FALSE
+# endif
+#else
+# define IsTermInfo(sp) TRUE
+# define HasTInfoTerminal(sp) (0 != TerminalOf(sp))
+# define IsTermInfoOnConsole(sp) FALSE
#endif
#define IsValidTIScreen(sp) (HasTInfoTerminal(sp))
#endif
-#ifndef __MINGW32__
-# define NC_ISATTY(fd) isatty(fd)
-#else
-# define NC_ISATTY(fd) _nc_mingw_isatty(fd)
-#endif
-
#ifdef __cplusplus
}
#endif