ncurses 5.6 - patch 20071020

+ continue implementing support for threading demo by adding mutex
  for use_window().
+ add mrxvt terminfo entry, add/fix xterm building blocks for modified
  cursor keys -TD
+ compile with FreeBSD "contemporary" TTY interface (patch by
  Rong-En Fan).
This commit is contained in:
Thomas E. Dickey 2007-10-20 23:21:19 +00:00
parent 491a3f08b7
commit cc79c103a0
9 changed files with 140 additions and 55 deletions

10
NEWS
View File

@ -25,7 +25,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: NEWS,v 1.1177 2007/10/13 22:24:34 tom Exp $
-- $Id: NEWS,v 1.1180 2007/10/20 20:55:26 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
@ -45,6 +45,14 @@ See the AUTHORS file for the corresponding full names.
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
20071020
+ continue implementing support for threading demo by adding mutex
for use_window().
+ add mrxvt terminfo entry, add/fix xterm building blocks for modified
cursor keys -TD
+ compile with FreeBSD "contemporary" TTY interface (patch by
Rong-En Fan).
20071013
+ modify makefile rules to allow clear, tput and tset to be built
without libtic. The other programs (infocmp, tic and toe) rely on

View File

@ -25,7 +25,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: dist.mk,v 1.613 2007/10/13 11:47:05 tom Exp $
# $Id: dist.mk,v 1.614 2007/10/20 14:35:24 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
@ -37,7 +37,7 @@ SHELL = /bin/sh
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 6
NCURSES_PATCH = 20071013
NCURSES_PATCH = 20071020
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)

View File

