From ef2d99350e0d3e4606171b5b1466ab92ec440205 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 9 Mar 2014 00:21:30 +0000 Subject: [PATCH] ncurses 5.9 - patch 20140308 + modify ifdef in read_entry.c to handle the case where NCURSES_USE_DATABASE is not defined (patch by Xin Li). + add cast in form_driver_w() to fix ARM build (patch by Xin Li). + add logic to win_driver.c to save/restore screen contents when not allocating a console-buffer (cf: 20140215). --- NEWS | 9 +++- dist.mk | 4 +- form/frm_driver.c | 6 +-- man/ncurses.3x | 39 ++++++++++---- ncurses/base/define_key.c | 6 +-- ncurses/base/keyok.c | 6 +-- ncurses/base/lib_beep.c | 6 +-- ncurses/base/lib_color.c | 16 +++--- ncurses/base/lib_dft_fgbg.c | 6 +-- ncurses/base/lib_driver.c | 14 ++--- ncurses/base/lib_endwin.c | 8 +-- ncurses/base/lib_flash.c | 6 +-- ncurses/base/lib_getch.c | 8 +-- ncurses/base/lib_mouse.c | 6 +-- ncurses/base/lib_newterm.c | 6 +-- ncurses/base/lib_set_term.c | 6 +-- ncurses/base/lib_slkrefr.c | 8 +-- ncurses/base/resizeterm.c | 6 +-- ncurses/curses.priv.h | 72 +++++++++++++------------ ncurses/tinfo/lib_acs.c | 6 +-- ncurses/tinfo/lib_cur_term.c | 6 +-- ncurses/tinfo/lib_napms.c | 6 +-- ncurses/tinfo/lib_options.c | 6 +-- ncurses/tinfo/lib_setup.c | 10 ++-- ncurses/tinfo/lib_ttyflags.c | 18 +++---- ncurses/tinfo/read_entry.c | 6 ++- ncurses/tinfo/tinfo_driver.c | 18 +++---- ncurses/tty/lib_mvcur.c | 5 +- ncurses/tty/lib_twait.c | 6 +-- ncurses/tty/lib_vidattr.c | 6 +-- ncurses/win32con/win_driver.c | 90 ++++++++++++++++++++++++-------- package/debian-mingw/changelog | 4 +- package/debian-mingw64/changelog | 4 +- package/debian/changelog | 4 +- package/mingw-ncurses.nsi | 4 +- package/mingw-ncurses.spec | 2 +- package/ncurses.spec | 2 +- 37 files changed, 256 insertions(+), 185 deletions(-) diff --git a/NEWS b/NEWS index ba4d91d2..a356be37 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.2174 2014/03/01 23:17:47 tom Exp $ +-- $Id: NEWS,v 1.2177 2014/03/08 22:10:41 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,13 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20140308 + + modify ifdef in read_entry.c to handle the case where + NCURSES_USE_DATABASE is not defined (patch by Xin Li). + + add cast in form_driver_w() to fix ARM build (patch by Xin Li). + + add logic to win_driver.c to save/restore screen contents when not + allocating a console-buffer (cf: 20140215). + 20140301 + clarify error-returns from newwin (report by Ruslan Nabioullin). diff --git a/dist.mk b/dist.mk index 134dce39..7f43575d 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.974 2014/03/01 14:32:51 tom Exp $ +# $Id: dist.mk,v 1.975 2014/03/08 19:20:13 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -37,7 +37,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 5 NCURSES_MINOR = 9 -NCURSES_PATCH = 20140301 +NCURSES_PATCH = 20140308 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/form/frm_driver.c b/form/frm_driver.c index ed561bf1..3b770571 100644 --- a/form/frm_driver.c +++ b/form/frm_driver.c @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_driver.c,v 1.110 2014/02/10 00:42:48 tom Exp $") +MODULE_ID("$Id: frm_driver.c,v 1.111 2014/03/08 22:08:20 Xin.Li Exp $") /*---------------------------------------------------------------------------- This is the core module of the form library. It contains the majority @@ -4493,7 +4493,7 @@ form_driver_w(FORM *form, int type, wchar_t c) const Binding_Info *BI = (Binding_Info *) 0; int res = E_UNKNOWN_COMMAND; - T((T_CALLED("form_driver(%p,%d)"), (void *)form, (int) c)); + T((T_CALLED("form_driver(%p,%d)"), (void *)form, (int)c)); if (!form) RETURN(E_BAD_ARGUMENT); @@ -4503,7 +4503,7 @@ form_driver_w(FORM *form, int type, wchar_t c) assert(form->page); - if (c == FIRST_ACTIVE_MAGIC) + if (c == (wchar_t)FIRST_ACTIVE_MAGIC) { form->current = _nc_First_Active_Field(form); RETURN(E_OK); diff --git a/man/ncurses.3x b/man/ncurses.3x index 6a5aa7c0..0c0c2ef3 100644 --- a/man/ncurses.3x +++ b/man/ncurses.3x @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: ncurses.3x,v 1.112 2013/07/20 19:29:59 tom Exp $ +.\" $Id: ncurses.3x,v 1.115 2014/03/08 22:07:02 tom Exp $ .hy 0 .TH ncurses 3X "" .ie \n(.g .ds `` \(lq @@ -760,14 +760,6 @@ The following environment symbols are useful for customizing the runtime behavior of the \fBncurses\fR library. The most important ones have been already discussed in detail. .TP 5 -BAUDRATE -The debugging library checks this environment variable when the application -has redirected output to a file. -The variable's numeric value is used for the baudrate. -If no value is found, \fBncurses\fR uses 9600. -This allows testers to construct repeatable test-cases -that take into account costs that depend on baudrate. -.TP 5 CC When set, change occurrences of the command_character (i.e., the \fBcmdch\fP capability) @@ -778,6 +770,14 @@ Because this name is also used in development environments to represent the C compiler's name, \fBncurses\fR ignores it if it does not happen to be a single character. .TP 5 +BAUDRATE +The debugging library checks this environment variable when the application +has redirected output to a file. +The variable's numeric value is used for the baudrate. +If no value is found, \fBncurses\fR uses 9600. +This allows testers to construct repeatable test-cases +that take into account costs that depend on baudrate. +.TP 5 COLUMNS Specify the width of the screen in characters. Applications running in a windowing environment usually are able to @@ -868,6 +868,17 @@ about the colors, set this to "\-1,\-1". To make it green-on-black, set it to "2,0". Any positive value from zero to the terminfo \fBmax_colors\fR value is allowed. .TP 5 +NCURSES_CONSOLE2 +This applies only to the MinGW port of ncurses. +.IP +The \fBConsole2\fP program's handling of the Microsoft Console API call +\fBCreateConsoleScreenBuffer\fP is defective. +Applications which use this will hang. +However, it is possible to simulate the action of this call by +mapping coordinates, +explicitly saving and restoring the original screen contents. +Setting the environment variable \fBNCGDB\fP has the same effect. +.TP 5 NCURSES_GPM_TERMS This applies only to ncurses configured to use the GPM interface. .IP @@ -1131,6 +1142,16 @@ the wide-character library's headers should be installed last, to allow applications to be built using either library from the same set of headers. .TP 5 +\-\-with\-pthread +The configure script renames the library. +All of the library names have a "t" appended to them +(before any "w" added by \fB\-\-enable\-widec\fP). +.IP +The global variables such as \fBLINES\fP are replaced by macros to +allow read-only access. +At the same time, setter-functions are provided to set these values. +Some applications (very few) may require changes to work with this convention. +.TP 5 \-\-with\-shared .TP \-\-with\-normal diff --git a/ncurses/base/define_key.c b/ncurses/base/define_key.c index a49b0942..c78375a7 100644 --- a/ncurses/base/define_key.c +++ b/ncurses/base/define_key.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,7 +33,7 @@ #include -MODULE_ID("$Id: define_key.c,v 1.20 2009/11/28 22:53:17 tom Exp $") +MODULE_ID("$Id: define_key.c,v 1.21 2014/03/08 20:32:59 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(define_key) (NCURSES_SP_DCLx const char *str, int keycode) @@ -47,7 +47,7 @@ NCURSES_SP_NAME(define_key) (NCURSES_SP_DCLx const char *str, int keycode) unsigned ukey = (unsigned) keycode; #ifdef USE_TERM_DRIVER -#define CallHasKey(keycode) CallDriver_1(SP_PARM, kyExist, keycode) +#define CallHasKey(keycode) CallDriver_1(SP_PARM, td_kyExist, keycode) #else #define CallHasKey(keycode) NCURSES_SP_NAME(has_key)(NCURSES_SP_ARGx keycode) #endif diff --git a/ncurses/base/keyok.c b/ncurses/base/keyok.c index 00e936da..37fddecf 100644 --- a/ncurses/base/keyok.c +++ b/ncurses/base/keyok.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,7 +33,7 @@ #include -MODULE_ID("$Id: keyok.c,v 1.13 2012/11/18 02:14:35 tom Exp $") +MODULE_ID("$Id: keyok.c,v 1.14 2014/03/08 20:32:59 tom Exp $") /* * Enable (or disable) ncurses' interpretation of a keycode by adding (or @@ -53,7 +53,7 @@ NCURSES_SP_NAME(keyok) (NCURSES_SP_DCLx int c, bool flag) if (HasTerminal(SP_PARM)) { T((T_CALLED("keyok(%p, %d,%d)"), (void *) SP_PARM, c, flag)); #ifdef USE_TERM_DRIVER - code = CallDriver_2(sp, kyOk, c, flag); + code = CallDriver_2(sp, td_kyOk, c, flag); #else T((T_CALLED("keyok(%d,%d)"), c, flag)); if (c >= 0) { diff --git a/ncurses/base/lib_beep.c b/ncurses/base/lib_beep.c index 4e14cb74..b775d56e 100644 --- a/ncurses/base/lib_beep.c +++ b/ncurses/base/lib_beep.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -46,7 +46,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_beep.c,v 1.16 2013/01/12 17:26:25 tom Exp $") +MODULE_ID("$Id: lib_beep.c,v 1.17 2014/03/08 20:32:59 tom Exp $") /* * beep() @@ -65,7 +65,7 @@ NCURSES_SP_NAME(beep) (NCURSES_SP_DCL0) #ifdef USE_TERM_DRIVER if (SP_PARM != 0) - res = CallDriver_1(SP_PARM, doBeepOrFlash, TRUE); + res = CallDriver_1(SP_PARM, td_doBeepOrFlash, TRUE); #else /* FIXME: should make sure that we are not in altchar mode */ if (cur_term == 0) { diff --git a/ncurses/base/lib_color.c b/ncurses/base/lib_color.c index 9f7250dd..1322600c 100644 --- a/ncurses/base/lib_color.c +++ b/ncurses/base/lib_color.c @@ -45,7 +45,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_color.c,v 1.109 2014/02/01 22:22:30 tom Exp $") +MODULE_ID("$Id: lib_color.c,v 1.110 2014/03/08 20:04:44 tom Exp $") #ifdef USE_TERM_DRIVER #define CanChange InfoOf(SP_PARM).canchange @@ -188,7 +188,7 @@ static void set_background_color(NCURSES_SP_DCLx int bg, NCURSES_SP_OUTC outc) { #ifdef USE_TERM_DRIVER - CallDriver_3(SP_PARM, color, FALSE, bg, outc); + CallDriver_3(SP_PARM, td_color, FALSE, bg, outc); #else if (set_a_background) { TPUTS_TRACE("set_a_background"); @@ -208,7 +208,7 @@ static void set_foreground_color(NCURSES_SP_DCLx int fg, NCURSES_SP_OUTC outc) { #ifdef USE_TERM_DRIVER - CallDriver_3(SP_PARM, color, TRUE, fg, outc); + CallDriver_3(SP_PARM, td_color, TRUE, fg, outc); #else if (set_a_foreground) { TPUTS_TRACE("set_a_foreground"); @@ -258,7 +258,7 @@ static bool reset_color_pair(NCURSES_SP_DCL0) { #ifdef USE_TERM_DRIVER - return CallDriver(SP_PARM, rescol); + return CallDriver(SP_PARM, td_rescol); #else bool result = FALSE; @@ -288,7 +288,7 @@ NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_DCL0) result = TRUE; #ifdef USE_TERM_DRIVER - result = CallDriver(SP_PARM, rescolors); + result = CallDriver(SP_PARM, td_rescolors); #else if (orig_colors != 0) { NCURSES_PUTP2("orig_colors", orig_colors); @@ -547,7 +547,7 @@ NCURSES_SP_NAME(init_pair) (NCURSES_SP_DCLx SET_SCREEN_PAIR(SP_PARM, (chtype) (~0)); /* force attribute update */ #ifdef USE_TERM_DRIVER - CallDriver_3(SP_PARM, initpair, pair, f, b); + CallDriver_3(SP_PARM, td_initpair, pair, f, b); #else if (initialize_pair && InPalette(f) && InPalette(b)) { const color_t *tp = DefaultPalette; @@ -625,7 +625,7 @@ NCURSES_SP_NAME(init_color) (NCURSES_SP_DCLx } #ifdef USE_TERM_DRIVER - CallDriver_4(SP_PARM, initcolor, color, r, g, b); + CallDriver_4(SP_PARM, td_initcolor, color, r, g, b); #else NCURSES_PUTP2("initialize_color", TPARM_4(initialize_color, color, r, g, b)); @@ -811,7 +811,7 @@ NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_DCLx NCURSES_SP_OUTC outc) { #ifdef USE_TERM_DRIVER - CallDriver_4(SP_PARM, docolor, old_pair, pair, reverse, outc); + CallDriver_4(SP_PARM, td_docolor, old_pair, pair, reverse, outc); #else NCURSES_COLOR_T fg = COLOR_DEFAULT; NCURSES_COLOR_T bg = COLOR_DEFAULT; diff --git a/ncurses/base/lib_dft_fgbg.c b/ncurses/base/lib_dft_fgbg.c index 00cbafb3..4d7fdd0f 100644 --- a/ncurses/base/lib_dft_fgbg.c +++ b/ncurses/base/lib_dft_fgbg.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,7 +37,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_dft_fgbg.c,v 1.26 2011/04/23 18:28:18 tom Exp $") +MODULE_ID("$Id: lib_dft_fgbg.c,v 1.27 2014/03/08 20:32:59 tom Exp $") /* * Modify the behavior of color-pair 0 so that the library doesn't assume that @@ -70,7 +70,7 @@ NCURSES_SP_NAME(assume_default_colors) (NCURSES_SP_DCLx int fg, int bg) T((T_CALLED("assume_default_colors(%p,%d,%d)"), (void *) SP_PARM, fg, bg)); #ifdef USE_TERM_DRIVER if (sp != 0) - code = CallDriver_2(sp, defaultcolors, fg, bg); + code = CallDriver_2(sp, td_defaultcolors, fg, bg); #else if ((orig_pair || orig_colors) && !initialize_pair) { diff --git a/ncurses/base/lib_driver.c b/ncurses/base/lib_driver.c index 6301a588..4f4b8ce5 100644 --- a/ncurses/base/lib_driver.c +++ b/ncurses/base/lib_driver.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2008-2010,2012 Free Software Foundation, Inc. * + * Copyright (c) 2008-2012,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,7 +33,7 @@ #include -MODULE_ID("$Id: lib_driver.c,v 1.4 2012/09/22 19:32:46 tom Exp $") +MODULE_ID("$Id: lib_driver.c,v 1.5 2014/03/08 20:32:59 tom Exp $") typedef struct DriverEntry { const char *name; @@ -77,7 +77,7 @@ _nc_get_driver(TERMINAL_CONTROL_BLOCK * TCB, const char *name, int *errret) continue; } } - if (res->CanHandle(TCB, name, errret)) { + if (res->td_CanHandle(TCB, name, errret)) { use = res; break; } @@ -93,7 +93,7 @@ NCURSES_EXPORT(int) NCURSES_SP_NAME(has_key) (SCREEN *sp, int keycode) { T((T_CALLED("has_key(%p, %d)"), (void *) sp, keycode)); - returnCode(IsValidTIScreen(sp) ? CallDriver_1(sp, kyExist, keycode) : FALSE); + returnCode(IsValidTIScreen(sp) ? CallDriver_1(sp, td_kyExist, keycode) : FALSE); } NCURSES_EXPORT(int) @@ -108,7 +108,7 @@ NCURSES_SP_NAME(_nc_mcprint) (SCREEN *sp, char *data, int len) int code = ERR; if (0 != TerminalOf(sp)) - code = CallDriver_2(sp, print, data, len); + code = CallDriver_2(sp, td_print, data, len); return (code); } @@ -126,7 +126,7 @@ NCURSES_SP_NAME(doupdate) (SCREEN *sp) T((T_CALLED("doupdate(%p)"), (void *) sp)); if (IsValidScreen(sp)) - code = CallDriver(sp, update); + code = CallDriver(sp, td_update); returnCode(code); } @@ -144,7 +144,7 @@ NCURSES_SP_NAME(mvcur) (SCREEN *sp, int yold, int xold, int ynew, int xnew) TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("mvcur(%p,%d,%d,%d,%d)"), (void *) sp, yold, xold, ynew, xnew)); if (HasTerminal(sp)) { - code = CallDriver_4(sp, hwcur, yold, xold, ynew, xnew); + code = CallDriver_4(sp, td_hwcur, yold, xold, ynew, xnew); } returnCode(code); } diff --git a/ncurses/base/lib_endwin.c b/ncurses/base/lib_endwin.c index 4596d074..9ebf7693 100644 --- a/ncurses/base/lib_endwin.c +++ b/ncurses/base/lib_endwin.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_endwin.c,v 1.22 2009/10/24 22:02:14 tom Exp $") +MODULE_ID("$Id: lib_endwin.c,v 1.23 2014/03/08 20:32:59 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(endwin) (NCURSES_SP_DCL0) @@ -56,8 +56,8 @@ NCURSES_SP_NAME(endwin) (NCURSES_SP_DCL0) TERMINAL_CONTROL_BLOCK *TCB = TCBOf(SP_PARM); SP_PARM->_endwin = TRUE; - if (TCB && TCB->drv && TCB->drv->scexit) - TCB->drv->scexit(SP_PARM); + if (TCB && TCB->drv && TCB->drv->td_scexit) + TCB->drv->td_scexit(SP_PARM); #else SP_PARM->_endwin = TRUE; SP_PARM->_mouse_wrap(SP_PARM); diff --git a/ncurses/base/lib_flash.c b/ncurses/base/lib_flash.c index 3520177e..7f25038c 100644 --- a/ncurses/base/lib_flash.c +++ b/ncurses/base/lib_flash.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2011,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -46,7 +46,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_flash.c,v 1.13 2013/01/12 17:26:07 tom Exp $") +MODULE_ID("$Id: lib_flash.c,v 1.14 2014/03/08 20:32:59 tom Exp $") /* * flash() @@ -64,7 +64,7 @@ NCURSES_SP_NAME(flash) (NCURSES_SP_DCL0) T((T_CALLED("flash(%p)"), (void *) SP_PARM)); #ifdef USE_TERM_DRIVER if (SP_PARM != 0) - res = CallDriver_1(SP_PARM, doBeepOrFlash, FALSE); + res = CallDriver_1(SP_PARM, td_doBeepOrFlash, FALSE); #else if (HasTerminal(SP_PARM)) { /* FIXME: should make sure that we are not in altchar mode */ diff --git a/ncurses/base/lib_getch.c b/ncurses/base/lib_getch.c index 0a04ef5a..aae578ab 100644 --- a/ncurses/base/lib_getch.c +++ b/ncurses/base/lib_getch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_getch.c,v 1.126 2013/02/16 18:30:37 tom Exp $") +MODULE_ID("$Id: lib_getch.c,v 1.127 2014/03/08 20:32:59 tom Exp $") #include @@ -133,7 +133,7 @@ check_mouse_activity(SCREEN *sp, int delay EVENTLIST_2nd(_nc_eventlist * evl)) int rc; #ifdef USE_TERM_DRIVER - rc = TCBOf(sp)->drv->testmouse(TCBOf(sp), delay EVENTLIST_2nd(evl)); + rc = TCBOf(sp)->drv->td_testmouse(TCBOf(sp), delay EVENTLIST_2nd(evl)); #else #if USE_SYSMOUSE if ((sp->_mouse_type == M_SYSMOUSE) @@ -268,7 +268,7 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl)) { /* Can block... */ #ifdef USE_TERM_DRIVER int buf; - n = CallDriver_1(sp, read, &buf); + n = CallDriver_1(sp, td_read, &buf); ch = buf; #else unsigned char c2 = 0; diff --git a/ncurses/base/lib_mouse.c b/ncurses/base/lib_mouse.c index b0e0f613..cb250a85 100644 --- a/ncurses/base/lib_mouse.c +++ b/ncurses/base/lib_mouse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -84,7 +84,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mouse.c,v 1.141 2013/09/21 19:09:19 tom Exp $") +MODULE_ID("$Id: lib_mouse.c,v 1.142 2014/03/08 20:32:59 tom Exp $") #include @@ -668,7 +668,7 @@ initialize_mousetype(SCREEN *sp) #endif /* USE_SYSMOUSE */ #ifdef USE_TERM_DRIVER - CallDriver(sp, initmouse); + CallDriver(sp, td_initmouse); #else /* we know how to recognize mouse events under "xterm" */ if (key_mouse != 0) { diff --git a/ncurses/base/lib_newterm.c b/ncurses/base/lib_newterm.c index 435763d0..cbb7f2b4 100644 --- a/ncurses/base/lib_newterm.c +++ b/ncurses/base/lib_newterm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -48,7 +48,7 @@ #include -MODULE_ID("$Id: lib_newterm.c,v 1.90 2013/09/28 21:02:56 tom Exp $") +MODULE_ID("$Id: lib_newterm.c,v 1.91 2014/03/08 20:32:59 tom Exp $") #ifdef USE_TERM_DRIVER #define NumLabels InfoOf(SP_PARM).numlabels @@ -306,7 +306,7 @@ NCURSES_SP_NAME(newterm) (NCURSES_SP_DCLx /* compute movement costs so we can do better move optimization */ #ifdef USE_TERM_DRIVER - TCBOf(SP_PARM)->drv->scinit(SP_PARM); + TCBOf(SP_PARM)->drv->td_scinit(SP_PARM); #else /* ! USE_TERM_DRIVER */ /* * Check for mismatched graphic-rendition capabilities. Most SVr4 diff --git a/ncurses/base/lib_set_term.c b/ncurses/base/lib_set_term.c index acf6bc1f..c1cf134b 100644 --- a/ncurses/base/lib_set_term.c +++ b/ncurses/base/lib_set_term.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -47,7 +47,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_set_term.c,v 1.148 2013/08/31 13:33:06 tom Exp $") +MODULE_ID("$Id: lib_set_term.c,v 1.149 2014/03/08 20:32:59 tom Exp $") #ifdef USE_TERM_DRIVER #define MaxColors InfoOf(sp).maxcolors @@ -351,7 +351,7 @@ NCURSES_SP_NAME(_nc_setupscreen) ( slines = 1; SET_LINES(slines); #ifdef USE_TERM_DRIVER - CallDriver(sp, setfilter); + CallDriver(sp, td_setfilter); #else clear_screen = 0; cursor_down = parm_down_cursor = 0; diff --git a/ncurses/base/lib_slkrefr.c b/ncurses/base/lib_slkrefr.c index 6d9fcd63..382f9c4b 100644 --- a/ncurses/base/lib_slkrefr.c +++ b/ncurses/base/lib_slkrefr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -43,7 +43,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_slkrefr.c,v 1.29 2013/01/12 17:25:48 tom Exp $") +MODULE_ID("$Id: lib_slkrefr.c,v 1.30 2014/03/08 20:32:59 tom Exp $") #ifdef USE_TERM_DRIVER #define NumLabels InfoOf(SP_PARM).numlabels @@ -97,7 +97,7 @@ slk_intern_refresh(SCREEN *sp) if (slk->ent[i].visible) { if (numlab > 0 && SLK_STDFMT(fmt)) { #ifdef USE_TERM_DRIVER - CallDriver_2(sp, hwlabel, i + 1, slk->ent[i].form_text); + CallDriver_2(sp, td_hwlabel, i + 1, slk->ent[i].form_text); #else if (i < num_labels) { NCURSES_PUTP2("plab_norm", @@ -125,7 +125,7 @@ slk_intern_refresh(SCREEN *sp) if (numlab > 0) { #ifdef USE_TERM_DRIVER - CallDriver_1(sp, hwlabelOnOff, slk->hidden ? FALSE : TRUE); + CallDriver_1(sp, td_hwlabelOnOff, slk->hidden ? FALSE : TRUE); #else if (slk->hidden) { NCURSES_PUTP2("label_off", label_off); diff --git a/ncurses/base/resizeterm.c b/ncurses/base/resizeterm.c index 03d52a44..27e3e7f4 100644 --- a/ncurses/base/resizeterm.c +++ b/ncurses/base/resizeterm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -45,7 +45,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: resizeterm.c,v 1.45 2012/07/07 17:07:23 tom Exp $") +MODULE_ID("$Id: resizeterm.c,v 1.46 2014/03/08 20:32:59 tom Exp $") /* * If we're trying to be reentrant, do not want any local statics. @@ -397,7 +397,7 @@ NCURSES_SP_NAME(resize_term) (NCURSES_SP_DCLx int ToLines, int ToCols) screen_columns(SP_PARM) = (NCURSES_SIZE_T) ToCols; #ifdef USE_TERM_DRIVER - CallDriver_2(SP_PARM, setsize, ToLines, ToCols); + CallDriver_2(SP_PARM, td_setsize, ToLines, ToCols); #else lines = (NCURSES_SIZE_T) ToLines; columns = (NCURSES_SIZE_T) ToCols; diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index 7deffad5..6d3a861b 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -34,7 +34,7 @@ ****************************************************************************/ /* - * $Id: curses.priv.h,v 1.530 2014/02/01 22:09:27 tom Exp $ + * $Id: curses.priv.h,v 1.531 2014/03/08 19:58:54 tom Exp $ * * curses.priv.h * @@ -2118,8 +2118,6 @@ extern NCURSES_EXPORT_VAR(int *) _nc_oldnums; #define USE_SETBUF_0 0 -#define NC_BUFFERED(sp,flag) NCURSES_SP_NAME(_nc_set_buffer)(NCURSES_SP_ARGx sp->_ofp, flag) - #define NC_OUTPUT(sp) ((sp != 0) ? sp->_ofp : stdout) /* @@ -2228,40 +2226,40 @@ typedef struct _termInfo typedef struct term_driver { bool isTerminfo; - bool (*CanHandle)(struct DriverTCB*, const char*, int*); - void (*init)(struct DriverTCB*); - void (*release)(struct DriverTCB*); - int (*size)(struct DriverTCB*, int* Line, int *Cols); - int (*sgmode)(struct DriverTCB*, int setFlag, TTY*); - chtype (*conattr)(struct DriverTCB*); - int (*hwcur)(struct DriverTCB*, int yold, int xold, int y, int x); - int (*mode)(struct DriverTCB*, int progFlag, int defFlag); - bool (*rescol)(struct DriverTCB*); - bool (*rescolors)(struct DriverTCB*); - void (*color)(struct DriverTCB*, int fore, int color, int(*)(SCREEN*, int)); - int (*doBeepOrFlash)(struct DriverTCB*, int); - void (*initpair)(struct DriverTCB*, int, int, int); - void (*initcolor)(struct DriverTCB*, int, int, int, int); - void (*docolor)(struct DriverTCB*, int, int, int, int(*)(SCREEN*, int)); - void (*initmouse)(struct DriverTCB*); - int (*testmouse)(struct DriverTCB*, int EVENTLIST_2nd(_nc_eventlist*)); - void (*setfilter)(struct DriverTCB*); - void (*hwlabel)(struct DriverTCB*, int, char*); - void (*hwlabelOnOff)(struct DriverTCB*, int); - int (*update)(struct DriverTCB*); - int (*defaultcolors)(struct DriverTCB*, int, int); - int (*print)(struct DriverTCB*, char*, int); - int (*getsize)(struct DriverTCB*, int*, int*); - int (*setsize)(struct DriverTCB*, int, int); - void (*initacs)(struct DriverTCB*, chtype*, chtype*); - void (*scinit)(SCREEN *); - void (*scexit)(SCREEN *); - int (*twait)(struct DriverTCB*, int, int, int* EVENTLIST_2nd(_nc_eventlist*)); - int (*read)(struct DriverTCB*, int*); - int (*nap)(struct DriverTCB*, int); - int (*kpad)(struct DriverTCB*, int); - int (*kyOk)(struct DriverTCB*, int, int); - bool (*kyExist)(struct DriverTCB*, int); + bool (*td_CanHandle)(struct DriverTCB*, const char*, int*); + void (*td_init)(struct DriverTCB*); + void (*td_release)(struct DriverTCB*); + int (*td_size)(struct DriverTCB*, int* Line, int *Cols); + int (*td_sgmode)(struct DriverTCB*, int setFlag, TTY*); + chtype (*td_conattr)(struct DriverTCB*); + int (*td_hwcur)(struct DriverTCB*, int yold, int xold, int y, int x); + int (*td_mode)(struct DriverTCB*, int progFlag, int defFlag); + bool (*td_rescol)(struct DriverTCB*); + bool (*td_rescolors)(struct DriverTCB*); + void (*td_color)(struct DriverTCB*, int fore, int color, int(*)(SCREEN*, int)); + int (*td_doBeepOrFlash)(struct DriverTCB*, int); + void (*td_initpair)(struct DriverTCB*, int, int, int); + void (*td_initcolor)(struct DriverTCB*, int, int, int, int); + void (*td_docolor)(struct DriverTCB*, int, int, int, int(*)(SCREEN*, int)); + void (*td_initmouse)(struct DriverTCB*); + int (*td_testmouse)(struct DriverTCB*, int EVENTLIST_2nd(_nc_eventlist*)); + void (*td_setfilter)(struct DriverTCB*); + void (*td_hwlabel)(struct DriverTCB*, int, char*); + void (*td_hwlabelOnOff)(struct DriverTCB*, int); + int (*td_update)(struct DriverTCB*); + int (*td_defaultcolors)(struct DriverTCB*, int, int); + int (*td_print)(struct DriverTCB*, char*, int); + int (*td_getsize)(struct DriverTCB*, int*, int*); + int (*td_setsize)(struct DriverTCB*, int, int); + void (*td_initacs)(struct DriverTCB*, chtype*, chtype*); + void (*td_scinit)(SCREEN *); + void (*td_scexit)(SCREEN *); + int (*td_twait)(struct DriverTCB*, int, int, int* EVENTLIST_2nd(_nc_eventlist*)); + int (*td_read)(struct DriverTCB*, int*); + int (*td_nap)(struct DriverTCB*, int); + int (*td_kpad)(struct DriverTCB*, int); + int (*td_kyOk)(struct DriverTCB*, int, int); + bool (*td_kyExist)(struct DriverTCB*, int); } TERM_DRIVER; typedef struct DriverTCB diff --git a/ncurses/tinfo/lib_acs.c b/ncurses/tinfo/lib_acs.c index 704eda5c..69a1851b 100644 --- a/ncurses/tinfo/lib_acs.c +++ b/ncurses/tinfo/lib_acs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_acs.c,v 1.44 2013/01/12 17:24:42 tom Exp $") +MODULE_ID("$Id: lib_acs.c,v 1.45 2014/03/08 20:32:59 tom Exp $") #if BROKEN_LINKER || USE_REENTRANT #define MyBuffer _nc_prescreen.real_acs_map @@ -166,7 +166,7 @@ NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0) real_map['E'] = '+'; /* large plus or crossover */ #ifdef USE_TERM_DRIVER - CallDriver_2(SP_PARM, initacs, real_map, fake_map); + CallDriver_2(SP_PARM, td_initacs, real_map, fake_map); #else if (ena_acs != NULL) { NCURSES_PUTP2("ena_acs", ena_acs); diff --git a/ncurses/tinfo/lib_cur_term.c b/ncurses/tinfo/lib_cur_term.c index eaaacbcb..9941d139 100644 --- a/ncurses/tinfo/lib_cur_term.c +++ b/ncurses/tinfo/lib_cur_term.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include #include /* ospeed */ -MODULE_ID("$Id: lib_cur_term.c,v 1.32 2013/10/28 00:10:27 tom Exp $") +MODULE_ID("$Id: lib_cur_term.c,v 1.33 2014/03/08 20:32:59 tom Exp $") #undef CUR #define CUR termp->type. @@ -151,7 +151,7 @@ NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL * termp) #endif #ifdef USE_TERM_DRIVER if (TCB->drv) - TCB->drv->release(TCB); + TCB->drv->td_release(TCB); #endif free(termp); diff --git a/ncurses/tinfo/lib_napms.c b/ncurses/tinfo/lib_napms.c index 36f1d25b..df17363d 100644 --- a/ncurses/tinfo/lib_napms.c +++ b/ncurses/tinfo/lib_napms.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -51,7 +51,7 @@ #endif #endif -MODULE_ID("$Id: lib_napms.c,v 1.23 2012/06/30 22:08:24 tom Exp $") +MODULE_ID("$Id: lib_napms.c,v 1.24 2014/03/08 20:32:59 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(napms) (NCURSES_SP_DCLx int ms) @@ -60,7 +60,7 @@ NCURSES_SP_NAME(napms) (NCURSES_SP_DCLx int ms) #ifdef USE_TERM_DRIVER if (HasTerminal(SP_PARM)) { - CallDriver_1(SP_PARM, nap, ms); + CallDriver_1(SP_PARM, td_nap, ms); } #else /* !USE_TERM_DRIVER */ #if NCURSES_SP_FUNCS diff --git a/ncurses/tinfo/lib_options.c b/ncurses/tinfo/lib_options.c index e1cda4eb..8e31d484 100644 --- a/ncurses/tinfo/lib_options.c +++ b/ncurses/tinfo/lib_options.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2011,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -46,7 +46,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_options.c,v 1.76 2013/12/14 22:23:58 tom Exp $") +MODULE_ID("$Id: lib_options.c,v 1.77 2014/03/08 20:32:59 tom Exp $") NCURSES_EXPORT(int) idlok(WINDOW *win, bool flag) @@ -350,7 +350,7 @@ _nc_keypad(SCREEN *sp, int flag) #endif { #ifdef USE_TERM_DRIVER - rc = CallDriver_1(sp, kpad, flag); + rc = CallDriver_1(sp, td_kpad, flag); if (rc == OK) sp->_keypad_on = flag; #else diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index 946342da..27b9db84 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -48,7 +48,7 @@ #include #endif -MODULE_ID("$Id: lib_setup.c,v 1.158 2013/06/22 19:59:08 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.159 2014/03/08 20:32:59 tom Exp $") /**************************************************************************** * @@ -283,7 +283,7 @@ _nc_get_screensize(SCREEN *sp, TCB = (TERMINAL_CONTROL_BLOCK *) termp; my_tabsize = TCB->info.tabsize; - TCB->drv->size(TCB, linep, colp); + TCB->drv->td_size(TCB, linep, colp); #if USE_REENTRANT if (sp != 0) { @@ -423,7 +423,7 @@ _nc_update_screensize(SCREEN *sp) assert(sp != 0); - CallDriver_2(sp, getsize, &old_lines, &old_cols); + CallDriver_2(sp, td_getsize, &old_lines, &old_cols); #else TERMINAL *termp = cur_term; @@ -763,7 +763,7 @@ TINFO_SETUP_TERM(TERMINAL ** tp, #ifdef USE_TERM_DRIVER *tp = termp; NCURSES_SP_NAME(set_curterm) (sp, termp); - TCB->drv->init(TCB); + TCB->drv->td_init(TCB); #else sp = SP; #endif diff --git a/ncurses/tinfo/lib_ttyflags.c b/ncurses/tinfo/lib_ttyflags.c index 700ec481..14eaf943 100644 --- a/ncurses/tinfo/lib_ttyflags.c +++ b/ncurses/tinfo/lib_ttyflags.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -41,7 +41,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_ttyflags.c,v 1.28 2012/01/21 19:21:29 KO.Myung-Hun Exp $") +MODULE_ID("$Id: lib_ttyflags.c,v 1.29 2014/03/08 20:32:59 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_DCLx TTY * buf) @@ -57,7 +57,7 @@ NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_DCLx TTY * buf) result = ERR; } else { #ifdef USE_TERM_DRIVER - result = CallDriver_2(SP_PARM, sgmode, FALSE, buf); + result = CallDriver_2(SP_PARM, td_sgmode, FALSE, buf); #else for (;;) { if (GET_TTY(termp->Filedes, buf) != 0) { @@ -102,7 +102,7 @@ NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_DCLx TTY * buf) result = ERR; } else { #ifdef USE_TERM_DRIVER - result = CallDriver_2(SP_PARM, sgmode, TRUE, buf); + result = CallDriver_2(SP_PARM, td_sgmode, TRUE, buf); #else for (;;) { if ((SET_TTY(termp->Filedes, buf) != 0) @@ -145,7 +145,7 @@ NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_DCL0) if (termp != 0) { #ifdef USE_TERM_DRIVER - rc = CallDriver_2(SP_PARM, mode, FALSE, TRUE); + rc = CallDriver_2(SP_PARM, td_mode, FALSE, TRUE); #else /* * If XTABS was on, remove the tab and backtab capabilities. @@ -183,7 +183,7 @@ NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_DCL0) if (termp != 0) { #ifdef USE_TERM_DRIVER - rc = CallDriver_2(SP_PARM, mode, TRUE, TRUE); + rc = CallDriver_2(SP_PARM, td_mode, TRUE, TRUE); #else /* * Turn off the XTABS bit in the tty structure if it was on. @@ -219,13 +219,12 @@ NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_DCL0) if (termp != 0) { #ifdef USE_TERM_DRIVER - rc = CallDriver_2(SP_PARM, mode, TRUE, FALSE); + rc = CallDriver_2(SP_PARM, td_mode, TRUE, FALSE); #else if (_nc_set_tty_mode(&termp->Nttyb) == OK) { if (SP_PARM) { if (SP_PARM->_keypad_on) _nc_keypad(SP_PARM, TRUE); - NC_BUFFERED(SP_PARM, TRUE); } rc = OK; } @@ -252,12 +251,11 @@ NCURSES_SP_NAME(reset_shell_mode) (NCURSES_SP_DCL0) if (termp != 0) { #ifdef USE_TERM_DRIVER - rc = CallDriver_2(SP_PARM, mode, FALSE, FALSE); + rc = CallDriver_2(SP_PARM, td_mode, FALSE, FALSE); #else if (SP_PARM) { _nc_keypad(SP_PARM, FALSE); _nc_flush(); - NC_BUFFERED(SP_PARM, FALSE); } rc = _nc_set_tty_mode(&termp->Ottyb); #endif diff --git a/ncurses/tinfo/read_entry.c b/ncurses/tinfo/read_entry.c index 435b0b5d..81b8180d 100644 --- a/ncurses/tinfo/read_entry.c +++ b/ncurses/tinfo/read_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -41,7 +41,7 @@ #include -MODULE_ID("$Id: read_entry.c,v 1.126 2013/12/15 00:35:36 tom Exp $") +MODULE_ID("$Id: read_entry.c,v 1.127 2014/03/08 22:07:31 Xin.Li Exp $") #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts)) @@ -114,6 +114,7 @@ fake_read(char *src, int *offset, int limit, char *dst, unsigned want) #define even_boundary(value) \ if ((value) % 2 != 0) Read(buf, 1) +#endif NCURSES_EXPORT(void) _nc_init_termtype(TERMTYPE *const tp) @@ -145,6 +146,7 @@ _nc_init_termtype(TERMTYPE *const tp) tp->Strings[i] = ABSENT_STRING; } +#if NCURSES_USE_DATABASE /* * Return TGETENT_YES if read, TGETENT_NO if not found or garbled. */ diff --git a/ncurses/tinfo/tinfo_driver.c b/ncurses/tinfo/tinfo_driver.c index 11431996..e36541f3 100644 --- a/ncurses/tinfo/tinfo_driver.c +++ b/ncurses/tinfo/tinfo_driver.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2008-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 2008-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -50,7 +50,7 @@ # endif #endif -MODULE_ID("$Id: tinfo_driver.c,v 1.32 2013/08/31 15:22:46 tom Exp $") +MODULE_ID("$Id: tinfo_driver.c,v 1.33 2014/03/08 20:33:38 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -537,7 +537,6 @@ drv_mode(TERMINAL_CONTROL_BLOCK * TCB, int progFlag, int defFlag) if (sp) { if (sp->_keypad_on) _nc_keypad(sp, TRUE); - NC_BUFFERED(sp, TRUE); } code = OK; } @@ -563,7 +562,6 @@ drv_mode(TERMINAL_CONTROL_BLOCK * TCB, int progFlag, int defFlag) if (sp) { _nc_keypad(sp, FALSE); NCURSES_SP_NAME(_nc_flush) (sp); - NC_BUFFERED(sp, FALSE); } code = drv_sgmode(TCB, TRUE, &(_term->Ottyb)); } @@ -665,7 +663,7 @@ drv_init(TERMINAL_CONTROL_BLOCK * TCB) * baudrate. */ if (isatty(trm->Filedes)) { - TCB->drv->mode(TCB, TRUE, TRUE); + TCB->drv->td_mode(TCB, TRUE, TRUE); } } @@ -868,11 +866,11 @@ drv_testmouse(TERMINAL_CONTROL_BLOCK * TCB, } else #endif { - rc = TCBOf(sp)->drv->twait(TCBOf(sp), - TWAIT_MASK, - delay, - (int *) 0 - EVENTLIST_2nd(evl)); + rc = TCBOf(sp)->drv->td_twait(TCBOf(sp), + TWAIT_MASK, + delay, + (int *) 0 + EVENTLIST_2nd(evl)); #if USE_SYSMOUSE if ((sp->_mouse_type == M_SYSMOUSE) && (sp->_sysmouse_head < sp->_sysmouse_tail) diff --git a/ncurses/tty/lib_mvcur.c b/ncurses/tty/lib_mvcur.c index 2ea04c58..2288769a 100644 --- a/ncurses/tty/lib_mvcur.c +++ b/ncurses/tty/lib_mvcur.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -159,7 +159,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mvcur.c,v 1.133 2013/05/25 23:59:41 tom Exp $") +MODULE_ID("$Id: lib_mvcur.c,v 1.134 2014/03/08 20:32:59 tom Exp $") #define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x] /* desired state */ @@ -1187,7 +1187,6 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) baudrate(); _nc_mvcur_init(); - NC_BUFFERED(FALSE); (void) puts("The mvcur tester. Type ? for help"); diff --git a/ncurses/tty/lib_twait.c b/ncurses/tty/lib_twait.c index 2f70550f..59942f77 100644 --- a/ncurses/tty/lib_twait.c +++ b/ncurses/tty/lib_twait.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -75,7 +75,7 @@ #endif #undef CUR -MODULE_ID("$Id: lib_twait.c,v 1.67 2013/02/18 09:22:27 tom Exp $") +MODULE_ID("$Id: lib_twait.c,v 1.68 2014/03/08 20:32:59 tom Exp $") static long _nc_gettime(TimeType * t0, int first) @@ -102,7 +102,7 @@ _nc_gettime(TimeType * t0, int first) if (first) { *t0 = t1; } - res = (t1 - *t0) * 1000; + res = (long) ((t1 - *t0) * 1000); #endif TR(TRACE_IEVENT, ("%s time: %ld msec", first ? "get" : "elapsed", res)); return res; diff --git a/ncurses/tty/lib_vidattr.c b/ncurses/tty/lib_vidattr.c index 0846d848..2d9c97b7 100644 --- a/ncurses/tty/lib_vidattr.c +++ b/ncurses/tty/lib_vidattr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2011,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -69,7 +69,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_vidattr.c,v 1.67 2013/08/31 20:08:59 tom Exp $") +MODULE_ID("$Id: lib_vidattr.c,v 1.68 2014/03/08 20:32:59 tom Exp $") #define doPut(mode) \ TPUTS_TRACE(#mode); \ @@ -368,7 +368,7 @@ NCURSES_SP_NAME(termattrs) (NCURSES_SP_DCL0) if (HasTerminal(SP_PARM)) { #ifdef USE_TERM_DRIVER - attrs = CallDriver(SP_PARM, conattr); + attrs = CallDriver(SP_PARM, td_conattr); #else /* ! USE_TERM_DRIVER */ if (enter_alt_charset_mode) diff --git a/ncurses/win32con/win_driver.c b/ncurses/win32con/win_driver.c index c664d923..bcb24f02 100644 --- a/ncurses/win32con/win_driver.c +++ b/ncurses/win32con/win_driver.c @@ -28,18 +28,18 @@ /**************************************************************************** * Author: Juergen Pfeifer * + * and: Thomas E. Dickey * ****************************************************************************/ /* * TODO - GetMousePos(POINT * result) from ntconio.c * TODO - implement nodelay - * TODO - when $NCGDB is set, implement non-buffered output, like PDCurses */ #include #define CUR my_term.type. -MODULE_ID("$Id: win_driver.c,v 1.24 2014/02/23 01:23:29 tom Exp $") +MODULE_ID("$Id: win_driver.c,v 1.28 2014/03/08 21:44:53 tom Exp $") #define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE) @@ -79,7 +79,8 @@ typedef struct props { DWORD map[MAPSIZE]; DWORD rmap[MAPSIZE]; WORD pairs[NUMPAIRS]; - bool buffered; + bool buffered; /* normally allocate console-buffer */ + bool window_only; /* ..if not, we save buffer or window-only */ COORD origin; CHAR_INFO *save_screen; } Properties; @@ -125,16 +126,22 @@ MapAttr(TERMINAL_CONTROL_BLOCK * TCB, WORD res, attr_t ch) if (p > 0 && p < NUMPAIRS && TCB != 0 && sp != 0) { WORD a; a = PropOf(TCB)->pairs[p]; - res = (res & 0xff00) | a; + res = (WORD) ((res & 0xff00) | a); } } - if (ch & A_REVERSE) - res = ((res & 0xff00) | (((res & 0x07) << 4) | ((res & 0x70) >> 4))); + if (ch & A_REVERSE) { + res = (WORD) ((res & 0xff00) | + (((res & 0x07) << 4) | + ((res & 0x70) >> 4))); + } - if (ch & A_STANDOUT) - res = ((res & 0xff00) | (((res & 0x07) << 4) | ((res & 0x70) >> 4)) - | BACKGROUND_INTENSITY); + if (ch & A_STANDOUT) { + res = (WORD) ((res & 0xff00) | + (((res & 0x07) << 4) | + ((res & 0x70) >> 4)) | + BACKGROUND_INTENSITY); + } if (ch & A_BOLD) res |= FOREGROUND_INTENSITY; @@ -336,6 +343,42 @@ selectActiveHandle(TERMINAL_CONTROL_BLOCK * TCB) } } +static bool +restore_original_screen(TERMINAL_CONTROL_BLOCK * TCB) +{ + COORD bufferCoord; + SMALL_RECT writeRegion; + Properties *p = PropOf(TCB); + bool result = FALSE; + + if (p->window_only) { + writeRegion.Top = p->SBI.srWindow.Top; + writeRegion.Left = p->SBI.srWindow.Left; + writeRegion.Bottom = p->SBI.srWindow.Bottom; + writeRegion.Right = p->SBI.srWindow.Right; + T(("... restoring window")); + } else { + writeRegion.Top = 0; + writeRegion.Left = 0; + writeRegion.Bottom = (SHORT) (p->SBI.dwSize.Y - 1); + writeRegion.Right = (SHORT) (p->SBI.dwSize.X - 1); + T(("... restoring entire buffer")); + } + + bufferCoord.X = bufferCoord.Y = 0; + + if (WriteConsoleOutput(TCB->hdl, + p->save_screen, + p->SBI.dwSize, + bufferCoord, + &writeRegion)) { + result = TRUE; + mvcur(-1, -1, LINES - 2, 0); + } + T(("... restore original screen contents %s", result ? "ok" : "err")); + return result; +} + static int drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB) { @@ -446,9 +489,9 @@ drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB) CurScreen(sp)->_curx = NewScreen(sp)->_curx; CurScreen(sp)->_cury = NewScreen(sp)->_cury; - TCB->drv->hwcur(TCB, - 0, 0, - CurScreen(sp)->_cury, CurScreen(sp)->_curx); + TCB->drv->td_hwcur(TCB, + 0, 0, + CurScreen(sp)->_cury, CurScreen(sp)->_curx); } selectActiveHandle(TCB); result = OK; @@ -738,6 +781,7 @@ drv_mode(TERMINAL_CONTROL_BLOCK * TCB, int progFlag, int defFlag) AssertTCB(); sp = TCB->csp; + T((T_CALLED("win32con::drv_mode(%p, prog=%d, def=%d)"), TCB, progFlag, defFlag)); PropOf(TCB)->progMode = progFlag; PropOf(TCB)->lastOut = progFlag ? TCB->hdl : TCB->out; SetConsoleActiveScreenBuffer(PropOf(TCB)->lastOut); @@ -754,7 +798,6 @@ drv_mode(TERMINAL_CONTROL_BLOCK * TCB, int progFlag, int defFlag) if (sp) { if (sp->_keypad_on) _nc_keypad(sp, TRUE); - NC_BUFFERED(sp, TRUE); } code = OK; } @@ -770,9 +813,12 @@ drv_mode(TERMINAL_CONTROL_BLOCK * TCB, int progFlag, int defFlag) if (sp) { _nc_keypad(sp, FALSE); NCURSES_SP_NAME(_nc_flush) (sp); - NC_BUFFERED(sp, FALSE); } code = drv_sgmode(TCB, TRUE, &(_term->Ottyb)); + if (!PropOf(TCB)->buffered) { + if (!restore_original_screen(TCB)) + code = ERR; + } } } @@ -919,6 +965,7 @@ save_original_screen(TERMINAL_CONTROL_BLOCK * TCB) bufferCoord, &readRegion)) { result = TRUE; + p->window_only = TRUE; } else { T((" error %#lx", (unsigned long) GetLastError())); } @@ -951,7 +998,7 @@ drv_init(TERMINAL_CONTROL_BLOCK * TCB) TCB->inp = GetStdHandle(STD_INPUT_HANDLE); TCB->out = GetStdHandle(STD_OUTPUT_HANDLE); - if (getenv("NCGDB")) { + if (getenv("NCGDB") || getenv("NCURSES_CONSOLE2")) { TCB->hdl = TCB->out; buffered = FALSE; } else { @@ -966,6 +1013,7 @@ drv_init(TERMINAL_CONTROL_BLOCK * TCB) returnVoid; } else if ((TCB->prop = typeCalloc(Properties, 1)) != 0) { PropOf(TCB)->buffered = buffered; + PropOf(TCB)->window_only = FALSE; if (!get_SBI(TCB)) { FreeAndNull(TCB->prop); /* force error in drv_size */ returnVoid; @@ -1005,7 +1053,7 @@ drv_init(TERMINAL_CONTROL_BLOCK * TCB) PropOf(TCB)->rmap[i] = PropOf(TCB)->map[i] = (DWORD) keylist[i]; else PropOf(TCB)->rmap[i] = PropOf(TCB)->map[i] = - GenMap((VK_F1 + (i - N_INI)), (KEY_F(1) + (i - N_INI))); + (DWORD) GenMap((VK_F1 + (i - N_INI)), (KEY_F(1) + (i - N_INI))); } qsort(PropOf(TCB)->map, (size_t) (MAPSIZE), @@ -1090,11 +1138,11 @@ drv_testmouse(TERMINAL_CONTROL_BLOCK * TCB, int delay) if (sp->_drv_mouse_head < sp->_drv_mouse_tail) { rc = TW_MOUSE; } else { - rc = TCBOf(sp)->drv->twait(TCBOf(sp), - TWAIT_MASK, - delay, - (int *) 0 - EVENTLIST_2nd(evl)); + rc = TCBOf(sp)->drv->td_twait(TCBOf(sp), + TWAIT_MASK, + delay, + (int *) 0 + EVENTLIST_2nd(evl)); } return rc; diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index fe1ff2f2..13be3173 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20140301) unstable; urgency=low +ncurses6 (5.9-20140308) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 01 Mar 2014 09:32:51 -0500 + -- Thomas E. Dickey Sat, 08 Mar 2014 14:20:13 -0500 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index fe1ff2f2..13be3173 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20140301) unstable; urgency=low +ncurses6 (5.9-20140308) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 01 Mar 2014 09:32:51 -0500 + -- Thomas E. Dickey Sat, 08 Mar 2014 14:20:13 -0500 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index e0705e82..3f7600ad 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20140301) unstable; urgency=low +ncurses6 (5.9-20140308) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 01 Mar 2014 09:32:51 -0500 + -- Thomas E. Dickey Sat, 08 Mar 2014 14:20:13 -0500 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 51907df3..a5b989f4 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.29 2014/03/01 14:32:51 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.30 2014/03/08 19:20:13 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "5" !define VERSION_MINOR "9" !define VERSION_YYYY "2014" -!define VERSION_MMDD "0301" +!define VERSION_MMDD "0308" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index a1116fd2..85ed94f7 100644 --- a/package/mingw-ncurses.spec +++ b/package/mingw-ncurses.spec @@ -3,7 +3,7 @@ Summary: shared libraries for terminal handling Name: mingw32-ncurses6 Version: 5.9 -Release: 20140301 +Release: 20140308 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index b06a6450..a01506d1 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 5.9 -Release: 20140301 +Release: 20140308 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz -- 2.44.0