summaryrefslogtreecommitdiff
path: root/lib/libcurses
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2000-07-24 04:06:13 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2000-07-24 04:06:13 +0000
commit87d5e312fa223e222019a8e0a52d3c51a9db8c11 (patch)
tree3912458699fe4c774c062490d9cc7f478f2a6553 /lib/libcurses
parent87ec33b1645ce0df4e10ca488963124aae5d6aba (diff)
Update to ncurses-5.1-20000722
Diffstat (limited to 'lib/libcurses')
-rw-r--r--lib/libcurses/Makefile9
-rw-r--r--lib/libcurses/base/lib_newterm.c16
-rw-r--r--lib/libcurses/curs_color.36
-rw-r--r--lib/libcurses/curs_extend.36
-rw-r--r--lib/libcurses/curs_scanw.314
-rw-r--r--lib/libcurses/curses.3tbl8
-rw-r--r--lib/libcurses/curses.h4
-rw-r--r--lib/libcurses/default_colors.3 (renamed from lib/libcurses/dft_fgbg.3)10
-rw-r--r--lib/libcurses/tinfo/lib_tputs.c20
-rw-r--r--lib/libcurses/trace/lib_tracebits.c63
-rw-r--r--lib/libcurses/tty/tty_update.c25
11 files changed, 98 insertions, 83 deletions
diff --git a/lib/libcurses/Makefile b/lib/libcurses/Makefile
index f94571ebf71..0cd9a9051ce 100644
--- a/lib/libcurses/Makefile
+++ b/lib/libcurses/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.45 2000/07/10 03:06:03 millert Exp $
+# $OpenBSD: Makefile,v 1.46 2000/07/24 04:06:09 millert Exp $
# Uncomment this to enable tracing in libcurses
#CURSESTRACE=-DTRACE
@@ -59,7 +59,7 @@ MAN= curs_addch.3 curs_addchstr.3 curs_addstr.3 curs_attr.3 curs_beep.3 \
curs_outopts.3 curs_overlay.3 curs_pad.3 curs_print.3 curs_printw.3 \
curs_refresh.3 curs_scanw.3 curs_scr_dump.3 curs_scroll.3 curs_slk.3 \
curs_termattrs.3 curs_touch.3 curs_util.3 curs_window.3 \
- curses.3 define_key.3 dft_fgbg.3 keybound.3 keyok.3 resizeterm.3 \
+ curses.3 define_key.3 default_colors.3 keybound.3 keyok.3 resizeterm.3 \
wresize.3 termcap.3 terminfo.3 terminfo.5 term.5 term.7
MLINKS+=curses.3 ncurses.3
MLINKS+=curs_addch.3 addch.3 curs_addch.3 waddch.3 curs_addch.3 mvaddch.3 \
@@ -168,9 +168,10 @@ MLINKS+=curs_addch.3 addch.3 curs_addch.3 waddch.3 curs_addch.3 mvaddch.3 \
mvwin.3 curs_window.3 subwin.3 curs_window.3 derwin.3 curs_window.3 \
mvderwin.3 curs_window.3 dupwin.3 curs_window.3 wsyncup.3 \
curs_window.3 syncok.3 curs_window.3 wcursyncup.3 curs_window.3 \
- wsyncdown.3 dft_fgbg.3 use_default_colors.3
+ wsyncdown.3 default_colors.3 use_default_colors.3
MLINKS+=curs_extend.3 curses_version.3 curs_extend.3 use_extended_names.3 \
- dft_fgbg.3 assume_default_colors.3 dft_fgbg.3 use_default_colors.3
+ default_colors.3 assume_default_colors.3 default_colors.3 \
+ use_default_colors.3
MLINKS+= terminfo.3 setupterm.3 terminfo.3 setterm.3 terminfo.3 set_curterm.3 \
terminfo.3 del_curterm.3 terminfo.3 restartterm.3 terminfo.3 tparm.3 \
terminfo.3 tparam.3 terminfo.3 tputs.3 terminfo.3 putp.3 \
diff --git a/lib/libcurses/base/lib_newterm.c b/lib/libcurses/base/lib_newterm.c
index 23a5d3d892d..6e01e19a271 100644
--- a/lib/libcurses/base/lib_newterm.c
+++ b/lib/libcurses/base/lib_newterm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_newterm.c,v 1.9 2000/07/10 03:06:15 millert Exp $ */
+/* $OpenBSD: lib_newterm.c,v 1.10 2000/07/24 04:06:10 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -49,7 +49,7 @@
#include <term.h> /* clear_screen, cup & friends, cur_term */
#include <tic.h>
-MODULE_ID("$From: lib_newterm.c,v 1.46 2000/07/01 22:26:22 tom Exp $")
+MODULE_ID("$From: lib_newterm.c,v 1.47 2000/07/22 22:33:34 Bruno.Haible Exp $")
#ifndef ONLCR /* Allows compilation under the QNX 4.2 OS */
#define ONLCR 0
@@ -200,10 +200,14 @@ newterm(NCURSES_CONST char *name, FILE * ofp, FILE * ifp)
*/
{
char *s;
- if (((s = getenv("LC_ALL")) != 0
- || (s = getenv("LC_CTYPE")) != 0
- || (s = getenv("LANG")) != 0)
- && strstr(s, "UTF-8") != 0) {
+ s = getenv("LC_ALL");
+ if (s == NULL || *s == '\0') {
+ s = getenv("LC_CTYPE");
+ if (s == NULL || *s == '\0') {
+ s = getenv("LANG");
+ }
+ }
+ if (s != NULL && *s != '\0' && strstr(s, "UTF-8") != NULL) {
SP->_outch = _nc_utf8_outch;
}
}
diff --git a/lib/libcurses/curs_color.3 b/lib/libcurses/curs_color.3
index 95fa9a3ee70..db447938918 100644
--- a/lib/libcurses/curs_color.3
+++ b/lib/libcurses/curs_color.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: curs_color.3,v 1.8 2000/07/10 03:06:05 millert Exp $
+.\" $OpenBSD: curs_color.3,v 1.9 2000/07/24 04:06:09 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. *
@@ -28,7 +28,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: curs_color.3x,v 1.15 2000/07/08 11:59:51 tom Exp $
+.\" $From: curs_color.3x,v 1.16 2000/07/15 22:57:03 tom Exp $
.TH curs_color 3 ""
.SH NAME
\fBstart_color\fR,
@@ -209,7 +209,7 @@ background color for all terminals can be modified using the
\fBcurses\fR(3),
\fBcurs_initscr\fR(3),
\fBcurs_attr\fR(3),
-\fBdft_fgbg\fR(3)
+\fBdefault_colors\fR(3)
.\"#
.\"# The following sets edit modes for GNU EMACS
.\"# Local Variables:
diff --git a/lib/libcurses/curs_extend.3 b/lib/libcurses/curs_extend.3
index 722f362b4da..bff0d730d1e 100644
--- a/lib/libcurses/curs_extend.3
+++ b/lib/libcurses/curs_extend.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: curs_extend.3,v 1.2 2000/07/10 03:06:06 millert Exp $
+.\" $OpenBSD: curs_extend.3,v 1.3 2000/07/24 04:06:09 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1999,2000 Free Software Foundation, Inc. *
@@ -30,7 +30,7 @@
.\"
.\" Author: Thomas E. Dickey <dickey@clark.net> 1999
.\"
-.\" $From: curs_extend.3x,v 1.4 2000/07/01 16:43:11 tom Exp $
+.\" $From: curs_extend.3x,v 1.6 2000/07/15 22:57:20 tom Exp $
.TH curs_extend 3 ""
.SH NAME
\fBcurs_extend\fR,
@@ -74,8 +74,8 @@ any code depending on them be conditioned using NCURSES_VERSION.
\fBcurs_getch\fR(3),
\fBcurs_mouse\fR(3),
\fBcurs_print\fR(3),
+\fBdefault_colors\fR(3),
\fBdefine_key\fR(3),
-\fBdft_fgbg\fR(3),
\fBkeybound\fR(3),
\fBkeyok\fR(3),
\fBresizeterm\fR(3),
diff --git a/lib/libcurses/curs_scanw.3 b/lib/libcurses/curs_scanw.3
index 0c4cbd9c01c..2fdaf089635 100644
--- a/lib/libcurses/curs_scanw.3
+++ b/lib/libcurses/curs_scanw.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: curs_scanw.3,v 1.8 2000/07/10 03:06:08 millert Exp $
+.\" $OpenBSD: curs_scanw.3,v 1.9 2000/07/24 04:06:09 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998,2000 Free Software Foundation, Inc. *
@@ -28,14 +28,14 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: curs_scanw.3x,v 1.10 2000/07/01 20:06:29 tom Exp $
+.\" $From: curs_scanw.3x,v 1.11 2000/07/15 21:48:17 tom Exp $
.TH curs_scanw 3 ""
.SH NAME
-+ \fBscanw\fR,
-+ \fBwscanw\fR,
-+ \fBmvscanw\fR,
-+ \fBmvwscanw\fR,
-+ \fBvwscanw\fR, \fBvw_scanw\fR - convert formatted input from a \fBcurses\fR window
+\fBscanw\fR,
+\fBwscanw\fR,
+\fBmvscanw\fR,
+\fBmvwscanw\fR,
+\fBvwscanw\fR, \fBvw_scanw\fR - convert formatted input from a \fBcurses\fR window
.SH SYNOPSIS
\fB#include <curses.h>\fR
diff --git a/lib/libcurses/curses.3tbl b/lib/libcurses/curses.3tbl
index a69033b1f09..f906acf45f8 100644
--- a/lib/libcurses/curses.3tbl
+++ b/lib/libcurses/curses.3tbl
@@ -1,5 +1,5 @@
'\" t
-.\" $OpenBSD: curses.3tbl,v 1.14 2000/07/10 03:06:10 millert Exp $
+.\" $OpenBSD: curses.3tbl,v 1.15 2000/07/24 04:06:09 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998,1999 Free Software Foundation, Inc. *
@@ -29,7 +29,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $From: ncurses.3x,v 1.40 2000/07/08 13:10:31 tom Exp $
+.\" $From: ncurses.3x,v 1.41 2000/07/15 22:04:13 tom Exp $
.TH ncurses 3 ""
.ds n 5
.ds d /usr/share/terminfo
@@ -200,7 +200,7 @@ addch/\fBcurs_addch\fR(3)
addchnstr/\fBcurs_addchstr\fR(3)
addchstr/\fBcurs_addchstr\fR(3)
addnstr/\fBcurs_addstr\fR(3)
-assume_default_colors/\fBdft_fgbg\fR(3)*
+assume_default_colors/\fBdefault_colors\fR(3)*
attr_get/\fBcurs_attr\fR(3)
attr_off/\fBcurs_attr\fR(3)
attr_on/\fBcurs_attr\fR(3)
@@ -433,7 +433,7 @@ unctrl/\fBcurs_util\fR(3)
ungetch/\fBcurs_getch\fR(3)
ungetmouse/\fBcurs_mouse\fR(3)*
untouchwin/\fBcurs_touch\fR(3)
-use_default_colors/\fBdft_fgbg\fR(3)*
+use_default_colors/\fBdefault_colors\fR(3)*
use_env/\fBcurs_util\fR(3)
use_extended_names/\fBcurs_extend\fR(3)*
vidattr/\fBterminfo\fR(3)
diff --git a/lib/libcurses/curses.h b/lib/libcurses/curses.h
index ca6fb556e25..3fc791092ac 100644
--- a/lib/libcurses/curses.h
+++ b/lib/libcurses/curses.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: curses.h,v 1.52 2000/07/10 03:06:10 millert Exp $ */
+/* $OpenBSD: curses.h,v 1.53 2000/07/24 04:06:09 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -50,7 +50,7 @@
/* These are defined only in curses.h, and are used for conditional compiles */
#define NCURSES_VERSION_MAJOR 5
#define NCURSES_VERSION_MINOR 1
-#define NCURSES_VERSION_PATCH 20000708
+#define NCURSES_VERSION_PATCH 20000722
/* This is defined in more than one ncurses header, for identification */
#undef NCURSES_VERSION
diff --git a/lib/libcurses/dft_fgbg.3 b/lib/libcurses/default_colors.3
index c01f4a1a078..16e224d2c4c 100644
--- a/lib/libcurses/dft_fgbg.3
+++ b/lib/libcurses/default_colors.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: dft_fgbg.3,v 1.6 2000/07/10 03:06:11 millert Exp $
+.\" $OpenBSD: default_colors.3,v 1.1 2000/07/24 04:06:10 millert Exp $
.\"
.\"***************************************************************************
.\" Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -28,12 +28,12 @@
.\" authorization. *
.\"***************************************************************************
.\"
-.\" Author: Thomas E. Dickey <dickey@clark.net> 1997,1999
+.\" Author: Thomas E. Dickey <dickey@clark.net> 1997,1999,2000
.\"
-.\" $From: dft_fgbg.3x,v 1.12 2000/07/04 22:31:56 tom Exp $
-.TH dft_fgbg 3 ""
+.\" $From: default_colors.3x,v 1.13 2000/07/15 22:06:50 tom Exp $
+.TH default_colors 3 ""
.SH NAME
-\fBdft_fgbg\fR,
+\fBdefault_colors\fR,
\fBuse_default_colors\fR,
\fBassume_default_colors\fR \- use terminal's default colors
..
diff --git a/lib/libcurses/tinfo/lib_tputs.c b/lib/libcurses/tinfo/lib_tputs.c
index 4a5aa118864..11b13bac863 100644
--- a/lib/libcurses/tinfo/lib_tputs.c
+++ b/lib/libcurses/tinfo/lib_tputs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_tputs.c,v 1.6 2000/06/19 03:53:50 millert Exp $ */
+/* $OpenBSD: lib_tputs.c,v 1.7 2000/07/24 04:06:10 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -47,7 +47,7 @@
#include <termcap.h> /* ospeed */
#include <tic.h>
-MODULE_ID("$From: lib_tputs.c,v 1.47 2000/05/27 23:08:41 tom Exp $")
+MODULE_ID("$From: lib_tputs.c,v 1.48 2000/07/22 22:33:23 Bruno.Haible Exp $")
char PC = 0; /* used by termcap library */
speed_t ospeed = 0; /* used by termcap library */
@@ -80,7 +80,7 @@ delay_output(int ms)
void
_nc_flush(void)
{
- (void)fflush(NC_OUTPUT);
+ (void) fflush(NC_OUTPUT);
}
int
@@ -122,20 +122,20 @@ _nc_utf8_outch(int ch)
int result[7], *ptr;
int count = 0;
- if (ch < 0x80)
+ if ((unsigned int) ch < 0x80)
count = 1;
- else if (ch < 0x800)
+ else if ((unsigned int) ch < 0x800)
count = 2;
- else if (ch < 0x10000)
+ else if ((unsigned int) ch < 0x10000)
count = 3;
- else if (ch < 0x200000)
+ else if ((unsigned int) ch < 0x200000)
count = 4;
- else if (ch < 0x4000000)
+ else if ((unsigned int) ch < 0x4000000)
count = 5;
- else if (ch <= 0x7FFFFFFF)
+ else if ((unsigned int) ch <= 0x7FFFFFFF)
count = 6;
else {
- count = 2;
+ count = 3;
ch = 0xFFFD;
}
ptr = result + count;
diff --git a/lib/libcurses/trace/lib_tracebits.c b/lib/libcurses/trace/lib_tracebits.c
index fe933b0ad71..2460c4d8b95 100644
--- a/lib/libcurses/trace/lib_tracebits.c
+++ b/lib/libcurses/trace/lib_tracebits.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_tracebits.c,v 1.5 2000/03/10 01:35:05 millert Exp $ */
+/* $OpenBSD: lib_tracebits.c,v 1.6 2000/07/24 04:06:11 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -36,7 +36,7 @@
#include <curses.priv.h>
#include <term.h> /* cur_term */
-MODULE_ID("$From: lib_tracebits.c,v 1.5 2000/02/13 01:01:55 tom Exp $")
+MODULE_ID("$From: lib_tracebits.c,v 1.6 2000/07/23 00:22:32 tom Exp $")
#if defined(SVR4_TERMIO) && !defined(_POSIX_SOURCE)
#define _POSIX_SOURCE
@@ -155,30 +155,41 @@ _nc_tracebits(void)
lookup_bits(buf, cflags, "cflags", cur_term->Nttyb.c_cflag);
#if defined(CS5) && defined(CS8)
- switch (cur_term->Nttyb.c_cflag & CSIZE) {
-#if defined(CS5) && (CS5 != 0)
- case CS5:
- strcat(buf, "CS5 ");
- break;
-#endif
-#if defined(CS6) && (CS6 != 0)
- case CS6:
- strcat(buf, "CS6 ");
- break;
-#endif
-#if defined(CS7) && (CS7 != 0)
- case CS7:
- strcat(buf, "CS7 ");
- break;
-#endif
-#if defined(CS8) && (CS8 != 0)
- case CS8:
- strcat(buf, "CS8 ");
- break;
-#endif
- default:
- strcat(buf, "CSIZE? ");
- break;
+ {
+ static struct {
+ char *name;
+ int value;
+ } csizes[] = {
+ {
+ "CS5 ", CS5
+ },
+#ifdef CS6
+ {
+ "CS6 ", CS6
+ },
+#endif
+#ifdef CS7
+ {
+ "CS7 ", CS7
+ },
+#endif
+ {
+ "CS8 ", CS8
+ },
+ };
+ char *result = "CSIZE? ";
+ int value = (cur_term->Nttyb.c_cflag & CSIZE);
+ unsigned n;
+
+ if (value != 0) {
+ for (n = 0; n < SIZEOF(csizes); n++) {
+ if (csizes[n].value == value) {
+ result = csizes[n].name;
+ break;
+ }
+ }
+ }
+ strcat(buf, result);
}
#endif
diff --git a/lib/libcurses/tty/tty_update.c b/lib/libcurses/tty/tty_update.c
index 7127732c103..dfb983a61cc 100644
--- a/lib/libcurses/tty/tty_update.c
+++ b/lib/libcurses/tty/tty_update.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_update.c,v 1.10 2000/07/10 03:06:17 millert Exp $ */
+/* $OpenBSD: tty_update.c,v 1.11 2000/07/24 04:06:11 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -72,7 +72,7 @@
#include <term.h>
-MODULE_ID("$From: tty_update.c,v 1.141 2000/07/04 21:01:40 tom Exp $")
+MODULE_ID("$From: tty_update.c,v 1.142 2000/07/23 01:41:17 tom Exp $")
/*
* This define controls the line-breakout optimization. Every once in a
@@ -858,14 +858,15 @@ ClrToEOL(chtype blank, bool needclear)
int j;
if (curscr != 0
- && SP->_cursrow >= 0
- && SP->_curscol >= 0) {
+ && SP->_cursrow >= 0) {
for (j = SP->_curscol; j < screen_columns; j++) {
- chtype *cp = &(curscr->_line[SP->_cursrow].text[j]);
+ if (j >= 0) {
+ chtype *cp = &(curscr->_line[SP->_cursrow].text[j]);
- if (*cp != blank) {
- *cp = blank;
- needclear = TRUE;
+ if (*cp != blank) {
+ *cp = blank;
+ needclear = TRUE;
+ }
}
}
} else {
@@ -899,11 +900,9 @@ ClrToEOS(chtype blank)
row = SP->_cursrow;
col = SP->_curscol;
- {
- UpdateAttrs(blank);
- TPUTS_TRACE("clr_eos");
- tputs(clr_eos, screen_lines - row, _nc_outch);
- }
+ UpdateAttrs(blank);
+ TPUTS_TRACE("clr_eos");
+ tputs(clr_eos, screen_lines - row, _nc_outch);
while (col < screen_columns)
curscr->_line[row].text[col++] = blank;