@ -6,8 +6,8 @@
# Report bugs and new terminal descriptions to
# bug-ncurses@gnu.org
#
# $Revision: 1.312 $
# $Date: 2007/10/13 17:26:29 $
# $Revision: 1.317 $
# $Date: 2007/10/20 18:34:36 $
#
# The original header is preserved below for reference. It is noted that there
# is a "newer" version which differs in some cosmetic details (but actually
@ -3026,11 +3026,10 @@ xterm-xfree86|xterm terminal emulator (XFree86),
xterm-new|modern xterm terminal emulator,
npc,
indn=\E[%p1%dS, kDC=\E[3;2~, kEND=\E[1;2F, kHOM=\E[1;2H,
kIC=\E[2;2~, kLFT=\E[1;2D, kNXT=\E[6;2~, kPRV=\E[5;2~,
kRIT=\E[1;2C, kb2=\EOE, kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB,
kcuf1=\EOC, kcuu1=\EOA, kend=\EOF, kent=\EOM, khome=\EOH,
kich1=\E[2~, kind=\E[1;2B, kmous=\E[M, knp=\E[6~,
kpp=\E[5~, kri=\E[1;2A, rin=\E[%p1%dT, use=xterm+pcfkeys,
kIC=\E[2;2~, kNXT=\E[6;2~, kPRV=\E[5;2~, kb2=\EOE,
kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
kend=\EOF, kent=\EOM, khome=\EOH, kich1=\E[2~, kmous=\E[M,
knp=\E[6~, kpp=\E[5~, rin=\E[%p1%dT, use=xterm+pcfkeys,
use=xterm-basic,
#
# This fragment describes as much of XFree86 xterm's "pc-style" function
@ -3071,25 +3070,30 @@ xterm+pcfkeys|fragment for PC-style fkeys,
# modifyCursorKeys resource. These fragments list the modified cursor-keys
# that might apply to xterm+pcfkeys with different values of that resource.
xterm+pcc3|fragment with modifyCursorKeys:3,
kDN=\E[>1;2B, kDN5=\E[>1;5B, kDN6=\E[>1;6B,
kLFT=\E[>1;2D, kRIT=\E[>1;2C, kind=\E[>1;2B,
kri=\E[>1;2A, kDN=\E[>1;2B, kDN5=\E[>1;5B, kDN6=\E[>1;6B,
kLFT5=\E[>1;5D, kLFT6=\E[>1;6D, kRIT5=\E[>1;5C,
kRIT6=\E[>1;6C, kUP=\E[>1;2A, kUP5=\E[>1;5A,
kUP6=\E[>1;6A,
xterm+pcc2|fragment with modifyCursorKeys:2,
kLFT=\E[1;2D, kRIT=\E[1;2C, kind=\E[1;2B, kri=\E[1;2A,
kDN=\E[1;2B, kDN5=\E[1;5B, kDN6=\E[1;6B, kLFT5=\E[1;5D,
kLFT6=\E[1;6D, kRIT5=\E[1;5C, kRIT6=\E[1;6C, kUP=\E[1;2A,
kUP5=\E[1;5A, kUP6=\E[1;6A,
xterm+pcc1|fragment with modifyCursorKeys:1,
kDN=\E[2B, kDN5=\E[5B, kDN6=\E[6B, kLFT5=\E[5D,
kLFT6=\E[6D, kRIT5=\E[5C, kRIT6=\E[6C, kUP=\E[2A,
kUP5=\E[5A, kUP6=\E[6A,
kLFT=\E[2D, kRIT=\E[2C, kind=\E[2B, kri=\E[2A, kDN=\E[2B,
kDN5=\E[5B, kDN6=\E[6B, kLFT5=\E[5D, kLFT6=\E[6D,
kRIT5=\E[5C, kRIT6=\E[6C, kUP=\E[2A, kUP5=\E[5A,
kUP6=\E[6A,
xterm+pcc0|fragment with modifyCursorKeys:0,
kDN=\EO2B, kDN5=\EO5B, kDN6=\EO6B, kLFT5=\EO5D,
kLFT6=\EO6D, kRIT5=\EO5C, kRIT6=\EO6C, kUP=\EO2A,
kUP5=\EO5A, kUP6=\EO6A,
kLFT=\EO2D, kRIT=\EO2C, kind=\EO2B, kri=\EO2A, kDN=\EO2B,
kDN5=\EO5B, kDN6=\EO6B, kLFT5=\EO5D, kLFT6=\EO6D,
kRIT5=\EO5C, kRIT6=\EO6C, kUP=\EO2A, kUP5=\EO5A,
kUP6=\EO6A,
#
# Here are corresponding fragments from xterm patch #216:
#
@ -3132,6 +3136,18 @@ xterm+pcf2|fragment with modifyFunctionKeys:2,
kf61=\E[1;4P, kf62=\E[1;4Q, kf63=\E[1;4R, kf7=\E[18~,
kf8=\E[19~, kf9=\E[20~,
#
# Those chunks use the new-style (the xterm oldFunctionKeys resource is false).
# Alternatively, the same scheme with old-style function keys as in xterm-r6
# is shown here (because that is used in mrxvt and mlterm):
xterm+r6f2|xterm with oldFunctionKeys and modifyFunctionKeys:2,
kf1=\E[11~, kf13=\E[11;2~, kf14=\E[12;2~, kf15=\E[13;2~,
kf16=\E[14;2~, kf2=\E[12~, kf25=\E[11;5~, kf26=\E[12;5~,
kf27=\E[13;5~, kf28=\E[14;5~, kf3=\E[13~, kf37=\E[11;6~,
kf38=\E[12;6~, kf39=\E[13;6~, kf4=\E[14~, kf40=\E[14;6~,
kf49=\E[11;3~, kf50=\E[12;3~, kf51=\E[13;3~,
kf52=\E[14;3~, kf61=\E[11;4~, kf62=\E[12;4~,
kf63=\E[13;4~, use=xterm+pcf2,
#
# This chunk is used for building the VT220/Sun/PC keyboard variants.
xterm-basic|modern xterm terminal emulator - common,
OTbs, am, bce, km, mc5i, mir, msgr, xenl, AX,
@ -3470,8 +3486,19 @@ gnome-fc5|GNOME Terminal,
rs2=\E7\E[r\E8\E[m\E[?7h\E[!p\E[?1;3;4;6l\E[4l\E>\E[?1000l\E[?25h,
use=ansi+enq, use=xterm+pcc0, use=gnome-rh90,
# GNOME Terminal 2.18.1 (2007 snapshot)
#
# For any "recent" version of gnome-terminal, it is futile to attempt to
# support modifiers on cursor- and keypad keys because the program usually
# is hardcoded to set $TERM to "xterm", and on startup, it builds a subset
# of the keys (which more/less correspond to the termcap values), and will
# interpret those according to the $TERM value, but others not in the
# terminfo according to some constantly changing set of hacker guidelines -TD
gnome-2007|GNOME Terminal snapshot 2.18.1,
use=xterm+pcc2, use=gnome-fc5,
gnome|GNOME Terminal,
use=gnome-fc5,
use=gnome-2007,
# palette is hardcoded...
gnome-256color|GNOME Terminal with xterm 256-colors,
@ -3616,37 +3643,18 @@ mlterm|multi lingual terminal emulator,
ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, indn=\E[%p1%dS,
is2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>,
kbs=\177, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\E[11~, kf10=\E[21~,
kf11=\E[23~, kf12=\E[24~, kf13=\E[11;2~, kf14=\E[12;2~,
kf15=\E[13;2~, kf16=\E[14;2~, kf17=\E[15;2~,
kf18=\E[17;2~, kf19=\E[18;2~, kf2=\E[12~, kf20=\E[19;2~,
kf21=\E[20;2~, kf22=\E[21;2~, kf23=\E[23;2~,
kf24=\E[24;2~, kf25=\E[11;5~, kf26=\E[12;5~,
kf27=\E[13;5~, kf28=\E[14;5~, kf29=\E[15;5~, kf3=\E[13~,
kf30=\E[17;5~, kf31=\E[18;5~, kf32=\E[19;5~,
kf33=\E[20;5~, kf34=\E[21;5~, kf35=\E[23;5~,
kf36=\E[24;5~, kf37=\E[11;6~, kf38=\E[12;6~,
kf39=\E[13;6~, kf4=\E[14~, kf40=\E[14;6~, kf41=\E[15;6~,
kf42=\E[17;6~, kf43=\E[18;6~, kf44=\E[19;6~,
kf45=\E[20;6~, kf46=\E[21;6~, kf47=\E[23;6~,
kf48=\E[24;6~, kf49=\E[11;3~, kf5=\E[15~, kf50=\E[12;3~,
kf51=\E[13;3~, kf52=\E[14;3~, kf53=\E[15;3~,
kf54=\E[17;3~, kf55=\E[18;3~, kf56=\E[19;3~,
kf57=\E[20;3~, kf58=\E[21;3~, kf59=\E[23;3~, kf6=\E[17~,
kf60=\E[24;3~, kf61=\E[11;4~, kf62=\E[12;4~,
kf63=\E[13;4~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
kfnd=\E[1~, khome=\EOH, kich1=\E[2~, kmous=\E[M, knp=\E[6~,
kpp=\E[5~, kslt=\E[4~, mc0=\E[i, nel=\EE, op=\E[39;49m,
rc=\E8, rev=\E[7m, ri=\EM, rin=\E[%p1%dT, rmacs=\E(B,
rmam=\E[?7l, rmcup=\E[?1049l, rmir=\E[4l, rmkx=\E[?1l\E>,
rmso=\E[27m, rmul=\E[24m,
kdch1=\E[3~, kend=\EOF, kent=\EOM, kfnd=\E[1~, khome=\EOH,
kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, kslt=\E[4~,
mc0=\E[i, nel=\EE, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM,
rin=\E[%p1%dT, rmacs=\E(B, rmam=\E[?7l, rmcup=\E[?1049l,
rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[27m, rmul=\E[24m,
rs2=\E7\E[r\E8\E[m\E[?7h\E[?1;3;4;6l\E[4l\E>\E[?1000l,
sc=\E7, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;m%?%p9%t\E(0%e\E(B%;,
sgr0=\E[m\E(B, smacs=\E(0, smam=\E[?7h, smcup=\E[?1049h,
smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m,
tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?1;2c, u9=\E[c,
vpa=\E[%i%p1%dd, use=mlterm+pcfkeys,
vpa=\E[%i%p1%dd, use=mlterm+pcfkeys, use=xterm+r6f2,
# The insert/delete/home/end keys do not respond to modifiers because mlterm
# looks in its termcap to decide which string to send. If it used terminfo
@ -3676,7 +3684,7 @@ mlterm+pcfkeys|fragment for PC-style fkeys,
#
# 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" (monochrome) and "rxvt-color".
# "rxvt" or "rxvt-color".
#
# removed dch/dch1 because they are inconsistent with bce/ech -TD
# remove km as per tack test -TD
@ -3828,6 +3836,13 @@ rxvt-cygwin-native|rxvt terminal emulator (native MS Window System port) on cygw
rxvt-16color|xterm with 16 colors like aixterm,
ncv#32, use=ibm+16color, use=rxvt,
# mrxvt 0.5.3
#
# mrxvt is based on rxvt 2.7.11, but has by default XTERM_FKEYS defined, which
# makes its function-keys different from other flavors of rxvt -TD
mrxvt|multitabbed rxvt,
use=xterm+pcc2, use=xterm+r6f2, use=rxvt,
# From: Michael Jennings <mej@valinux.com>
#
# Eterm 0.9.3
@ -21581,6 +21596,13 @@ v3220|LANPAR Vision II model 3220/3221/3222,
# * update mlterm entry to 2.9.3 -TD
# * add mlterm+pcfkeys -TD
#
# 2007-10-20
# * move kLFT, kRIT, kind and kri capabilities from xterm-new to
# xterm+pcc0, etc., to make the corresponding building blocks reflect
# xterm's capabilities -TD
# * add mrxvt entry -TD
# * add xterm+r6f2, use in mlterm and mrxvt entries -TD
#
# The following sets edit modes for GNU EMACS.
# Local Variables:
# fill-prefix:"\t"

View File

@ -41,7 +41,7 @@
#include <curses.priv.h>
MODULE_ID("$Id: lib_newwin.c,v 1.40 2007/03/10 18:18:59 tom Exp $")
MODULE_ID("$Id: lib_newwin.c,v 1.41 2007/10/20 20:56:07 tom Exp $")
static WINDOW *
remove_window_from_screen(WINDOW *win)
@ -225,6 +225,15 @@ _nc_makenew(int num_lines, int num_columns, int begy, int begx, int flags)
if ((wp = typeCalloc(WINDOWLIST, 1)) == 0)
returnWin(0);
#ifdef USE_PTHREADS
{
pthread_mutexattr_t recattr;
memset(&recattr, 0, sizeof(recattr));
pthread_mutexattr_settype(&recattr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&(wp->mutex_use_window), &recattr);
}
#endif
win = &(wp->win);
if ((win->_line = typeCalloc(struct ldat, ((unsigned) num_lines))) == 0) {

View File

@ -32,7 +32,39 @@
#include <curses.priv.h>
MODULE_ID("$Id: use_window.c,v 1.1 2007/09/08 21:35:33 tom Exp $")
MODULE_ID("$Id: use_window.c,v 1.2 2007/10/20 19:57:55 tom Exp $")
#ifdef USE_PTHREADS
NCURSES_EXPORT(void)
_nc_lock_window(WINDOW *win)
{
WINDOWLIST *p;
_nc_lock_global(windowlist);
for (p = _nc_windows; p != 0; p = p->next) {
if (&(p->win) == win) {
pthread_mutex_lock(&(p->mutex_use_window));
break;
}
}
_nc_unlock_global(windowlist);
}
NCURSES_EXPORT(void)
_nc_unlock_window(WINDOW *win)
{
WINDOWLIST *p;
_nc_lock_global(windowlist);
for (p = _nc_windows; p != 0; p = p->next) {
if (&(p->win) == win) {
pthread_mutex_unlock(&(p->mutex_use_window));
break;
}
}
_nc_unlock_global(windowlist);
}
#endif
NCURSES_EXPORT(int)
use_window(WINDOW *win, NCURSES_CALLBACK func, void *data)
@ -43,5 +75,6 @@ use_window(WINDOW *win, NCURSES_CALLBACK func, void *data)
_nc_lock_window(win);
code = func(win, data);
_nc_unlock_window(win);
returnCode(code);
}

View File

@ -34,7 +34,7 @@
/*
* $Id: curses.priv.h,v 1.346 2007/10/13 18:55:29 Miroslav.Lichvar Exp $
* $Id: curses.priv.h,v 1.347 2007/10/20 19:56:55 tom Exp $
*
* curses.priv.h
*
@ -305,20 +305,25 @@ color_t;
#include <pthread.h>
#define _nc_lock_global(name) pthread_mutex_lock(&_nc_globals.mutex_##name)
#define _nc_unlock_global(name) pthread_mutex_unlock(&_nc_globals.mutex_##name)
extern NCURSES_EXPORT(void) _nc_lock_window(WINDOW *);
extern NCURSES_EXPORT(void) _nc_unlock_window(WINDOW *);
#else
#error POSIX threads requires --enable-reentrant option
#endif
#else
#define _nc_lock_global(name) /* nothing */
#define _nc_unlock_global(name) /* nothing */
#define _nc_lock_window(name) TRUE
#define _nc_unlock_window(name) /* nothing */
#endif
#define _nc_lock_screen(name) /* nothing */
#define _nc_unlock_screen(name) /* nothing */
#define _nc_lock_window(name) /* nothing */
#define _nc_unlock_window(name) /* nothing */
/*
* Definitions for color pairs
*/
@ -559,6 +564,7 @@ typedef struct {
#ifdef USE_PTHREADS
pthread_mutex_t mutex_set_SP;
pthread_mutex_t mutex_use_screen;
pthread_mutex_t mutex_use_window;
pthread_mutex_t mutex_windowlist;
pthread_mutex_t mutex_tst_tracef;
pthread_mutex_t mutex_tracef;
@ -840,6 +846,9 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
int addch_x; /* x-position for addch_work[] */
int addch_y; /* y-position for addch_work[] */
#endif
#ifdef USE_PTHREADS
pthread_mutex_t mutex_use_window;
#endif
};
#define WINDOW_EXT(win,field) (((WINDOWLIST *)(win))->field)

View File

@ -40,6 +40,9 @@
#include <curses.priv.h>
#include <term.h> /* cur_term, pad_char */
#include <termcap.h> /* ospeed */
#if defined(__FreeBSD__)
#include <sys/param.h>
#endif
/*
* These systems use similar header files, which define B1200 as 1200, etc.,
@ -47,7 +50,7 @@
* of the indices up to B115200 fit nicely in a 'short', allowing us to retain
* ospeed's type for compatibility.
*/
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#if (defined(__FreeBSD__) && (__FreeBSD_version < 700000)) || defined(__NetBSD__) || defined(__OpenBSD__)
#undef B0
#undef B50
#undef B75
@ -77,7 +80,7 @@
#undef USE_OLD_TTY
#endif /* USE_OLD_TTY */
MODULE_ID("$Id: lib_baudrate.c,v 1.24 2007/03/10 19:25:57 tom Exp $")
MODULE_ID("$Id: lib_baudrate.c,v 1.25 2007/10/20 15:00:41 Rong-En.Fan Exp $")
/*
* int

View File

@ -41,7 +41,7 @@
#include <curses.priv.h>
MODULE_ID("$Id: lib_data.c,v 1.32 2007/09/29 21:34:21 tom Exp $")
MODULE_ID("$Id: lib_data.c,v 1.33 2007/10/20 19:07:29 tom Exp $")
/*
* OS/2's native linker complains if we don't initialize public data when
@ -179,6 +179,7 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
#ifdef USE_PTHREADS
PTHREAD_MUTEX_INITIALIZER, /* mutex_set_SP */
PTHREAD_MUTEX_INITIALIZER, /* mutex_use_screen */
PTHREAD_MUTEX_INITIALIZER, /* mutex_use_window */
PTHREAD_MUTEX_INITIALIZER, /* mutex_windowlist */
PTHREAD_MUTEX_INITIALIZER, /* mutex_tst_tracef */
PTHREAD_MUTEX_INITIALIZER, /* mutex_tracef */

View File

@ -32,7 +32,7 @@
#include <curses.priv.h>
MODULE_ID("$Id: use_screen.c,v 1.2 2007/09/08 21:46:48 tom Exp $")
MODULE_ID("$Id: use_screen.c,v 1.3 2007/10/20 22:46:13 tom Exp $")
NCURSES_EXPORT(int)
use_screen(SCREEN *screen, NCURSES_CALLBACK func, void *data)
@ -40,7 +40,7 @@ use_screen(SCREEN *screen, NCURSES_CALLBACK func, void *data)
SCREEN *save_SP;
int code = OK;
T((T_CALLED("use_window(%p,%p,%p)"), screen, func, data));
T((T_CALLED("use_screen(%p,%p,%p)"), screen, func, data));
/*
* FIXME - add a flag so a given thread can check if _it_ has already