aboutsummaryrefslogtreecommitdiff
path: root/ncurses/tty/tty_update.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2014-03-01 00:40:26 +0000
committerXin LI <delphij@FreeBSD.org>2014-03-01 00:40:26 +0000
commitcea297eb34d2361e79529034397465068ae34ecd (patch)
treefbc3775582ebd1e6f026931751cfab6c588b643c /ncurses/tty/tty_update.c
parent6826a395a618014c4541ff6a654be0d3afb392a1 (diff)
downloadsrc-cea297eb34d2361e79529034397465068ae34ecd.tar.gz
src-cea297eb34d2361e79529034397465068ae34ecd.zip
Vendor import of ncurses 5.9 20140222 snapshot.vendor/ncurses/5.9-20140222
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=262639 svn path=/vendor/ncurses/5.9-20140222/; revision=262640; tag=vendor/ncurses/5.9-20140222
Diffstat (limited to 'ncurses/tty/tty_update.c')
-rw-r--r--ncurses/tty/tty_update.c268
1 files changed, 118 insertions, 150 deletions
diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c
index f0d2369c18d6..8a110ee92125 100644
--- a/ncurses/tty/tty_update.c
+++ b/ncurses/tty/tty_update.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2009,2010 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 *
@@ -82,7 +82,7 @@
#include <ctype.h>
-MODULE_ID("$Id: tty_update.c,v 1.264 2010/12/19 01:21:02 tom Exp $")
+MODULE_ID("$Id: tty_update.c,v 1.277 2014/02/01 22:09:27 tom Exp $")
/*
* This define controls the line-breakout optimization. Every once in a
@@ -145,8 +145,7 @@ position_check(NCURSES_SP_DCLx int expected_y, int expected_x, char *legend)
NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG);
memset(buf, '\0', sizeof(buf));
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx "\033[6n"); /* only works on ANSI-compatibles */
- NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG);
+ NCURSES_PUTP2_FLUSH("cpr", "\033[6n"); /* only works on ANSI-compatibles */
*(s = buf) = 0;
do {
int ask = sizeof(buf) - 1 - (s - buf);
@@ -209,7 +208,9 @@ PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch)
{
int chlen = 1;
NCURSES_CH_T my_ch;
+#if USE_WIDEC_SUPPORT
PUTC_DATA;
+#endif
NCURSES_CH_T tilde;
NCURSES_CH_T attr = CHDEREF(ch);
@@ -276,6 +277,11 @@ PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch)
&& SP_PARM->_screen_acs_map[CharOf(my_ch)]) {
RemAttr(attr, A_ALTCHARSET);
my_ch = _nc_wacs[CharOf(my_ch)];
+ } else if (SP_PARM->_screen_unicode
+ && !SP_PARM->_screen_acs_map[CharOf(my_ch)]
+ && _nc_wacs[CharOf(my_ch)].chars[0]) {
+ RemAttr(attr, A_ALTCHARSET);
+ my_ch = _nc_wacs[CharOf(my_ch)];
}
#endif
/*
@@ -288,13 +294,12 @@ PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch)
int j = CharOfD(ch);
chtype temp = UChar(SP_PARM->_acs_map[j]);
- if (!(SP_PARM->_screen_acs_map[j])) {
+ if (temp != 0) {
+ SetChar(my_ch, temp, AttrOf(attr));
+ } else {
+ my_ch = CHDEREF(ch);
RemAttr(attr, A_ALTCHARSET);
- if (temp == 0)
- temp = ' ';
}
- if (temp != 0)
- SetChar(my_ch, temp, AttrOf(attr));
}
ch = CHREF(my_ch);
}
@@ -304,22 +309,13 @@ PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch)
}
UpdateAttrs(SP_PARM, attr);
+ PUTC(CHDEREF(ch));
#if !USE_WIDEC_SUPPORT
- /* FIXME - we do this special case for signal handling, should see how to
- * make it work for wide characters.
- */
- if (SP_PARM->_outch != 0) {
- SP_PARM->_outch(NCURSES_SP_ARGx UChar(ch));
- } else
+ COUNT_OUTCHARS(1);
#endif
- {
- PUTC(CHDEREF(ch), SP_PARM->_ofp); /* macro's fastest... */
- COUNT_OUTCHARS(1);
- }
SP_PARM->_curscol += chlen;
if (char_padding) {
- TPUTS_TRACE("char_padding");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx char_padding);
+ NCURSES_PUTP2("char_padding", char_padding);
}
}
@@ -342,7 +338,7 @@ check_pending(NCURSES_SP_DCL0)
struct pollfd fds[1];
fds[0].fd = SP_PARM->_checkfd;
fds[0].events = POLLIN;
- if (poll(fds, 1, 0) > 0) {
+ if (poll(fds, (size_t) 1, 0) > 0) {
have_pending = TRUE;
}
#elif defined(__BEOS__)
@@ -390,8 +386,7 @@ PutCharLR(NCURSES_SP_DCLx const ARG_CH_T ch)
PutAttrChar(NCURSES_SP_ARGx ch);
} else if (enter_am_mode && exit_am_mode) {
/* we can suppress automargin */
- TPUTS_TRACE("exit_am_mode");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_am_mode);
+ NCURSES_PUTP2("exit_am_mode", exit_am_mode);
PutAttrChar(NCURSES_SP_ARGx ch);
SP_PARM->_curscol--;
@@ -400,8 +395,7 @@ PutCharLR(NCURSES_SP_DCLx const ARG_CH_T ch)
SP_PARM->_curscol,
"exit_am_mode");
- TPUTS_TRACE("enter_am_mode");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx enter_am_mode);
+ NCURSES_PUTP2("enter_am_mode", enter_am_mode);
} else if ((enter_insert_mode && exit_insert_mode)
|| insert_character || parm_ich) {
GoTo(NCURSES_SP_ARGx
@@ -496,12 +490,13 @@ can_clear_with(NCURSES_SP_DCLx ARG_CH_T ch)
if (SP_PARM->_default_fg != C_MASK || SP_PARM->_default_bg != C_MASK)
return FALSE;
if ((pair = GetPair(CHDEREF(ch))) != 0) {
- short fg, bg;
- NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx
- (short) pair,
- &fg, &bg);
- if (fg != C_MASK || bg != C_MASK)
+ NCURSES_COLOR_T fg, bg;
+ if (NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx
+ (short) pair,
+ &fg, &bg) == ERR
+ || (fg != C_MASK || bg != C_MASK)) {
return FALSE;
+ }
}
#else
if (AttrOfD(ch) & A_COLOR)
@@ -563,8 +558,7 @@ EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num)
&& runcount > SP_PARM->_ech_cost + SP_PARM->_cup_ch_cost
&& can_clear_with(NCURSES_SP_ARGx CHREF(ntext0))) {
UpdateAttrs(SP_PARM, ntext0);
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx
- TPARM_1(erase_chars, runcount));
+ NCURSES_PUTP2("erase_chars", TPARM_1(erase_chars, runcount));
/*
* If this is the last part of the given interval,
@@ -677,6 +671,9 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0)
T((T_CALLED("_nc_tinfo:doupdate(%p)"), (void *) SP_PARM));
+ if (SP_PARM == 0)
+ returnCode(ERR);
+
#if !USE_REENTRANT
/*
* It is "legal" but unlikely that an application could assign a new
@@ -1076,32 +1073,29 @@ ClrUpdate(NCURSES_SP_DCL0)
*/
static void
-ClrToEOL(NCURSES_SP_DCLx NCURSES_CH_T blank, bool needclear)
+ClrToEOL(NCURSES_SP_DCLx NCURSES_CH_T blank, int needclear)
{
int j;
- if (SP_PARM != 0) {
- if (CurScreen(SP_PARM) != 0
- && SP_PARM->_cursrow >= 0) {
- for (j = SP_PARM->_curscol; j < screen_columns(SP_PARM); j++) {
- if (j >= 0) {
- NCURSES_CH_T *cp =
- &(CurScreen(SP_PARM)->_line[SP_PARM->_cursrow].text[j]);
-
- if (!CharEq(*cp, blank)) {
- *cp = blank;
- needclear = TRUE;
- }
+ if (CurScreen(SP_PARM) != 0
+ && SP_PARM->_cursrow >= 0) {
+ for (j = SP_PARM->_curscol; j < screen_columns(SP_PARM); j++) {
+ if (j >= 0) {
+ NCURSES_CH_T *cp =
+ &(CurScreen(SP_PARM)->_line[SP_PARM->_cursrow].text[j]);
+
+ if (!CharEq(*cp, blank)) {
+ *cp = blank;
+ needclear = TRUE;
}
}
}
}
- if (needclear && (SP_PARM != 0)) {
+ if (needclear) {
UpdateAttrs(SP_PARM, blank);
- TPUTS_TRACE("clr_eol");
if (clr_eol && SP_PARM->_el_cost <= (screen_columns(SP_PARM) - SP_PARM->_curscol)) {
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol);
+ NCURSES_PUTP2("clr_eol", clr_eol);
} else {
int count = (screen_columns(SP_PARM) - SP_PARM->_curscol);
while (count-- > 0)
@@ -1121,12 +1115,14 @@ ClrToEOS(NCURSES_SP_DCLx NCURSES_CH_T blank)
{
int row, col;
- if (0 == SP_PARM)
- return;
-
row = SP_PARM->_cursrow;
col = SP_PARM->_curscol;
+ if (row < 0)
+ row = 0;
+ if (col < 0)
+ col = 0;
+
UpdateAttrs(SP_PARM, blank);
TPUTS_TRACE("clr_eos");
NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
@@ -1370,13 +1366,11 @@ TransformLine(NCURSES_SP_DCLx int const lineno)
&& SP_PARM->_el_cost <= SP_PARM->_el1_cost) {
GoTo(NCURSES_SP_ARGx lineno, 0);
UpdateAttrs(SP_PARM, blank);
- TPUTS_TRACE("clr_eol");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol);
+ NCURSES_PUTP2("clr_eol", clr_eol);
} else {
GoTo(NCURSES_SP_ARGx lineno, nFirstChar - 1);
UpdateAttrs(SP_PARM, blank);
- TPUTS_TRACE("clr_bol");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_bol);
+ NCURSES_PUTP2("clr_bol", clr_bol);
}
while (firstChar < nFirstChar)
@@ -1574,8 +1568,7 @@ ClearScreen(NCURSES_SP_DCLx NCURSES_CH_T blank)
if (fast_clear) {
if (clear_screen) {
UpdateAttrs(SP_PARM, blank);
- TPUTS_TRACE("clear_screen");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clear_screen);
+ NCURSES_PUTP2("clear_screen", clear_screen);
SP_PARM->_cursrow = SP_PARM->_curscol = 0;
position_check(SP_PARM,
SP_PARM->_cursrow,
@@ -1595,8 +1588,7 @@ ClearScreen(NCURSES_SP_DCLx NCURSES_CH_T blank)
UpdateAttrs(SP_PARM, blank);
for (i = 0; i < screen_lines(SP_PARM); i++) {
GoTo(NCURSES_SP_ARGx i, 0);
- TPUTS_TRACE("clr_eol");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol);
+ NCURSES_PUTP2("clr_eol", clr_eol);
}
GoTo(NCURSES_SP_ARGx 0, 0);
}
@@ -1647,27 +1639,22 @@ InsStr(NCURSES_SP_DCLx NCURSES_CH_T * line, int count)
count--;
}
} else if (enter_insert_mode && exit_insert_mode) {
- TPUTS_TRACE("enter_insert_mode");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx enter_insert_mode);
+ NCURSES_PUTP2("enter_insert_mode", enter_insert_mode);
while (count) {
PutAttrChar(NCURSES_SP_ARGx CHREF(*line));
if (insert_padding) {
- TPUTS_TRACE("insert_padding");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_padding);
+ NCURSES_PUTP2("insert_padding", insert_padding);
}
line++;
count--;
}
- TPUTS_TRACE("exit_insert_mode");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_insert_mode);
+ NCURSES_PUTP2("exit_insert_mode", exit_insert_mode);
} else {
while (count) {
- TPUTS_TRACE("insert_character");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_character);
+ NCURSES_PUTP2("insert_character", insert_character);
PutAttrChar(NCURSES_SP_ARGx CHREF(*line));
if (insert_padding) {
- TPUTS_TRACE("insert_padding");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_padding);
+ NCURSES_PUTP2("insert_padding", insert_padding);
}
line++;
count--;
@@ -1701,8 +1688,7 @@ DelChar(NCURSES_SP_DCLx int count)
NCURSES_SP_NAME(_nc_outch));
} else {
for (n = 0; n < count; n++) {
- TPUTS_TRACE("delete_character");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_character);
+ NCURSES_PUTP2("delete_character", delete_character);
}
}
}
@@ -1754,13 +1740,11 @@ scroll_csr_forward(NCURSES_SP_DCLx
if (n == 1 && scroll_forward && top == miny && bot == maxy) {
GoTo(NCURSES_SP_ARGx bot, 0);
UpdateAttrs(SP_PARM, blank);
- TPUTS_TRACE("scroll_forward");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_forward);
+ NCURSES_PUTP2("scroll_forward", scroll_forward);
} else if (n == 1 && delete_line && bot == maxy) {
GoTo(NCURSES_SP_ARGx top, 0);
UpdateAttrs(SP_PARM, blank);
- TPUTS_TRACE("delete_line");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line);
+ NCURSES_PUTP2("delete_line", delete_line);
} else if (parm_index && top == miny && bot == maxy) {
GoTo(NCURSES_SP_ARGx bot, 0);
UpdateAttrs(SP_PARM, blank);
@@ -1781,15 +1765,13 @@ scroll_csr_forward(NCURSES_SP_DCLx
GoTo(NCURSES_SP_ARGx bot, 0);
UpdateAttrs(SP_PARM, blank);
for (i = 0; i < n; i++) {
- TPUTS_TRACE("scroll_forward");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_forward);
+ NCURSES_PUTP2("scroll_forward", scroll_forward);
}
} else if (delete_line && bot == maxy) {
GoTo(NCURSES_SP_ARGx top, 0);
UpdateAttrs(SP_PARM, blank);
for (i = 0; i < n; i++) {
- TPUTS_TRACE("delete_line");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line);
+ NCURSES_PUTP2("delete_line", delete_line);
}
} else
return ERR;
@@ -1823,13 +1805,11 @@ scroll_csr_backward(NCURSES_SP_DCLx
if (n == 1 && scroll_reverse && top == miny && bot == maxy) {
GoTo(NCURSES_SP_ARGx top, 0);
UpdateAttrs(SP_PARM, blank);
- TPUTS_TRACE("scroll_reverse");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_reverse);
+ NCURSES_PUTP2("scroll_reverse", scroll_reverse);
} else if (n == 1 && insert_line && bot == maxy) {
GoTo(NCURSES_SP_ARGx top, 0);
UpdateAttrs(SP_PARM, blank);
- TPUTS_TRACE("insert_line");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line);
+ NCURSES_PUTP2("insert_line", insert_line);
} else if (parm_rindex && top == miny && bot == maxy) {
GoTo(NCURSES_SP_ARGx top, 0);
UpdateAttrs(SP_PARM, blank);
@@ -1850,15 +1830,13 @@ scroll_csr_backward(NCURSES_SP_DCLx
GoTo(NCURSES_SP_ARGx top, 0);
UpdateAttrs(SP_PARM, blank);
for (i = 0; i < n; i++) {
- TPUTS_TRACE("scroll_reverse");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_reverse);
+ NCURSES_PUTP2("scroll_reverse", scroll_reverse);
}
} else if (insert_line && bot == maxy) {
GoTo(NCURSES_SP_ARGx top, 0);
UpdateAttrs(SP_PARM, blank);
for (i = 0; i < n; i++) {
- TPUTS_TRACE("insert_line");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line);
+ NCURSES_PUTP2("insert_line", insert_line);
}
} else
return ERR;
@@ -1889,8 +1867,7 @@ scroll_idl(NCURSES_SP_DCLx int n, int del, int ins, NCURSES_CH_T blank)
GoTo(NCURSES_SP_ARGx del, 0);
UpdateAttrs(SP_PARM, blank);
if (n == 1 && delete_line) {
- TPUTS_TRACE("delete_line");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line);
+ NCURSES_PUTP2("delete_line", delete_line);
} else if (parm_delete_line) {
TPUTS_TRACE("parm_delete_line");
NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
@@ -1899,16 +1876,14 @@ scroll_idl(NCURSES_SP_DCLx int n, int del, int ins, NCURSES_CH_T blank)
NCURSES_SP_NAME(_nc_outch));
} else { /* if (delete_line) */
for (i = 0; i < n; i++) {
- TPUTS_TRACE("delete_line");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line);
+ NCURSES_PUTP2("delete_line", delete_line);
}
}
GoTo(NCURSES_SP_ARGx ins, 0);
UpdateAttrs(SP_PARM, blank);
if (n == 1 && insert_line) {
- TPUTS_TRACE("insert_line");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line);
+ NCURSES_PUTP2("insert_line", insert_line);
} else if (parm_insert_line) {
TPUTS_TRACE("parm_insert_line");
NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
@@ -1917,8 +1892,7 @@ scroll_idl(NCURSES_SP_DCLx int n, int del, int ins, NCURSES_CH_T blank)
NCURSES_SP_NAME(_nc_outch));
} else { /* if (insert_line) */
for (i = 0; i < n; i++) {
- TPUTS_TRACE("insert_line");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line);
+ NCURSES_PUTP2("insert_line", insert_line);
}
}
@@ -1975,24 +1949,20 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx
&& (SP_PARM->_cursrow == bot || SP_PARM->_cursrow == bot - 1))
&& save_cursor && restore_cursor) {
cursor_saved = TRUE;
- TPUTS_TRACE("save_cursor");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx save_cursor);
+ NCURSES_PUTP2("save_cursor", save_cursor);
}
- TPUTS_TRACE("change_scroll_region");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx
- TPARM_2(change_scroll_region, top, bot));
+ NCURSES_PUTP2("change_scroll_region",
+ TPARM_2(change_scroll_region, top, bot));
if (cursor_saved) {
- TPUTS_TRACE("restore_cursor");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx restore_cursor);
+ NCURSES_PUTP2("restore_cursor", restore_cursor);
} else {
SP_PARM->_cursrow = SP_PARM->_curscol = -1;
}
res = scroll_csr_forward(NCURSES_SP_ARGx n, top, bot, top, bot, blank);
- TPUTS_TRACE("change_scroll_region");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx
- TPARM_2(change_scroll_region, 0, maxy));
+ NCURSES_PUTP2("change_scroll_region",
+ TPARM_2(change_scroll_region, 0, maxy));
SP_PARM->_cursrow = SP_PARM->_curscol = -1;
}
@@ -2025,15 +1995,12 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx
SP_PARM->_cursrow == top - 1)
&& save_cursor && restore_cursor) {
cursor_saved = TRUE;
- TPUTS_TRACE("save_cursor");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx save_cursor);
+ NCURSES_PUTP2("save_cursor", save_cursor);
}
- TPUTS_TRACE("change_scroll_region");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx
- TPARM_2(change_scroll_region, top, bot));
+ NCURSES_PUTP2("change_scroll_region",
+ TPARM_2(change_scroll_region, top, bot));
if (cursor_saved) {
- TPUTS_TRACE("restore_cursor");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx restore_cursor);
+ NCURSES_PUTP2("restore_cursor", restore_cursor);
} else {
SP_PARM->_cursrow = SP_PARM->_curscol = -1;
}
@@ -2041,9 +2008,8 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx
res = scroll_csr_backward(NCURSES_SP_ARGx
-n, top, bot, top, bot, blank);
- TPUTS_TRACE("change_scroll_region");
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx
- TPARM_2(change_scroll_region, 0, maxy));
+ NCURSES_PUTP2("change_scroll_region",
+ TPARM_2(change_scroll_region, 0, maxy));
SP_PARM->_cursrow = SP_PARM->_curscol = -1;
}
@@ -2114,23 +2080,25 @@ NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_DCL0)
}
if (exit_attribute_mode)
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_attribute_mode);
+ NCURSES_PUTP2("exit_attribute_mode", exit_attribute_mode);
else {
/* turn off attributes */
if (exit_alt_charset_mode)
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_alt_charset_mode);
+ NCURSES_PUTP2("exit_alt_charset_mode", exit_alt_charset_mode);
if (exit_standout_mode)
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_standout_mode);
+ NCURSES_PUTP2("exit_standout_mode", exit_standout_mode);
if (exit_underline_mode)
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_underline_mode);
+ NCURSES_PUTP2("exit_underline_mode", exit_underline_mode);
}
if (exit_insert_mode)
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_insert_mode);
- if (enter_am_mode && exit_am_mode)
- NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx
- (auto_right_margin
- ? enter_am_mode
- : exit_am_mode));
+ NCURSES_PUTP2("exit_insert_mode", exit_insert_mode);
+ if (enter_am_mode && exit_am_mode) {
+ if (auto_right_margin) {
+ NCURSES_PUTP2("enter_am_mode", enter_am_mode);
+ } else {
+ NCURSES_PUTP2("exit_am_mode", exit_am_mode);
+ }
+ }
}
#if NCURSES_SP_FUNCS
@@ -2159,33 +2127,33 @@ _nc_screen_init(void)
NCURSES_EXPORT(void)
NCURSES_SP_NAME(_nc_screen_wrap) (NCURSES_SP_DCL0)
{
- if (SP_PARM == 0)
- return;
+ if (SP_PARM != 0) {
- UpdateAttrs(SP_PARM, normal);
+ UpdateAttrs(SP_PARM, normal);
#if NCURSES_EXT_FUNCS
- if (SP_PARM->_coloron
- && !SP_PARM->_default_color) {
- static const NCURSES_CH_T blank = NewChar(BLANK_TEXT);
- SP_PARM->_default_color = TRUE;
- NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx
- -1,
- 0,
- FALSE,
- NCURSES_SP_NAME(_nc_outch));
- SP_PARM->_default_color = FALSE;
-
- TINFO_MVCUR(NCURSES_SP_ARGx
- SP_PARM->_cursrow,
- SP_PARM->_curscol,
- screen_lines(SP_PARM) - 1,
- 0);
-
- ClrToEOL(NCURSES_SP_ARGx blank, TRUE);
- }
+ if (SP_PARM->_coloron
+ && !SP_PARM->_default_color) {
+ static const NCURSES_CH_T blank = NewChar(BLANK_TEXT);
+ SP_PARM->_default_color = TRUE;
+ NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx
+ -1,
+ 0,
+ FALSE,
+ NCURSES_SP_NAME(_nc_outch));
+ SP_PARM->_default_color = FALSE;
+
+ TINFO_MVCUR(NCURSES_SP_ARGx
+ SP_PARM->_cursrow,
+ SP_PARM->_curscol,
+ screen_lines(SP_PARM) - 1,
+ 0);
+
+ ClrToEOL(NCURSES_SP_ARGx blank, TRUE);
+ }
#endif
- if (SP_PARM->_color_defs) {
- NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_ARG);
+ if (SP_PARM->_color_defs) {
+ NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_ARG);
+ }
}
}