summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8144a95)
+ remove recursive-mutex definitions, finish threading demo for worm.c
+ remove a redundant adjustment of lines in resizeterm.c's
adjust_window() which caused occasional misadjustment of stdscr when
softkeys were used.
12 files changed:
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1195 2008/01/06 00:01:08 tom Exp $
+-- $Id: NEWS,v 1.1197 2008/01/13 01:05:34 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
-------------------------------------------------------------------------------
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.
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20080112
+ + remove recursive-mutex definitions, finish threading demo for worm.c
+ + remove a redundant adjustment of lines in resizeterm.c's
+ adjust_window() which caused occasional misadjustment of stdscr when
+ softkeys were used.
+
20080105
+ several improvements to terminfo entries based on xterm #230 -TD
+ modify MKlib_gen.sh to handle keyname/key_name prototypes, so the
20080105
+ several improvements to terminfo entries based on xterm #230 -TD
+ modify MKlib_gen.sh to handle keyname/key_name prototypes, so the
##############################################################################
##############################################################################
-# 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 "Software"), #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.622 2008/01/05 19:49:50 tom Exp $
+# $Id: dist.mk,v 1.624 2008/01/12 16:01:48 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# 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
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 6
-NCURSES_PATCH = 20080105
+NCURSES_PATCH = 20080112
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
/****************************************************************************
/****************************************************************************
- * 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 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <term.h> /* clear_screen, cup & friends, cur_term */
#include <tic.h>
#include <term.h> /* clear_screen, cup & friends, cur_term */
#include <tic.h>
-MODULE_ID("$Id: lib_newterm.c,v 1.67 2007/04/21 20:47:32 tom Exp $")
+MODULE_ID("$Id: lib_newterm.c,v 1.68 2008/01/12 20:24:40 tom Exp $")
#ifndef ONLCR /* Allows compilation under the QNX 4.2 OS */
#define ONLCR 0
#ifndef ONLCR /* Allows compilation under the QNX 4.2 OS */
#define ONLCR 0
- int slk_format = _nc_slk_format;
+ int slk_format = _nc_globals.slk_format;
SCREEN *current;
SCREEN *result = 0;
SCREEN *current;
SCREEN *result = 0;
/****************************************************************************
/****************************************************************************
- * 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 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
-MODULE_ID("$Id: lib_newwin.c,v 1.42 2007/12/22 23:20:18 tom Exp $")
+MODULE_ID("$Id: lib_newwin.c,v 1.44 2008/01/13 00:28:13 tom Exp $")
static WINDOW *
remove_window_from_screen(WINDOW *win)
static WINDOW *
remove_window_from_screen(WINDOW *win)
{
pthread_mutexattr_t recattr;
memset(&recattr, 0, sizeof(recattr));
{
pthread_mutexattr_t recattr;
memset(&recattr, 0, sizeof(recattr));
- pthread_mutexattr_settype(&recattr, PTHREAD_MUTEX_RECURSIVE);
+ pthread_mutexattr_settype(&recattr, PTHREAD_MUTEX_NORMAL);
pthread_mutex_init(&(wp->mutex_use_window), &recattr);
}
#endif
pthread_mutex_init(&(wp->mutex_use_window), &recattr);
}
#endif
/****************************************************************************
/****************************************************************************
- * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2005,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 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <ctype.h>
#include <term.h> /* num_labels, label_*, plab_norm */
#include <ctype.h>
#include <term.h> /* num_labels, label_*, plab_norm */
-MODULE_ID("$Id: lib_slk.c,v 1.30 2005/01/08 21:56:36 tom Exp $")
+MODULE_ID("$Id: lib_slk.c,v 1.31 2008/01/12 20:21:00 tom Exp $")
/*
* We'd like to move these into the screen context structure, but cannot,
/*
* We'd like to move these into the screen context structure, but cannot,
/*
* Paint the info line for the PC style SLK emulation.
/*
* Paint the info line for the PC style SLK emulation.
*/
static void
slk_paint_info(WINDOW *win)
*/
static void
slk_paint_info(WINDOW *win)
SP->_slk->maxlab = ((num_labels > 0)
? num_labels
SP->_slk->maxlab = ((num_labels > 0)
? num_labels
- : MAX_SKEY(_nc_slk_format));
+ : MAX_SKEY(_nc_globals.slk_format));
SP->_slk->maxlen = ((num_labels > 0)
? label_width * label_height
SP->_slk->maxlen = ((num_labels > 0)
? label_width * label_height
- : MAX_SKEY_LEN(_nc_slk_format));
- SP->_slk->labcnt = ((SP->_slk->maxlab < MAX_SKEY(_nc_slk_format))
- ? MAX_SKEY(_nc_slk_format)
+ : MAX_SKEY_LEN(_nc_globals.slk_format));
+ SP->_slk->labcnt = ((SP->_slk->maxlab < MAX_SKEY(_nc_globals.slk_format))
+ ? MAX_SKEY(_nc_globals.slk_format)
: SP->_slk->maxlab);
if (SP->_slk->maxlen <= 0
: SP->_slk->maxlab);
if (SP->_slk->maxlen <= 0
memset(SP->_slk->ent[i].form_text, ' ', max_length);
SP->_slk->ent[i].visible = (i < SP->_slk->maxlab);
}
memset(SP->_slk->ent[i].form_text, ' ', max_length);
SP->_slk->ent[i].visible = (i < SP->_slk->maxlab);
}
- if (_nc_slk_format >= 3) { /* PC style */
+ if (_nc_globals.slk_format >= 3) { /* PC style */
int gap = (cols - 3 * (3 + 4 * max_length)) / 2;
if (gap < 1)
int gap = (cols - 3 * (3 + 4 * max_length)) / 2;
if (gap < 1)
}
slk_paint_info(stwin);
} else {
}
slk_paint_info(stwin);
} else {
- if (_nc_slk_format == 2) { /* 4-4 */
+ if (_nc_globals.slk_format == 2) { /* 4-4 */
int gap = cols - (SP->_slk->maxlab * max_length) - 6;
if (gap < 1)
int gap = cols - (SP->_slk->maxlab * max_length) - 6;
if (gap < 1)
x += (i == 3) ? gap : 1;
}
} else {
x += (i == 3) ? gap : 1;
}
} else {
- if (_nc_slk_format == 1) { /* 1 -> 3-2-3 */
+ if (_nc_globals.slk_format == 1) { /* 1 -> 3-2-3 */
int gap = (cols - (SP->_slk->maxlab * max_length) - 5)
/ 2;
int gap = (cols - (SP->_slk->maxlab * max_length) - 5)
/ 2;
* per default no SLK keys and may call slk_init again to
* define a new layout. (juergen 03-Mar-1999)
*/
* per default no SLK keys and may call slk_init again to
* define a new layout. (juergen 03-Mar-1999)
*/
- SP->slk_format = _nc_slk_format;
- _nc_slk_format = 0;
+ SP->slk_format = _nc_globals.slk_format;
+ _nc_globals.slk_format = 0;
/****************************************************************************
/****************************************************************************
- * Copyright (c) 1998-2000,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 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996-on *
****************************************************************************/
/*
****************************************************************************/
/*
*/
#include <curses.priv.h>
*/
#include <curses.priv.h>
-MODULE_ID("$Id: lib_slkinit.c,v 1.6 2007/05/12 18:14:21 tom Exp $")
+MODULE_ID("$Id: lib_slkinit.c,v 1.7 2008/01/12 20:23:39 tom Exp $")
NCURSES_EXPORT(int)
slk_init(int format)
NCURSES_EXPORT(int)
slk_init(int format)
int code = ERR;
T((T_CALLED("slk_init(%d)"), format));
int code = ERR;
T((T_CALLED("slk_init(%d)"), format));
- if (format >= 0 && format <= 3 && !_nc_slk_format) {
- _nc_slk_format = 1 + format;
- code = _nc_ripoffline(-SLK_LINES(_nc_slk_format), _nc_slk_initialize);
+ if (format >= 0 && format <= 3 && !_nc_globals.slk_format) {
+ _nc_globals.slk_format = 1 + format;
+ code = _nc_ripoffline(-SLK_LINES(_nc_globals.slk_format), _nc_slk_initialize);
#include <curses.priv.h>
#include <term.h>
#include <curses.priv.h>
#include <term.h>
-MODULE_ID("$Id: resizeterm.c,v 1.28 2008/01/06 01:23:36 tom Exp $")
+MODULE_ID("$Id: resizeterm.c,v 1.30 2008/01/12 22:26:56 tom Exp $")
#define stolen_lines (screen_lines - SP->_lines_avail)
#define stolen_lines (screen_lines - SP->_lines_avail)
*/
win->_begy += (ToLines - CurLines);
} else {
*/
win->_begy += (ToLines - CurLines);
} else {
- if (myLines == CurLines - stolen
- && ToLines != CurLines)
+ if (myLines == (CurLines - stolen)
+ && ToLines != CurLines) {
myLines = ToLines - stolen;
myLines = ToLines - stolen;
- else if (myLines == CurLines
- && ToLines != CurLines)
+ } else if (myLines == CurLines
+ && ToLines != CurLines) {
+ if (myLines > ToLines) {
if (myCols > ToCols)
myCols = ToCols;
if (myCols > ToCols)
myCols = ToCols;
- if (myLines == CurLines
- && ToLines != CurLines)
- myLines = ToLines;
-
if (myCols == CurCols
&& ToCols != CurCols)
myCols = ToCols;
if (myCols == CurCols
&& ToCols != CurCols)
myCols = ToCols;
/* ripped-off lines are a special case: if we did not lengthen
* them, we haven't moved them either. repaint them, too.
/* ripped-off lines are a special case: if we did not lengthen
* them, we haven't moved them either. repaint them, too.
+ *
+ * for the rest - stdscr and other windows - the client has to
+ * decide which to repaint, since without panels, ncurses does
+ * not know which are really on top.
*/
for (rop = ripoff_stack; (rop - ripoff_stack) < N_RIPS; rop++) {
if (rop->win != stdscr
*/
for (rop = ripoff_stack; (rop - ripoff_stack) < N_RIPS; rop++) {
if (rop->win != stdscr
/****************************************************************************
/****************************************************************************
- * Copyright (c) 2007 Free Software Foundation, Inc. *
+ * Copyright (c) 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 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
-MODULE_ID("$Id: use_window.c,v 1.2 2007/10/20 19:57:55 tom Exp $")
+MODULE_ID("$Id: use_window.c,v 1.3 2008/01/13 00:36:22 tom Exp $")
#ifdef USE_PTHREADS
NCURSES_EXPORT(void)
#ifdef USE_PTHREADS
NCURSES_EXPORT(void)
_nc_lock_global(windowlist);
for (p = _nc_windows; p != 0; p = p->next) {
if (&(p->win) == win) {
_nc_lock_global(windowlist);
for (p = _nc_windows; p != 0; p = p->next) {
if (&(p->win) == win) {
- pthread_mutex_lock(&(p->mutex_use_window));
+ _nc_mutex_lock(&(p->mutex_use_window));
_nc_lock_global(windowlist);
for (p = _nc_windows; p != 0; p = p->next) {
if (&(p->win) == win) {
_nc_lock_global(windowlist);
for (p = _nc_windows; p != 0; p = p->next) {
if (&(p->win) == win) {
- pthread_mutex_unlock(&(p->mutex_use_window));
+ _nc_mutex_unlock(&(p->mutex_use_window));
/****************************************************************************
/****************************************************************************
- * 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 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
- * $Id: curses.priv.h,v 1.355 2007/12/29 20:32:54 tom Exp $
+ * $Id: curses.priv.h,v 1.357 2008/01/13 00:33:10 tom Exp $
#ifdef USE_PTHREADS
#if USE_REENTRANT
#include <pthread.h>
#ifdef USE_PTHREADS
#if USE_REENTRANT
#include <pthread.h>
-#define _nc_lock_global(name) pthread_mutex_lock(&_nc_globals.mutex_##name)
-#define _nc_try_global(name) pthread_mutex_trylock(&_nc_globals.mutex_##name)
-#define _nc_unlock_global(name) pthread_mutex_unlock(&_nc_globals.mutex_##name)
+extern NCURSES_EXPORT(int) _nc_mutex_lock(pthread_mutex_t *);
+extern NCURSES_EXPORT(int) _nc_mutex_trylock(pthread_mutex_t *);
+extern NCURSES_EXPORT(int) _nc_mutex_unlock(pthread_mutex_t *);
+#define _nc_lock_global(name) _nc_mutex_lock(&_nc_globals.mutex_##name)
+#define _nc_try_global(name) _nc_mutex_trylock(&_nc_globals.mutex_##name)
+#define _nc_unlock_global(name) _nc_mutex_unlock(&_nc_globals.mutex_##name)
extern NCURSES_EXPORT(void) _nc_lock_window(WINDOW *);
extern NCURSES_EXPORT(void) _nc_unlock_window(WINDOW *);
extern NCURSES_EXPORT(void) _nc_lock_window(WINDOW *);
extern NCURSES_EXPORT(void) _nc_unlock_window(WINDOW *);
char *first_name;
char **keyname_table;
char *first_name;
char **keyname_table;
char *safeprint_buf;
size_t safeprint_used;
char *safeprint_buf;
size_t safeprint_used;
#define screen_lines SP->_lines
#define screen_columns SP->_columns
#define screen_lines SP->_lines
#define screen_columns SP->_columns
-extern NCURSES_EXPORT_VAR(int) _nc_slk_format; /* != 0 if slk_init() called */
extern NCURSES_EXPORT(int) _nc_slk_initialize (WINDOW *, int);
/*
extern NCURSES_EXPORT(int) _nc_slk_initialize (WINDOW *, int);
/*
/****************************************************************************
/****************************************************************************
- * Copyright (c) 1998-2005,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 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
-MODULE_ID("$Id: lib_data.c,v 1.35 2007/12/29 20:29:27 tom Exp $")
+MODULE_ID("$Id: lib_data.c,v 1.39 2008/01/13 01:21:59 tom Exp $")
/*
* OS/2's native linker complains if we don't initialize public data when
/*
* OS/2's native linker complains if we don't initialize public data when
NULL, /* first_name */
NULL, /* keyname_table */
NULL, /* first_name */
NULL, /* keyname_table */
NULL, /* safeprint_buf */
0, /* safeprint_used */
NULL, /* safeprint_buf */
0, /* safeprint_used */
#endif /* TRACE */
#ifdef USE_PTHREADS
#endif /* TRACE */
#ifdef USE_PTHREADS
- PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, /* mutex_set_SP */
- PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, /* mutex_use_screen */
- PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, /* mutex_use_window */
- PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, /* mutex_windowlist */
+ 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 */
0, /* nested_tracef */
PTHREAD_MUTEX_INITIALIZER, /* mutex_tst_tracef */
PTHREAD_MUTEX_INITIALIZER, /* mutex_tracef */
0, /* nested_tracef */
#endif
};
/* *INDENT-ON* */
#endif
};
/* *INDENT-ON* */
+
+/******************************************************************************/
+#ifdef USE_PTHREADS
+NCURSES_EXPORT(int)
+_nc_mutex_lock(pthread_mutex_t *obj)
+{
+ return pthread_mutex_lock(obj);
+}
+
+NCURSES_EXPORT(int)
+_nc_mutex_trylock(pthread_mutex_t *obj)
+{
+ return pthread_mutex_trylock(obj);
+}
+
+NCURSES_EXPORT(int)
+_nc_mutex_unlock(pthread_mutex_t *obj)
+{
+ return pthread_mutex_unlock(obj);
+}
+#endif /* USE_PTHREADS */
/****************************************************************************
/****************************************************************************
- * 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 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
Thomas E. Dickey (beginning revision 1.27 in 1996).
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
Thomas E. Dickey (beginning revision 1.27 in 1996).
-$Id: ncurses.c,v 1.296 2007/12/29 21:05:43 tom Exp $
+$Id: ncurses.c,v 1.298 2008/01/12 23:06:58 tom Exp $
***************************************************************************/
***************************************************************************/
#define NCURSES_CONST_PARAM const void
#ifdef TRACE
#define NCURSES_CONST_PARAM const void
#ifdef TRACE
-static unsigned save_trace = TRACE_ORDINARY | TRACE_CALLS;
+static unsigned save_trace = TRACE_ORDINARY | TRACE_ICALLS | TRACE_CALLS;
extern unsigned _nc_tracing;
#endif
extern unsigned _nc_tracing;
#endif
#endif
#if defined(NCURSES_VERSION) && defined(KEY_RESIZE) && HAVE_WRESIZE
case KEY_RESIZE:
#endif
#if defined(NCURSES_VERSION) && defined(KEY_RESIZE) && HAVE_WRESIZE
case KEY_RESIZE:
break;
#if defined(NCURSES_VERSION) && defined(KEY_RESIZE) && HAVE_WRESIZE
case KEY_RESIZE:
break;
#if defined(NCURSES_VERSION) && defined(KEY_RESIZE) && HAVE_WRESIZE
case KEY_RESIZE:
traces will be dumped. The program stops and waits for one character of
input at the beginning and end of the interval.
traces will be dumped. The program stops and waits for one character of
input at the beginning and end of the interval.
- $Id: worm.c,v 1.50 2007/12/22 23:55:13 tom Exp $
+ $Id: worm.c,v 1.51 2008/01/13 01:03:23 tom Exp $
*/
#include <test.priv.h>
*/
#include <test.priv.h>
+static unsigned long sequence = 0;
static bool quitting = FALSE;
static WORM worm[40];
static bool quitting = FALSE;
static WORM worm[40];
static bool
quit_worm(void)
{
static bool
quit_worm(void)
{
- napms(20); /* let the other thread(s) have a chance */
+ napms(10); /* let the other thread(s) have a chance */
return quitting;
}
static void *
start_worm(void *arg)
{
return quitting;
}
static void *
start_worm(void *arg)
{
+ unsigned long compare = 0;
- use_window(stdscr, draw_worm, arg);
+ while (compare < sequence) {
+ ++compare;
+ use_window(stdscr, draw_worm, arg);
+ }
refresh();
nodelay(stdscr, TRUE);
while (!done) {
int ch;
refresh();
nodelay(stdscr, TRUE);
while (!done) {
int ch;
if ((ch = getch()) > 0) {
#ifdef TRACE
if (trace_start || trace_end) {
if ((ch = getch()) > 0) {
#ifdef TRACE
if (trace_start || trace_end) {