ncurses 6.3 - patch 20220813

+ modify delscreen to more effectively delete all windows on the given
  screen.
+ amend portability note for delwin in manual page.
+ adapt test/test_delwin.c from example by Bill Gray.
+ account for prescreen data if freeing leaks in pthread-configuration
+ split-out _nc_set_read_thread(), to reduce compiler warnings about
  pthread_self(), which may/may not be a weak symbol.
+ improve pthread-configuration for test/worm.c
This commit is contained in:
Thomas E. Dickey 2022-08-14 00:26:10 +00:00
parent 768f77851c
commit 1c305869cc
43 changed files with 276 additions and 139 deletions

View File

@ -1216,6 +1216,7 @@
./test/test_addstr.c
./test/test_addwstr.c
./test/test_arrays.c
./test/test_delwin.c
./test/test_get_wstr.c
./test/test_getstr.c
./test/test_instr.c

12
NEWS
View File

@ -26,7 +26,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: NEWS,v 1.3841 2022/08/06 19:13:14 tom Exp $
-- $Id: NEWS,v 1.3846 2022/08/13 23:42:30 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
@ -46,6 +46,16 @@ 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.
20220813
+ modify delscreen to more effectively delete all windows on the given
screen.
+ amend portability note for delwin in manual page.
+ adapt test/test_delwin.c from example by Bill Gray.
+ account for prescreen data if freeing leaks in pthread-configuration
+ split-out _nc_set_read_thread(), to reduce compiler warnings about
pthread_self(), which may/may not be a weak symbol.
+ improve pthread-configuration for test/worm.c
20220806
+ amend end_of_stream() to allow for input files without a final
newline.

View File

@ -1 +1 @@
5:0:10 6.3 20220806
5:0:10 6.3 20220813

View File

@ -26,7 +26,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: dist.mk,v 1.1496 2022/08/06 10:14:36 tom Exp $
# $Id: dist.mk,v 1.1497 2022/08/13 09:43:55 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
@ -38,7 +38,7 @@ SHELL = /bin/sh
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 6
NCURSES_MINOR = 3
NCURSES_PATCH = 20220806
NCURSES_PATCH = 20220813
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)

View File

@ -126,7 +126,7 @@
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).

View File

@ -199,7 +199,7 @@
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>

View File

@ -150,7 +150,7 @@
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="tput.1.html">tput(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>, <STRONG>xterm(1)</STRONG>.
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).

View File

@ -27,7 +27,7 @@
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
* @Id: curs_window.3x,v 1.27 2022/07/24 15:35:15 tom Exp @
* @Id: curs_window.3x,v 1.28 2022/08/13 23:24:22 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
@ -241,8 +241,8 @@
ent window which still has subwindows.
<STRONG>o</STRONG> Since release 4.0 (1996), ncurses maintains a list of windows for
each screen, and is able to recursively delete subwindows when
asked to delete their parent.
each screen, to ensure that a window has no subwindows before al-
lowing deletion.
<STRONG>o</STRONG> NetBSD copied this feature of ncurses in 2003.
PDCurses follows the scheme used in Solaris X/Open curses.

View File

@ -248,7 +248,7 @@
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "form_" for detailed
descriptions of the entry points.
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).

View File

@ -514,7 +514,7 @@
https://invisible-island.net/ncurses/tctest.html
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>

View File

@ -91,7 +91,7 @@
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>

View File

@ -223,7 +223,7 @@
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "menu_" for detailed
descriptions of the entry points.
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).

View File

@ -60,7 +60,7 @@
method of updating character screens with reasonable optimization.
This implementation is "new curses" (ncurses) and is the approved
replacement for 4.4BSD classic curses, which has been discontinued.
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
The <STRONG>ncurses</STRONG> library emulates the curses library of System V Release 4
UNIX, and XPG4 (X/Open Portability Guide) curses (also known as XSI

View File

@ -113,7 +113,7 @@
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).

View File

@ -281,7 +281,7 @@
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>,
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>

View File

@ -252,7 +252,7 @@
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).

View File

@ -106,7 +106,7 @@
have, by specifying how to perform screen operations, and by specifying
padding requirements and initialization sequences.
This manual describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
This manual describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
</PRE><H3><a name="h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></H3><PRE>

View File

@ -461,7 +461,7 @@
<STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>, <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,
<STRONG><A HREF="term.5.html">term(5)</A></STRONG>. <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>. <STRONG><A HREF="user_caps.5.html">user_caps(5)</A></STRONG>.
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>

View File

@ -171,7 +171,7 @@
<STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,
<STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).

View File

@ -545,7 +545,7 @@
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>, <STRONG>stty(1)</STRONG>, <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>, <STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).

View File

@ -391,7 +391,7 @@
<STRONG>csh(1)</STRONG>, <STRONG>sh(1)</STRONG>, <STRONG>stty(1)</STRONG>, <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>, <STRONG>tty(4)</STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>,
<STRONG>ttys(5)</STRONG>, <STRONG>environ(7)</STRONG>
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).

View File

