Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)

- Fix for possible unset uid/gid in toproto
 - Fix for default mtree style
 - Update libelf
 - Importing libexecinfo
 - Resynchronize GCC, mpc, gmp, mpfr
 - build.sh: Replace params with show-params.
     This has been done as the make target has been renamed in the same
     way, while a new target named params has been added. This new
     target generates a file containing all the parameters, instead of
     printing it on the console.
 - Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org)
     get getservbyport() out of the inner loop

Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
This commit is contained in:
2014-07-28 17:05:06 +02:00
parent ff10274392
commit 84d9c625bf
4655 changed files with 379308 additions and 151050 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
/* $NetBSD: add_wch.c,v 1.3 2009/07/22 16:57:14 roy Exp $ */
/* $NetBSD: add_wch.c,v 1.4 2013/11/09 11:16:59 blymn Exp $ */
/*
* Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: add_wch.c,v 1.3 2009/07/22 16:57:14 roy Exp $");
__RCSID("$NetBSD: add_wch.c,v 1.4 2013/11/09 11:16:59 blymn Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -119,6 +119,6 @@ wadd_wch(WINDOW *win, const cchar_t *wch)
__CTRACE(__CTRACE_INPUT, "wadd_wch: win(%p)", win);
#endif
lnp = win->alines[y];
return _cursesi_addwchar(win, &lnp, &y, &x, wch);
return _cursesi_addwchar(win, &lnp, &y, &x, wch, 1);
#endif /* HAVE_WCHAR */
}
+180 -157
View File
@@ -1,4 +1,4 @@
/* $NetBSD: addbytes.c,v 1.39 2011/07/01 01:19:33 joerg Exp $ */
/* $NetBSD: addbytes.c,v 1.42 2013/11/10 03:14:16 christos Exp $ */
/*
* Copyright (c) 1987, 1993, 1994
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)addbytes.c 8.4 (Berkeley) 5/4/94";
#else
__RCSID("$NetBSD: addbytes.c,v 1.39 2011/07/01 01:19:33 joerg Exp $");
__RCSID("$NetBSD: addbytes.c,v 1.42 2013/11/10 03:14:16 christos Exp $");
#endif
#endif /* not lint */
@@ -60,7 +60,7 @@ __RCSID("$NetBSD: addbytes.c,v 1.39 2011/07/01 01:19:33 joerg Exp $");
int
addbytes(const char *bytes, int count)
{
return __waddbytes(stdscr, bytes, count, 0);
return _cursesi_waddbytes(stdscr, bytes, count, 0, 1);
}
/*
@@ -70,7 +70,7 @@ addbytes(const char *bytes, int count)
int
waddbytes(WINDOW *win, const char *bytes, int count)
{
return __waddbytes(win, bytes, count, 0);
return _cursesi_waddbytes(win, bytes, count, 0, 1);
}
/*
@@ -93,19 +93,29 @@ mvwaddbytes(WINDOW *win, int y, int x, const char *bytes, int count)
if (wmove(win, y, x) == ERR)
return ERR;
return __waddbytes(win, bytes, count, 0);
return _cursesi_waddbytes(win, bytes, count, 0, 1);
}
#endif
/*
* waddbytes --
* Add the character to the current position in the given window.
*/
int
__waddbytes(WINDOW *win, const char *bytes, int count, attr_t attr)
{
int x, y, err;
return _cursesi_waddbytes(win, bytes, count, attr, 1);
}
/*
* _cursesi_waddbytes --
* Add the character to the current position in the given window.
* if char_interp is non-zero then character interpretation is done on
* the byte (i.e. \n to newline, \r to carriage return, \b to backspace
* and so on).
*/
int
_cursesi_waddbytes(WINDOW *win, const char *bytes, int count, attr_t attr,
int char_interp)
{
int x, y, err;
__LINE *lp;
#ifdef HAVE_WCHAR
int n;
@@ -139,7 +149,7 @@ __waddbytes(WINDOW *win, const char *bytes, int count, attr_t attr)
__CTRACE(__CTRACE_INPUT, "ADDBYTES('%c', %x) at (%d, %d)\n",
c, attr, y, x);
#endif
err = _cursesi_addbyte(win, &lp, &y, &x, c, attr);
err = _cursesi_addbyte(win, &lp, &y, &x, c, attr, char_interp);
count--;
#else
/*
@@ -169,7 +179,7 @@ __waddbytes(WINDOW *win, const char *bytes, int count, attr_t attr)
cc.vals[0] = wc;
cc.elements = 1;
cc.attributes = attr;
err = _cursesi_addwchar(win, &lp, &y, &x, &cc);
err = _cursesi_addwchar(win, &lp, &y, &x, &cc, char_interp);
bytes += n;
count -= n;
#endif
@@ -190,125 +200,132 @@ __waddbytes(WINDOW *win, const char *bytes, int count, attr_t attr)
* _cursesi_addbyte -
* Internal function to add a byte and update the row and column
* positions as appropriate. This function is only used in the narrow
* character version of curses.
* character version of curses. If update_cursor is non-zero then character
* interpretation.
*/
int
_cursesi_addbyte(WINDOW *win, __LINE **lp, int *y, int *x, int c,
attr_t attr)
attr_t attr, int char_interp)
{
static char blanks[] = " ";
int newx;
static char blank[] = " ";
int tabsize;
int newx, i;
attr_t attributes;
switch (c) {
case '\t':
PSYNCH_OUT;
if (waddbytes(win, blanks, 8 - (*x % 8)) == ERR)
return (ERR);
PSYNCH_IN;
break;
default:
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT, "ADDBYTES(%p, %d, %d)\n",
win, *y, *x);
#endif
if ((*lp)->flags & __ISPASTEOL) {
new_line:
*x = 0;
(*lp)->flags &= ~__ISPASTEOL;
if (*y == win->scr_b) {
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT,
"ADDBYTES - on bottom "
"of scrolling region\n");
#endif
if (!(win->flags & __SCROLLOK))
return ERR;
PSYNCH_OUT;
scroll(win);
PSYNCH_IN;
} else {
(*y)++;
if (char_interp) {
switch (c) {
case '\t':
tabsize = win->screen->TABSIZE;
PSYNCH_OUT;
for (i = 0; i < (tabsize - (*x % tabsize)); i++) {
if (waddbytes(win, blank, 1) == ERR)
return (ERR);
}
*lp = win->alines[*y];
if (c == '\n')
break;
}
PSYNCH_IN;
return (OK);
attributes = (win->wattr | attr) &
(__ATTRIBUTES & ~__COLOR);
if (attr & __COLOR)
attributes |= attr & __COLOR;
else if (win->wattr & __COLOR)
attributes |= win->wattr & __COLOR;
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT,
"ADDBYTES: 1: y = %d, x = %d, firstch = %d, "
"lastch = %d\n",
*y, *x, *win->alines[*y]->firstchp,
*win->alines[*y]->lastchp);
#endif
/*
* Always update the change pointers. Otherwise,
* we could end up not displaying 'blank' characters
* when overlapping windows are displayed.
*/
newx = *x + win->ch_off;
(*lp)->flags |= __ISDIRTY;
/*
* firstchp/lastchp are shared between
* parent window and sub-window.
*/
if (newx < *(*lp)->firstchp)
*(*lp)->firstchp = newx;
if (newx > *(*lp)->lastchp)
*(*lp)->lastchp = newx;
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT,
"ADDBYTES: change gives f/l: %d/%d [%d/%d]\n",
*(*lp)->firstchp, *(*lp)->lastchp,
*(*lp)->firstchp - win->ch_off,
*(*lp)->lastchp - win->ch_off);
#endif
if (win->bch != ' ' && c == ' ')
(*lp)->line[*x].ch = win->bch;
else
(*lp)->line[*x].ch = c;
if (attributes & __COLOR)
(*lp)->line[*x].attr =
attributes | (win->battr & ~__COLOR);
else
(*lp)->line[*x].attr = attributes | win->battr;
if (*x == win->maxx - 1)
case '\n':
PSYNCH_OUT;
wclrtoeol(win);
PSYNCH_IN;
(*lp)->flags |= __ISPASTEOL;
else
(*x)++;
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT,
"ADDBYTES: 2: y = %d, x = %d, firstch = %d, "
"lastch = %d\n",
*y, *x, *win->alines[*y]->firstchp,
*win->alines[*y]->lastchp);
#endif
break;
case '\n':
PSYNCH_OUT;
wclrtoeol(win);
PSYNCH_IN;
goto new_line;
case '\r':
*x = 0;
break;
case '\b':
if (--(*x) < 0)
break;
case '\r':
*x = 0;
break;
win->curx = *x;
return (OK);
case '\b':
if (--(*x) < 0)
*x = 0;
win->curx = *x;
return (OK);
}
}
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT, "ADDBYTES(%p, %d, %d)\n", win, *y, *x);
#endif
if (char_interp && ((*lp)->flags & __ISPASTEOL)) {
*x = 0;
(*lp)->flags &= ~__ISPASTEOL;
if (*y == win->scr_b) {
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT,
"ADDBYTES - on bottom "
"of scrolling region\n");
#endif
if (!(win->flags & __SCROLLOK))
return ERR;
PSYNCH_OUT;
scroll(win);
PSYNCH_IN;
} else {
(*y)++;
}
*lp = win->alines[*y];
if (c == '\n')
return (OK);
}
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT,
"ADDBYTES: 1: y = %d, x = %d, firstch = %d, lastch = %d\n",
*y, *x, *win->alines[*y]->firstchp,
*win->alines[*y]->lastchp);
#endif
attributes = (win->wattr | attr) & (__ATTRIBUTES & ~__COLOR);
if (attr & __COLOR)
attributes |= attr & __COLOR;
else if (win->wattr & __COLOR)
attributes |= win->wattr & __COLOR;
/*
* Always update the change pointers. Otherwise,
* we could end up not displaying 'blank' characters
* when overlapping windows are displayed.
*/
newx = *x + win->ch_off;
(*lp)->flags |= __ISDIRTY;
/*
* firstchp/lastchp are shared between
* parent window and sub-window.
*/
if (newx < *(*lp)->firstchp)
*(*lp)->firstchp = newx;
if (newx > *(*lp)->lastchp)
*(*lp)->lastchp = newx;
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT, "ADDBYTES: change gives f/l: %d/%d [%d/%d]\n",
*(*lp)->firstchp, *(*lp)->lastchp,
*(*lp)->firstchp - win->ch_off,
*(*lp)->lastchp - win->ch_off);
#endif
if (win->bch != ' ' && c == ' ')
(*lp)->line[*x].ch = win->bch;
else
(*lp)->line[*x].ch = c;
if (attributes & __COLOR)
(*lp)->line[*x].attr =
attributes | (win->battr & ~__COLOR);
else
(*lp)->line[*x].attr = attributes | win->battr;
if (*x == win->maxx - 1)
(*lp)->flags |= __ISPASTEOL;
else
(*x)++;
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT,
"ADDBYTES: 2: y = %d, x = %d, firstch = %d, lastch = %d\n",
*y, *x, *win->alines[*y]->firstchp,
*win->alines[*y]->lastchp);
#endif
return (OK);
}
@@ -319,52 +336,56 @@ _cursesi_addbyte(WINDOW *win, __LINE **lp, int *y, int *x, int c,
*/
int
_cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x,
const cchar_t *wch)
const cchar_t *wch, int char_interp)
{
#ifndef HAVE_WCHAR
return (ERR);
#else
int sx = 0, ex = 0, cw = 0, i = 0, newx = 0;
int sx = 0, ex = 0, cw = 0, i = 0, newx = 0, tabsize;
__LDATA *lp = &win->alines[*y]->line[*x], *tp = NULL;
nschar_t *np = NULL;
cchar_t cc;
attr_t attributes;
/* special characters handling */
switch (wch->vals[0]) {
case L'\b':
if (--*x < 0)
if (char_interp) {
/* special characters handling */
switch (wch->vals[0]) {
case L'\b':
if (--*x < 0)
*x = 0;
win->curx = *x;
return OK;
case L'\r':
*x = 0;
win->curx = *x;
return OK;
case L'\r':
*x = 0;
return OK;
case L'\n':
wclrtoeol(win);
PSYNCH_IN;
*x = 0;
(*lnp)->flags &= ~__ISPASTEOL;
if (*y == win->scr_b) {
if (!(win->flags & __SCROLLOK))
return ERR;
PSYNCH_OUT;
scroll(win);
win->curx = *x;
return OK;
case L'\n':
wclrtoeol(win);
PSYNCH_IN;
} else {
(*y)++;
*x = 0;
(*lnp)->flags &= ~__ISPASTEOL;
if (*y == win->scr_b) {
if (!(win->flags & __SCROLLOK))
return ERR;
PSYNCH_OUT;
scroll(win);
PSYNCH_IN;
} else {
(*y)++;
}
PSYNCH_OUT;
return OK;
case L'\t':
cc.vals[0] = L' ';
cc.elements = 1;
cc.attributes = win->wattr;
tabsize = win->screen->TABSIZE;
for (i = 0; i < tabsize - (*x % tabsize); i++) {
if (wadd_wch(win, &cc) == ERR)
return ERR;
}
return OK;
}
PSYNCH_OUT;
return OK;
case L'\t':
cc.vals[0] = L' ';
cc.elements = 1;
cc.attributes = win->wattr;
for (i = 0; i < 8 - (*x % 8); i++) {
if (wadd_wch(win, &cc) == ERR)
return ERR;
}
return OK;
}
/* check for non-spacing character */
@@ -396,7 +417,7 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x,
return OK;
}
/* check for new line first */
if ((*lnp)->flags & __ISPASTEOL) {
if (char_interp && ((*lnp)->flags & __ISPASTEOL)) {
*x = 0;
(*lnp)->flags &= ~__ISPASTEOL;
if (*y == win->scr_b) {
@@ -441,6 +462,7 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x,
cw = wcwidth(wch->vals[0]);
if (cw < 0)
cw = 1;
if (cw > win->maxx - *x) {
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT,
@@ -543,6 +565,7 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x,
/* Mark as "continuation" cell */
tp->attr |= __WCWIDTH;
}
if (*x == win->maxx) {
(*lnp)->flags |= __ISPASTEOL;
newx = win->maxx - 1 + win->ch_off;
@@ -560,9 +583,9 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x,
while (ex < win->maxx && WCOL(*tp) < 0) {
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT,
"_cursesi_addwchar: clear "
"remaining of current char (%d,%d)nn",
*y, ex);
"_cursesi_addwchar: clear "
"remaining of current char (%d,%d)nn",
*y, ex);
#endif /* DEBUG */
tp->ch = (wchar_t) btowc((int) win->bch);
if (_cursesi_copy_nsp(win->bnsp, tp) == ERR)
+3 -3
View File
@@ -1,4 +1,4 @@
/* $NetBSD: addch.c,v 1.16 2010/02/23 19:48:26 drochner Exp $ */
/* $NetBSD: addch.c,v 1.17 2013/11/09 11:16:59 blymn Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)addch.c 8.2 (Berkeley) 5/4/94";
#else
__RCSID("$NetBSD: addch.c,v 1.16 2010/02/23 19:48:26 drochner Exp $");
__RCSID("$NetBSD: addch.c,v 1.17 2013/11/09 11:16:59 blymn Exp $");
#endif
#endif /* not lint */
@@ -124,5 +124,5 @@ __waddch(WINDOW *win, __LDATA *dp)
buf[0] = dp->ch;
buf[1] = '\0';
return (__waddbytes(win, buf, 1, dp->attr));
return (_cursesi_waddbytes(win, buf, 1, dp->attr, 1));
}
+8 -5
View File
@@ -1,4 +1,4 @@
/* $NetBSD: addchnstr.c,v 1.5 2012/09/28 06:00:39 blymn Exp $ */
/* $NetBSD: addchnstr.c,v 1.6 2013/11/09 11:16:59 blymn Exp $ */
/*
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: addchnstr.c,v 1.5 2012/09/28 06:00:39 blymn Exp $");
__RCSID("$NetBSD: addchnstr.c,v 1.6 2013/11/09 11:16:59 blymn Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -135,7 +135,7 @@ waddchnstr(WINDOW *win, const chtype *chstr, int n)
const chtype *chp;
attr_t attr;
char *ocp, *cp, *start;
int i, ret;
int i, ret, ox, oy;
#ifdef DEBUG
__CTRACE(__CTRACE_INPUT, "waddchnstr: win = %p, chstr = %p, n = %d\n",
@@ -158,6 +158,8 @@ waddchnstr(WINDOW *win, const chtype *chstr, int n)
start = ocp;
i = 0;
attr = (*chp) & __ATTRIBUTES;
ox = win->curx;
oy = win->cury;
while (len) {
*cp = (*chp) & __CHARTEXT;
cp++;
@@ -166,7 +168,7 @@ waddchnstr(WINDOW *win, const chtype *chstr, int n)
len--;
if (((*chp) & __ATTRIBUTES) != attr) {
*cp = '\0';
if (__waddbytes(win, start, i, attr) == ERR) {
if (_cursesi_waddbytes(win, start, i, attr, 0) == ERR) {
free(ocp);
return ERR;
}
@@ -176,7 +178,8 @@ waddchnstr(WINDOW *win, const chtype *chstr, int n)
}
}
*cp = '\0';
ret = __waddbytes(win, start, i, attr);
ret = _cursesi_waddbytes(win, start, i, attr, 0);
free(ocp);
wmove(win, oy, ox);
return ret;
}
+18 -2
View File
@@ -1,4 +1,4 @@
/* $NetBSD: border.c,v 1.14 2010/12/25 09:59:52 blymn Exp $ */
/* $NetBSD: border.c,v 1.15 2013/05/05 14:23:16 jdc Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: border.c,v 1.14 2010/12/25 09:59:52 blymn Exp $");
__RCSID("$NetBSD: border.c,v 1.15 2013/05/05 14:23:16 jdc Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -261,20 +261,36 @@ int wborder_set(WINDOW *win, const cchar_t *ls, const cchar_t *rs,
/* Merge window attributes */
left.attributes |= (left.attributes & __COLOR) ?
(win->wattr & ~__COLOR) : win->wattr;
left.attributes |= (left.attributes & __COLOR) ?
(win->battr & ~__COLOR) : win->battr;
right.attributes |= (right.attributes & __COLOR) ?
(win->wattr & ~__COLOR) : win->wattr;
right.attributes |= (right.attributes & __COLOR) ?
(win->battr & ~__COLOR) : win->battr;
top.attributes |= (top.attributes & __COLOR) ?
(win->wattr & ~__COLOR) : win->wattr;
top.attributes |= (top.attributes & __COLOR) ?
(win->battr & ~__COLOR) : win->battr;
bottom.attributes |= (bottom.attributes & __COLOR) ?
(win->wattr & ~__COLOR) : win->wattr;
bottom.attributes |= (bottom.attributes & __COLOR) ?
(win->battr & ~__COLOR) : win->battr;
topleft.attributes |= (topleft.attributes & __COLOR) ?
(win->wattr & ~__COLOR) : win->wattr;
topleft.attributes |= (topleft.attributes & __COLOR) ?
(win->battr & ~__COLOR) : win->battr;
topright.attributes |= (topright.attributes & __COLOR) ?
(win->wattr & ~__COLOR) : win->wattr;
topright.attributes |= (topright.attributes & __COLOR) ?
(win->battr & ~__COLOR) : win->battr;
botleft.attributes |= (botleft.attributes & __COLOR) ?
(win->wattr & ~__COLOR) : win->wattr;
botleft.attributes |= (botleft.attributes & __COLOR) ?
(win->battr & ~__COLOR) : win->battr;
botright.attributes |= (botright.attributes & __COLOR) ?
(win->wattr & ~__COLOR) : win->wattr;
botright.attributes |= (botright.attributes & __COLOR) ?
(win->battr & ~__COLOR) : win->battr;
endx = win->maxx - 1;
endy = win->maxy - 1;
+1 -1
View File
@@ -118,7 +118,7 @@ int copywin(const WINDOW *srcwin, WINDOW *dstwin,
cc.elements = 1;
np = sp->nsp;
if (np) {
/* MINIX: off-by one error, has to be strictly less than. */
/* MINIX: off by one error, has to be strictly less than. */
while (np && cc.elements <
CURSES_CCHAR_MAX) {
cc.vals[cc.elements++] = np->ch;
+3 -2
View File
@@ -1,4 +1,4 @@
/* $NetBSD: curses.c,v 1.24 2010/02/03 15:34:40 roy Exp $ */
/* $NetBSD: curses.c,v 1.25 2013/10/16 19:59:29 roy Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -35,7 +35,7 @@
#if 0
static char sccsid[] = "@(#)curses.c 8.3 (Berkeley) 5/4/94";
#else
__RCSID("$NetBSD: curses.c,v 1.24 2010/02/03 15:34:40 roy Exp $");
__RCSID("$NetBSD: curses.c,v 1.25 2013/10/16 19:59:29 roy Exp $");
#endif
#endif /* not lint */
@@ -66,6 +66,7 @@ WINDOW *__virtscr; /* Virtual screen (for doupdate()). */
SCREEN *_cursesi_screen; /* the current screen we are using */
int COLS; /* Columns on the screen. */
int LINES; /* Lines on the screen. */
int TABSIZE; /* Size of a tab. */
int COLORS; /* Maximum colors on the screen */
int COLOR_PAIRS = 0; /* Maximum color pairs on the screen */
int My_term = 0; /* Use Def_term regardless. */
+3 -1
View File
@@ -1,4 +1,4 @@
/* $NetBSD: curses.h,v 1.104 2012/04/21 12:27:27 roy Exp $ */
/* $NetBSD: curses.h,v 1.106 2013/10/16 19:59:29 roy Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -259,6 +259,7 @@ typedef struct __screen SCREEN;
#ifdef HAVE_WCHAR
#define WA_ATTRIBUTES 0x03ffffff /* Wide character attributes mask */
#define WA_NORMAL __NORMAL
#define WA_STANDOUT __STANDOUT /* Best highlighting mode */
#define WA_UNDERLINE __UNDERSCORE /* Underlining */
#define WA_REVERSE __REVERSE /* Reverse video */
@@ -409,6 +410,7 @@ extern int COLORS; /* Max colors on the screen. */
extern int COLOR_PAIRS; /* Max color pairs on the screen. */
extern int ESCDELAY; /* Delay between keys in esc seq's. */
extern int TABSIZE; /* Size of a tab. */
#ifndef OK
#define ERR (-1) /* Error return. */
+7 -3
View File
@@ -1,4 +1,4 @@
/* $NetBSD: curses_private.h,v 1.47 2011/10/04 11:01:13 roy Exp $ */
/* $NetBSD: curses_private.h,v 1.49 2013/11/09 11:16:59 blymn Exp $ */
/*-
* Copyright (c) 1998-2000 Brett Lymn
@@ -99,6 +99,7 @@ struct __line {
#endif
#define __ISDIRTY 0x01 /* Line is dirty. */
#define __ISPASTEOL 0x02 /* Cursor is past end of line */
#define __ISFORCED 0x04 /* Force update, no optimisation */
unsigned int flags;
unsigned int hash; /* Hash value for the line. */
int *firstchp, *lastchp; /* First and last chngd columns ptrs */
@@ -193,6 +194,7 @@ struct __screen {
int lx, ly; /* loop parameters for refresh */
int COLS; /* Columns on the screen. */
int LINES; /* Lines on the screen. */
int TABSIZE; /* Size of a tab. */
int COLORS; /* Maximum colors on the screen */
int COLOR_PAIRS; /* Maximum color pairs on the screen */
int My_term; /* Use Def_term regardless. */
@@ -289,8 +291,10 @@ int __cputchar_args(int, void *);
void _cursesi_free_keymap(keymap_t *);
int _cursesi_gettmode(SCREEN *);
void _cursesi_reset_acs(SCREEN *);
int _cursesi_addbyte(WINDOW *, __LINE **, int *, int *, int , attr_t);
int _cursesi_addwchar(WINDOW *, __LINE **, int *, int *, const cchar_t *);
int _cursesi_addbyte(WINDOW *, __LINE **, int *, int *, int , attr_t, int);
int _cursesi_addwchar(WINDOW *, __LINE **, int *, int *, const cchar_t *,
int);
int _cursesi_waddbytes(WINDOW *, const char *, int, attr_t, int);
#ifdef HAVE_WCHAR
void _cursesi_reset_wacs(SCREEN *);
#endif /* HAVE_WCHAR */
+7 -2
View File
@@ -1,4 +1,4 @@
.\" $NetBSD: curses_window.3,v 1.15 2011/09/15 12:01:18 wiz Exp $
.\" $NetBSD: curses_window.3,v 1.16 2013/10/15 22:15:17 roy Exp $
.\"
.\" Copyright (c) 2002
.\" Brett Lymn (blymn@NetBSD.org, brett_lymn@yahoo.com.au)
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\"
.Dd September 15, 2011
.Dd October 15, 2013
.Dt CURSES_WINDOW 3
.Os
.Sh NAME
@@ -143,6 +143,11 @@ A window may deleted and all resources freed by calling the
.Fn delwin
function with the pointer to the window to be deleted in
.Fa win .
If
.Fa win
is
.Dv NULL ,
then no action occurs.
.Pp
A window can be moved to a new position by calling the
.Fn mvwin
+6 -2
View File
@@ -1,4 +1,4 @@
/* $NetBSD: delwin.c,v 1.17 2009/07/22 16:57:14 roy Exp $ */
/* $NetBSD: delwin.c,v 1.18 2013/10/15 22:15:17 roy Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)delwin.c 8.2 (Berkeley) 5/4/94";
#else
__RCSID("$NetBSD: delwin.c,v 1.17 2009/07/22 16:57:14 roy Exp $");
__RCSID("$NetBSD: delwin.c,v 1.18 2013/10/15 22:15:17 roy Exp $");
#endif
#endif /* not lint */
@@ -57,6 +57,10 @@ delwin(WINDOW *win)
#ifdef DEBUG
__CTRACE(__CTRACE_WINDOW, "delwin(%p)\n", win);
#endif
if (win == NULL)
return (OK);
/*
* Free any storage used by non-spacing characters in the window.
*/
+3 -3
View File
@@ -1,4 +1,4 @@
/* $NetBSD: getstr.c,v 1.22 2012/01/27 15:37:09 christos Exp $ */
/* $NetBSD: getstr.c,v 1.23 2013/10/01 11:41:14 blymn Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -35,7 +35,7 @@
#if 0
static char sccsid[] = "@(#)getstr.c 8.2 (Berkeley) 5/4/94";
#else
__RCSID("$NetBSD: getstr.c,v 1.22 2012/01/27 15:37:09 christos Exp $");
__RCSID("$NetBSD: getstr.c,v 1.23 2013/10/01 11:41:14 blymn Exp $");
#endif
#endif /* not lint */
@@ -178,7 +178,7 @@ __wgetnstr(WINDOW *win, char *str, int n)
win, c, remain);
#endif
*str = c;
touchline(win, win->cury, 1);
__touchline(win, win->cury, 0, (int) win->maxx - 1);
if (c == ec || c == KEY_BACKSPACE || c == KEY_LEFT) {
*str = '\0';
if (str != ostr) {
+6 -5
View File
@@ -1,4 +1,4 @@
/* $NetBSD: ins_wch.c,v 1.5 2010/02/23 19:48:26 drochner Exp $ */
/* $NetBSD: ins_wch.c,v 1.6 2013/10/16 19:59:29 roy Exp $ */
/*
* Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: ins_wch.c,v 1.5 2010/02/23 19:48:26 drochner Exp $");
__RCSID("$NetBSD: ins_wch.c,v 1.6 2013/10/16 19:59:29 roy Exp $");
#endif /* not lint */
#include <string.h>
@@ -102,7 +102,7 @@ wins_wch(WINDOW *win, const cchar_t *wch)
#else
__LDATA *start, *temp1, *temp2;
__LINE *lnp;
int cw, pcw, x, y, sx, ex, newx, i;
int cw, pcw, x, y, sx, ex, newx, i, tabsize;
nschar_t *np, *tnp;
wchar_t ws[] = L" ";
@@ -146,8 +146,9 @@ wins_wch(WINDOW *win, const cchar_t *wch)
}
return OK;
case L'\t':
if (wins_nwstr(win, ws, min(win->maxx - x, 8-(x % 8)))
== ERR)
tabsize = win->screen->TABSIZE;
if (wins_nwstr(win, ws, min(win->maxx - x,
tabsize - (x % tabsize))) == ERR)
return ERR;
return OK;
}
+6 -5
View File
@@ -1,4 +1,4 @@
/* $NetBSD: ins_wstr.c,v 1.6 2010/12/16 17:42:28 wiz Exp $ */
/* $NetBSD: ins_wstr.c,v 1.7 2013/10/16 19:59:29 roy Exp $ */
/*
* Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: ins_wstr.c,v 1.6 2010/12/16 17:42:28 wiz Exp $");
__RCSID("$NetBSD: ins_wstr.c,v 1.7 2013/10/16 19:59:29 roy Exp $");
#endif /* not lint */
#include <string.h>
@@ -136,7 +136,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n)
__LDATA *start, *temp1, *temp2;
__LINE *lnp;
const wchar_t *scp;
int width, len, sx, x, y, cw, pcw, newx;
int width, len, sx, x, y, cw, pcw, newx, tabsize;
nschar_t *np;
wchar_t ws[] = L" ";
@@ -266,9 +266,10 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n)
}
continue;
case L'\t':
tabsize = win->screen->TABSIZE;
if (wins_nwstr(win, ws,
min(win->maxx - x, 8-(x % 8)))
== ERR)
min(win->maxx - x, tabsize - (x % tabsize)))
== ERR)
return ERR;
continue;
}
+3 -4
View File
@@ -1,4 +1,4 @@
/* $NetBSD: mvwin.c,v 1.17 2012/09/28 06:03:45 blymn Exp $ */
/* $NetBSD: mvwin.c,v 1.18 2013/10/18 19:53:59 christos Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)mvwin.c 8.2 (Berkeley) 5/4/94";
#else
__RCSID("$NetBSD: mvwin.c,v 1.17 2012/09/28 06:03:45 blymn Exp $");
__RCSID("$NetBSD: mvwin.c,v 1.18 2013/10/18 19:53:59 christos Exp $");
#endif
#endif /* not lint */
@@ -52,7 +52,7 @@ int
mvderwin(WINDOW *win, int dy, int dx)
{
WINDOW *parent;
int x, y, i;
int x, i;
__LINE *lp, *olp;
#ifdef HAVE_WCHAR
__LDATA *cp;
@@ -73,7 +73,6 @@ mvderwin(WINDOW *win, int dy, int dx)
return ERR;
x = parent->begx + dx;
y = parent->begy + dy;
win->ch_off = x;
/* Point the line pointers to line space */
+11 -4
View File
@@ -1,4 +1,4 @@
/* $NetBSD: refresh.c,v 1.76 2012/04/21 11:33:16 blymn Exp $ */
/* $NetBSD: refresh.c,v 1.77 2013/05/05 14:22:07 jdc Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)refresh.c 8.7 (Berkeley) 8/13/94";
#else
__RCSID("$NetBSD: refresh.c,v 1.76 2012/04/21 11:33:16 blymn Exp $");
__RCSID("$NetBSD: refresh.c,v 1.77 2013/05/05 14:22:07 jdc Exp $");
#endif
#endif /* not lint */
@@ -233,8 +233,10 @@ _cursesi_wnoutrefresh(SCREEN *screen, WINDOW *win, int begy, int begx,
#ifdef DEBUG
__CTRACE(__CTRACE_REFRESH,
"_wnoutrefresh: copy from %d, "
"%d to %d, %d\n",
wy, wx, y_off, x_off);
"%d to %d, %d: %s, 0x%x",
wy, wx, y_off, x_off,
unctrl(wlp->line[wx].ch),
wlp->line[wx].attr);
#endif
/* Copy character */
vlp->line[x_off].ch = wlp->line[wx].ch;
@@ -256,6 +258,11 @@ _cursesi_wnoutrefresh(SCREEN *screen, WINDOW *win, int begy, int begx,
return ERR;
}
#endif /* HAVE_WCHAR */
#ifdef DEBUG
__CTRACE(__CTRACE_REFRESH, " = %s, 0x%x\n",
unctrl(vlp->line[x_off].ch),
vlp->line[x_off].attr);
#endif
wx++;
x_off++;
}
+26 -15
View File
@@ -1,4 +1,4 @@
/* $NetBSD: setterm.c,v 1.49 2012/04/21 12:27:28 roy Exp $ */
/* $NetBSD: setterm.c,v 1.52 2013/10/16 19:59:29 roy Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)setterm.c 8.8 (Berkeley) 10/25/94";
#else
__RCSID("$NetBSD: setterm.c,v 1.49 2012/04/21 12:27:28 roy Exp $");
__RCSID("$NetBSD: setterm.c,v 1.52 2013/10/16 19:59:29 roy Exp $");
#endif
#endif /* not lint */
@@ -49,7 +49,7 @@ __RCSID("$NetBSD: setterm.c,v 1.49 2012/04/21 12:27:28 roy Exp $");
#include "curses_private.h"
static int does_esc_m(const char *cap);
static int does_ctrl_o(const char *cap);
static int does_ctrl_o(const char *exit_cap, const char *acs_cap);
attr_t __mask_op, __mask_me, __mask_ue, __mask_se;
@@ -95,7 +95,6 @@ _cursesi_setterm(char *type, SCREEN *screen)
screen->LINES = t_lines(screen->term);
screen->COLS = t_columns(screen->term);
}
}
/* POSIX 1003.2 requires that the environment override. */
@@ -105,7 +104,12 @@ _cursesi_setterm(char *type, SCREEN *screen)
screen->COLS = (int) strtol(p, NULL, 0);
if ((p = getenv("ESCDELAY")) != NULL)
ESCDELAY = (int) strtol(p, NULL, 0);
if ((p = getenv("TABSIZE")) != NULL)
screen->TABSIZE = (int) strtol(p, NULL, 0);
else if (t_init_tabs(screen->term) >= 0)
screen->TABSIZE = (int) t_init_tabs(screen->term);
else
screen->TABSIZE = 8;
/*
* Want cols > 4, otherwise things will fail.
*/
@@ -114,10 +118,12 @@ _cursesi_setterm(char *type, SCREEN *screen)
LINES = screen->LINES;
COLS = screen->COLS;
TABSIZE = screen->TABSIZE;
#ifdef DEBUG
__CTRACE(__CTRACE_INIT, "setterm: LINES = %d, COLS = %d\n",
LINES, COLS);
__CTRACE(__CTRACE_INIT,
"setterm: LINES = %d, COLS = %d\n, TABSIZE = %d\n",
LINES, COLS, TABSIZE);
#endif
/*
@@ -172,7 +178,9 @@ _cursesi_setterm(char *type, SCREEN *screen)
* It might turn off ACS, so check for that.
*/
if (t_exit_attribute_mode(screen->term) != NULL &&
does_ctrl_o(t_exit_attribute_mode(screen->term)))
t_exit_alt_charset_mode(screen->term) != NULL &&
does_ctrl_o(t_exit_attribute_mode(screen->term),
t_exit_alt_charset_mode(screen->term)))
screen->mask_me = 0;
else
screen->mask_me = __ALTCHARSET;
@@ -241,6 +249,7 @@ _cursesi_resetterm(SCREEN *screen)
LINES = screen->LINES;
COLS = screen->COLS;
TABSIZE = screen->TABSIZE;
__GT = screen->GT;
__noqch = screen->noqch;
@@ -330,20 +339,22 @@ does_esc_m(const char *cap)
/*
* does_ctrl_o --
* A hack for vt100/xterm-like terminals where the "me" capability also
* unsets acs (i.e. it contains the character '\017').
* unsets acs.
*/
static int
does_ctrl_o(const char *cap)
does_ctrl_o(const char *exit_cap, const char *acs_cap)
{
const char *capptr = cap;
const char *eptr = exit_cap, *aptr = acs_cap;
int l;
#ifdef DEBUG
__CTRACE(__CTRACE_INIT, "does_ctrl_o: Looping on %s\n", capptr);
__CTRACE(__CTRACE_INIT, "does_ctrl_o: Testing %s for %s\n", eptr, aptr);
#endif
while (*capptr != 0) {
if (*capptr == '\x0f')
l = strlen(acs_cap);
while (*eptr != 0) {
if (!strncmp(eptr, aptr, l))
return 1;
capptr++;
eptr++;
}
return 0;
}
+1 -1
View File
@@ -4,5 +4,5 @@
# Remember to increment the major numbers of both libform and libmenu
# when the libcurses major number increments.
#
major=0
major=7
minor=0
+4 -4
View File
@@ -1,4 +1,4 @@
/* $NetBSD: tstp.c,v 1.39 2011/08/29 11:07:38 christos Exp $ */
/* $NetBSD: tstp.c,v 1.40 2013/10/15 13:00:52 christos Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)tstp.c 8.3 (Berkeley) 5/4/94";
#else
__RCSID("$NetBSD: tstp.c,v 1.39 2011/08/29 11:07:38 christos Exp $");
__RCSID("$NetBSD: tstp.c,v 1.40 2013/10/15 13:00:52 christos Exp $");
#endif
#endif /* not lint */
@@ -234,8 +234,8 @@ __stopwin(void)
(int) curscr->maxy - 1, 0, 0);
}
if (meta_off != NULL)
(void) tputs(meta_off, 0, __cputchar);
if (meta_on != NULL)
(void) tputs(meta_on, 0, __cputchar);
if ((curscr != NULL) && (curscr->flags & __KEYPAD))
(void) tputs(keypad_local, 0, __cputchar);