-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1206 2008/02/09 23:49:39 tom Exp $
+-- $Id: NEWS,v 1.1208 2008/02/23 21:26:58 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.
+20080223
+ + fix a size-difference in _nc_globals which caused hanging of mutex
+ lock/unlock when termlib was built separately.
+
+20080216
+ + avoid using nanosleep() in threaded configuration since that often
+ is implemented to suspend the entire process.
+
20080209
+ update test programs to build/work with various UNIX curses for
comparisons. This was to reinvestigate statement in X/Open curses
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.629 2008/02/09 15:32:57 tom Exp $
+# $Id: dist.mk,v 1.631 2008/02/23 14:51:29 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 = 20080209
+NCURSES_PATCH = 20080223
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
-.\" $Id: terminfo.tail,v 1.48 2007/06/02 20:30:40 tom Exp $
+.\" $Id: terminfo.tail,v 1.49 2008/02/16 20:57:43 tom Exp $
.\" Beginning of terminfo.tail file
.\" This file is part of ncurses.
.\" See "terminfo.head" for copyright.
outputs `%'
.TP
%\fI[[\fP:\fI]flags][width[.precision]][\fPdoxXs\fI]\fP
-as in \fBprintf\fP, flags are [-+#] and space
+as in \fBprintf\fP, flags are [-+#] and space.
+Use a `:' to allow the next character to be a `-' flag,
+avoiding interpreting "%-" as an operator.
.TP
%c
print pop() like %c in \fBprintf\fP
*/
#include <curses.priv.h>
+#include <stddef.h>
-MODULE_ID("$Id: lib_newwin.c,v 1.44 2008/01/13 00:28:13 tom Exp $")
+MODULE_ID("$Id: lib_newwin.c,v 1.45 2008/02/23 20:57:58 tom Exp $")
static WINDOW *
remove_window_from_screen(WINDOW *win)
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_NORMAL);
- pthread_mutex_init(&(wp->mutex_use_window), &recattr);
- }
-#endif
+ _nc_mutex_init(&(wp->mutex_use_window));
win = &(wp->win);
/*
- * $Id: curses.priv.h,v 1.357 2008/01/13 00:33:10 tom Exp $
+ * $Id: curses.priv.h,v 1.359 2008/02/23 21:19:56 tom Exp $
*
* curses.priv.h
*
#define TR_GLOBAL_MUTEX(name) TR_MUTEX(_nc_globals.mutex_##name)
#ifdef USE_PTHREADS
+
#if USE_REENTRANT
#include <pthread.h>
+extern NCURSES_EXPORT(void) _nc_mutex_init(pthread_mutex_t *);
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 *);
#else
#error POSIX threads requires --enable-reentrant option
#endif
-#else
+
+#if HAVE_NANOSLEEP
+#undef HAVE_NANOSLEEP
+#define HAVE_NANOSLEEP 0 /* nanosleep suspends all threads */
+#endif
+
+#else /* !USE_PTHREADS */
+
+#define _nc_mutex_init(obj) /* nothing */
+
#define _nc_lock_global(name) /* nothing */
#define _nc_try_global(name) 0
#define _nc_unlock_global(name) /* nothing */
#define _nc_lock_window(name) (void) TRUE
#define _nc_unlock_window(name) /* nothing */
-#endif
+#endif /* USE_PTHREADS */
#define _nc_lock_screen(name) /* nothing */
#define _nc_unlock_screen(name) /* nothing */
unsigned char *tracetry_buf;
size_t tracetry_used;
-#ifndef USE_TERMLIB
char traceatr_color_buf[2][80];
int traceatr_color_sel;
int traceatr_color_last;
-#endif /* USE_TERMLIB */
#endif /* TRACE */
#include <curses.priv.h>
-MODULE_ID("$Id: lib_data.c,v 1.39 2008/01/13 01:21:59 tom Exp $")
+MODULE_ID("$Id: lib_data.c,v 1.40 2008/02/23 21:23:44 tom Exp $")
/*
* OS/2's native linker complains if we don't initialize public data when
#define CHARS_0s { '\0' }
#define TGETENT_0 { 0L, FALSE, NULL, NULL, NULL }
-#define TGETENT_0s { TGETENT_0, TGETENT_0, TGETENT_0, TGETENT_0 }
+#define TGETENT_0s { TGETENT_0, TGETENT_0, TGETENT_0, TGETENT_0 }
NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = {
0, /* have_sigwinch */
NULL, /* tracetry_buf */
0, /* tracetry_used */
-#ifndef USE_TERMLIB
{ CHARS_0s, CHARS_0s }, /* traceatr_color_buf */
0, /* traceatr_color_sel */
-1, /* traceatr_color_last */
-#endif /* USE_TERMLIB */
#endif /* TRACE */
#ifdef USE_PTHREADS
/******************************************************************************/
#ifdef USE_PTHREADS
+NCURSES_EXPORT(void)
+_nc_mutex_init(pthread_mutex_t * obj)
+{
+ pthread_mutexattr_t recattr;
+
+ memset(&recattr, 0, sizeof(recattr));
+ pthread_mutexattr_settype(&recattr, PTHREAD_MUTEX_NORMAL);
+ pthread_mutex_init(obj, &recattr);
+}
+
NCURSES_EXPORT(int)
-_nc_mutex_lock(pthread_mutex_t *obj)
+_nc_mutex_lock(pthread_mutex_t * obj)
{
return pthread_mutex_lock(obj);
}
NCURSES_EXPORT(int)
-_nc_mutex_trylock(pthread_mutex_t *obj)
+_nc_mutex_trylock(pthread_mutex_t * obj)
{
return pthread_mutex_trylock(obj);
}
NCURSES_EXPORT(int)
-_nc_mutex_unlock(pthread_mutex_t *obj)
+_nc_mutex_unlock(pthread_mutex_t * obj)
{
return pthread_mutex_unlock(obj);
}
* authorization. *
****************************************************************************/
/*
- * $Id: demo_menus.c,v 1.22 2008/02/09 18:09:26 tom Exp $
+ * $Id: demo_menus.c,v 1.23 2008/02/23 23:06:49 tom Exp $
*
* Demonstrate a variety of functions from the menu library.
* Thomas Dickey - 2005/4/9
while ((c = wgetch(win)) == CTRL('T')) {
if (_nc_tracing) {
save_trace = _nc_tracing;
- _tracef("TOGGLE-TRACING OFF");
+ Trace(("TOGGLE-TRACING OFF"));
_nc_tracing = 0;
} else {
_nc_tracing = save_trace;
}
trace(_nc_tracing);
if (_nc_tracing)
- _tracef("TOGGLE-TRACING ON");
+ Trace(("TOGGLE-TRACING ON"));
}
#else
c = wgetch(win);
#if 0
if (count > 0) {
while (*ip) {
- _tracef("freeing item %d:%d", ip - menu_items(m), count);
+ Trace(("freeing item %d:%d", ip - menu_items(m), count));
free_item(*ip++);
}
}
newtrace |= t_tbl[item_index(*ip)].mask;
}
trace(newtrace);
- _tracef("trace level interactively set to %s", tracetrace(_nc_tracing));
+ Trace(("trace level interactively set to %s", tracetrace(_nc_tracing)));
(void) mvprintw(LINES - 2, 0,
"Trace level is %s\n", tracetrace(_nc_tracing));
/****************************************************************************
- * 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 *
*
* Generate timing statistics for vertical-motion optimization.
*
- * $Id: hashtest.c,v 1.27 2007/07/21 17:45:09 tom Exp $
+ * $Id: hashtest.c,v 1.28 2008/02/23 23:02:41 tom Exp $
*/
-#ifdef TRACE
-#define Trace(p) _tracef p
-#define USE_TRACE 1
-#else
-#define Trace(p) /* nothing */
-#define USE_TRACE 0
-#endif
-
#include <test.priv.h>
#define LO_CHAR ' '
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
Thomas E. Dickey (beginning revision 1.27 in 1996).
-$Id: ncurses.c,v 1.301 2008/02/09 17:19:55 tom Exp $
+$Id: ncurses.c,v 1.302 2008/02/23 23:07:28 tom Exp $
***************************************************************************/
while ((c = wgetch(win)) == CTRL('T')) {
if (_nc_tracing) {
save_trace = _nc_tracing;
- _tracef("TOGGLE-TRACING OFF");
+ Trace(("TOGGLE-TRACING OFF"));
_nc_tracing = 0;
} else {
_nc_tracing = save_trace;
}
trace(_nc_tracing);
if (_nc_tracing)
- _tracef("TOGGLE-TRACING ON");
+ Trace(("TOGGLE-TRACING ON"));
}
#else
c = wgetch(win);
while ((c = wget_wch(win, result)) == CTRL('T')) {
if (_nc_tracing) {
save_trace = _nc_tracing;
- _tracef("TOGGLE-TRACING OFF");
+ Trace(("TOGGLE-TRACING OFF"));
_nc_tracing = 0;
} else {
_nc_tracing = save_trace;
}
trace(_nc_tracing);
if (_nc_tracing)
- _tracef("TOGGLE-TRACING ON");
+ Trace(("TOGGLE-TRACING ON"));
}
#else
c = wget_wch(win, result);
if (item_value(*ip))
newtrace |= t_tbl[item_index(*ip)].mask;
trace(newtrace);
- _tracef("trace level interactively set to %s", tracetrace(_nc_tracing));
+ Trace(("trace level interactively set to %s", tracetrace(_nc_tracing)));
(void) mvprintw(LINES - 2, 0,
"Trace level is %s\n", tracetrace(_nc_tracing));
/****************************************************************************
* Author: Thomas E. Dickey 1996-on *
****************************************************************************/
-/* $Id: test.priv.h,v 1.73 2008/02/10 00:12:55 tom Exp $ */
+/* $Id: test.priv.h,v 1.74 2008/02/23 23:02:41 tom Exp $ */
#ifndef __TEST_PRIV_H
#define __TEST_PRIV_H 1
#define USING_WINDOW(w,func) func(w)
#endif
+#ifdef TRACE
+#define Trace(p) _tracef p
+#define USE_TRACE 1
+#else
+#define Trace(p) /* nothing */
+#define USE_TRACE 0
+#endif
#endif /* __TEST_PRIV_H */
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.55 2008/01/26 22:07:57 tom Exp $
+ $Id: worm.c,v 1.56 2008/02/23 23:08:57 tom Exp $
*/
#include <test.priv.h>
start_worm(void *arg)
{
unsigned long compare = 0;
+ Trace(("start_worm"));
while (!quit_worm()) {
while (compare < sequence) {
++compare;
use_window(stdscr, draw_worm, arg);
}
}
+ Trace(("...start_worm (done)"));
return NULL;
}
#endif
USING_WINDOW(stdscr, wrefresh);
}
+ Trace(("Cleanup"));
cleanup();
#ifdef NO_LEAKS
for (y = 0; y < LINES; y++) {
/*
* Do this just in case one of the threads did not really exit.
*/
+ Trace(("join all threads"));
for (n = 0; n < number; n++) {
pthread_join(worm[n].thread, NULL);
}