@ -27,7 +27,7 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: curs_window.3x,v 1.27 2022/07/24 15:35:15 tom Exp $
.\" $Id: curs_window.3x,v 1.28 2022/08/13 23:24:22 tom Exp $
.TH curs_window 3X ""
.de bP
.ie n .IP \(bu 4
@ -269,7 +269,7 @@ Solaris X/Open curses does not even make that check,
and will delete a parent window which still has subwindows.
.bP
Since release 4.0 (1996), ncurses maintains a list of windows for each screen,
and is able to recursively delete subwindows when asked to delete their parent.
to ensure that a window has no subwindows before allowing deletion.
.bP
NetBSD copied this feature of ncurses in 2003.
.br

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 2018-2021,2022 Thomas E. Dickey *
* Copyright 1998-2015,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@ -44,7 +44,7 @@
#define NEED_KEY_EVENT
#include <curses.priv.h>
MODULE_ID("$Id: lib_getch.c,v 1.143 2021/10/23 17:06:20 tom Exp $")
MODULE_ID("$Id: lib_getch.c,v 1.144 2022/08/13 14:36:43 tom Exp $")
#include <fifo_defs.h>
@ -309,16 +309,11 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
int buf;
# if defined(EXP_WIN32_DRIVER)
if (NC_ISATTY(sp->_ifd) && IsTermInfoOnConsole(sp) && sp->_cbreak) {
# if USE_PTHREADS_EINTR
if ((pthread_self) && (pthread_kill) && (pthread_equal))
_nc_globals.read_thread = pthread_self();
# endif
_nc_set_read_thread(TRUE);
n = _nc_console_read(sp,
_nc_console_handle(sp->_ifd),
&buf);
# if USE_PTHREADS_EINTR
_nc_globals.read_thread = 0;
# endif
_nc_set_read_thread(FALSE);
} else
# elif defined(_NC_WINDOWS)
if (NC_ISATTY(sp->_ifd) && IsTermInfoOnConsole(sp) && sp->_cbreak)
@ -334,12 +329,8 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
int buf;
#endif
unsigned char c2 = 0;
#if USE_PTHREADS_EINTR
#if USE_WEAK_SYMBOLS
if ((pthread_self) && (pthread_kill) && (pthread_equal))
#endif
_nc_globals.read_thread = pthread_self();
#endif
_nc_set_read_thread(TRUE);
#if defined(EXP_WIN32_DRIVER)
n = _nc_console_read(sp,
_nc_console_handle(sp->_ifd),
@ -348,9 +339,7 @@ fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl))
#else
n = (int) read(sp->_ifd, &c2, (size_t) 1);
#endif
#if USE_PTHREADS_EINTR
_nc_globals.read_thread = 0;
#endif
_nc_set_read_thread(FALSE);
ch = c2;
#endif /* USE_TERM_DRIVER */
}

View File

