aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ncurses/NEWS37
-rwxr-xr-xcontrib/ncurses/configure52
-rw-r--r--contrib/ncurses/configure.in28
-rw-r--r--contrib/ncurses/dist.mk4
-rwxr-xr-xcontrib/ncurses/include/MKkey_defs.sh9
-rw-r--r--contrib/ncurses/include/curses.h.in6
-rw-r--r--contrib/ncurses/include/tic.h3
-rw-r--r--contrib/ncurses/menu/m_global.c6
-rw-r--r--contrib/ncurses/misc/terminfo.src138
-rw-r--r--contrib/ncurses/ncurses/base/MKkeyname.awk10
-rw-r--r--contrib/ncurses/ncurses/base/lib_getch.c4
-rw-r--r--contrib/ncurses/ncurses/base/lib_pad.c35
-rw-r--r--contrib/ncurses/ncurses/base/lib_set_term.c22
-rw-r--r--contrib/ncurses/ncurses/curses.priv.h4
-rw-r--r--contrib/ncurses/ncurses/tinfo/lib_termcap.c6
-rw-r--r--contrib/ncurses/ncurses/tinfo/lib_ttyflags.c8
-rw-r--r--contrib/ncurses/ncurses/tinfo/parse_entry.c4
-rw-r--r--contrib/ncurses/ncurses/trace/lib_traceatr.c63
-rw-r--r--contrib/ncurses/ncurses/trace/lib_tracebits.c34
-rw-r--r--contrib/ncurses/ncurses/trace/lib_tracechr.c10
-rw-r--r--contrib/ncurses/ncurses/trace/varargs.c7
-rw-r--r--contrib/ncurses/progs/dump_entry.c173
-rw-r--r--contrib/ncurses/progs/tic.c77
-rw-r--r--contrib/ncurses/test/ncurses.c157
-rw-r--r--contrib/ncurses/test/testcurs.c6
25 files changed, 643 insertions, 260 deletions
diff --git a/contrib/ncurses/NEWS b/contrib/ncurses/NEWS
index 5b564bfd8261..961934890e45 100644
--- a/contrib/ncurses/NEWS
+++ b/contrib/ncurses/NEWS
@@ -1,4 +1,4 @@
--- $Id: NEWS,v 1.686 2002/05/18 21:26:10 tom Exp $
+-- $Id: NEWS,v 1.690 2002/06/16 00:31:21 tom Exp $
This is a log of changes that ncurses has gone through since Zeyd started
working with Pavel Curtis' original work, pcurses, in 1992.
@@ -6,6 +6,41 @@ working with Pavel Curtis' original work, pcurses, in 1992.
Changes through 1.9.9e are recorded by Zeyd M. Ben-Halim.
Changes since 1.9.9e are recorded by Thomas Dickey.
+20020615
+ + modify wgetch() to allow returning ungetch'd KEY_RESIZE as a function
+ key code in get_wch().
+ + extended resize-handling in test/ncurses 'a' menu to the entire
+ stack of windows created with 'w' commands.
+ + improve $COLORFGBG feature by interpreting an out-of-range color
+ value as an SGR 39 or 49, for foreground/background respectively.
+ + correct a typo in configure --enable-colorfgbg option, and move it
+ to the experimental section (cf: 20011208).
+
+20020601
+ + add logic to dump_entry.c to remove function-key definitions that do
+ not fit into the 1023-byte limit for generated termcaps. This makes
+ hds200 fit.
+ + more improvements to tic's warnings, including logic to ignore
+ differences between delay values in sgr strings.
+ + move definition of KEY_RESIZE into MKkeydefs.sh script, to
+ accommodate Caps.osf1r5 which introduced a conflicting definition.
+
+20020525
+ + add simple resize-handling in test/ncurses.c 'a' menu.
+ + fixes in keyname() and _tracechar() to handle negative values.
+ + make tic's warnings about mismatches in sgr strings easier to follow.
+ + correct tic checks for number of parameters in smgbp and smglp.
+ + improve scoansi terminfo entry, and add scoansi-new entry -TD
+ + add pcvt25-color terminfo entry -TD
+ + add kf13-kf48 strings to cons25w terminfo entry (reported by Stephen
+ Hurd <deuce@lordlegacy.org> in newsgroup lucky.freebsd.bugs) -TD
+ + add entrypoint _nc_trace_ttymode(), use this to distinguish the
+ Ottyb and Nttyb members of terminal (aka cur_term), for tracing.
+
+20020523
+ + correct and simplify logic for lib_pad.c change in 20020518 (reported
+ by Mike Castle).
+
20020518
+ fix lib_pad.c for case of drawing a double-width character which
falls off the left margin of the pad (patch by Kriang Lerdsuwanakij
diff --git a/contrib/ncurses/configure b/contrib/ncurses/configure
index 59cd6095e1ec..e3a6bccbbc5d 100755
--- a/contrib/ncurses/configure
+++ b/contrib/ncurses/configure
@@ -1,6 +1,6 @@
#! /bin/sh
-# From configure.in Revision: 1.267
+# From configure.in Revision: 1.268
@@ -251,15 +251,15 @@ cat <<EOF
--enable-tcap-names compile with user-definable terminal capabilities
Development Code:
--with-develop enable all development options
- --enable-colorfgbg compile with \$COLORFGBG code
--enable-hard-tabs compile with hard-tabs code
--disable-root-environ limit environment when running as root
--enable-xmc-glitch compile with limited support for xmc
Experimental Code:
--disable-assumed-color do not assume anything about default-colors
+ --disable-hashmap compile without hashmap scrolling-optimization
EOF
cat <<EOF
- --disable-hashmap compile without hashmap scrolling-optimization
+ --enable-colorfgbg compile with \$COLORFGBG code
--enable-safe-sprintf compile with experimental safe-sprintf code
--disable-scroll-hints compile without scroll-hints code
--enable-widec compile with experimental wide-char/UTF-8 code
@@ -4165,27 +4165,9 @@ fi
echo "$ac_t""$with_develop" 1>&6
-### use option --enable-colorfgbg to turn on use of $COLORFGBG environment
-echo $ac_n "checking if you want colorfgbg code""... $ac_c" 1>&6
-echo "configure:4171: checking if you want colorfgbg code" >&5
-
-# Check whether --enable-enable-colorfgbg or --disable-enable-colorfgbg was given.
-if test "${enable_enable_colorfgbg+set}" = set; then
- enableval="$enable_enable_colorfgbg"
- with_colorfgbg=$enableval
-else
- with_colorfgbg=$with_develop
-fi
-
-echo "$ac_t""$with_colorfgbg" 1>&6
-test "$with_colorfgbg" = yes && cat >> confdefs.h <<\EOF
-#define USE_COLORFGBG 1
-EOF
-
-
### use option --enable-hard-tabs to turn on use of hard-tabs optimize
echo $ac_n "checking if you want hard-tabs code""... $ac_c" 1>&6
-echo "configure:4189: checking if you want hard-tabs code" >&5
+echo "configure:4171: checking if you want hard-tabs code" >&5
# Check whether --enable-hard-tabs or --disable-hard-tabs was given.
if test "${enable_hard_tabs+set}" = set; then
@@ -4202,7 +4184,7 @@ EOF
echo $ac_n "checking if you want to use restrict environment when running as root""... $ac_c" 1>&6
-echo "configure:4206: checking if you want to use restrict environment when running as root" >&5
+echo "configure:4188: checking if you want to use restrict environment when running as root" >&5
# Check whether --enable-root-environ or --disable-root-environ was given.
if test "${enable_root_environ+set}" = set; then
@@ -4220,7 +4202,7 @@ EOF
### use option --enable-xmc-glitch to turn on use of magic-cookie optimize
echo $ac_n "checking if you want limited support for xmc""... $ac_c" 1>&6
-echo "configure:4224: checking if you want limited support for xmc" >&5
+echo "configure:4206: checking if you want limited support for xmc" >&5
# Check whether --enable-xmc-glitch or --disable-xmc-glitch was given.
if test "${enable_xmc_glitch+set}" = set; then
@@ -4241,7 +4223,7 @@ EOF
echo $ac_n "checking if you do not want to assume colors are white-on-black""... $ac_c" 1>&6
-echo "configure:4245: checking if you do not want to assume colors are white-on-black" >&5
+echo "configure:4227: checking if you do not want to assume colors are white-on-black" >&5
# Check whether --enable-assumed-color or --disable-assumed-color was given.
if test "${enable_assumed_color+set}" = set; then
@@ -4259,7 +4241,7 @@ EOF
### use option --enable-hashmap to turn on use of hashmap scrolling logic
echo $ac_n "checking if you want hashmap scrolling-optimization code""... $ac_c" 1>&6
-echo "configure:4263: checking if you want hashmap scrolling-optimization code" >&5
+echo "configure:4245: checking if you want hashmap scrolling-optimization code" >&5
# Check whether --enable-hashmap or --disable-hashmap was given.
if test "${enable_hashmap+set}" = set; then
@@ -4275,6 +4257,24 @@ test "$with_hashmap" = yes && cat >> confdefs.h <<\EOF
EOF
+### use option --enable-colorfgbg to turn on use of $COLORFGBG environment
+echo $ac_n "checking if you want colorfgbg code""... $ac_c" 1>&6
+echo "configure:4263: checking if you want colorfgbg code" >&5
+
+# Check whether --enable-colorfgbg or --disable-colorfgbg was given.
+if test "${enable_colorfgbg+set}" = set; then
+ enableval="$enable_colorfgbg"
+ with_colorfgbg=$enableval
+else
+ with_colorfgbg=no
+fi
+
+echo "$ac_t""$with_colorfgbg" 1>&6
+test "$with_colorfgbg" = yes && cat >> confdefs.h <<\EOF
+#define USE_COLORFGBG 1
+EOF
+
+
echo $ac_n "checking if you want experimental safe-sprintf code""... $ac_c" 1>&6
echo "configure:4280: checking if you want experimental safe-sprintf code" >&5
diff --git a/contrib/ncurses/configure.in b/contrib/ncurses/configure.in
index b7beda60e814..93a6d0091e16 100644
--- a/contrib/ncurses/configure.in
+++ b/contrib/ncurses/configure.in
@@ -1,5 +1,5 @@
dnl***************************************************************************
-dnl Copyright (c) 1998,1999,2000,2001,2002 Free Software Foundation, Inc. *
+dnl Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. *
dnl *
dnl Permission is hereby granted, free of charge, to any person obtaining a *
dnl copy of this software and associated documentation files (the *
@@ -26,16 +26,16 @@ dnl sale, use or other dealings in this Software without prior written *
dnl authorization. *
dnl***************************************************************************
dnl
-dnl Author: Thomas E. Dickey <dickey@clark.net> 1996,1997
+dnl Author: Thomas E. Dickey 1995-on
dnl
-dnl $Id: configure.in,v 1.267 2002/05/18 21:14:13 tom Exp $
+dnl $Id: configure.in,v 1.268 2002/06/15 17:40:45 tom Exp $
dnl Process this file with autoconf to produce a configure script.
dnl
dnl See http://dickey.his.com/autoconf/ for additional information.
dnl
dnl ---------------------------------------------------------------------------
-AC_PREREQ(2.13.20000819)
-AC_REVISION($Revision: 1.267 $)
+AC_PREREQ(2.13.20020210)
+AC_REVISION($Revision: 1.268 $)
AC_INIT(ncurses/base/lib_initscr.c)
AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
@@ -723,15 +723,6 @@ AC_ARG_WITH(develop,
[with_develop=no])
AC_MSG_RESULT($with_develop)
-### use option --enable-colorfgbg to turn on use of $COLORFGBG environment
-AC_MSG_CHECKING(if you want colorfgbg code)
-AC_ARG_ENABLE(enable-colorfgbg,
- [ --enable-colorfgbg compile with \$COLORFGBG code],
- [with_colorfgbg=$enableval],
- [with_colorfgbg=$with_develop])
-AC_MSG_RESULT($with_colorfgbg)
-test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG)
-
### use option --enable-hard-tabs to turn on use of hard-tabs optimize
AC_MSG_CHECKING(if you want hard-tabs code)
AC_ARG_ENABLE(hard-tabs,
@@ -779,6 +770,15 @@ AC_ARG_ENABLE(hashmap,
AC_MSG_RESULT($with_hashmap)
test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP)
+### use option --enable-colorfgbg to turn on use of $COLORFGBG environment
+AC_MSG_CHECKING(if you want colorfgbg code)
+AC_ARG_ENABLE(colorfgbg,
+ [ --enable-colorfgbg compile with \$COLORFGBG code],
+ [with_colorfgbg=$enableval],
+ [with_colorfgbg=no])
+AC_MSG_RESULT($with_colorfgbg)
+test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG)
+
AC_MSG_CHECKING(if you want experimental safe-sprintf code)
AC_ARG_ENABLE(safe-sprintf,
[ --enable-safe-sprintf compile with experimental safe-sprintf code],
diff --git a/contrib/ncurses/dist.mk b/contrib/ncurses/dist.mk
index b432b41e2ca6..9d7a905e901d 100644
--- a/contrib/ncurses/dist.mk
+++ b/contrib/ncurses/dist.mk
@@ -1,4 +1,4 @@
-# $Id: dist.mk,v 1.303 2002/05/18 19:18:04 tom Exp $
+# $Id: dist.mk,v 1.306 2002/06/15 17:13:40 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
@@ -10,7 +10,7 @@ SHELL = /bin/sh
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 2
-NCURSES_PATCH = 20020518
+NCURSES_PATCH = 20020615
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
diff --git a/contrib/ncurses/include/MKkey_defs.sh b/contrib/ncurses/include/MKkey_defs.sh
index 68f33466bb80..ab43b09f4845 100755
--- a/contrib/ncurses/include/MKkey_defs.sh
+++ b/contrib/ncurses/include/MKkey_defs.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# $Id: MKkey_defs.sh,v 1.7 2002/01/13 01:36:32 tom Exp $
+# $Id: MKkey_defs.sh,v 1.8 2002/06/01 17:24:28 tom Exp $
##############################################################################
# Copyright (c) 2001,2002 Free Software Foundation, Inc. #
# #
@@ -44,6 +44,9 @@ pass3=pass3_$$
pass4=pass4_$$
trap 'rm -f $data pass[1234]_$$' 0 1 2 5 15
sed -e 's/[ ]\+/ /g' < $DATA |sort -n +5 >$data
+cat >>$data <<EOF
+key_resize kr1 str R1 KEY_RESIZE + ----- Terminal resize event
+EOF
cat <<EOF
/*
@@ -51,8 +54,8 @@ cat <<EOF
*/
EOF
-# KEY_RESIZE
-maxkey=410
+# KEY_RESET
+maxkey=345
for pass in 1 2 3 4
do
diff --git a/contrib/ncurses/include/curses.h.in b/contrib/ncurses/include/curses.h.in
index 88028cce1431..df6f2a142376 100644
--- a/contrib/ncurses/include/curses.h.in
+++ b/contrib/ncurses/include/curses.h.in
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,1999,2000,2001,2002 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2001,2002 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 *
@@ -29,9 +29,10 @@
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996-on *
****************************************************************************/
-/* $Id: curses.h.in,v 1.128 2002/05/11 21:38:02 tom Exp $ */
+/* $Id: curses.h.in,v 1.129 2002/06/01 17:22:56 tom Exp $ */
#ifndef __NCURSES_H
#define __NCURSES_H
@@ -963,4 +964,3 @@ NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list);
#define KEY_BREAK 0401 /* Break key (unreliable) */
#define KEY_SRESET 0530 /* Soft (partial) reset (unreliable) */
#define KEY_RESET 0531 /* Reset or hard reset (unreliable) */
-#define KEY_RESIZE 0632 /* Terminal resize event */
diff --git a/contrib/ncurses/include/tic.h b/contrib/ncurses/include/tic.h
index c4e7dfd095a5..3a3d8e24c0f2 100644
--- a/contrib/ncurses/include/tic.h
+++ b/contrib/ncurses/include/tic.h
@@ -32,7 +32,7 @@
****************************************************************************/
/*
- * $Id: tic.h,v 1.40 2001/08/12 00:45:57 tom Exp $
+ * $Id: tic.h,v 1.41 2002/06/01 19:07:02 tom Exp $
* tic.h - Global variables and structures for the terminfo
* compiler.
*/
@@ -119,6 +119,7 @@ extern "C" {
extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing;
extern NCURSES_EXPORT(void) _nc_tracef (char *, ...) GCC_PRINTFLIKE(1,2);
extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *);
+extern NCURSES_EXPORT(const char *) _nc_visbuf2 (int, const char *);
/*
* These are the types of tokens returned by the scanner. The first
diff --git a/contrib/ncurses/menu/m_global.c b/contrib/ncurses/menu/m_global.c
index 0100618e423a..927df28d65b0 100644
--- a/contrib/ncurses/menu/m_global.c
+++ b/contrib/ncurses/menu/m_global.c
@@ -37,7 +37,9 @@
#include "menu.priv.h"
-MODULE_ID("$Id: m_global.c,v 1.12 2000/12/10 02:16:48 tom Exp $")
+MODULE_ID("$Id: m_global.c,v 1.13 2002/06/01 16:16:44 tom Exp $")
+
+static char mark[] = "-";
NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = {
16, /* Nr. of chars high */
@@ -73,7 +75,7 @@ NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu = {
(Menu_Hook)0, /* Item init */
(Menu_Hook)0, /* Item term */
(void *)0, /* userptr */
- "-", /* mark */
+ mark, /* mark */
ALL_MENU_OPTS, /* options */
0 /* status */
};
diff --git a/contrib/ncurses/misc/terminfo.src b/contrib/ncurses/misc/terminfo.src
index 2285f6afcfb3..55be8059e904 100644
--- a/contrib/ncurses/misc/terminfo.src
+++ b/contrib/ncurses/misc/terminfo.src
@@ -10,7 +10,7 @@
#
#------------------------------------------------------------------------------
# Version 10.2.1
-# $Date: 2002/01/12 17:31:53 $
+# $Date: 2002/06/15 19:40:34 $
# terminfo syntax
#
# Eric S. Raymond (current maintainer)
@@ -804,8 +804,8 @@ pmcons|pmconsole|PMAX console,
#
# klone+sgr-dumb is an error since the acsc does not match -TD
#
-# In this description based on SCO's keyboard(HW) manpage list of default function key
-# values:
+# In this description based on SCO's keyboard(HW) manpage list of default
+# function key values:
# F13-F24 are shifted F1-F12
# F25-F36 are control F1-F12
# F37-F48 are shift+control F1-F12
@@ -820,33 +820,50 @@ pmcons|pmconsole|PMAX console,
# which do not work (console or scoterm).
#
# Console documents only 3 attributes can be set with SGR (so we don't use sgr).
-scoansi|SCO Extended ANSI standard crt,
+scoansi-old|SCO Extended ANSI standard crt (5.0.5),
OTbs, am, bce, eo, xon,
colors#8, cols#80, it#8, lines#25, pairs#64,
- acsc=0[5566778899\:\:;;<<==>>FFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXX`ja0fxgqh2jYk?lZm@nEqDtCu4vAwBx3~y,
+ acsc=-\230.\231\,.+/0[5566778899\:\:;;<<==>>FFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVVWWXX`\204a0fxgqh2jYk?lZm@nEqDtCu4vAwBx3yszr{c}\034~\207,
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z,
- civis=\E[=14;12C, clear=\E[2J\E[H, cnorm=\E[=10;12C,
- cub1=\E[D, cud1=\E[B, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
- cuu1=\E[A, cvvis=\E[=0;12C, dch1=\E[P, dl=\E[%p1%dM,
- dl1=\E[M, ed=\E[m\E[J, el=\E[m\E[K, home=\E[H, ht=^I,
- ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=\E[S,
- indn=\E[%p1%dS, invis=\E[8m, kbeg=\E[E, kbs=^H, kcbt=\E[Z,
- kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kdch1=^_,
- kend=\E[F, kf1=\E[M, kf10=\E[V, kf11=\E[W, kf12=\E[X,
- kf13=\E[Y, kf15=\E[a, kf16=\E[b, kf17=\E[c, kf18=\E[d,
- kf19=\E[e, kf2=\E[N, kf20=\E[f, kf21=\E[g, kf22=\E[h,
- kf23=\E[i, kf24=\E[j, kf25=\E[k, kf26=\E[l, kf27=\E[m,
- kf28=\E[n, kf29=\E[o, kf3=\E[O, kf30=\E[p, kf31=\E[q,
- kf32=\E[r, kf33=\E[s, kf34=\E[t, kf35=\E[u, kf36=\E[v,
- kf37=\E[w, kf38=\E[x, kf39=\E[y, kf4=\E[P, kf40=\E[z,
- kf41=\E[@, kf42=\E[[, kf43=\E[\\, kf44=\E[], kf45=\E[\^,
- kf46=\E[_, kf47=\E[`, kf48=\E[{, kf5=\E[Q, kf6=\E[R,
- kf7=\E[S, kf8=\E[T, kf9=\E[U, khome=\E[H, kich1=\E[L,
- knp=\E[G, kpp=\E[I, op=\E[37;40m, rev=\E[7m, ri=\E[T,
- rin=\E[%p1%dT, rmacs=\E[10m, rmam=\E[?7l, rmso=\E[m,
- rmul=\E[m, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
- sgr0=\E[0;10m, smacs=\E[12m, smam=\E[?7h, smso=\E[7m,
- smul=\E[4m,
+ civis=\E[=14;12C, clear=\E[H\E[2J, cnorm=\E[=10;12C,
+ cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\E[B,
+ cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
+ cuu=\E[%p1%dA, cuu1=\E[A, cvvis=\E[=0;12C, dch=\E[%p1%dP,
+ dch1=\E[P, dispc=\E[=%p1%dg, dl=\E[%p1%dM, dl1=\E[M,
+ ed=\E[m\E[J, el=\E[m\E[K, el1=\E[1K, home=\E[H, ht=^I,
+ hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L,
+ ind=\E[S, indn=\E[%p1%dS, invis=\E[8m, kbeg=\E[E, kbs=^H,
+ kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
+ kdch1=\177, kend=\E[F, kf1=\E[M, kf10=\E[V, kf11=\E[W,
+ kf12=\E[X, kf13=\E[Y, kf15=\E[a, kf16=\E[b, kf17=\E[c,
+ kf18=\E[d, kf19=\E[e, kf2=\E[N, kf20=\E[f, kf21=\E[g,
+ kf22=\E[h, kf23=\E[i, kf24=\E[j, kf25=\E[k, kf26=\E[l,
+ kf27=\E[m, kf28=\E[n, kf29=\E[o, kf3=\E[O, kf30=\E[p,
+ kf31=\E[q, kf32=\E[r, kf33=\E[s, kf34=\E[t, kf35=\E[u,
+ kf36=\E[v, kf37=\E[w, kf38=\E[x, kf39=\E[y, kf4=\E[P,
+ kf40=\E[z, kf41=\E[@, kf42=\E[[, kf43=\E[\\, kf44=\E[],
+ kf45=\E[\^, kf46=\E[_, kf47=\E[`, kf48=\E[{, kf5=\E[Q,
+ kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U, khome=\E[H,
+ kich1=\E[L, knp=\E[G, kpp=\E[I, op=\E[0;37;40m, rc=\E8,
+ rev=\E[7m, ri=\E[T, rin=\E[%p1%dT, rmacs=\E[10m,
+ rmam=\E[?7l, rmso=\E[m, rmul=\E[m, sc=\E7,
+ setab=\E[4%p1%dm, setaf=\E[3%p1%dm, sgr0=\E[0;10m,
+ smacs=\E[12m, smam=\E[?7h, smso=\E[7m, smul=\E[4m,
+scoansi-new|SCO Extended ANSI standard crt (5.0.6),
+ km,
+ civis=\E[=0c, cnorm=\E[=1c, csr=\E[%i%p1%d;%p2%dr,
+ cvvis=\E[=2c, mgc=\E[=r, oc=\E[51m, op=\E[50m,
+ rep=\E[%p1%d;%p2%db, rmm=\E[=11L,
+ sgr=\E[0%?%p1%p3%|%t;7%;%?%p2%t;4%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;12%;m,
+ smgb=\E[=1;0m, smgbp=\E[=1;%i%p1%dm,
+ smglp=\E[=2;%i%p1%dm, smgr=\E[=3;0m,
+ smgrp=\E[=3;%i%p1%dm, smgt=\E[=0;0m,
+ smgtp=\E[=0;%i%p1%dm, smm=\E[=10L,
+ wind=\E[%i%p1%d;%p2%d;%i%p3%d;%p4%dr,
+ use=scoansi-old,
+# make this easy to change...
+scoansi|SCO Extended ANSI standard crt,
+ use=scoansi-old,
# This actually describes the generic SVr4 display driver for Intel boxes.
# The <dim=\E[2m> isn't documented and therefore may not be reliable.
@@ -1384,6 +1401,16 @@ pcvt50w|dec vt220 emulation with 50 lines and 132 cols,
cols#132, lines#50,
is2=\E[1;50r\E[50;1H, use=pcvtXX,
+# OpenBSD implements a color variation
+pcvt25-color|dec vt220 emulation with 25 lines and color,
+ cols#80, lines#25,
+ is2=\E[1;25r\E[25;1H, kf1=\EOP, kf10=\E[29~, kf11=\E[23~,
+ kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~,
+ kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~,
+ kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS, kf5=\E[17~,
+ kf6=\E[18~, kf7=\E[19~, kf8=\E[20~, kf9=\E[21~, use=pcvtXX,
+ use=ecma+color,
+
# Terminfo entries to enable the use of the ncurses library in colour on a
# NetBSD-arm32 console (only tested on a RiscPC).
# Created by Dave Millen <dmill@globalnet.co.uk> 22.07.98
@@ -1510,6 +1537,12 @@ mgterm,
#
# Setting colors turns off reverse; we cannot guarantee order, so use ncv.
# Note that this disables standout with color.
+#
+# The emulator sends difference strings based on shift- and control-keys,
+# like scoansi:
+# F13-F24 are shifted F1-F12
+# F25-F36 are control F1-F12
+# F37-F48 are shift+control F1-F12
cons25w|ansiw|ansi80x25-raw|freebsd console (25-line raw mode),
am, bce, bw, eo, msgr, npc,
colors#8, cols#80, it#8, lines#25, ncv#21, pairs#64,
@@ -1523,12 +1556,19 @@ cons25w|ansiw|ansi80x25-raw|freebsd console (25-line raw mode),
il=\E[%p1%dL, il1=\E[L, ind=\E[S, indn=\E[%p1%dS, kb2=\E[E,
kbs=^H, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C,
kcuu1=\E[A, kdch1=\177, kend=\E[F, kf1=\E[M, kf10=\E[V,
- kf11=\E[W, kf12=\E[X, kf2=\E[N, kf3=\E[O, kf4=\E[P, kf5=\E[Q,
- kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U, khome=\E[H,
- kich1=\E[L, knp=\E[G, kpp=\E[I, nel=\E[E, op=\E[x, rev=\E[7m,
- ri=\E[T, rin=\E[%p1%dT, rmso=\E[m, rs2=\E[x\E[m\Ec,
- setab=\E[4%p1%dm, setaf=\E[3%p1%dm, sgr0=\E[m,
- smso=\E[7m, vpa=\E[%i%p1%dd,
+ kf11=\E[W, kf12=\E[X, kf13=\E[Y, kf14=\E[Z, kf15=\E[a,
+ kf16=\E[b, kf17=\E[c, kf18=\E[d, kf19=\E[e, kf2=\E[N,
+ kf20=\E[f, kf21=\E[g, kf22=\E[h, kf23=\E[i, kf24=\E[j,
+ kf25=\E[k, kf26=\E[l, kf27=\E[m, kf28=\E[n, kf29=\E[o,
+ kf3=\E[O, kf30=\E[p, kf31=\E[q, kf32=\E[r, kf33=\E[s,
+ kf34=\E[t, kf35=\E[u, kf36=\E[v, kf37=\E[w, kf38=\E[x,
+ kf39=\E[y, kf4=\E[P, kf40=\E[z, kf41=\E[@, kf42=\E[[,
+ kf43=\E[\\, kf44=\E[], kf45=\E[\^, kf46=\E[_, kf47=\E[`,
+ kf48=\E[{, kf5=\E[Q, kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U,
+ khome=\E[H, kich1=\E[L, knp=\E[G, kpp=\E[I, nel=\E[E,
+ op=\E[x, rev=\E[7m, ri=\E[T, rin=\E[%p1%dT, rmso=\E[m,
+ rs2=\E[x\E[m\Ec, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
+ sgr0=\E[m, smso=\E[7m, vpa=\E[%i%p1%dd,
cons25|ansis|ansi80x25|freebsd console (25-line ansi mode),
acsc=-\030.^Y0\333`\004a\260f\370g\361h\261i\025j\331k\277l\332m\300n\305q\304t\303u\264v\301w\302x\263y\363z\362~\371,
use=cons25w,
@@ -2049,7 +2089,7 @@ vt200-js|vt220-js|dec vt200 series with jump scroll,
is2=\E[61"p\E[H\E[?3l\E[?4l\E[?1l\E[?5l\E[?6l\E[?7h\E[?8h\E[?25h\E>\E[m,
kbs=^H, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, nel=^M\ED, rc=\E8,
- rf=/usr/lib/tabset/vt100, ri=\EM, rmdc=, rmir=\E[4l,
+ rf=/usr/share/tabset/vt100, ri=\EM, rmdc=, rmir=\E[4l,
rmkx=\E[?1l\E>, rmso=\E[27m$<5/>, rmul=\E[24m,
rs1=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7, smdc=,
smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m$<5/>, smul=\E[4m,
@@ -3100,7 +3140,7 @@ konsole|KDE console window,
#
# rxvt is normally configured to look for "xterm" or "xterm-color" as $TERM.
# Since rxvt is not really compatible with xterm, it should be configured as
-# "rxvt-basic" (monochrome) and "rxvt".
+# "rxvt" (monochrome) and "rxvt-color".
rxvt-basic|rxvt terminal base (X Window System),
OTbs, am, bce, eo, km, mir, msgr, xenl, xon,
cols#80, it#8, lines#24,
@@ -3392,11 +3432,11 @@ screen|VT 100/ANSI X3.64 virtual terminal,
cvvis=\E[34l, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM,
dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, enacs=\E(B\E)0,
flash=\Eg, home=\E[H, ht=^I, hts=\EH, ich=\E[%p1%d@,
- il=\E[%p1%dL, il1=\E[L, ind=^J, is2=\E)0, kbs=^H, kcub1=\EOD,
- kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kdch1=\E[3~,
- kend=\E[4~, kf1=\EOP, kf10=\E[21~, kf11=\E[23~,
- kf12=\E[24~, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\E[15~,
- kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
+ il=\E[%p1%dL, il1=\E[L, ind=^J, is2=\E)0, kbs=^H, kcbt=\E[Z,
+ kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
+ kdch1=\E[3~, kend=\E[4~, kf1=\EOP, kf10=\E[21~,
+ kf11=\E[23~, kf12=\E[24~, kf2=\EOQ, kf3=\EOR, kf4=\EOS,
+ kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
khome=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~,
nel=\EE, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, rmir=\E[4l,
rmkx=\E[?1l\E>, rmso=\E[23m, rmul=\E[24m, rs2=\Ec, sc=\E7,
@@ -3787,7 +3827,7 @@ news-unk|SONY NEWS vt100 emulator common entry,
cr=^M, csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, dl=\E[%p1%dM, dl1=\E[M,
ed=\E[J, el=\E[K, home=\E[H, ht=^I,
- if=/usr/lib/tabset/vt100, il=\E[%p1%dL, il1=\E[L,
+ if=/usr/share/tabset/vt100, il=\E[%p1%dL, il1=\E[L,
is2=\E[?7h\E[?1l\E[?3l\E7\E8, kbs=^H, kcub1=\EOD,
kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kf0=\EOY, kf1=\EOP,
kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\EOT, kf6=\EOU, kf7=\EOV,
@@ -3835,7 +3875,7 @@ news-old-unk|SONY NEWS vt100 emulator common entry,
OTnl=^J, bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[;H\E[2J,
cr=^M, csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, ed=\E[J, el=\E[K,
- home=\E[H, ht=^I, if=/usr/lib/tabset/vt100, kbs=^H,
+ home=\E[H, ht=^I, if=/usr/share/tabset/vt100, kbs=^H,
kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kf1=\EOP,
kf2=\EOQ, kf3=\EOR, kf4=\EOS, rc=\E8, rev=\E[7m, ri=\EM,
rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m,
@@ -5190,7 +5230,7 @@ adm31-old|o31|old adm31,
adm36|LSI ADM36,
OTbs, OTpt,
OTkn#4,
- if=/usr/lib/tabset/vt100,
+ if=/usr/share/tabset/vt100,
is2=\E<\E>\E[6;?2;?7;?8h\E[4;20;?1;?3;?4;?5;?6;?18;?19l,
use=vt100,
# (adm42: removed obsolete ":ma=^K^P:" -- esr)
@@ -15471,7 +15511,7 @@ mai|basic4|MAI Basic Four in ansi mode,
cr=^M, csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=^X,
cup=\E[%i%p1%d;%p2%dH, cuu1=^Z, cvvis=\E[?7l, dch1=\E[1P,
dl1=\E[M, ed=^_, el=^^, home=^], ht=^I,
- if=/usr/lib/tabset/vt100, il1=\E[L, ind=\ED,
+ if=/usr/share/tabset/vt100, il1=\E[L, ind=\ED,
is2=\E>\E[?1h\E[?7h\E[?5l\017\E(B\E[m\E[20l\E[1;24r\E[24;1H,
kbs=^H, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\EOT, kf6=\EOU,
@@ -19443,6 +19483,16 @@ v3220|LANPAR Vision II model 3220/3221/3222,
# 2001-12-08
# * update gnome entry to Redhat 7.2 -TD
#
+# 2002-05-25
+# * add kf13-kf48 strings to cons25w -TD
+# * add pcvt25-color entry -TD
+# * changed a few /usr/lib/tabset -> /usr/share/tabset.
+# * improve some features of scoansi entry based on SCO's version -TD
+# * add scoansi-new entry corresponding to OpenServer 5.0.6
+#
+# 2002-06-15
+# * add kcbt to screen entry -TD
+#
# The following sets edit modes for GNU EMACS.
# Local Variables:
# fill-prefix:"\t"
diff --git a/contrib/ncurses/ncurses/base/MKkeyname.awk b/contrib/ncurses/ncurses/base/MKkeyname.awk
index 5aab9369857c..b8cd5da256a2 100644
--- a/contrib/ncurses/ncurses/base/MKkeyname.awk
+++ b/contrib/ncurses/ncurses/base/MKkeyname.awk
@@ -1,4 +1,4 @@
-# $Id: MKkeyname.awk,v 1.21 2002/02/23 22:36:33 tom Exp $
+# $Id: MKkeyname.awk,v 1.22 2002/05/25 22:25:06 tom Exp $
##############################################################################
# Copyright (c) 1999-2001,2002 Free Software Foundation, Inc. #
# #
@@ -49,10 +49,12 @@ END {
print "char name[20];"
print "char *p;"
print ""
+ print "\tif (c == -1) return \"-1\";"
+ print ""
print "\tfor (i = 0; _nc_key_names[i].name != 0; i++)"
print "\t\tif (_nc_key_names[i].code == c)"
print "\t\t\treturn (NCURSES_CONST char *)_nc_key_names[i].name;"
- print "\tif (c >= 256) return \"UNKNOWN KEY\";"
+ print "\tif (c < 0 || c >= 256) return \"UNKNOWN KEY\";"
print ""
print "\tif (table == 0)"
print "\t\ttable = typeCalloc(char *, 256);"
@@ -66,9 +68,7 @@ END {
print "\t\t\tp += 2;"
print "\t\t\tc -= 128;"
print "\t\t}"
- print "\t\tif (c < 0)"
- print "\t\t\tsprintf(p, \"%d\", c);"
- print "\t\telse if (c < 32)"
+ print "\t\tif (c < 32)"
print "\t\t\tsprintf(p, \"^%c\", c + '@');"
print "\t\telse if (c == 127)"
print "\t\t\tstrcpy(p, \"^?\");"
diff --git a/contrib/ncurses/ncurses/base/lib_getch.c b/contrib/ncurses/ncurses/base/lib_getch.c
index f4ecbdafe2ae..af1be33a18d5 100644
--- a/contrib/ncurses/ncurses/base/lib_getch.c
+++ b/contrib/ncurses/ncurses/base/lib_getch.c
@@ -40,7 +40,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_getch.c,v 1.60 2002/03/17 00:46:01 tom Exp $")
+MODULE_ID("$Id: lib_getch.c,v 1.61 2002/06/16 00:31:57 tom Exp $")
#include <fifo_defs.h>
@@ -260,7 +260,7 @@ _nc_wgetch(WINDOW *win, unsigned long *result, int use_meta)
/* resizeterm can push KEY_RESIZE */
if (cooked_key_in_fifo()) {
*result = fifo_pull();
- returnCode(OK);
+ returnCode(*result >= KEY_MIN ? KEY_CODE_YES : OK);
}
}
#endif
diff --git a/contrib/ncurses/ncurses/base/lib_pad.c b/contrib/ncurses/ncurses/base/lib_pad.c
index 556fb19e6993..83983c3bbd1c 100644
--- a/contrib/ncurses/ncurses/base/lib_pad.c
+++ b/contrib/ncurses/ncurses/base/lib_pad.c
@@ -40,7 +40,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_pad.c,v 1.36 2002/05/18 21:28:44 Kriang.Lerdsuwanakij Exp $")
+MODULE_ID("$Id: lib_pad.c,v 1.37 2002/05/23 23:39:26 tom Exp $")
NCURSES_EXPORT(WINDOW *)
newpad(int l, int c)
@@ -193,24 +193,21 @@ pnoutrefresh
i++, m++) {
register struct ldat *nline = &newscr->_line[m];
register struct ldat *oline = &win->_line[i];
- NCURSES_CH_T ch;
-
- /*
- * Special case for leftmost character of the displayed area.
- * Only half of a double-width character may be visible.
- */
- ch = oline->text[pmincol];
- if_WIDEC(isnac(ch)) {
- SetChar(ch, L(' '), AttrOf(oline->text[pmincol - 1]));
- }
- if (!CharEq(ch, nline->text[smincol])) {
- nline->text[smincol] = ch;
- CHANGED_CELL(nline, smincol);
- }
-
- for (j = pmincol + 1, n = smincol + 1; j <= pmaxcol; j++, n++) {
- if (!CharEq(oline->text[j], nline->text[n])) {
- nline->text[n] = oline->text[j];
+ for (j = pmincol, n = smincol; j <= pmaxcol; j++, n++) {
+ NCURSES_CH_T ch = oline->text[j];
+#if USE_WIDEC_SUPPORT
+ /*
+ * Special case for leftmost character of the displayed area.
+ * Only half of a double-width character may be visible.
+ */
+ if (j == pmincol
+ && j > 0
+ && isnac(ch)) {
+ SetChar(ch, L(' '), AttrOf(oline->text[j - 1]));
+ }
+#endif
+ if (!CharEq(ch, nline->text[n])) {
+ nline->text[n] = ch;
CHANGED_CELL(nline, n);
}
}
diff --git a/contrib/ncurses/ncurses/base/lib_set_term.c b/contrib/ncurses/ncurses/base/lib_set_term.c
index 03bb5bfaaac2..f3940fa03c1c 100644
--- a/contrib/ncurses/ncurses/base/lib_set_term.c
+++ b/contrib/ncurses/ncurses/base/lib_set_term.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2001,2002 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 *
@@ -43,7 +43,7 @@
#include <term.h> /* cur_term */
#include <tic.h>
-MODULE_ID("$Id: lib_set_term.c,v 1.64 2002/02/10 00:21:10 tom Exp $")
+MODULE_ID("$Id: lib_set_term.c,v 1.65 2002/06/15 18:40:20 tom Exp $")
NCURSES_EXPORT(SCREEN *)
set_term(SCREEN * screenp)
@@ -181,7 +181,7 @@ extract_fgbg(char *src, int *result)
if (dst == 0) {
dst = src;
} else if (value >= 0) {
- *result = value % max_colors;
+ *result = value;
}
while (*dst != 0 && *dst != ';')
dst++;
@@ -275,6 +275,22 @@ _nc_setupscreen
p = extract_fgbg(p, &(SP->_default_bg));
TR(TRACE_CHARPUT | TRACE_MOVE, ("decoded fg=%d, bg=%d",
SP->_default_fg, SP->_default_bg));
+ if (SP->_default_fg > max_colors) {
+ if (set_a_foreground != ABSENT_STRING
+ && !strcmp(set_a_foreground, "\033[3%p1%dm")) {
+ set_a_foreground = "\033[3%?%p1%{8}%>%t9%e%p1%d%;m";
+ } else {
+ SP->_default_fg %= max_colors;
+ }
+ }
+ if (SP->_default_bg > max_colors) {
+ if (set_a_background != ABSENT_STRING
+ && !strcmp(set_a_background, "\033[4%p1%dm")) {
+ set_a_background = "\033[4%?%p1%{8}%>%t9%e%p1%d%;m";
+ } else {
+ SP->_default_bg %= max_colors;
+ }
+ }
}
#endif
#endif /* NCURSES_EXT_FUNCS */
diff --git a/contrib/ncurses/ncurses/curses.priv.h b/contrib/ncurses/ncurses/curses.priv.h
index d901eca7f3ae..97582786d04a 100644
--- a/contrib/ncurses/ncurses/curses.priv.h
+++ b/contrib/ncurses/ncurses/curses.priv.h
@@ -34,7 +34,7 @@
/*
- * $Id: curses.priv.h,v 1.218 2002/05/18 19:48:38 tom Exp $
+ * $Id: curses.priv.h,v 1.219 2002/05/25 12:22:43 tom Exp $
*
* curses.priv.h
*
@@ -248,6 +248,7 @@ color_t;
#endif
#include <curses.h> /* we'll use -Ipath directive to get the right one! */
+#include <term.h>
struct ldat
{
@@ -672,6 +673,7 @@ extern NCURSES_EXPORT(WINDOW *) _nc_retrace_win (WINDOW *);
extern NCURSES_EXPORT(attr_t) _nc_retrace_attr_t (attr_t);
extern NCURSES_EXPORT(attr_t) _nc_retrace_chtype (chtype);
extern NCURSES_EXPORT(char *) _nc_retrace_ptr (char *);
+extern NCURSES_EXPORT(char *) _nc_trace_ttymode(TTY *tty);
extern NCURSES_EXPORT(char *) _nc_varargs (const char *, va_list);
extern NCURSES_EXPORT(const char *) _nc_altcharset_name(attr_t, chtype);
extern NCURSES_EXPORT(int) _nc_retrace_int (int);
diff --git a/contrib/ncurses/ncurses/tinfo/lib_termcap.c b/contrib/ncurses/ncurses/tinfo/lib_termcap.c
index c647b9730a58..c03a601f4968 100644
--- a/contrib/ncurses/ncurses/tinfo/lib_termcap.c
+++ b/contrib/ncurses/ncurses/tinfo/lib_termcap.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2001,2002 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 *
@@ -34,16 +34,16 @@
* Magnus Bengtsson, d6mbeng@dtek.chalmers.se (Nov'93) *
****************************************************************************/
+#define __INTERNAL_CAPS_VISIBLE
#include <curses.priv.h>
#include <termcap.h>
#include <tic.h>
#include <ctype.h>
-#define __INTERNAL_CAPS_VISIBLE
#include <term_entry.h>
-MODULE_ID("$Id: lib_termcap.c,v 1.42 2001/09/22 19:17:31 tom Exp $")
+MODULE_ID("$Id: lib_termcap.c,v 1.43 2002/05/25 12:24:13 tom Exp $")
#define CSI 233
#define ESC 033 /* ^[ */
diff --git a/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c b/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c
index e71be893fbb9..385166e94fa7 100644
--- a/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c
+++ b/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2001,2002 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 *
@@ -38,7 +38,7 @@
#include <curses.priv.h>
#include <term.h> /* cur_term */
-MODULE_ID("$Id: lib_ttyflags.c,v 1.6 2001/12/16 01:19:01 tom Exp $")
+MODULE_ID("$Id: lib_ttyflags.c,v 1.7 2002/05/25 14:50:00 tom Exp $")
#undef tabs
@@ -62,7 +62,7 @@ _nc_get_tty_mode(TTY * buf)
if (cur_term == 0
|| GET_TTY(cur_term->Filedes, buf) != 0)
return (ERR);
- TR(TRACE_BITS, ("_nc_get_tty_mode: %s", _nc_tracebits()));
+ TR(TRACE_BITS, ("_nc_get_tty_mode: %s", _nc_trace_ttymode(buf)));
return (OK);
}
@@ -72,7 +72,7 @@ _nc_set_tty_mode(TTY * buf)
if (cur_term == 0
|| SET_TTY(cur_term->Filedes, buf) != 0)
return (ERR);
- TR(TRACE_BITS, ("_nc_set_tty_mode: %s", _nc_tracebits()));
+ TR(TRACE_BITS, ("_nc_set_tty_mode: %s", _nc_trace_ttymode(buf)));
return (OK);
}
diff --git a/contrib/ncurses/ncurses/tinfo/parse_entry.c b/contrib/ncurses/ncurses/tinfo/parse_entry.c
index 797974cb1642..1c0ce850e42d 100644
--- a/contrib/ncurses/ncurses/tinfo/parse_entry.c
+++ b/contrib/ncurses/ncurses/tinfo/parse_entry.c
@@ -40,14 +40,14 @@
* from the input stream.
*/
+#define __INTERNAL_CAPS_VISIBLE
#include <curses.priv.h>
#include <ctype.h>
#include <tic.h>
-#define __INTERNAL_CAPS_VISIBLE
#include <term_entry.h>
-MODULE_ID("$Id: parse_entry.c,v 1.55 2002/04/22 00:01:30 tom Exp $")
+MODULE_ID("$Id: parse_entry.c,v 1.56 2002/05/25 12:23:51 tom Exp $")
#ifdef LINT
static short const parametrized[] =
diff --git a/contrib/ncurses/ncurses/trace/lib_traceatr.c b/contrib/ncurses/ncurses/trace/lib_traceatr.c
index 714e508f3040..870624f3f514 100644
--- a/contrib/ncurses/ncurses/trace/lib_traceatr.c
+++ b/contrib/ncurses/ncurses/trace/lib_traceatr.c
@@ -39,7 +39,7 @@
#include <curses.priv.h>
#include <term.h> /* acs_chars */
-MODULE_ID("$Id: lib_traceatr.c,v 1.41 2002/02/10 01:26:56 tom Exp $")
+MODULE_ID("$Id: lib_traceatr.c,v 1.42 2002/06/16 00:35:01 tom Exp $")
#define COLOR_OF(c) (c < 0 || c > 7 ? "default" : colors[c].name)
@@ -249,39 +249,42 @@ NCURSES_EXPORT(char *)
_tracecchar_t2 (int bufnum, const cchar_t *ch)
{
char *buf = _nc_trace_buf(bufnum, BUFSIZ);
- attr_t attr = AttrOfD(ch);
+ attr_t attr;
const char *found;
strcpy(buf, l_brace);
- if ((found = _nc_altcharset_name(attr, CharOfD(ch))) != 0) {
- (void) strcat(buf, found);
- attr &= ~A_ALTCHARSET;
- } else if (!isnac(CHDEREF(ch))) {
- PUTC_DATA;
- int n;
-
- memset (&PUT_st, '\0', sizeof (PUT_st));
- PUTC_i = 0;
- (void) strcat(buf, "{ ");
- do {
- PUTC_ch = PUTC_i < CCHARW_MAX ? ch->chars[PUTC_i] : L'\0';
- PUTC_n = wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st);
- if (PUTC_ch == L'\0')
- --PUTC_n;
- if (PUTC_n <= 0)
- break;
- for (n = 0; n < PUTC_n; n++) {
- if (n)
- (void) strcat(buf, ", ");
- (void) strcat(buf, _tracechar(UChar(PUTC_buf[n])));
- }
- ++PUTC_i;
- } while (PUTC_ch != L'\0');
- (void) strcat(buf, " }");
+ if (ch != 0) {
+ attr = AttrOfD(ch);
+ if ((found = _nc_altcharset_name(attr, CharOfD(ch))) != 0) {
+ (void) strcat(buf, found);
+ attr &= ~A_ALTCHARSET;
+ } else if (!isnac(CHDEREF(ch))) {
+ PUTC_DATA;
+ int n;
+
+ memset (&PUT_st, '\0', sizeof (PUT_st));
+ PUTC_i = 0;
+ (void) strcat(buf, "{ ");
+ do {
+ PUTC_ch = PUTC_i < CCHARW_MAX ? ch->chars[PUTC_i] : L'\0';
+ PUTC_n = wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st);
+ if (PUTC_ch == L'\0')
+ --PUTC_n;
+ if (PUTC_n <= 0)
+ break;
+ for (n = 0; n < PUTC_n; n++) {
+ if (n)
+ (void) strcat(buf, ", ");
+ (void) strcat(buf, _tracechar(UChar(PUTC_buf[n])));
+ }
+ ++PUTC_i;
+ } while (PUTC_ch != L'\0');
+ (void) strcat(buf, " }");
+ }
+ if (attr != A_NORMAL)
+ (void) sprintf(buf + strlen(buf), " | %s",
+ _traceattr2(bufnum + 20, attr));
}
- if (attr != A_NORMAL)
- (void) sprintf(buf + strlen(buf), " | %s",
- _traceattr2(bufnum + 20, attr));
return (strcat(buf, r_brace));
}
diff --git a/contrib/ncurses/ncurses/trace/lib_tracebits.c b/contrib/ncurses/ncurses/trace/lib_tracebits.c
index a2153d496aa6..e681862649af 100644
--- a/contrib/ncurses/ncurses/trace/lib_tracebits.c
+++ b/contrib/ncurses/ncurses/trace/lib_tracebits.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2001,2002 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 *
@@ -34,7 +34,7 @@
#include <curses.priv.h>
#include <term.h> /* cur_term */
-MODULE_ID("$Id: lib_tracebits.c,v 1.11 2001/10/20 22:44:32 tom Exp $")
+MODULE_ID("$Id: lib_tracebits.c,v 1.12 2002/05/25 14:35:07 tom Exp $")
#if SVR4_TERMIO && !defined(_POSIX_SOURCE)
#define _POSIX_SOURCE
@@ -82,7 +82,7 @@ lookup_bits(char *buf, const BITNAMES * table, const char *label, unsigned int v
}
NCURSES_EXPORT(char *)
-_nc_tracebits(void)
+_nc_trace_ttymode(TTY * tty)
/* describe the state of the terminal control bits exactly */
{
char *buf;
@@ -143,14 +143,14 @@ _nc_tracebits(void)
8 + sizeof(lflags) +
8);
- if (cur_term->Nttyb.c_iflag & ALLIN)
- lookup_bits(buf, iflags, "iflags", cur_term->Nttyb.c_iflag);
+ if (tty->c_iflag & ALLIN)
+ lookup_bits(buf, iflags, "iflags", tty->c_iflag);
- if (cur_term->Nttyb.c_oflag & ALLOUT)
- lookup_bits(buf, oflags, "oflags", cur_term->Nttyb.c_oflag);
+ if (tty->c_oflag & ALLOUT)
+ lookup_bits(buf, oflags, "oflags", tty->c_oflag);
- if (cur_term->Nttyb.c_cflag & ALLCTRL)
- lookup_bits(buf, cflags, "cflags", cur_term->Nttyb.c_cflag);
+ if (tty->c_cflag & ALLCTRL)
+ lookup_bits(buf, cflags, "cflags", tty->c_cflag);
#if defined(CS5) && defined(CS8)
{
@@ -176,7 +176,7 @@ _nc_tracebits(void)
},
};
const char *result = "CSIZE? ";
- int value = (cur_term->Nttyb.c_cflag & CSIZE);
+ int value = (tty->c_cflag & CSIZE);
unsigned n;
if (value != 0) {
@@ -191,8 +191,8 @@ _nc_tracebits(void)
}
#endif
- if (cur_term->Nttyb.c_lflag & ALLLOCAL)
- lookup_bits(buf, lflags, "lflags", cur_term->Nttyb.c_lflag);
+ if (tty->c_lflag & ALLLOCAL)
+ lookup_bits(buf, lflags, "lflags", tty->c_lflag);
#else
/* reference: ttcompat(4M) on SunOS 4.1 */
@@ -231,12 +231,18 @@ _nc_tracebits(void)
buf = _nc_trace_buf(0,
8 + sizeof(cflags));
- if (cur_term->Nttyb.sg_flags & ALLCTRL) {
- lookup_bits(buf, cflags, "cflags", cur_term->Nttyb.sg_flags);
+ if (tty->sg_flags & ALLCTRL) {
+ lookup_bits(buf, cflags, "cflags", tty->sg_flags);
}
#endif
return (buf);
}
+
+NCURSES_EXPORT(char *)
+_nc_tracebits(void)
+{
+ return _nc_trace_ttymode(&(cur_term->Nttyb));
+}
#else
empty_module(_nc_tracebits)
#endif /* TRACE */
diff --git a/contrib/ncurses/ncurses/trace/lib_tracechr.c b/contrib/ncurses/ncurses/trace/lib_tracechr.c
index 5b7c90c74587..2f33391b5505 100644
--- a/contrib/ncurses/ncurses/trace/lib_tracechr.c
+++ b/contrib/ncurses/ncurses/trace/lib_tracechr.c
@@ -36,7 +36,7 @@
*/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_tracechr.c,v 1.8 2002/02/10 01:26:04 tom Exp $")
+MODULE_ID("$Id: lib_tracechr.c,v 1.9 2002/05/25 23:34:19 tom Exp $")
#ifdef TRACE
NCURSES_EXPORT(char *)
@@ -44,10 +44,10 @@ _tracechar(int ch)
{
static char crep[40];
(void) sprintf(crep, "'%.30s' = %#03o",
- (ch > KEY_MIN)
- ? keyname(ch)
- : unctrl(ch),
- (unsigned) ch);
+ ((ch > KEY_MIN || ch < 0)
+ ? keyname(ch)
+ : unctrl(ch)),
+ ch);
return (crep);
}
#else
diff --git a/contrib/ncurses/ncurses/trace/varargs.c b/contrib/ncurses/ncurses/trace/varargs.c
index 7a1a7424fe09..7bcb7b55d42c 100644
--- a/contrib/ncurses/ncurses/trace/varargs.c
+++ b/contrib/ncurses/ncurses/trace/varargs.c
@@ -34,7 +34,7 @@
#include <ctype.h>
-MODULE_ID("$Id: varargs.c,v 1.1 2001/10/20 20:37:48 tom Exp $")
+MODULE_ID("$Id: varargs.c,v 1.2 2002/06/01 16:16:00 tom Exp $")
#ifdef TRACE
@@ -53,17 +53,18 @@ typedef enum {
NCURSES_EXPORT(char *)
_nc_varargs(const char *fmt, va_list ap)
{
+ static char dummy[] = "";
static char *result_buf;
static size_t result_len;
char buffer[BUFSIZ];
if (fmt == 0 || *fmt == '\0')
- return "";
+ return dummy;
if (result_len == 0)
result_buf = typeMalloc(char, result_len = BUFSIZ);
if (result_buf == 0)
- return "";
+ return dummy;
*result_buf = '\0';
while (*fmt != '\0') {
diff --git a/contrib/ncurses/progs/dump_entry.c b/contrib/ncurses/progs/dump_entry.c
index 5245a47a6bf6..f54ecf83919d 100644
--- a/contrib/ncurses/progs/dump_entry.c
+++ b/contrib/ncurses/progs/dump_entry.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2000 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2001,2002 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 *
@@ -29,6 +29,7 @@
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996 on *
****************************************************************************/
#define __INTERNAL_CAPS_VISIBLE
@@ -38,7 +39,7 @@
#include "termsort.c" /* this C file is generated */
#include <parametrized.h> /* so is this */
-MODULE_ID("$Id: dump_entry.c,v 1.56 2001/08/12 00:21:22 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.58 2002/06/01 22:58:11 tom Exp $")
#define INDENT 8
#define DISCARD(string) string = ABSENT_STRING
@@ -166,7 +167,7 @@ nametrans(const char *name)
void
dump_init(const char *version, int mode, int sort, int twidth, int traceval,
- bool formatted)
+ bool formatted)
/* set up for entry display */
{
width = twidth;
@@ -176,7 +177,7 @@ dump_init(const char *version, int mode, int sort, int twidth, int traceval,
if (version == 0)
tversion = V_ALLCAPS;
else if (!strcmp(version, "SVr1") || !strcmp(version, "SVR1")
- || !strcmp(version, "Ultrix"))
+ || !strcmp(version, "Ultrix"))
tversion = V_SVR1;
else if (!strcmp(version, "HP"))
tversion = V_HPUX;
@@ -221,13 +222,13 @@ dump_init(const char *version, int mode, int sort, int twidth, int traceval,
case S_NOSORT:
if (traceval)
(void) fprintf(stderr,
- "%s: sorting by term structure order\n", _nc_progname);
+ "%s: sorting by term structure order\n", _nc_progname);
break;
case S_TERMINFO:
if (traceval)
(void) fprintf(stderr,
- "%s: sorting by terminfo name order\n", _nc_progname);
+ "%s: sorting by terminfo name order\n", _nc_progname);
bool_indirect = bool_terminfo_sort;
num_indirect = num_terminfo_sort;
str_indirect = str_terminfo_sort;
@@ -236,7 +237,7 @@ dump_init(const char *version, int mode, int sort, int twidth, int traceval,
case S_VARIABLE:
if (traceval)
(void) fprintf(stderr,
- "%s: sorting by C variable order\n", _nc_progname);
+ "%s: sorting by C variable order\n", _nc_progname);
bool_indirect = bool_variable_sort;
num_indirect = num_variable_sort;
str_indirect = str_variable_sort;
@@ -245,7 +246,7 @@ dump_init(const char *version, int mode, int sort, int twidth, int traceval,
case S_TERMCAP:
if (traceval)
(void) fprintf(stderr,
- "%s: sorting by termcap name order\n", _nc_progname);
+ "%s: sorting by termcap name order\n", _nc_progname);
bool_indirect = bool_termcap_sort;
num_indirect = num_termcap_sort;
str_indirect = str_termcap_sort;
@@ -254,8 +255,8 @@ dump_init(const char *version, int mode, int sort, int twidth, int traceval,
if (traceval)
(void) fprintf(stderr,
- "%s: width = %d, tversion = %d, outform = %d\n",
- _nc_progname, width, tversion, outform);
+ "%s: width = %d, tversion = %d, outform = %d\n",
+ _nc_progname, width, tversion, outform);
}
static TERMTYPE *cur_type;
@@ -496,10 +497,10 @@ fmt_complex(char *src, int level)
int
fmt_entry(TERMTYPE * tterm,
- int (*pred) (int type, int idx),
- bool suppress_untranslatable,
- bool infodump,
- int numbers)
+ int (*pred) (int type, int idx),
+ bool suppress_untranslatable,
+ bool infodump,
+ int numbers)
{
int i, j;
char buffer[MAX_TERMINFO_LENGTH];
@@ -639,14 +640,16 @@ fmt_entry(TERMTYPE * tterm,
sprintf(buffer, "%s@", name);
WRAP_CONCAT;
} else if (outform == F_TERMCAP || outform == F_TCONVERR) {
- int params = (i < (int) SIZEOF(parametrized)) ? parametrized[i] : 0;
+ int params = ((i < (int) SIZEOF(parametrized))
+ ? parametrized[i]
+ : 0);
char *srccap = _nc_tic_expand(tterm->Strings[i], TRUE, numbers);
char *cv = _nc_infotocap(name, srccap, params);
if (cv == 0) {
if (outform == F_TCONVERR) {
sprintf(buffer, "%s=!!! %s WILL NOT CONVERT !!!",
- name, srccap);
+ name, srccap);
} else if (suppress_untranslatable) {
continue;
} else {
@@ -670,7 +673,7 @@ fmt_entry(TERMTYPE * tterm,
WRAP_CONCAT;
} else {
char *src = _nc_tic_expand(tterm->Strings[i],
- outform == F_TERMINFO, numbers);
+ outform == F_TERMINFO, numbers);
strcpy_DYN(&tmpbuf, 0);
strcpy_DYN(&tmpbuf, name);
@@ -726,7 +729,7 @@ fmt_entry(TERMTYPE * tterm,
if (box_ok) {
(void) strcpy(buffer, "box1=");
(void) strcat(buffer, _nc_tic_expand(boxchars,
- outform == F_TERMINFO, numbers));
+ outform == F_TERMINFO, numbers));
WRAP_CONCAT;
}
}
@@ -745,10 +748,10 @@ fmt_entry(TERMTYPE * tterm,
outbuf.used -= 2;
trimmed = TRUE;
} else if (j >= 4
- && outbuf.text[j - 1] == ':'
- && outbuf.text[j - 2] == '\t'
- && outbuf.text[j - 3] == '\n'
- && outbuf.text[j - 4] == '\\') {
+ && outbuf.text[j - 1] == ':'
+ && outbuf.text[j - 2] == '\t'
+ && outbuf.text[j - 3] == '\n'
+ && outbuf.text[j - 4] == '\\') {
outbuf.used -= 4;
trimmed = TRUE;
}
@@ -762,7 +765,7 @@ fmt_entry(TERMTYPE * tterm,
fprintf(stderr, "num_values = %d\n", num_values);
fprintf(stderr, "num_strings = %d\n", num_strings);
fprintf(stderr, "term_names=%s, len=%d, strlen(outbuf)=%d, outbuf=%s\n",
- tterm->term_names, len, outbuf.used, outbuf.text);
+ tterm->term_names, len, outbuf.used, outbuf.text);
#endif
/*
* Here's where we use infodump to trigger a more stringent length check
@@ -774,9 +777,91 @@ fmt_entry(TERMTYPE * tterm,
return (infodump ? len : (int) termcap_length(outbuf.text));
}
+static bool
+kill_string(TERMTYPE * tterm, char *cap)
+{
+ int n;
+ for (n = 0; n < tterm->num_Strings; ++n) {
+ if (cap == tterm->Strings[n]) {
+ tterm->Strings[n] = ABSENT_STRING;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+static char *
+find_string(TERMTYPE * tterm, char *name)
+{
+ int n;
+ for (n = 0; n < tterm->num_Strings; ++n) {
+ if (version_filter(STRING, n)
+ && !strcmp(name, strnames[n])) {
+ char *cap = tterm->Strings[n];
+ if (VALID_STRING(cap)) {
+ return cap;
+ }
+ break;
+ }
+ }
+ return ABSENT_STRING;
+}
+
+/*
+ * This is used to remove function-key labels from a termcap entry to
+ * make it smaller.
+ */
+static int
+kill_labels(TERMTYPE * tterm, int target)
+{
+ int n;
+ int result = 0;
+ char *cap;
+ char name[10];
+
+ for (n = 0; n <= 10; ++n) {
+ sprintf(name, "lf%d", n);
+ if ((cap = find_string(tterm, name)) != ABSENT_STRING
+ && kill_string(tterm, cap)) {
+ target -= (strlen(cap) + 5);
+ ++result;
+ if (target < 0)
+ break;
+ }
+ }
+ return result;
+}
+
+/*
+ * This is used to remove function-key definitions from a termcap entry to
+ * make it smaller.
+ */
+static int
+kill_fkeys(TERMTYPE * tterm, int target)
+{
+ int n;
+ int result = 0;
+ char *cap;
+ char name[10];
+
+ for (n = 60; n >= 0; --n) {
+ sprintf(name, "kf%d", n);
+ if ((cap = find_string(tterm, name)) != ABSENT_STRING
+ && kill_string(tterm, cap)) {
+ target -= (strlen(cap) + 5);
+ ++result;
+ if (target < 0)
+ break;
+ }
+ }
+ return result;
+}
+
int
-dump_entry(TERMTYPE * tterm, bool limited, int numbers, int (*pred) (int
- type, int idx))
+dump_entry(TERMTYPE * tterm,
+ bool limited,
+ int numbers,
+ int (*pred) (int type, int idx))
/* dump a single entry */
{
int len, critlen;
@@ -797,7 +882,7 @@ dump_entry(TERMTYPE * tterm, bool limited, int numbers, int (*pred) (int
if (((len = fmt_entry(tterm, pred, FALSE, infodump, numbers)) > critlen)
&& limited) {
PRINTF("# (untranslatable capabilities removed to fit entry within %d bytes)\n",
- critlen);
+ critlen);
if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) {
/*
* We pick on sgr because it's a nice long string capability that
@@ -808,28 +893,40 @@ dump_entry(TERMTYPE * tterm, bool limited, int numbers, int (*pred) (int
char *oldacsc = acs_chars;
set_attributes = ABSENT_STRING;
PRINTF("# (sgr removed to fit entry within %d bytes)\n",
- critlen);
+ critlen);
if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) {
acs_chars = ABSENT_STRING;
PRINTF("# (acsc removed to fit entry within %d bytes)\n",
- critlen);
+ critlen);
}
if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers)) > critlen) {
int oldversion = tversion;
tversion = V_BSD;
PRINTF("# (terminfo-only capabilities suppressed to fit entry within %d bytes)\n",
- critlen);
-
- if ((len = fmt_entry(tterm, pred, TRUE, infodump, numbers))
- > critlen) {
+ critlen);
+
+ len = fmt_entry(tterm, pred, TRUE, infodump, numbers);
+ if (len > critlen
+ && kill_labels(tterm, len - critlen)) {
+ PRINTF("# (some labels capabilities suppressed to fit entry within %d bytes)\n",
+ critlen);
+ len = fmt_entry(tterm, pred, TRUE, infodump, numbers);
+ }
+ if (len > critlen
+ && kill_fkeys(tterm, len - critlen)) {
+ PRINTF("# (some function-key capabilities suppressed to fit entry within %d bytes)\n",
+ critlen);
+ len = fmt_entry(tterm, pred, TRUE, infodump, numbers);
+ }
+ if (len > critlen) {
(void) fprintf(stderr,
- "warning: %s entry is %d bytes long\n",
- _nc_first_name(tterm->term_names),
- len);
+ "warning: %s entry is %d bytes long\n",
+ _nc_first_name(tterm->term_names),
+ len);
PRINTF(
- "# WARNING: this entry, %d bytes long, may core-dump %s libraries!\n",
- len, legend);
+ "# WARNING: this entry, %d bytes long, may core-dump %s libraries!\n",
+ len, legend);
}
tversion = oldversion;
}
@@ -857,7 +954,7 @@ dump_uses(const char *name, bool infodump)
void
compare_entry(void (*hook) (int t, int i, const char *name), TERMTYPE * tp
- GCC_UNUSED, bool quiet)
+ GCC_UNUSED, bool quiet)
/* compare two entries */
{
int i, j;
diff --git a/contrib/ncurses/progs/tic.c b/contrib/ncurses/progs/tic.c
index 28292e6ece29..2fb34df53968 100644
--- a/contrib/ncurses/progs/tic.c
+++ b/contrib/ncurses/progs/tic.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2001,2002 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 *
@@ -29,6 +29,7 @@
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996 on *
****************************************************************************/
/*
@@ -44,7 +45,7 @@
#include <term_entry.h>
#include <transform.h>
-MODULE_ID("$Id: tic.c,v 1.92 2001/06/18 18:44:01 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.96 2002/06/01 20:42:53 tom Exp $")
const char *_nc_progname = "tic";
@@ -822,8 +823,8 @@ expected_params(const char *name)
{ "sgr1", 6 },
{ "slength", 1 },
{ "slines", 1 },
- { "smgbp", 2 },
- { "smglp", 2 },
+ { "smgbp", 1 }, /* 2 if smgtp is not given */
+ { "smglp", 1 },
{ "smglr", 2 },
{ "smgrp", 1 },
{ "smgtb", 2 },
@@ -863,6 +864,10 @@ check_params(TERMTYPE * tp, const char *name, char *value)
bool params[10];
char *s = value;
+ if (!strcmp(name, "smgbp")
+ && set_top_margin_parm == 0)
+ expected = 2;
+
for (n = 0; n < 10; n++)
params[n] = FALSE;
@@ -901,6 +906,14 @@ check_params(TERMTYPE * tp, const char *name, char *value)
}
}
+static char *
+skip_delay(char *s)
+{
+ while (*s == '/' || isdigit(UChar(*s)))
+ ++s;
+ return s;
+}
+
/*
* An sgr string may contain several settings other than the one we're
* interested in, essentially sgr0 + rmacs + whatever. As long as the
@@ -908,8 +921,25 @@ check_params(TERMTYPE * tp, const char *name, char *value)
* sanity check.
*/
static bool
-similar_sgr(char *a, char *b)
+similar_sgr(int num, char *a, char *b)
{
+ static const char *names[] =
+ {
+ "none"
+ ,"standout"
+ ,"underline"
+ ,"reverse"
+ ,"blink"
+ ,"dim"
+ ,"bold"
+ ,"invis"
+ ,"protect"
+ ,"altcharset"
+ };
+ char *base_a = a;
+ char *base_b = b;
+ int delaying = 0;
+
while (*b != 0) {
while (*a != *b) {
if (*a == 0) {
@@ -917,11 +947,31 @@ similar_sgr(char *a, char *b)
&& b[1] == '<') {
_nc_warning("Did not find delay %s", _nc_visbuf(b));
} else {
- _nc_warning("Unmatched portion %s", _nc_visbuf(b));
+ _nc_warning("checking sgr(%s) %s\n\tcompare to %s\n\tunmatched %s",
+ names[num], _nc_visbuf2(1, base_a),
+ _nc_visbuf2(2, base_b),
+ _nc_visbuf2(3, b));
}
return FALSE;
+ } else if (delaying) {
+ a = skip_delay(a);
+ b = skip_delay(b);
+ } else {
+ a++;
}
- a++;
+ }
+ switch (*a) {
+ case '$':
+ if (delaying == 0)
+ delaying = 1;
+ break;
+ case '<':
+ if (delaying == 1)
+ delaying = 2;
+ break;
+ default:
+ delaying = 0;
+ break;
}
a++;
b++;
@@ -945,9 +995,11 @@ check_sgr(TERMTYPE * tp, char *zero, int num, char *cap, const char *name)
tparm_errs += _nc_tparm_err;
if (test != 0) {
if (PRESENT(cap)) {
- if (!similar_sgr(test, cap)) {
- _nc_warning("%s differs from sgr(%d): %s", name, num,
- _nc_visbuf(test));
+ if (!similar_sgr(num, test, cap)) {
+ _nc_warning("%s differs from sgr(%d)\n\t%s=%s\n\tsgr(%d)=%s",
+ name, num,
+ name, _nc_visbuf2(1, cap),
+ num, _nc_visbuf2(2, test));
}
} else if (strcmp(test, zero)) {
_nc_warning("sgr(%d) present, but not %s", num, name);
@@ -1018,8 +1070,9 @@ check_termtype(TERMTYPE * tp)
* non-ANSI strings are misused.
*/
if ((max_colors > 0) != (max_pairs > 0)
- || (max_colors > max_pairs))
- _nc_warning("inconsistent values for max_colors and max_pairs");
+ || ((max_colors > max_pairs) && (initialize_pair == 0)))
+ _nc_warning("inconsistent values for max_colors (%d) and max_pairs (%d)",
+ max_colors, max_pairs);
PAIRED(set_foreground, set_background);
PAIRED(set_a_foreground, set_a_background);
diff --git a/contrib/ncurses/test/ncurses.c b/contrib/ncurses/test/ncurses.c
index 0782d4071073..3d2101dbc904 100644
--- a/contrib/ncurses/test/ncurses.c
+++ b/contrib/ncurses/test/ncurses.c
@@ -40,7 +40,7 @@ AUTHOR
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
Thomas E. Dickey (beginning revision 1.27 in 1996).
-$Id: ncurses.c,v 1.170 2002/04/21 21:08:07 tom Exp $
+$Id: ncurses.c,v 1.173 2002/06/16 00:29:27 tom Exp $
***************************************************************************/
@@ -104,13 +104,13 @@ extern int _nc_tracing;
#define ACS_NEQUAL (CURSES_ACS_ARRAY['|']) /* not equal */
#define ACS_STERLING (CURSES_ACS_ARRAY['}']) /* UK pound sign */
#else
-#define ACS_S3 (A_ALTCHARSET + 'p') /* scan line 3 */
-#define ACS_S7 (A_ALTCHARSET + 'r') /* scan line 7 */
-#define ACS_LEQUAL (A_ALTCHARSET + 'y') /* less/equal */
-#define ACS_GEQUAL (A_ALTCHARSET + 'z') /* greater/equal */
-#define ACS_PI (A_ALTCHARSET + '{') /* Pi */
-#define ACS_NEQUAL (A_ALTCHARSET + '|') /* not equal */
-#define ACS_STERLING (A_ALTCHARSET + '}') /* UK pound sign */
+#define ACS_S3 (A_ALTCHARSET + 'p') /* scan line 3 */
+#define ACS_S7 (A_ALTCHARSET + 'r') /* scan line 7 */
+#define ACS_LEQUAL (A_ALTCHARSET + 'y') /* less/equal */
+#define ACS_GEQUAL (A_ALTCHARSET + 'z') /* greater/equal */
+#define ACS_PI (A_ALTCHARSET + '{') /* Pi */
+#define ACS_NEQUAL (A_ALTCHARSET + '|') /* not equal */
+#define ACS_STERLING (A_ALTCHARSET + '}') /* UK pound sign */
#endif
#ifdef CURSES_WACS_ARRAY
@@ -358,12 +358,78 @@ wgetch_wrap(WINDOW *win, int first_y)
wclrtoeol(win);
}
+#if defined(NCURSES_VERSION) && defined(KEY_RESIZE)
+typedef struct {
+ WINDOW *text;
+ WINDOW *frame;
+} WINSTACK;
+
+static WINSTACK *winstack = 0;
+static unsigned len_winstack = 0;
+
+static void
+remember_boxes(unsigned level, WINDOW *txt_win, WINDOW *box_win)
+{
+ unsigned need = (level + 1) * 2;
+
+ if (winstack == 0) {
+ len_winstack = 20;
+ winstack = malloc(len_winstack * sizeof(WINSTACK));
+ } else if (need >= len_winstack) {
+ len_winstack = need;
+ winstack = realloc(winstack, len_winstack * sizeof(WINSTACK));
+ }
+ winstack[level].text = txt_win;
+ winstack[level].frame = box_win;
+}
+
+/*
+ * For wgetch_test(), we create pairs of windows - one for a box, one for text.
+ * Resize both and paint the box in the parent.
+ */
static void
-wgetch_test(WINDOW *win, int delay)
+resize_boxes(int level, WINDOW *win)
+{
+ unsigned n;
+ int base = 5;
+ int high = LINES - base;
+ int wide = COLS;
+
+ touchwin(stdscr);
+ wnoutrefresh(stdscr);
+
+ /* FIXME: this chunk should be done in resizeterm() */
+ slk_touch();
+ slk_clear();
+ slk_noutrefresh();
+
+ for (n = 0; (int) n < level; ++n) {
+ wresize(winstack[n].frame, high, wide);
+ wresize(winstack[n].text, high - 2, wide - 2);
+ high -= 2;
+ wide -= 2;
+ werase(winstack[n].text);
+ box(winstack[n].frame, 0, 0);
+ wnoutrefresh(winstack[n].frame);
+ wprintw(winstack[n].text,
+ "size %dx%d\n",
+ getmaxy(winstack[n].text),
+ getmaxx(winstack[n].text));
+ wnoutrefresh(winstack[n].text);
+ if (winstack[n].text == win)
+ break;
+ }
+ doupdate();
+}
+#else
+#define remember_boxes(level,text,frame) /* nothing */
+#endif
+
+static void
+wgetch_test(int level, WINDOW *win, int delay)
{
char buf[BUFSIZ];
int first_y, first_x;
- int last_y = getmaxy(win) - 1;
int c;
int incount = 0;
bool flags[256];
@@ -378,7 +444,7 @@ wgetch_test(WINDOW *win, int delay)
getyx(win, first_y, first_x);
wgetch_help(win, flags);
- wsetscrreg(win, first_y, last_y);
+ wsetscrreg(win, first_y, getmaxy(win) - 1);
scrollok(win, TRUE);
for (;;) {
@@ -420,7 +486,7 @@ wgetch_test(WINDOW *win, int delay)
} else if (c == 's') {
ShellOut(TRUE);
} else if (c == 'w') {
- int high = last_y - first_y + 1;
+ int high = getmaxy(win) - 1 - first_y + 1;
int wide = getmaxx(win) - first_x;
int old_y, old_x;
int new_y = first_y + getbegy(win);
@@ -434,7 +500,8 @@ wgetch_test(WINDOW *win, int delay)
box(wb, 0, 0);
wrefresh(wb);
wmove(wi, 0, 0);
- wgetch_test(wi, delay);
+ remember_boxes(level, wi, wb);
+ wgetch_test(level + 1, wi, delay);
delwin(wi);
delwin(wb);
@@ -442,6 +509,7 @@ wgetch_test(WINDOW *win, int delay)
wmove(win, old_y, old_x);
touchwin(win);
wrefresh(win);
+ doupdate();
}
#ifdef SIGTSTP
} else if (c == 'z') {
@@ -462,6 +530,11 @@ wgetch_test(WINDOW *win, int delay)
} else
#endif /* NCURSES_MOUSE_VERSION */
if (c >= KEY_MIN) {
+#if defined(NCURSES_VERSION) && defined(KEY_RESIZE)
+ if (c == KEY_RESIZE) {
+ resize_boxes(level, win);
+ }
+#endif
(void) waddstr(win, keyname(c));
} else if (c > 0x80) {
int c2 = (c & 0x7f);
@@ -528,17 +601,55 @@ static void
getch_test(void)
{
int delay = begin_getch_test();
- wgetch_test(stdscr, delay);
+ wgetch_test(0, stdscr, delay);
finish_getch_test();
}
#if USE_WIDEC_SUPPORT
+/*
+ * For wgetch_test(), we create pairs of windows - one for a box, one for text.
+ * Resize both and paint the box in the parent.
+ */
+static void
+resize_wide_boxes(int level, WINDOW *win)
+{
+ unsigned n;
+ int base = 5;
+ int high = LINES - base;
+ int wide = COLS;
+
+ touchwin(stdscr);
+ wnoutrefresh(stdscr);
+
+ /* FIXME: this chunk should be done in resizeterm() */
+ slk_touch();
+ slk_clear();
+ slk_noutrefresh();
+
+ for (n = 0; (int) n < level; ++n) {
+ wresize(winstack[n].frame, high, wide);
+ wresize(winstack[n].text, high - 2, wide - 2);
+ high -= 2;
+ wide -= 2;
+ werase(winstack[n].text);
+ box_set(winstack[n].frame, 0, 0);
+ wnoutrefresh(winstack[n].frame);
+ wprintw(winstack[n].text,
+ "size %dx%d\n",
+ getmaxy(winstack[n].text),
+ getmaxx(winstack[n].text));
+ wnoutrefresh(winstack[n].text);
+ if (winstack[n].text == win)
+ break;
+ }
+ doupdate();
+}
+
static void
-wget_wch_test(WINDOW *win, int delay)
+wget_wch_test(int level, WINDOW *win, int delay)
{
char buf[BUFSIZ];
int first_y, first_x;
- int last_y = getmaxy(win) - 1;
wint_t c;
int incount = 0;
bool flags[256];
@@ -553,7 +664,7 @@ wget_wch_test(WINDOW *win, int delay)
getyx(win, first_y, first_x);
wgetch_help(win, flags);
- wsetscrreg(win, first_y, last_y);
+ wsetscrreg(win, first_y, getmaxy(win) - 1);
scrollok(win, TRUE);
for (;;) {
@@ -595,7 +706,7 @@ wget_wch_test(WINDOW *win, int delay)
} else if (c == 's') {
ShellOut(TRUE);
} else if (c == 'w') {
- int high = last_y - first_y + 1;
+ int high = getmaxy(win) - 1 - first_y + 1;
int wide = getmaxx(win) - first_x;
int old_y, old_x;
int new_y = first_y + getbegy(win);
@@ -609,7 +720,8 @@ wget_wch_test(WINDOW *win, int delay)
box_set(wb, 0, 0);
wrefresh(wb);
wmove(wi, 0, 0);
- wget_wch_test(wi, delay);
+ remember_boxes(level, wi, wb);
+ wget_wch_test(level + 1, wi, delay);
delwin(wi);
delwin(wb);
@@ -637,6 +749,11 @@ wget_wch_test(WINDOW *win, int delay)
} else
#endif /* NCURSES_MOUSE_VERSION */
if (code == KEY_CODE_YES) {
+#ifdef KEY_RESIZE
+ if (c == KEY_RESIZE) {
+ resize_wide_boxes(level, win);
+ }
+#endif
(void) waddstr(win, key_name(c));
} else {
if (c < 256 && iscntrl(c)) {
@@ -658,7 +775,7 @@ static void
get_wch_test(void)
{
int delay = begin_getch_test();
- wget_wch_test(stdscr, delay);
+ wget_wch_test(0, stdscr, delay);
finish_getch_test();
}
#endif
diff --git a/contrib/ncurses/test/testcurs.c b/contrib/ncurses/test/testcurs.c
index b08c766f3bcd..7e92f795c019 100644
--- a/contrib/ncurses/test/testcurs.c
+++ b/contrib/ncurses/test/testcurs.c
@@ -7,7 +7,7 @@
* wrs(5/28/93) -- modified to be consistent (perform identically) with either
* PDCurses or under Unix System V, R4
*
- * $Id: testcurs.c,v 1.28 2002/02/03 00:29:22 tom Exp $
+ * $Id: testcurs.c,v 1.29 2002/06/01 16:17:52 tom Exp $
*/
#include <test.priv.h>
@@ -387,13 +387,13 @@ inputTest(WINDOW *win)
repeat = 0;
do {
- static char *fmt[] = {
+ static const char *fmt[] = {
"%d %10s",
"%d %[a-zA-Z]s",
"%d %[][a-zA-Z]s",
"%d %[^0-9]"
};
- char *format = fmt[repeat % SIZEOF(fmt)];
+ const char *format = fmt[repeat % SIZEOF(fmt)];
wclear(win);
mvwaddstr(win, 3, 2, "The window should have moved");