-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1617 2010/12/04 20:21:40 tom Exp $
+-- $Id: NEWS,v 1.1621 2010/12/11 23:42:36 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.
+20101211
+ + suppress ncv in screen entry, allowing underline (patch by Alejandro
+ R Sedeno).
+ + also suppress ncv in konsole-base -TD
+ + fixes in wins_nwstr() and related functions to ensure that special
+ characters, i.e., control characters are handled properly with the
+ wide-character configuration.
+ + correct a comparison in wins_nwstr() (Redhat #661506).
+ + correct help-messages in some of the test-programs, which still
+ referred to quitting with 'q'.
+
20101204
+ add special case to _nc_infotocap() to recognize the setaf/setab
strings from xterm+256color and xterm+88color, and provide a reduced
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.784 2010/12/04 16:06:24 tom Exp $
+# $Id: dist.mk,v 1.785 2010/12/11 17:04:22 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 = 7
-NCURSES_PATCH = 20101204
+NCURSES_PATCH = 20101211
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
# Report bugs and new terminal descriptions to
# bug-ncurses@gnu.org
#
-# $Revision: 1.380 $
-# $Date: 2010/12/04 18:38:55 $
+# $Revision: 1.381 $
+# $Date: 2010/12/11 23:39:36 $
#
# The original header is preserved below for reference. It is noted that there
# is a "newer" version which differs in some cosmetic details (but actually
# detail, but it is unclear which copies the other.
konsole-base|KDE console window,
bce, km@, npc, XT,
+ ncv@,
bel@, blink=\E[5m, civis=\E[?25l, cnorm=\E[?25h,
ech=\E[%p1%dX, flash=\E[?5h$<100/>\E[?5l,
hpa=\E[%i%p1%dG, indn=\E[%p1%dS, kbs=\177, kdch1@,
# tested with screen 3.09.08
screen|VT 100/ANSI X3.64 virtual terminal,
OTbs, OTpt, am, km, mir, msgr, xenl, G0,
- colors#8, cols#80, it#8, lines#24, pairs#64,
+ colors#8, cols#80, it#8, lines#24, ncv@, pairs#64,
acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
clear=\E[H\E[J, cnorm=\E[34h\E[?25h, cr=^M,
# 2010-11-27
# * fix typo in rmso for tek4106 -Goran Weinholt
#
+# 2010-12-11
+# * suppress ncv in screen entry, allowing underline -Alejandro R. Sedeno
+# * also suppress ncv in konsole-base -TD
+#
######## SHANTIH! SHANTIH! SHANTIH!
/****************************************************************************
- * Copyright (c) 2002-2005,2009 Free Software Foundation, Inc. *
+ * Copyright (c) 2002-2009,2010 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 *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_ins_wch.c,v 1.11 2009/10/24 22:43:14 tom Exp $")
+MODULE_ID("$Id: lib_ins_wch.c,v 1.15 2010/12/11 19:58:39 tom Exp $")
/*
* Insert the given character, updating the current location to simplify
{
int cells = wcwidth(CharOf(CHDEREF(wch)));
int cell;
+ int code = OK;
+
+ if (cells < 0) {
+ code = winsch(win, CharOf(CHDEREF(wch)));
+ } else {
+ if (cells == 0)
+ cells = 1;
+
+ if (win->_curx <= win->_maxx) {
+ struct ldat *line = &(win->_line[win->_cury]);
+ NCURSES_CH_T *end = &(line->text[win->_curx]);
+ NCURSES_CH_T *temp1 = &(line->text[win->_maxx]);
+ NCURSES_CH_T *temp2 = temp1 - cells;
+
+ CHANGED_TO_EOL(line, win->_curx, win->_maxx);
+ while (temp1 > end)
+ *temp1-- = *temp2--;
+
+ *temp1 = _nc_render(win, *wch);
+ for (cell = 1; cell < cells; ++cell) {
+ SetWidecExt(temp1[cell], cell);
+ }
- if (cells <= 0)
- cells = 1;
-
- if (win->_curx <= win->_maxx) {
- struct ldat *line = &(win->_line[win->_cury]);
- NCURSES_CH_T *end = &(line->text[win->_curx]);
- NCURSES_CH_T *temp1 = &(line->text[win->_maxx]);
- NCURSES_CH_T *temp2 = temp1 - cells;
-
- CHANGED_TO_EOL(line, win->_curx, win->_maxx);
- while (temp1 > end)
- *temp1-- = *temp2--;
-
- *temp1 = _nc_render(win, *wch);
- for (cell = 1; cell < cells; ++cell) {
- SetWidecExt(temp1[cell], cell);
+ win->_curx++;
}
-
- win->_curx++;
}
- return OK;
+ return code;
}
NCURSES_EXPORT(int)
for (cp = wstr; *cp && ((cp - wstr) < n); cp++) {
int len = wcwidth(*cp);
- if (len != 1 || !is8bits(*cp)) {
+ if ((len >= 0 && len != 1) || !is7bits(*cp)) {
cchar_t tmp_cchar;
wchar_t tmp_wchar = *cp;
memset(&tmp_cchar, 0, sizeof(tmp_cchar));
* authorization. *
****************************************************************************/
/*
- * $Id: ins_wide.c,v 1.13 2010/11/13 23:40:32 tom Exp $
+ * $Id: ins_wide.c,v 1.15 2010/12/12 00:20:14 tom Exp $
*
* Demonstrate the wins_wstr() and wins_wch functions.
* Thomas Dickey - 2002/11/23
static void
legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length)
{
- NCURSES_CONST char *showstate;
+ const char *showstate;
switch (state) {
default:
wprintw(win,
"The Strings/Chars displays should match. Enter any characters, except:\n");
wprintw(win,
- "down-arrow or ^N to repeat on next line, 'w' for inner window, 'q' to exit.\n");
+ "down-arrow or ^N to repeat on next line, ^W for inner window, ESC to exit.\n");
wclrtoeol(win);
wprintw(win, "Level %d,%s inserted %d characters <", level,
showstate, length);
* authorization. *
****************************************************************************/
/*
- * $Id: inserts.c,v 1.21 2010/05/01 19:12:26 tom Exp $
+ * $Id: inserts.c,v 1.23 2010/12/12 00:19:55 tom Exp $
*
* Demonstrate the winsstr() and winsch functions.
* Thomas Dickey - 2002/10/19
static void
legend(WINDOW *win, int level, Options state, char *buffer, int length)
{
- NCURSES_CONST char *showstate;
+ const char *showstate;
switch (state) {
default:
wprintw(win,
"The Strings/Chars displays should match. Enter any characters, except:\n");
wprintw(win,
- "down-arrow or ^N to repeat on next line, 'w' for inner window, 'q' to exit.\n");
+ "down-arrow or ^N to repeat on next line, ^W for inner window, ESC to exit.\n");
wclrtoeol(win);
wprintw(win, "Level %d,%s inserted %d characters <%s>", level,
showstate, length, buffer);
* newdemo.c - A demo program using PDCurses. The program illustrate
* the use of colours for text output.
*
- * $Id: newdemo.c,v 1.34 2010/11/13 23:33:42 tom Exp $
+ * $Id: newdemo.c,v 1.35 2010/12/12 00:19:15 tom Exp $
*/
#include <test.priv.h>
*/
#define NMESSAGES 6
-static NCURSES_CONST char *messages[] =
+static const char *messages[] =
{
"Hello from the Land Down Under",
"The Land of crocs. and a big Red Rock",
* authorization. *
****************************************************************************/
/*
- * $Id: test_add_wchstr.c,v 1.9 2010/11/13 21:14:50 tom Exp $
+ * $Id: test_add_wchstr.c,v 1.12 2010/12/12 00:17:13 tom Exp $
*
* Demonstrate the waddwchstr() and wadd_wch functions.
* Thomas Dickey - 2009/9/12
} Options;
static bool m_opt = FALSE;
+static bool pass_ctls = FALSE;
static bool w_opt = FALSE;
static int n_opt = -1;
#define TempBuffer(source_len, source_cast) \
if (source != 0) { \
+ const char *temp; \
size_t need = source_len + 1; \
wchar_t have[2]; \
int n = 0; \
have[1] = 0; \
do { \
have[0] = source_cast; \
- setcchar(&temp_buffer[n++], have, A_NORMAL, 0, NULL); \
+ if (!pass_ctls \
+ && have[0] != 0 \
+ && have[0] < 256 \
+ && (temp = unctrl((chtype) have[0])) != 0 \
+ && strlen(temp) > 1) { \
+ while (*temp != '\0') { \
+ have[0] = *temp++; \
+ setcchar(&temp_buffer[n++], have, A_NORMAL, 0, NULL); \
+ } \
+ } else { \
+ setcchar(&temp_buffer[n++], have, A_NORMAL, 0, NULL); \
+ } \
} while (have[0] != 0); \
} else if (temp_buffer != 0) { \
free(temp_buffer); \
} \
return temp_buffer;
+static size_t
+ChWLen(const wchar_t *source)
+{
+ size_t result = wcslen(source);
+
+ if (!pass_ctls) {
+ size_t adjust = 0;
+ size_t n;
+ char *s;
+
+ for (n = 0; n < result; ++n) {
+ if (source[n] < 256 && (s = unctrl((chtype) source[n])) != 0) {
+ adjust += (strlen(s) - 1);
+ }
+ }
+ result += adjust;
+ }
+ return result;
+}
+
static cchar_t *
ChStr(const char *source)
{
static cchar_t *
ChWStr(const wchar_t *source)
{
- TempBuffer(wcslen(source), *source++);
+ TempBuffer(ChWLen(source), *source++);
}
static void
legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length)
{
- NCURSES_CONST char *showstate;
+ const char *showstate;
switch (state) {
default:
wprintw(win,
"The Strings/Chars displays should match. Enter any characters, except:\n");
wprintw(win,
- "down-arrow or ^N to repeat on next line, 'w' for inner window, 'q' to exit.\n");
+ "down-arrow or ^N to repeat on next line, ^W for inner window, ESC to exit.\n");
wclrtoeol(win);
wprintw(win, "Level %d,%s added %d characters <", level,
showstate, length);
," -f FILE read data from given file"
," -n NUM limit string-adds to NUM bytes on ^N replay"
," -m perform wmove/move separately from add-functions"
+ ," -p pass-thru control characters without using unctrl()"
," -w use window-parameter even when stdscr would be implied"
};
unsigned n;
setlocale(LC_ALL, "");
- while ((ch = getopt(argc, argv, "f:mn:w")) != -1) {
+ while ((ch = getopt(argc, argv, "f:mn:pw")) != -1) {
switch (ch) {
case 'f':
init_linedata(optarg);
if (n_opt == 0)
n_opt = -1;
break;
+ case 'p':
+ pass_ctls = TRUE;
+ break;
case 'w':
w_opt = TRUE;
break;
* authorization. *
****************************************************************************/
/*
- * $Id: test_addchstr.c,v 1.6 2010/05/01 19:13:46 tom Exp $
+ * $Id: test_addchstr.c,v 1.13 2010/12/12 01:28:24 tom Exp $
*
* Demonstrate the waddchstr() and waddch functions.
* Thomas Dickey - 2009/9/12
} Options;
static bool m_opt = FALSE;
+static bool pass_ctls = FALSE;
static bool w_opt = FALSE;
static int n_opt = -1;
+static attr_t show_attr;
static chtype *temp_buffer;
static size_t temp_length;
#define TempBuffer(source_cast)
+static size_t
+ChLen(const char *source)
+{
+ size_t result = strlen(source);
+
+ if (!pass_ctls) {
+ size_t adjust = 0;
+ size_t n;
+
+ for (n = 0; n < result; ++n) {
+ const char *s = unctrl(UChar(source[n]));
+ if (s != 0) {
+ adjust += (strlen(s) - 1);
+ }
+ }
+ result += adjust;
+ }
+ return result;
+}
+
static chtype *
ChStr(const char *source)
{
if (source != 0) {
- size_t need = strlen(source) + 1;
- wchar_t have[2];
+ size_t need = ChLen(source) + 1;
int n = 0;
if (need > temp_length) {
temp_length = need * 2;
temp_buffer = typeRealloc(chtype, temp_length, temp_buffer);
}
- have[0] = 0;
- have[1] = 0;
do {
- temp_buffer[n++] = UChar(*source++);
- } while (have[0] != 0);
+ const char *s;
+ chtype ch = UChar(*source++);
+ if (!pass_ctls && (s = unctrl(ch)) != 0) {
+ while (*s != '\0') {
+ temp_buffer[n++] = UChar(*s++);
+ }
+ } else {
+ temp_buffer[n++] = ch;
+ }
+ } while (source[0] != 0);
+ temp_buffer[n] = 0;
} else if (temp_buffer != 0) {
free(temp_buffer);
temp_buffer = 0;
return temp_buffer;
}
+/* color the strings drawn in the workspace */
+static chtype *
+ChStr2(const char *source)
+{
+ size_t len = ChLen(source);
+ size_t n;
+ chtype *result = ChStr(source);
+ for (n = 0; n < len; ++n) {
+ result[n] |= show_attr;
+ }
+ return result;
+}
+
static void
legend(WINDOW *win, int level, Options state, char *buffer, int length)
{
- NCURSES_CONST char *showstate;
+ const char *showstate;
switch (state) {
default:
wprintw(win,
"The Strings/Chars displays should match. Enter any characters, except:\n");
wprintw(win,
- "down-arrow or ^N to repeat on next line, 'w' for inner window, 'q' to exit.\n");
+ "down-arrow or ^N to repeat on next line, ^W for inner window, ESC to exit.\n");
wclrtoeol(win);
wprintw(win, "Level %d,%s added %d characters <%s>", level,
showstate, length, buffer);
if (has_colors()) {
start_color();
init_pair(1, COLOR_WHITE, COLOR_BLUE);
- wbkgdset(work, COLOR_PAIR(1) | ' ');
+ show_attr = COLOR_PAIR(1);
+ wbkgdset(work, show_attr | ' ');
+ } else {
+ show_attr = A_STANDOUT;
}
while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) {
for (col = 0; col < length; col += n_opt) {
col2 = ColOf(buffer, col, margin);
if (move(row, col2) != ERR) {
- AddNStr(ChStr(buffer + col), LEN(col));
+ AddNStr(ChStr2(buffer + col), LEN(col));
}
}
} else {
if (move(row, col2) != ERR) {
- AddStr(ChStr(buffer));
+ AddStr(ChStr2(buffer));
}
}
break;
if (n_opt > 1) {
for (col = 0; col < length; col += n_opt) {
col2 = ColOf(buffer, col, margin);
- MvAddNStr(row, col2, ChStr(buffer + col), LEN(col));
+ MvAddNStr(row, col2, ChStr2(buffer + col), LEN(col));
}
} else {
- MvAddStr(row, col2, ChStr(buffer));
+ MvAddStr(row, col2, ChStr2(buffer));
}
break;
case oWindow:
for (col = 0; col < length; col += n_opt) {
col2 = ColOf(buffer, col, margin);
if (wmove(work, row, col2) != ERR) {
- WAddNStr(work, ChStr(buffer + col), LEN(col));
+ WAddNStr(work, ChStr2(buffer + col), LEN(col));
}
}
} else {
if (wmove(work, row, col2) != ERR) {
- WAddStr(work, ChStr(buffer));
+ WAddStr(work, ChStr2(buffer));
}
}
break;
if (n_opt > 1) {
for (col = 0; col < length; col += n_opt) {
col2 = ColOf(buffer, col, margin);
- MvWAddNStr(work, row, col2, ChStr(buffer + col),
+ MvWAddNStr(work, row, col2, ChStr2(buffer + col),
LEN(col));
}
} else {
- MvWAddStr(work, row, col2, ChStr(buffer));
+ MvWAddStr(work, row, col2, ChStr2(buffer));
}
break;
}
switch (option) {
case oDefault:
if (move(row, col) != ERR) {
- AddStr(ChStr(buffer + length - 1));
+ AddStr(ChStr2(buffer + length - 1));
}
break;
case oMove:
- MvAddStr(row, col, ChStr(buffer + length - 1));
+ MvAddStr(row, col, ChStr2(buffer + length - 1));
break;
case oWindow:
if (wmove(work, row, col) != ERR) {
- WAddStr(work, ChStr(buffer + length - 1));
+ WAddStr(work, ChStr2(buffer + length - 1));
}
break;
case oMoveWindow:
- MvWAddStr(work, row, col, ChStr(buffer + length - 1));
+ MvWAddStr(work, row, col, ChStr2(buffer + length - 1));
break;
}
," -f FILE read data from given file"
," -n NUM limit string-adds to NUM bytes on ^N replay"
," -m perform wmove/move separately from add-functions"
+ ," -p pass-thru control characters without using unctrl()"
," -w use window-parameter even when stdscr would be implied"
};
unsigned n;
setlocale(LC_ALL, "");
- while ((ch = getopt(argc, argv, "f:mn:w")) != -1) {
+ while ((ch = getopt(argc, argv, "f:mn:pw")) != -1) {
switch (ch) {
case 'f':
init_linedata(optarg);
if (n_opt == 0)
n_opt = -1;
break;
+ case 'p':
+ pass_ctls = TRUE;
+ break;
case 'w':
w_opt = TRUE;
break;
* authorization. *
****************************************************************************/
/*
- * $Id: test_addstr.c,v 1.4 2010/05/01 19:13:46 tom Exp $
+ * $Id: test_addstr.c,v 1.6 2010/12/12 00:17:37 tom Exp $
*
* Demonstrate the waddstr() and waddch functions.
* Thomas Dickey - 2009/9/12
static void
legend(WINDOW *win, int level, Options state, char *buffer, int length)
{
- NCURSES_CONST char *showstate;
+ const char *showstate;
switch (state) {
default:
wprintw(win,
"The Strings/Chars displays should match. Enter any characters, except:\n");
wprintw(win,
- "down-arrow or ^N to repeat on next line, 'w' for inner window, 'q' to exit.\n");
+ "down-arrow or ^N to repeat on next line, ^W for inner window, ESC to exit.\n");
wclrtoeol(win);
wprintw(win, "Level %d,%s added %d characters <%s>", level,
showstate, length, buffer);
* authorization. *
****************************************************************************/
/*
- * $Id: test_addwstr.c,v 1.4 2010/11/13 21:13:53 tom Exp $
+ * $Id: test_addwstr.c,v 1.6 2010/12/12 00:18:00 tom Exp $
*
* Demonstrate the waddwstr() and wadd_wch functions.
* Thomas Dickey - 2009/9/12
static void
legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length)
{
- NCURSES_CONST char *showstate;
+ const char *showstate;
switch (state) {
default:
wprintw(win,
"The Strings/Chars displays should match. Enter any characters, except:\n");
wprintw(win,
- "down-arrow or ^N to repeat on next line, 'w' for inner window, 'q' to exit.\n");
+ "down-arrow or ^N to repeat on next line, ^W for inner window, ESC to exit.\n");
wclrtoeol(win);
wprintw(win, "Level %d,%s inserted %d characters <", level,
showstate, length);