-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1950 2012/09/02 16:59:41 tom Exp $
+-- $Id: NEWS,v 1.1952 2012/09/03 17:59:39 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20120903
+ + simplify varargs logic in lib_printw.c; va_copy is no longer needed
+ there.
+ + modifications for mingw port to make wide-character display usable.
+
20120902
+ regenerate configure script (report by Sven Joachim, cf: 20120901).
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.890 2012/09/02 16:58:18 tom Exp $
+# $Id: dist.mk,v 1.891 2012/09/03 12:47:40 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 9
-NCURSES_PATCH = 20120902
+NCURSES_PATCH = 20120903
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
****************************************************************************/
/****************************************************************************
- * Author: Thomas E. Dickey <dickey@clark.net> 1997 *
+ * Author: Thomas E. Dickey 1997-on *
****************************************************************************/
/*
#include <curses.priv.h>
-MODULE_ID("$Id: lib_printw.c,v 1.22 2012/03/10 20:47:33 tom Exp $")
+MODULE_ID("$Id: lib_printw.c,v 1.23 2012/09/03 17:55:28 tom Exp $")
NCURSES_EXPORT(int)
printw(const char *fmt,...)
#ifdef TRACE
va_list argq;
- begin_va_copy(argq, argp);
va_start(argq, fmt);
T((T_CALLED("printw(%s%s)"),
_nc_visbuf(fmt), _nc_varargs(fmt, argq)));
- end_va_copy(argq);
+ va_end(argq);
#endif
va_start(argp, fmt);
#ifdef TRACE
va_list argq;
- begin_va_copy(argq, argp);
va_start(argq, fmt);
T((T_CALLED("wprintw(%p,%s%s)"),
(void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
- end_va_copy(argq);
+ va_end(argq);
#endif
va_start(argp, fmt);
#ifdef TRACE
va_list argq;
- begin_va_copy(argq, argp);
va_start(argq, fmt);
T((T_CALLED("mvprintw(%d,%d,%s%s)"),
y, x, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
- end_va_copy(argq);
+ va_end(argq);
#endif
if ((code = move(y, x)) != ERR) {
#ifdef TRACE
va_list argq;
- begin_va_copy(argq, argp);
va_start(argq, fmt);
T((T_CALLED("mvwprintw(%d,%d,%p,%s%s)"),
y, x, (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
- end_va_copy(argq);
+ va_end(argq);
#endif
if ((code = wmove(win, y, x)) != ERR) {
#include <locale.h>
#endif
-MODULE_ID("$Id: lib_setup.c,v 1.148 2012/07/21 18:05:41 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.149 2012/09/03 16:19:14 tom Exp $")
/****************************************************************************
*
_nc_unicode_locale(void)
{
int result = 0;
-#if HAVE_LANGINFO_CODESET
+#if defined(__MINGW32__) && USE_WIDEC_SUPPORT
+ result = 1;
+#elif HAVE_LANGINFO_CODESET
char *env = nl_langinfo(CODESET);
result = !strcmp(env, "UTF-8");
T(("_nc_unicode_locale(%s) ->%d", env, result));
#include <curses.priv.h>
#define CUR my_term.type.
-MODULE_ID("$Id: win_driver.c,v 1.11 2012/02/18 20:28:25 tom Exp $")
+MODULE_ID("$Id: win_driver.c,v 1.13 2012/09/03 16:20:24 tom Exp $")
#define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE)
}
static WORD
-MapAttr(TERMINAL_CONTROL_BLOCK * TCB, WORD res, chtype ch)
+MapAttr(TERMINAL_CONTROL_BLOCK * TCB, WORD res, attr_t ch)
{
if (ch & A_COLOR) {
int p;
return res;
}
+#if USE_WIDEC_SUPPORT
+/*
+ * TODO: support surrogate pairs
+ * TODO: support combining characters
+ * TODO: support acsc
+ * TODO: check wcwidth of base character, fill if needed for double-width
+ * TODO: _nc_wacs should be part of sp.
+ */
static BOOL
-con_write(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, chtype *str, int n)
+con_write16(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, cchar_t *str, int n)
+{
+ CHAR_INFO ci[n];
+ COORD loc, siz;
+ SMALL_RECT rec;
+ int i;
+ cchar_t ch;
+ SCREEN *sp;
+
+ AssertTCB();
+
+ if (TCB == 0 || InvalidConsoleHandle(TCB->hdl))
+ return FALSE;
+
+ SetSP();
+
+ for (i = 0; i < n; i++) {
+ ch = str[i];
+ ci[i].Char.UnicodeChar = CharOf(ch);
+ ci[i].Attributes = MapAttr(TCB,
+ PropOf(TCB)->SBI.wAttributes,
+ AttrOf(ch));
+ if (AttrOf(ch) & A_ALTCHARSET) {
+ if (_nc_wacs) {
+ int which = CharOf(ch);
+ if (which > 0
+ && which < ACS_LEN
+ && CharOf(_nc_wacs[which]) != 0) {
+ ci[i].Char.UnicodeChar = CharOf(_nc_wacs[which]);
+ } else {
+ ci[i].Char.UnicodeChar = ' ';
+ }
+ }
+ }
+ }
+
+ loc.X = (short) 0;
+ loc.Y = (short) 0;
+ siz.X = (short) n;
+ siz.Y = 1;
+
+ rec.Left = (short) x;
+ rec.Top = (short) y;
+ rec.Right = (short) (x + n - 1);
+ rec.Bottom = rec.Top;
+
+ return WriteConsoleOutputW(TCB->hdl, ci, siz, loc, &rec);
+}
+#define con_write(tcb, y, x, str, n) con_write16(tcb, y, x, str, n)
+#else
+static BOOL
+con_write8(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, chtype *str, int n)
{
CHAR_INFO ci[n];
COORD loc, siz;
return WriteConsoleOutput(TCB->hdl, ci, siz, loc, &rec);
}
+#define con_write(tcb, y, x, str, n) con_write8(tcb, y, x, str, n)
+#endif
#define MARK_NOCHANGE(win,row) \
win->_line[row].firstchar = _NOCHANGE; \
if ((CurScreen(sp)->_clear || NewScreen(sp)->_clear)) {
int x;
+#if USE_WIDEC_SUPPORT
+ cchar_t empty[Width];
+ wchar_t blank[2] =
+ {
+ L' ', L'\0'
+ };
+
+ for (x = 0; x < Width; x++)
+ setcchar(&empty[x], blank, 0, 0, 0);
+#else
chtype empty[Width];
for (x = 0; x < Width; x++)
empty[x] = ' ';
+#endif
for (y = 0; y < nonempty; y++) {
con_write(TCB, y, 0, empty, Width);
memcpy(empty,
CurScreen(sp)->_line[y].text,
- Width * sizeof(chtype));
+ Width * sizeof(empty[0]));
}
CurScreen(sp)->_clear = FALSE;
NewScreen(sp)->_clear = FALSE;
x1 = NewScreen(sp)->_line[y].lastchar;
n = x1 - x0 + 1;
if (n > 0) {
- memcpy(CurScreen(sp)->_line[y].text + x0,
- NewScreen(sp)->_line[y].text + x0,
- n * sizeof(chtype));
+ memcpy(&CurScreen(sp)->_line[y].text[x0],
+ &NewScreen(sp)->_line[y].text[x0],
+ n * sizeof(CurScreen(sp)->_line[y].text[x0]));
con_write(TCB,
y,
x0,
- ((chtype *) CurScreen(sp)->_line[y].text) + x0, n);
+ &CurScreen(sp)->_line[y].text[x0], n);
/* mark line changed successfully */
if (y <= NewScreen(sp)->_maxy) {
-ncurses6 (5.9-20120902) unstable; urgency=low
+ncurses6 (5.9-20120903) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 02 Sep 2012 12:58:41 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 03 Sep 2012 08:47:49 -0400
ncurses6 (5.9-20120608) unstable; urgency=low
Summary: shared libraries for terminal handling
Name: ncurses6
Release: 5.9
-Version: 20120902
+Version: 20120903
License: X11
Group: Development/Libraries
Source: ncurses-%{release}-%{version}.tgz