@ -85,7 +85,7 @@
#define CUR SP_TERMTYPE
#endif
MODULE_ID("$Id: lib_mouse.c,v 1.196 2022/04/30 23:21:34 tom Exp $")
MODULE_ID("$Id: lib_mouse.c,v 1.197 2022/08/13 14:13:12 tom Exp $")
#include <tic.h>
@ -1085,12 +1085,7 @@ decode_xterm_X10(SCREEN *sp, MEVENT * eventp)
int res;
bool result;
# if USE_PTHREADS_EINTR
# if USE_WEAK_SYMBOLS
if ((pthread_self) && (pthread_kill) && (pthread_equal))
# endif
_nc_globals.read_thread = pthread_self();
# endif
_nc_set_read_thread(TRUE);
for (grabbed = 0; grabbed < MAX_KBUF; grabbed += (size_t) res) {
/* For VIO mouse we add extra bit 64 to disambiguate button-up. */
@ -1104,9 +1099,7 @@ decode_xterm_X10(SCREEN *sp, MEVENT * eventp)
if (res == -1)
break;
}
#if USE_PTHREADS_EINTR
_nc_globals.read_thread = 0;
#endif
_nc_set_read_thread(FALSE);
kbuf[MAX_KBUF] = '\0';
TR(TRACE_IEVENT,
@ -1140,12 +1133,7 @@ decode_xterm_1005(SCREEN *sp, MEVENT * eventp)
coords[0] = 0;
coords[1] = 0;
# if USE_PTHREADS_EINTR
# if USE_WEAK_SYMBOLS
if ((pthread_self) && (pthread_kill) && (pthread_equal))
# endif
_nc_globals.read_thread = pthread_self();
# endif
_nc_set_read_thread(TRUE);
for (grabbed = 0; grabbed < limit;) {
int res;
@ -1178,9 +1166,7 @@ decode_xterm_1005(SCREEN *sp, MEVENT * eventp)
break;
}
}
#if USE_PTHREADS_EINTR
_nc_globals.read_thread = 0;
#endif
_nc_set_read_thread(FALSE);
TR(TRACE_IEVENT,
("_nc_mouse_inline sees the following xterm data: %s",
@ -1224,12 +1210,7 @@ read_SGR(SCREEN *sp, SGR_DATA * result)
int marker = 1;
memset(result, 0, sizeof(*result));
# if USE_PTHREADS_EINTR
# if USE_WEAK_SYMBOLS
if ((pthread_self) && (pthread_kill) && (pthread_equal))
# endif
_nc_globals.read_thread = pthread_self();
# endif
_nc_set_read_thread(TRUE);
do {
int res;
@ -1294,9 +1275,7 @@ read_SGR(SCREEN *sp, SGR_DATA * result)
}
++grabbed;
} while (!isFinal(ch));
#if USE_PTHREADS_EINTR
_nc_globals.read_thread = 0;
#endif
_nc_set_read_thread(FALSE);
kbuf[++grabbed] = 0;
TR(TRACE_IEVENT,

View File

@ -54,7 +54,7 @@
#undef CUR
#define CUR SP_TERMTYPE
MODULE_ID("$Id: lib_set_term.c,v 1.181 2022/07/21 23:35:21 tom Exp $")
MODULE_ID("$Id: lib_set_term.c,v 1.182 2022/08/13 23:14:26 tom Exp $")
#ifdef USE_TERM_DRIVER
#define MaxColors InfoOf(sp).maxcolors
@ -146,6 +146,7 @@ delscreen(SCREEN *sp)
_nc_lock_global(curses);
if (delink_screen(sp)) {
WINDOWLIST *wl;
bool is_current = (sp == CURRENT_SCREEN);
#ifdef USE_SP_RIPOFF
@ -162,9 +163,13 @@ delscreen(SCREEN *sp)
}
#endif
(void) _nc_freewin(CurScreen(sp));
(void) _nc_freewin(NewScreen(sp));
(void) _nc_freewin(StdScreen(sp));
/* delete all of the windows in this screen */
rescan:
for (each_window(sp, wl)) {
if (_nc_freewin(&(wl->win)) == OK) {
goto rescan;
}
}
if (sp->_slk != 0) {

View File

@ -35,7 +35,7 @@
****************************************************************************/
/*
* $Id: curses.priv.h,v 1.650 2022/05/01 14:41:33 tom Exp $
* $Id: curses.priv.h,v 1.651 2022/08/13 14:35:01 tom Exp $
*
* curses.priv.h
*
@ -672,9 +672,14 @@ extern NCURSES_EXPORT(int) _nc_sigprocmask(int, const sigset_t *, sigset_t *);
#define _nc_lock_global(name) /* nothing */
#define _nc_try_global(name) 0
#define _nc_unlock_global(name) /* nothing */
#endif /* USE_PTHREADS */
#if USE_PTHREADS_EINTR || defined(EXP_WIN32_DRIVER)
extern NCURSES_EXPORT(void) _nc_set_read_thread(bool);
#else
#define _nc_set_read_thread(enable) /* nothing */
#endif
/*
* When using sp-funcs, locks are targeted to SCREEN-level granularity.
* So the locking is done in the non-sp-func (which calls the sp-func) rather

View File

@ -38,7 +38,7 @@
#include <tic.h>
MODULE_ID("$Id: entries.c,v 1.33 2022/05/07 17:08:11 tom Exp $")
MODULE_ID("$Id: entries.c,v 1.34 2022/08/13 16:57:35 tom Exp $")
/****************************************************************************
*
@ -125,6 +125,22 @@ _nc_leaks_tinfo(void)
_nc_free_tparm(cur_term);
_nc_tgetent_leaks();
#ifdef USE_PTHREADS
/*
* Discard any prescreen data which is not used for the current screen.
*/
_nc_lock_global(screen);
{
PRESCREEN_LIST *p;
pthread_t id = GetThreadID();
for (p = _nc_prescreen.allocated; p != 0; p = p->next) {
if (p->id == id && p->sp != CURRENT_SCREEN) {
FreeAndNull(p->sp);
}
}
}
_nc_unlock_global(screen);
#endif
if (TerminalOf(CURRENT_SCREEN) != 0) {
del_curterm(TerminalOf(CURRENT_SCREEN));
}

View File

@ -49,7 +49,7 @@
#include <locale.h>
#endif
MODULE_ID("$Id: lib_setup.c,v 1.217 2022/07/21 08:24:50 tom Exp $")
MODULE_ID("$Id: lib_setup.c,v 1.218 2022/08/13 18:12:22 tom Exp $")
/****************************************************************************
*
@ -831,7 +831,7 @@ TINFO_SETUP_TERM(TERMINAL **tp,
if (NC_ISATTY(Filedes)) {
NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_ARG);
NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_ARG);
NCURSES_SP_NAME(baudrate)(NCURSES_SP_ARG);
NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG);
}
code = OK;
#endif
@ -908,6 +908,7 @@ _nc_forget_prescr(void)
{
PRESCREEN_LIST *p, *q;
pthread_t id = GetThreadID();
_nc_lock_global(screen);
for (p = _nc_prescreen.allocated, q = 0; p != 0; q = p, p = p->next) {
if (p->id == id) {
if (q) {
@ -919,6 +920,7 @@ _nc_forget_prescr(void)
break;
}
}
_nc_unlock_global(screen);
}
#endif /* USE_PTHREADS */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 2018-2021,2022 Thomas E. Dickey *
* Copyright 2008-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@ -52,7 +52,7 @@
# endif
#endif
MODULE_ID("$Id: tinfo_driver.c,v 1.72 2021/06/17 21:30:22 tom Exp $")
MODULE_ID("$Id: tinfo_driver.c,v 1.73 2022/08/13 14:36:43 tom Exp $")
/*
* SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS,
@ -1282,10 +1282,7 @@ drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf)
assert(buf);
SetSP();
# if USE_PTHREADS_EINTR
if ((pthread_self) && (pthread_kill) && (pthread_equal))
_nc_globals.read_thread = pthread_self();
# endif
_nc_set_read_thread(TRUE);
#ifdef EXP_WIN32_DRIVER
n = _nc_console_read(sp,
_nc_console_handle(sp->_ifd),
@ -1293,9 +1290,7 @@ drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf)
#else
n = (int) read(sp->_ifd, &c2, (size_t) 1);
#endif
#if USE_PTHREADS_EINTR
_nc_globals.read_thread = 0;
#endif
_nc_set_read_thread(FALSE);
#ifndef EXP_WIN32_DRIVER
*buf = (int) c2;
#endif

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright 2020,2021 Thomas E. Dickey *
* Copyright 2020-2021,2022 Thomas E. Dickey *
* Copyright 1998-2014,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@ -43,7 +43,7 @@
#include <SigAction.h>
MODULE_ID("$Id: lib_tstp.c,v 1.51 2021/09/04 10:54:35 tom Exp $")
MODULE_ID("$Id: lib_tstp.c,v 1.52 2022/08/13 14:36:43 tom Exp $")
#if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC)
#define USE_SIGTSTP 1
@ -284,6 +284,22 @@ handle_SIGINT(int sig)
}
#if USE_SIGWINCH
# ifndef _nc_set_read_thread
NCURSES_EXPORT(void)
_nc_set_read_thread(bool enable)
{
if (enable) {
# if USE_WEAK_SYMBOLS
if ((pthread_self) && (pthread_kill) && (pthread_equal))
# endif
_nc_globals.read_thread = pthread_self();
} else {
_nc_globals.read_thread = 0;
}
}
# endif
static void
handle_SIGWINCH(int sig GCC_UNUSED)
{

View File

@ -1,8 +1,8 @@
ncurses6 (6.3+20220806) unstable; urgency=low
ncurses6 (6.3+20220813) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 06 Aug 2022 06:14:36 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 13 Aug 2022 05:43:55 -0400
ncurses6 (5.9-20131005) unstable; urgency=low

View File

@ -1,8 +1,8 @@
ncurses6 (6.3+20220806) unstable; urgency=low
ncurses6 (6.3+20220813) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 06 Aug 2022 06:14:36 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 13 Aug 2022 05:43:55 -0400
ncurses6 (5.9-20131005) unstable; urgency=low

View File

@ -1,8 +1,8 @@
ncurses6 (6.3+20220806) unstable; urgency=low
ncurses6 (6.3+20220813) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 06 Aug 2022 06:14:36 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 13 Aug 2022 05:43:55 -0400
ncurses6 (5.9-20120608) unstable; urgency=low

View File

@ -1,4 +1,4 @@
; $Id: mingw-ncurses.nsi,v 1.536 2022/08/06 10:14:36 tom Exp $
; $Id: mingw-ncurses.nsi,v 1.537 2022/08/13 09:43:55 tom Exp $
; TODO add examples
; TODO bump ABI to 6
@ -10,7 +10,7 @@
!define VERSION_MAJOR "6"
!define VERSION_MINOR "3"
!define VERSION_YYYY "2022"
!define VERSION_MMDD "0806"
!define VERSION_MMDD "0813"
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
!define MY_ABI "5"

View File

@ -3,7 +3,7 @@
Summary: shared libraries for terminal handling
Name: mingw32-ncurses6
Version: 6.3
Release: 20220806
Release: 20220813
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz

View File

@ -1,7 +1,7 @@
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 6.3
Release: 20220806
Release: 20220813
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz

View File

@ -1,7 +1,7 @@
Summary: Curses library with POSIX thread support.
Name: ncursest6
Version: 6.3
Release: 20220806
Release: 20220813
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz

View File

@ -26,7 +26,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: README,v 1.76 2022/06/04 23:25:37 tom Exp $
-- $Id: README,v 1.77 2022/08/13 23:34:33 tom Exp $
-------------------------------------------------------------------------------
The programs in this directory are used to test and demonstrate ncurses.
@ -234,9 +234,9 @@ BC test: demo_termcap
COLORS test: color_content demo_new_pair dots_curses dots_xcurses echochar ncurses pair_content picsmap savescreen xmas
COLOR_PAIR test: background blue bs cardfile clip_printw demo_forms demo_menus demo_panels dots_curses dup_field echochar filter firework gdc hanoi ins_wide insdelln inserts knight move_field ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
COLOR_PAIRS test: demo_new_pair dots_curses dots_xcurses echochar ncurses newdemo pair_content
COLS test: cardfile combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels demo_tabs ditto dots_curses dots_xcurses echochar filter firework foldkeys hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm
COLS test: cardfile combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels demo_tabs ditto dots_curses dots_xcurses echochar filter firework foldkeys hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm
ESCDELAY test: test_opaque
LINES test: cardfile combine demo_defkey demo_keyok demo_menus demo_panels demo_tabs ditto dots_curses dots_xcurses echochar firework hanoi hashtest inch_wide inchs ins_wide inserts lrtest move_field movewindow ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
LINES test: cardfile combine demo_defkey demo_keyok demo_menus demo_panels demo_tabs ditto dots_curses dots_xcurses echochar firework hanoi hashtest inch_wide inchs ins_wide inserts lrtest move_field movewindow ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
PAIR_NUMBER test: dump_window ncurses
PC test: demo_termcap
SP lib: form
@ -277,11 +277,11 @@ boolfnames test: demo_terminfo test_arrays progs: dump_entry
boolnames test: demo_terminfo test_arrays progs: dump_entry infocmp
border -
border_set -
box test: cardfile chgat clip_printw demo_forms demo_menus demo_panels ditto inch_wide inchs ins_wide insdelln inserts lrtest ncurses newdemo popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
box test: cardfile chgat clip_printw demo_forms demo_menus demo_panels ditto inch_wide inchs ins_wide insdelln inserts lrtest ncurses newdemo popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
box_set test: ncurses
can_change_color test: color_content extended_color ncurses
can_change_color_sp test: extended_color
cbreak test: back_ground background blue bs cardfile chgat clip_printw color_content color_set combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dup_field extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_unget_wch testcurs view worm xmas
cbreak test: back_ground background blue bs cardfile chgat clip_printw color_content color_set combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dup_field extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_unget_wch testcurs view worm xmas
cbreak_sp test: sp_tinfo
chgat test: chgat
clear test: blue bs filter gdc ncurses padview testcurs xmas
@ -310,9 +310,9 @@ delay_output test: newdemo
delay_output_sp test: sp_tinfo
delch -
deleteln test: insdelln
delscreen test: ditto dots_mvcur
delwin test: cardfile chgat clip_printw demo_forms demo_panels dup_field inch_wide inchs ins_wide insdelln inserts move_field ncurses newdemo padview popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view
derwin test: cardfile chgat clip_printw demo_forms demo_menus ditto inch_wide inchs ins_wide insdelln inserts movewindow ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque
delscreen test: ditto dots_mvcur test_delwin
delwin test: cardfile chgat clip_printw demo_forms demo_panels dup_field inch_wide inchs ins_wide insdelln inserts move_field ncurses newdemo padview popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view
derwin test: cardfile chgat clip_printw demo_forms demo_menus ditto inch_wide inchs ins_wide insdelln inserts movewindow ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_opaque
doupdate test: cardfile demo_menus demo_panels ditto ins_wide inserts knight movewindow ncurses padview popup_msg redraw savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr
doupdate_sp lib: ncurses
dupwin test: popup_msg
@ -320,14 +320,14 @@ echo test: bs hanoi ncurses test_get_wstr test_getstr testcurs testscanw
echo_sp lib: ncurses
echo_wchar test: ncurses
echochar test: echochar ncurses
endwin test: back_ground background blue bs cardfile chgat clip_printw color_content color_set combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dots_curses dots_mvcur dots_xcurses dup_field echochar extended_color filter firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_unget_wch testaddch testcurs testscanw view worm xmas
endwin test: back_ground background blue bs cardfile chgat clip_printw color_content color_set combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dots_curses dots_mvcur dots_xcurses dup_field echochar extended_color filter firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_unget_wch testaddch testcurs testscanw view worm xmas
endwin_sp lib: ncurses
erase test: cardfile demo_menus filter firework firstlast hanoi lrtest ncurses picsmap tclock test_opaque testcurs
erasechar test: ncurses
erasechar_sp test: sp_tinfo
erasewchar test: ncurses
erasewchar_sp lib: ncurses
exit_curses test: back_ground background blue bs cardfile chgat clip_printw color_content color_set combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dots_curses dots_xcurses dup_field echochar extended_color filter firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_setupterm test_termattrs test_unget_wch testaddch testcurs testscanw view worm xmas
exit_curses test: back_ground background blue bs cardfile chgat clip_printw color_content color_set combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dots_curses dots_xcurses dup_field echochar extended_color filter firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_setupterm test_termattrs test_unget_wch testaddch testcurs testscanw view worm xmas
exit_terminfo test: demo_termcap demo_terminfo dots dots_mvcur dots_termcap list_keys railroad sp_tinfo test_arrays test_sgr test_tparm test_vid_puts test_vidputs
extended_color_content test: color_content extended_color
extended_color_content_sp test: extended_color
@ -539,7 +539,7 @@ mvwinsnstr test: inserts
mvwinsstr test: inserts testcurs
mvwinstr test: test_instr
mvwinwstr test: test_inwstr
mvwprintw test: demo_menus demo_panels inch_wide inchs ncurses test_instr test_inwstr testcurs
mvwprintw test: demo_menus demo_panels inch_wide inchs ncurses test_delwin test_instr test_inwstr testcurs
mvwscanw test: testcurs
mvwvline test: ins_wide inserts movewindow ncurses test_add_wchstr test_addchstr test_addstr test_addwstr
mvwvline_set -
@ -549,16 +549,16 @@ new_prescr test: sp_tinfo
newpad test: ncurses padview popup_msg testcurs
newpad_sp lib: ncurses
newscr lib: ncurses
newterm test: demo_altkeys demo_new_pair ditto dots_mvcur extended_color filter foldkeys gdc key_names keynames redraw test_setupterm test_termattrs
newterm test: demo_altkeys demo_new_pair ditto dots_mvcur extended_color filter foldkeys gdc key_names keynames redraw test_delwin test_setupterm test_termattrs
newterm_sp -
newwin test: cardfile chgat clip_printw demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto firstlast inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses newdemo popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view xmas
newwin test: cardfile chgat clip_printw demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto firstlast inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses newdemo popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view xmas
newwin_sp lib: ncurses
nl test: demo_forms dup_field move_field ncurses rain testcurs
nl_sp lib: ncurses
nocbreak test: testcurs
nocbreak_sp test: sp_tinfo
nodelay test: demo_new_pair ditto extended_color firework gdc lrtest ncurses newdemo padview rain tclock test_opaque view worm xmas
noecho test: back_ground background bs cardfile chgat clip_printw color_content color_set combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dup_field extended_color firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest move_field movewindow ncurses padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_unget_wch testcurs view worm xmas
noecho test: back_ground background bs cardfile chgat clip_printw color_content color_set combine demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dup_field extended_color firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest move_field movewindow ncurses padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_unget_wch testcurs view worm xmas
noecho_sp lib: ncurses
nofilter -
nofilter_sp -
@ -581,7 +581,7 @@ pecho_wchar -
pechochar -
pnoutrefresh test: ncurses padview popup_msg
prefresh test: testcurs
printw test: back_ground background blue bs color_content color_set combine demo_altkeys demo_defkey demo_keyok demo_tabs extended_color filter foldkeys ncurses pair_content savescreen test_unget_wch testcurs testscanw view
printw test: back_ground background blue bs color_content color_set combine demo_altkeys demo_defkey demo_keyok demo_tabs extended_color filter foldkeys ncurses pair_content savescreen test_delwin test_unget_wch testcurs testscanw view
putp test: filter test_mouse test_sgr progs: tput
putp_sp test: sp_tinfo
putwin test: ncurses
@ -590,7 +590,7 @@ qiflush_sp test: sp_tinfo
raw test: demo_forms dup_field move_field ncurses redraw testcurs
raw_sp test: sp_tinfo
redrawwin test: combine padview redraw view
refresh test: blue bs color_content demo_defkey demo_forms demo_keyok demo_menus demo_panels demo_tabs dots_curses dots_mvcur dots_xcurses dup_field echochar filter firstlast form_driver_w gdc hanoi hashtest lrtest move_field movewindow ncurses pair_content picsmap savescreen tclock test_mouse testcurs view xmas
refresh test: blue bs color_content demo_defkey demo_forms demo_keyok demo_menus demo_panels demo_tabs dots_curses dots_mvcur dots_xcurses dup_field echochar filter firstlast form_driver_w gdc hanoi hashtest lrtest move_field movewindow ncurses pair_content picsmap savescreen tclock test_delwin test_mouse testcurs view xmas
reset_color_pairs test: picsmap
reset_color_pairs_sp -
reset_prog_mode test: filter ncurses
@ -619,7 +619,7 @@ scr_set test: savescreen
scr_set_sp -
scrl test: view
scroll test: testcurs
scrollok test: clip_printw color_content demo_altkeys demo_defkey demo_keyok demo_new_pair demo_panels ditto foldkeys hashtest knight ncurses pair_content picsmap redraw test_opaque test_unget_wch testcurs testscanw view
scrollok test: clip_printw color_content demo_altkeys demo_defkey demo_keyok demo_new_pair demo_panels ditto foldkeys hashtest knight ncurses pair_content picsmap redraw test_delwin test_opaque test_unget_wch testcurs testscanw view
set_curterm test: list_keys sp_tinfo
set_curterm_sp test: sp_tinfo
set_escdelay test: test_opaque
@ -665,7 +665,7 @@ standend test: blue gdc ncurses
standout test: blue ncurses
start_color test: back_ground background blue bs cardfile chgat clip_printw color_content color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses dots_xcurses dup_field echochar extended_color filter firework gdc hanoi ins_wide insdelln inserts knight move_field ncurses newdemo padview pair_content picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
start_color_sp -
stdscr test: back_ground background bs chgat clip_printw color_content combine demo_altkeys demo_forms demo_menus demo_new_pair demo_panels ditto dup_field edit_field extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest move_field movewindow ncurses padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_unget_wch testcurs testscanw view worm xmas
stdscr test: back_ground background bs chgat clip_printw color_content combine demo_altkeys demo_forms demo_menus demo_new_pair demo_panels ditto dup_field edit_field extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest move_field movewindow ncurses padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque test_unget_wch testcurs testscanw view worm xmas
strcodes test: demo_termcap test_arrays progs: dump_entry
strfnames test: demo_terminfo list_keys test_arrays progs: dump_entry
strnames test: demo_terminfo foldkeys list_keys test_arrays test_tparm progs: dump_entry infocmp tic
@ -696,7 +696,7 @@ tigetstr_sp test: sp_tinfo
timeout test: filter rain savescreen
tiparm -
touchline test: chgat clip_printw insdelln
touchwin test: chgat clip_printw demo_menus filter firstlast inch_wide inchs ins_wide insdelln inserts movewindow ncurses popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque xmas
touchwin test: chgat clip_printw demo_menus filter firstlast inch_wide inchs ins_wide insdelln inserts movewindow ncurses popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin test_get_wstr test_getstr test_instr test_inwstr test_opaque xmas
tparm test: dots dots_mvcur test_mouse test_sgr test_tparm progs: tic tput
tputs test: dots dots_mvcur dots_termcap railroad test_tparm test_vid_puts test_vidputs progs: clear_cmd reset_cmd tabs
tputs_sp test: sp_tinfo
@ -763,7 +763,7 @@ wborder test: ncurses
wborder_set test: ncurses
wchgat test: chgat test_get_wstr test_getstr view
wclear test: ncurses test_opaque testcurs
wclrtobot test: firstlast inch_wide inchs ncurses test_instr test_inwstr testcurs
wclrtobot test: firstlast inch_wide inchs ncurses test_delwin test_instr test_inwstr testcurs
wclrtoeol test: chgat clip_printw demo_defkey demo_keyok demo_menus demo_panels firstlast inch_wide inchs ins_wide insdelln inserts knight ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_instr test_inwstr testcurs
wcolor_set lib: ncurses
wcursyncup lib: form
@ -776,7 +776,7 @@ werase test: cardfile demo_forms demo_menus demo_panels dup_field firstlast k
wget_wch test: ins_wide ncurses test_add_wchstr test_addwstr
wget_wstr test: test_get_wstr
wgetbkgrnd lib: ncurses
wgetch test: cardfile chgat clip_printw demo_defkey demo_keyok demo_menus demo_panels ditto dump_window dup_field edit_field gdc insdelln inserts knight move_field movewindow ncurses newdemo popup_msg rain redraw test_addchstr test_addstr test_opaque testcurs worm
wgetch test: cardfile chgat clip_printw demo_defkey demo_keyok demo_menus demo_panels ditto dump_window dup_field edit_field gdc insdelln inserts knight move_field movewindow ncurses newdemo popup_msg rain redraw test_addchstr test_addstr test_delwin test_opaque testcurs worm
wgetdelay test: test_opaque
wgetn_wstr test: ncurses test_get_wstr
wgetnstr test: ncurses test_getstr
@ -808,11 +808,11 @@ wmove test: chgat clip_printw demo_altkeys demo_defkey demo_keyok demo_menus
wnoutrefresh test: demo_menus ditto inch_wide inchs ins_wide inserts knight movewindow ncurses padview popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque
wprintw test: chgat clip_printw demo_defkey demo_forms demo_keyok demo_menus demo_panels inch_wide inchs ins_wide insdelln inserts knight ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_mouse test_opaque testcurs
wredrawln test: redraw
wrefresh test: chgat clip_printw demo_forms demo_keyok demo_menus demo_panels dup_field firstlast ins_wide insdelln inserts knight lrtest move_field movewindow ncurses newdemo popup_msg redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testcurs worm xmas
wrefresh test: chgat clip_printw demo_forms demo_keyok demo_menus demo_panels dup_field firstlast ins_wide insdelln inserts knight lrtest move_field movewindow ncurses newdemo popup_msg redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_delwin testcurs worm xmas
wresize test: cardfile demo_menus ncurses
wscanw test: testcurs
wscrl test: ncurses testcurs
wsetscrreg test: ncurses testcurs
wsetscrreg test: ncurses test_delwin testcurs
wstandend test: ncurses test_opaque xmas
wstandout test: ncurses test_opaque xmas
wsyncdown test: movewindow

View File

@ -29,13 +29,13 @@
/*
* Author: Thomas E. Dickey
*
* $Id: demo_tabs.c,v 1.6 2022/05/15 13:04:57 tom Exp $
* $Id: demo_tabs.c,v 1.7 2022/08/13 21:02:25 tom Exp $
*
* A simple demo of tabs in curses.
*/
#define USE_CURSES
#define USE_TINFO
#include "test.priv.h"
#include <test.priv.h>
static void
usage(void)

View File

@ -1,4 +1,4 @@
# $Id: modules,v 1.77 2022/05/07 22:39:21 tom Exp $
# $Id: modules,v 1.78 2022/08/13 20:53:43 tom Exp $
##############################################################################
# Copyright 2018-2021,2022 Thomas E. Dickey #
# Copyright 1998-2016,2017 Free Software Foundation, Inc. #
@ -101,6 +101,7 @@ test_addchstr progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h
test_addstr progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h
test_addwstr progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h
test_arrays progs $(srcdir) $(HEADER_DEPS)
test_delwin progs $(srcdir) $(HEADER_DEPS)
test_get_wstr progs $(srcdir) $(HEADER_DEPS)
test_getstr progs $(srcdir) $(HEADER_DEPS)
test_instr progs $(srcdir) $(HEADER_DEPS)

View File

@ -1,4 +1,4 @@
# $Id: programs,v 1.53 2022/05/07 22:39:49 tom Exp $
# $Id: programs,v 1.55 2022/08/13 23:37:10 tom Exp $
##############################################################################
# Copyright 2018-2021,2022 Thomas E. Dickey #
# Copyright 2006-2016,2017 Free Software Foundation, Inc. #
@ -96,6 +96,7 @@ test_addchstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_addchstr
test_addstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_addstr
test_addwstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_addwstr
test_arrays $(LDFLAGS_TINFO) $(LOCAL_LIBS) test_arrays
test_delwin $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_delwin
test_get_wstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_get_wstr popup_msg
test_getstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_getstr popup_msg
test_instr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_instr

117
test/test_delwin.c Normal file
View File

@ -0,0 +1,117 @@
/****************************************************************************
* Copyright 2022 Thomas E. Dickey *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
* *
* Except as contained in this notice, the name(s) of the above copyright *
* holders shall not be used in advertising or otherwise to promote the *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************/
/*
* $Id: test_delwin.c,v 1.3 2022/08/14 00:12:52 tom Exp $
*/
#include <test.priv.h>
#define STATUS 10
static SCREEN *my_screen;
static void
show_rc(const char *what, const char *explain, int rc)
{
printw("%s : %d (%s)\n", what, rc, explain);
}
static void
next_step(WINDOW *win)
{
int ch = wgetch(win);
if (ch == QUIT || ch == ESCAPE) {
endwin();
/* use this to verify if delscreen frees all memory */
delscreen(my_screen);
exit(EXIT_FAILURE);
}
}
int
main(void)
{
WINDOW *parent, *child1;
int rc;
if ((my_screen = newterm(NULL, stdout, stdin)) == NULL)
ExitProgram(EXIT_FAILURE);
noecho();
cbreak();
refresh();
wsetscrreg(stdscr, 0, STATUS - 1);
scrollok(stdscr, TRUE);
parent = newwin(0, 0, STATUS, 0);
box(parent, 0, 0);
wrefresh(parent);
next_step(parent);
printw("New window %p %s\n", (void *) parent, "Top window");
mvwprintw(parent, 1, 1, "Top window");
wrefresh(parent);
next_step(stdscr);
child1 = derwin(parent, LINES - STATUS - 4, COLS - 4, 2, 2);
box(child1, 0, 0);
mvwprintw(child1, 1, 1, "Sub window");
wrefresh(child1);
printw("Sub window %p %s\n", (void *) child1, "Hello world!");
next_step(stdscr);
show_rc("Deleted parent",
"should fail, it still has a subwindow",
rc = delwin(parent));
next_step(stdscr);
show_rc("Deleted child1",
"should succeed",
rc = delwin(child1));
next_step(stdscr);
if (rc == OK) {
wclrtobot(parent);
box(parent, 0, 0);
next_step(parent);
}
show_rc("Deleted parent",
"should succeed, it has no subwindow now",
rc = delwin(parent));
next_step(stdscr);
if (rc == OK) {
touchwin(stdscr);
next_step(stdscr);
}
show_rc("Deleted parent",
"should fail, may dump core",
delwin(parent));
next_step(stdscr);
endwin();
ExitProgram(EXIT_SUCCESS);
}

View File

@ -53,7 +53,7 @@
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.84 2022/07/23 17:06:16 tom Exp $
$Id: worm.c,v 1.85 2022/08/13 13:28:01 tom Exp $
*/
#include <test.priv.h>
@ -663,6 +663,15 @@ main(int argc, char *argv[])
Trace(("Cleanup"));
cleanup();
#ifdef USE_PTHREADS
/*
* 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);
}
#endif
#if NO_LEAKS
for (y = 0; y < max_refs; y++) {
free(refs[y]);
@ -672,15 +681,6 @@ main(int argc, char *argv[])
free(w->xpos);
free(w->ypos);
}
#endif
#ifdef USE_PTHREADS
/*
* 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);
}
#endif
ExitProgram(EXIT_SUCCESS);
}