-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1235 2008/05/17 19:51:30 tom Exp $
+-- $Id: NEWS,v 1.1237 2008/05/24 22:23:07 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20080524
+ + modify _nc_keypad() to make it switch temporarily as needed to the
+ screen which must be updated.
+ + wrap cur_term variable to help make _nc_keymap() thread-safe, and
+ always set the screen's copy of this variable in set_curterm().
+ + restore curs_set() state after endwin()/refresh() (report/patch
+ Miroslav Lichvar)
+
20080517
+ modify configure script to note that --enable-ext-colors and
--enable-ext-mouse are not experimental, but extensions from
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.642 2008/05/17 18:44:56 tom Exp $
+# $Id: dist.mk,v 1.643 2008/05/24 12:05:32 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 6
-NCURSES_PATCH = 20080517
+NCURSES_PATCH = 20080524
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
# vile:awkmode
BEGIN {
print "/****************************************************************************"
- print " * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *"
+ print " * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *"
print " * *"
print " * Permission is hereby granted, free of charge, to any person obtaining a *"
print " * copy of this software and associated documentation files (the *"
print "/* and: Thomas E. Dickey 1995-on */"
print "/****************************************************************************/"
print ""
- print "/* $Id: MKterm.h.awk.in,v 1.49 2007/08/18 11:44:26 tom Exp $ */"
+ print "/* $Id: MKterm.h.awk.in,v 1.50 2008/05/24 23:13:59 tom Exp $ */"
print ""
print "/*"
print "** term.h -- Definition of struct term"
print " char * _termname; /* used for termname() */"
print "} TERMINAL;"
print ""
- print "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
- print ""
print "#if @BROKEN_LINKER@ || @cf_cv_enable_reentrant@"
+ print "NCURSES_WRAPPED_VAR(TERMINAL *, cur_term);"
print "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolnames);"
print "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolcodes);"
print "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolfnames);"
print "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strcodes);"
print "NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strfnames);"
print ""
+ print "#define cur_term NCURSES_PUBLIC_VAR(cur_term())"
print "#define boolnames NCURSES_PUBLIC_VAR(boolnames())"
print "#define boolcodes NCURSES_PUBLIC_VAR(boolcodes())"
print "#define boolfnames NCURSES_PUBLIC_VAR(boolfnames())"
print ""
print "#else"
print ""
+ print "extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;"
+ print ""
print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];"
print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];"
print "extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];"
/*
- * $Id: curses.priv.h,v 1.374 2008/05/17 21:24:44 tom Exp $
+ * $Id: curses.priv.h,v 1.375 2008/05/24 23:08:27 tom Exp $
*
* curses.priv.h
*
chtype *real_acs_map;
int _LINES;
int _COLS;
+ TERMINAL *_cur_term;
#ifdef TRACE
long _outchars;
const char *_tputs_trace;
#include <term_entry.h>
-MODULE_ID("$Id: init_keytry.c,v 1.11 2008/05/03 23:09:15 tom Exp $")
+MODULE_ID("$Id: init_keytry.c,v 1.12 2008/05/24 21:44:51 tom Exp $")
/*
** _nc_init_keytry()
**
*/
+/*
+ * Internal entrypoints use SCREEN* parameter to obtain capabilities rather
+ * than cur_term.
+ */
+#undef CUR
+#define CUR (sp->_term)->type.
+
#if BROKEN_LINKER
#undef _nc_tinfo_fkeys
#endif
/****************************************************************************
- * Copyright (c) 1998-2000,2003 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2003,2008 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 *
#include <term_entry.h> /* TTY, cur_term */
#include <termcap.h> /* ospeed */
-MODULE_ID("$Id: lib_cur_term.c,v 1.13 2003/12/27 18:21:30 tom Exp $")
+MODULE_ID("$Id: lib_cur_term.c,v 1.15 2008/05/24 23:11:18 tom Exp $")
+#if USE_REENTRANT
+NCURSES_EXPORT(TERMINAL *)
+NCURSES_PUBLIC_VAR(cur_term) (void)
+{
+ return (SP != 0 && SP->_term != 0) ? SP->_term : _nc_prescreen._cur_term;
+}
+#else
NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0;
+#endif
NCURSES_EXPORT(TERMINAL *)
set_curterm(TERMINAL * termp)
T((T_CALLED("set_curterm(%p)"), termp));
- if ((cur_term = termp) != 0) {
- ospeed = _nc_ospeed(cur_term->_baudrate);
+ if (SP)
+ SP->_term = termp;
+#if USE_REENTRANT
+ _nc_prescreen._cur_term = termp;
+#else
+ cur_term = termp;
+#endif
+ if (termp != 0) {
+ ospeed = _nc_ospeed(termp->_baudrate);
PC = (pad_char != NULL) ? pad_char[0] : 0;
}
+
T((T_RETURN("%p"), oldterm));
return (oldterm);
}
FreeIfNeeded(termp->_termname);
free(termp);
if (termp == cur_term)
- cur_term = 0;
+ set_curterm(0);
returnCode(OK);
}
returnCode(ERR);
#include <curses.priv.h>
-MODULE_ID("$Id: lib_data.c,v 1.43 2008/03/29 21:16:49 tom Exp $")
+MODULE_ID("$Id: lib_data.c,v 1.44 2008/05/24 23:09:21 tom Exp $")
/*
* OS/2's native linker complains if we don't initialize public data when
NULL, /* real_acs_map */
0, /* LINES */
0, /* COLS */
+ 0, /* cur_term */
#ifdef TRACE
0L, /* _outchars */
NULL, /* _tputs_trace */
#include <term.h>
-MODULE_ID("$Id: lib_options.c,v 1.52 2008/05/03 23:09:20 tom Exp $")
+MODULE_ID("$Id: lib_options.c,v 1.55 2008/05/25 00:32:17 tom Exp $")
+
+static int _nc_curs_set(SCREEN *, int);
+static int _nc_meta(SCREEN *, bool);
NCURSES_EXPORT(int)
idlok(WINDOW *win, bool flag)
NCURSES_EXPORT(int)
meta(WINDOW *win GCC_UNUSED, bool flag)
{
- int result = ERR;
+ int result;
/* Ok, we stay relaxed and don't signal an error if win is NULL */
T((T_CALLED("meta(%p,%d)"), win, flag));
-
- if (SP != 0) {
- SP->_use_meta = flag;
-
- if (flag && meta_on) {
- TPUTS_TRACE("meta_on");
- putp(meta_on);
- } else if (!flag && meta_off) {
- TPUTS_TRACE("meta_off");
- putp(meta_off);
- }
- result = OK;
- }
+ result = _nc_meta(SP, flag);
returnCode(result);
}
NCURSES_EXPORT(int)
curs_set(int vis)
{
- int result = ERR;
+ int result;
T((T_CALLED("curs_set(%d)"), vis));
- if (SP != 0 && vis >= 0 && vis <= 2) {
- int cursor = SP->_cursor;
-
- if (vis == cursor) {
- result = cursor;
- } else {
- result = (cursor == -1 ? 1 : cursor);
- switch (vis) {
- case 2:
- if (cursor_visible) {
- TPUTS_TRACE("cursor_visible");
- putp(cursor_visible);
- } else
- result = ERR;
- break;
- case 1:
- if (cursor_normal) {
- TPUTS_TRACE("cursor_normal");
- putp(cursor_normal);
- } else
- result = ERR;
- break;
- case 0:
- if (cursor_invisible) {
- TPUTS_TRACE("cursor_invisible");
- putp(cursor_invisible);
- } else
- result = ERR;
- break;
- }
- SP->_cursor = vis;
- _nc_flush();
- }
- }
+ result = _nc_curs_set(SP, vis);
returnCode(result);
}
}
#endif /* NCURSES_EXT_FUNCS */
+/*
+ * Internal entrypoints use SCREEN* parameter to obtain capabilities rather
+ * than cur_term.
+ */
+#undef CUR
+#define CUR (sp->_term)->type.
+
+static int
+_nc_putp(const char *name GCC_UNUSED, const char *value)
+{
+ int rc = ERR;
+
+ if (value) {
+ TPUTS_TRACE(name);
+ rc = putp(value);
+ }
+ return rc;
+}
+
+static int
+_nc_putp_flush(const char *name, const char *value)
+{
+ int rc = _nc_putp(name, value);
+ if (rc != ERR) {
+ _nc_flush();
+ }
+ return rc;
+}
+
/* Turn the keypad on/off
*
* Note: we flush the output because changing this mode causes some terminals
NCURSES_EXPORT(int)
_nc_keypad(SCREEN *sp, bool flag)
{
- if (flag && keypad_xmit) {
- TPUTS_TRACE("keypad_xmit");
- putp(keypad_xmit);
- _nc_flush();
- } else if (!flag && keypad_local) {
- TPUTS_TRACE("keypad_local");
- putp(keypad_local);
- _nc_flush();
- }
+ int rc = ERR;
if (sp != 0) {
- if (flag && !sp->_tried) {
- _nc_init_keytry(sp);
- sp->_tried = TRUE;
+#ifdef USE_PTHREADS
+ /*
+ * We might have this situation in a multithreaded application that
+ * has wgetch() reading in more than one thread. putp() and below
+ * may use SP explicitly.
+ */
+ if (sp != SP) {
+ SCREEN *save_sp;
+
+ /* cannot use use_screen(), since that is not in tinfo library */
+ _nc_lock_global(use_screen);
+ save_sp = SP;
+ SP = sp;
+ rc = _nc_keypad(sp, flag);
+ SP = save_sp;
+ _nc_unlock_global(use_screen);
+ } else
+#endif
+ {
+ if (flag) {
+ (void) _nc_putp_flush("keypad_xmit", keypad_xmit);
+ } else if (!flag && keypad_local) {
+ (void) _nc_putp_flush("keypad_local", keypad_local);
+ }
+
+ if (flag && !sp->_tried) {
+ _nc_init_keytry(sp);
+ sp->_tried = TRUE;
+ }
+ sp->_keypad_on = flag;
+ rc = OK;
}
- sp->_keypad_on = flag;
}
- return (OK);
+ return (rc);
+}
+
+static int
+_nc_curs_set(SCREEN *sp, int vis)
+{
+ int result = ERR;
+
+ T((T_CALLED("curs_set(%d)"), vis));
+ if (sp != 0 && vis >= 0 && vis <= 2) {
+ int cursor = sp->_cursor;
+
+ if (vis == cursor) {
+ result = cursor;
+ } else {
+ switch (vis) {
+ case 2:
+ result = _nc_putp_flush("cursor_visible", cursor_visible);
+ break;
+ case 1:
+ result = _nc_putp_flush("cursor_normal", cursor_normal);
+ break;
+ case 0:
+ result = _nc_putp_flush("cursor_invisible", cursor_invisible);
+ break;
+ }
+ if (result != ERR)
+ result = (cursor == -1 ? 1 : cursor);
+ sp->_cursor = vis;
+ }
+ }
+ returnCode(result);
+}
+
+static int
+_nc_meta(SCREEN *sp, bool flag)
+{
+ int result = ERR;
+
+ /* Ok, we stay relaxed and don't signal an error if win is NULL */
+
+ if (SP != 0) {
+ SP->_use_meta = flag;
+
+ if (flag) {
+ _nc_putp("meta_on", meta_on);
+ } else {
+ _nc_putp("meta_off", meta_off);
+ }
+ result = OK;
+ }
+ return result;
}
/****************************************************************************
- * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2007,2008 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 *
#include <term.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_mvcur.c,v 1.110 2007/08/11 16:15:57 tom Exp $")
+MODULE_ID("$Id: lib_mvcur.c,v 1.111 2008/05/24 14:36:54 Miroslav.Lichvar Exp $")
#define WANT_CHAR(y, x) SP->_newscr->_line[y].text[x] /* desired state */
#define BAUDRATE cur_term->_baudrate /* bits per second */
mvcur(-1, -1, screen_lines - 1, 0);
/* set cursor to normal mode */
- if (SP->_cursor != -1)
+ if (SP->_cursor != -1) {
+ int cursor = SP->_cursor;
curs_set(1);
+ SP->_cursor = cursor;
+ }
if (exit_ca_mode) {
TPUTS_TRACE("exit_ca_mode");
# endif
#endif
-MODULE_ID("$Id: lib_twait.c,v 1.57 2008/05/03 21:35:57 tom Exp $")
+#undef CUR
+
+MODULE_ID("$Id: lib_twait.c,v 1.58 2008/05/24 15:08:01 tom Exp $")
static long
_nc_gettime(TimeType * t0, bool first)
* authorization. *
****************************************************************************/
/*
- * $Id: rain.c,v 1.33 2008/03/22 18:12:01 tom Exp $
+ * $Id: rain.c,v 1.34 2008/05/24 23:34:34 tom Exp $
*/
#include <test.priv.h>
last[j].x = random_x();
last[j].y = random_y();
}
+ j = 0;
#endif
while (!done) {