-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3831 2022/07/16 18:43:58 tom Exp $
+-- $Id: NEWS,v 1.3836 2022/07/24 10:06:18 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.
+20220724
+ + add portability notes for delscreen and delwin in manual.
+ + improve pthread-configuration for test/worm.c, test/rain.c
+ + improve pointer/limit checks associated with deleting a screen
+ (Debian #1015756).
+
20220716
+ build-fix for test_mouse.c, for non-standard cfmakeraw.
+ improve shell-scripts with shellcheck
-5:0:10 6.3 20220716
+5:0:10 6.3 20220724
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.1492 2022/07/16 10:45:29 tom Exp $
+# $Id: dist.mk,v 1.1494 2022/07/24 09:45:40 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 = 6
NCURSES_MINOR = 3
-NCURSES_PATCH = 20220716
+NCURSES_PATCH = 20220724
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
</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 20220703).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
</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 20220703).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
</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 20220703).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: curs_initscr.3x,v 1.37 2022/02/12 20:07:29 tom Exp @
+ * @Id: curs_initscr.3x,v 1.39 2022/07/24 15:46:49 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
<STRONG>o</STRONG> This implementation allows using <STRONG>initscr</STRONG> after <STRONG>endwin</STRONG>.
- Old versions of curses, e.g., BSD 4.4, may have returned a null pointer
- from <STRONG>initscr</STRONG> when an error is detected, rather than exiting. It is
- safe but redundant to check the return value of <STRONG>initscr</STRONG> in XSI Curses.
+ Old versions of curses, e.g., BSD 4.4, would return a null pointer from
+ <STRONG>initscr</STRONG> when an error is detected, rather than exiting. It is safe but
+ redundant to check the return value of <STRONG>initscr</STRONG> in XSI Curses.
+
+ Calling <STRONG>endwin</STRONG> does not dispose of the memory allocated in <STRONG>initscr</STRONG> or
+ <STRONG>newterm</STRONG>. Deleting a <STRONG>SCREEN</STRONG> provides a way to do this:
+
+ <STRONG>o</STRONG> X/Open Curses does not say what happens to <STRONG>WINDOW</STRONG>s when <STRONG>delscreen</STRONG>
+ "frees storage associated with the <STRONG>SCREEN</STRONG>" nor does the SVr4 docu-
+ mentation help, adding that it should be called after <STRONG>endwin</STRONG> if a
+ <STRONG>SCREEN</STRONG> is no longer needed.
+
+ <STRONG>o</STRONG> However, <STRONG>WINDOW</STRONG>s are implicitly associated with a <STRONG>SCREEN</STRONG>. so that
+ it is reasonable to expect <STRONG>delscreen</STRONG> to deal with these.
+
+ <STRONG>o</STRONG> SVr4 curses deletes the standard <STRONG>WINDOW</STRONG> structures <STRONG>stdscr</STRONG> and
+ <STRONG>curscr</STRONG> as well as a work area <STRONG>newscr</STRONG>. SVr4 curses ignores other
+ windows.
+
+ <STRONG>o</STRONG> Since version 4.0 (1996), ncurses has maintained a list of all win-
+ dows for each screen, using that information to delete those win-
+ dows when <STRONG>delscreen</STRONG> is called.
+
+ <STRONG>o</STRONG> NetBSD copied this feature of ncurses in 2001. PDCurses follows
+ the SVr4 model, deleting only the standard <STRONG>WINDOW</STRONG> structures.
</PRE><H3><a name="h3-Unset-TERM-Variable">Unset TERM Variable</a></H3><PRE>
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: curs_window.3x,v 1.25 2022/02/12 20:06:41 tom Exp @
+ * @Id: curs_window.3x,v 1.27 2022/07/24 15:35:15 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
The XSI Curses standard, Issue 4 describes these functions.
+ X/Open Curses states regarding <STRONG>delwin</STRONG>:
+
+ <STRONG>o</STRONG> It must delete subwindows before deleting their parent.
+
+ <STRONG>o</STRONG> If <STRONG>delwin</STRONG> is asked to delete a parent window, it can only succeed
+ if the curses library keeps a list of the subwindows. SVr4 curses
+ kept a count of the number of subwindows rather than a list. It
+ simply returned <STRONG>ERR</STRONG> when asked to delete a subwindow. Solaris
+ X/Open curses does not even make that check, and will delete a par-
+ 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.
+
+ <STRONG>o</STRONG> NetBSD copied this feature of ncurses in 2003.
+ PDCurses follows the scheme used in Solaris X/Open curses.
+
</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_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_touch.3x.html">curs_touch(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>
+ <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_touch.3x.html">curs_touch(3x)</A></STRONG>,
+ <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>
<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 20220703).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
https://invisible-island.net/ncurses/tctest.html
- This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220703).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
</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 20220703).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
<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 20220703).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
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 20220703).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
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
</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 20220703).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
</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 20220703).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
</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 20220703).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
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 20220703).
+ This manual describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
</PRE><H3><a name="h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></H3><PRE>
<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 20220703).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
<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 20220703).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
</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 20220703).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
<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 20220703).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220724).
<!--
****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 2018-2021,2022 Thomas E. Dickey *
* Copyright 2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: user_caps.5,v 1.21 2022/07/03 20:01:04 tom Exp @
+ * @Id: user_caps.5,v 1.22 2022/07/03 20:01:04 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: curs_initscr.3x,v 1.37 2022/02/12 20:07:29 tom Exp $
+.\" $Id: curs_initscr.3x,v 1.39 2022/07/24 15:46:49 tom Exp $
.TH curs_initscr 3X ""
.de bP
.ie n .IP \(bu 4
.bP
This implementation allows using \fBinitscr\fP after \fBendwin\fP.
.PP
-Old versions of curses, e.g., BSD 4.4, may have returned a null pointer
+Old versions of curses, e.g., BSD 4.4, would return a null pointer
from \fBinitscr\fP when an error is detected, rather than exiting.
It is safe but redundant to check the return value of \fBinitscr\fP
in XSI Curses.
+.PP
+Calling \fBendwin\fP does not dispose of the memory allocated in \fBinitscr\fP
+or \fBnewterm\fP.
+Deleting a \fBSCREEN\fP provides a way to do this:
+.bP
+X/Open Curses does not say what happens to \fBWINDOW\fPs when \fBdelscreen\fP
+\*(``frees storage associated with the \fBSCREEN\fP\*(''
+nor does the SVr4 documentation help,
+adding that it should be called after \fBendwin\fP if a \fBSCREEN\fP
+is no longer needed.
+.bP
+However, \fBWINDOW\fPs are implicitly associated with a \fBSCREEN\fP.
+so that it is reasonable to expect \fBdelscreen\fP to deal with these.
+.bP
+SVr4 curses deletes the standard \fBWINDOW\fP structures
+\fBstdscr\fP and \fBcurscr\fP as well as a work area \fBnewscr\fP.
+SVr4 curses ignores other windows.
+.bP
+Since version 4.0 (1996), ncurses has maintained a list of all windows
+for each screen,
+using that information to delete those windows when \fBdelscreen\fP is called.
+.bP
+NetBSD copied this feature of ncurses in 2001.
+PDCurses follows the SVr4 model,
+deleting only the standard \fBWINDOW\fP structures.
.SS Unset TERM Variable
.PP
If the TERM variable is missing or empty, \fBinitscr\fP uses the
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: curs_window.3x,v 1.25 2022/02/12 20:06:41 tom Exp $
+.\" $Id: curs_window.3x,v 1.27 2022/07/24 15:35:15 tom Exp $
.TH curs_window 3X ""
.de bP
.ie n .IP \(bu 4
The weaker XPG4 spec may result in slower updates.
.SH PORTABILITY
The XSI Curses standard, Issue 4 describes these functions.
+.PP
+X/Open Curses states regarding \fBdelwin\fP:
+.bP
+It must delete subwindows before deleting their parent.
+.bP
+If \fBdelwin\fP is asked to delete a parent window,
+it can only succeed if the curses library keeps a list of the subwindows.
+SVr4 curses kept a count of the number of subwindows rather than a list.
+It simply returned \fBERR\fP when asked to delete a subwindow.
+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.
+.bP
+NetBSD copied this feature of ncurses in 2003.
+.br
+PDCurses follows the scheme used in Solaris X/Open curses.
.SH SEE ALSO
\fBcurses\fP(3X),
+\fBcurs_initscr\fP(3X),
\fBcurs_refresh\fP(3X),
\fBcurs_touch\fP(3X),
\fBcurs_variables\fP(3X)
#undef CUR
#define CUR SP_TERMTYPE
-MODULE_ID("$Id: lib_set_term.c,v 1.180 2022/07/09 18:58:58 tom Exp $")
+MODULE_ID("$Id: lib_set_term.c,v 1.181 2022/07/21 23:35:21 tom Exp $")
#ifdef USE_TERM_DRIVER
#define MaxColors InfoOf(sp).maxcolors
_nc_lock_global(curses);
if (delink_screen(sp)) {
+ bool is_current = (sp == CURRENT_SCREEN);
+
#ifdef USE_SP_RIPOFF
if (safe_ripoff_sp && safe_ripoff_sp != safe_ripoff_stack) {
ripoff_t *rop;
* application might try to use (except cur_term, which may have
* multiple references in different screens).
*/
- if (sp == CURRENT_SCREEN) {
+ if (is_current) {
#if !USE_REENTRANT
curscr = 0;
newscr = 0;
_nc_wacs = 0;
}
#endif
+ } else {
+ set_term(CURRENT_SCREEN);
}
}
_nc_unlock_global(curses);
#include <locale.h>
#endif
-MODULE_ID("$Id: lib_setup.c,v 1.216 2022/07/09 18:58:58 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.217 2022/07/21 08:24:50 tom Exp $")
/****************************************************************************
*
if (NC_ISATTY(Filedes)) {
NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_ARG);
NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_ARG);
- baudrate();
+ NCURSES_SP_NAME(baudrate)(NCURSES_SP_ARG);
}
code = OK;
#endif
/****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 2018-2021,2022 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <termcap.h> /* ospeed */
#include <tic.h>
-MODULE_ID("$Id: lib_tputs.c,v 1.108 2021/05/08 23:27:40 tom Exp $")
+MODULE_ID("$Id: lib_tputs.c,v 1.109 2022/07/21 23:26:34 tom Exp $")
NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */
NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */
SP_PARM->out_buffer));
if (SP_PARM->out_inuse) {
char *buf = SP_PARM->out_buffer;
- size_t amount = SP->out_inuse;
+ size_t amount = SP_PARM->out_inuse;
- SP->out_inuse = 0;
TR(TRACE_CHARPUT, ("flushing %ld/%ld bytes",
(unsigned long) amount, _nc_outchars));
while (amount) {
TR(TRACE_CHARPUT, ("flushing stdout"));
fflush(stdout);
}
+ if (SP_PARM != 0)
+ SP_PARM->out_inuse = 0;
returnVoid;
}
/****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 2018-2021,2022 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <ctype.h>
-MODULE_ID("$Id: lib_trace.c,v 1.99 2021/06/26 20:44:59 tom Exp $")
+MODULE_ID("$Id: lib_trace.c,v 1.100 2022/07/23 20:08:45 tom Exp $")
NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */
#define MyNested _nc_globals.nested_tracef
#endif /* TRACE */
+#if USE_REENTRANT
+#define Locked(statement) { \
+ _nc_lock_global(tst_tracef); \
+ statement; \
+ _nc_unlock_global(tst_tracef); \
+ }
+#else
+#define Locked(statement) statement
+#endif
+
NCURSES_EXPORT(unsigned)
curses_trace(unsigned tracelevel)
{
unsigned result;
#if defined(TRACE)
- result = _nc_tracing;
+ Locked(result = _nc_tracing);
if ((MyFP == 0) && tracelevel) {
MyInit = TRUE;
if (MyFD >= 0) {
; /* EMPTY */
}
}
- _nc_tracing = tracelevel;
+ Locked(_nc_tracing = tracelevel);
/* Try to set line-buffered mode, or (failing that) unbuffered,
* so that the trace-output gets flushed automatically at the
* end of each line. This is useful in case the program dies.
fclose(MyFP);
MyFP = 0;
}
- _nc_tracing = tracelevel;
+ Locked(_nc_tracing = tracelevel);
} else if (_nc_tracing != tracelevel) {
- _nc_tracing = tracelevel;
+ Locked(_nc_tracing = tracelevel);
_tracef("tracelevel=%#x", tracelevel);
}
#else
/****************************************************************************
- * Copyright 2018-2020,2021 Thomas E. Dickey *
+ * Copyright 2018-2021,2022 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include <ctype.h>
-MODULE_ID("$Id: tty_update.c,v 1.312 2021/09/04 10:29:59 tom Exp $")
+MODULE_ID("$Id: tty_update.c,v 1.314 2022/07/23 22:12:59 tom Exp $")
/*
* This define controls the line-breakout optimization. Every once in a
* We do not allow applications to assign new values in the reentrant
* model.
*/
+#if NCURSES_SP_FUNCS
+ if (SP_PARM == CURRENT_SCREEN) {
+#endif
#define SyncScreens(internal,exported) \
if (internal == 0) internal = exported; \
if (internal != exported) exported = internal
- SyncScreens(CurScreen(SP_PARM), curscr);
- SyncScreens(NewScreen(SP_PARM), newscr);
- SyncScreens(StdScreen(SP_PARM), stdscr);
+ SyncScreens(CurScreen(SP_PARM), curscr);
+ SyncScreens(NewScreen(SP_PARM), newscr);
+ SyncScreens(StdScreen(SP_PARM), stdscr);
+#if NCURSES_SP_FUNCS
+ }
#endif
+#endif /* !USE_REENTRANT */
if (CurScreen(SP_PARM) == 0
|| NewScreen(SP_PARM) == 0
-ncurses6 (6.3+20220716) unstable; urgency=low
+ncurses6 (6.3+20220724) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 16 Jul 2022 06:45:29 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 24 Jul 2022 05:45:41 -0400
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (6.3+20220716) unstable; urgency=low
+ncurses6 (6.3+20220724) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 16 Jul 2022 06:45:29 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 24 Jul 2022 05:45:41 -0400
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (6.3+20220716) unstable; urgency=low
+ncurses6 (6.3+20220724) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 16 Jul 2022 06:45:29 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 24 Jul 2022 05:45:41 -0400
ncurses6 (5.9-20120608) unstable; urgency=low
-; $Id: mingw-ncurses.nsi,v 1.532 2022/07/16 10:45:29 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.534 2022/07/24 09:45:40 tom Exp $\r
\r
; TODO add examples\r
; TODO bump ABI to 6\r
!define VERSION_MAJOR "6"\r
!define VERSION_MINOR "3"\r
!define VERSION_YYYY "2022"\r
-!define VERSION_MMDD "0716"\r
+!define VERSION_MMDD "0724"\r
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
\r
!define MY_ABI "5"\r
Summary: shared libraries for terminal handling
Name: mingw32-ncurses6
Version: 6.3
-Release: 20220716
+Release: 20220724
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 6.3
-Release: 20220716
+Release: 20220724
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
Summary: Curses library with POSIX thread support.
Name: ncursest6
Version: 6.3
-Release: 20220716
+Release: 20220724
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2022 Thomas E. Dickey *
* Copyright 1998-2014,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* authorization. *
****************************************************************************/
/*
- * $Id: rain.c,v 1.52 2020/08/29 16:22:03 juergen Exp $
+ * $Id: rain.c,v 1.54 2022/07/23 22:47:38 tom Exp $
*/
#include <test.priv.h>
#include <popup_msg.h>
#ifdef USE_PTHREADS
pthread_cond_t cond_next_drop;
+pthread_mutex_t mutex_drop_data;
pthread_mutex_t mutex_next_drop;
static int used_threads;
static int
put_next_drop(void)
{
- pthread_cond_signal(&cond_next_drop);
+ pthread_cond_broadcast(&cond_next_drop);
pthread_mutex_unlock(&mutex_next_drop);
return 0;
* to the data which it uses for setting up this thread (but it has
* been modified to use different coordinates).
*/
+ pthread_mutex_lock(&mutex_drop_data);
mydata = *(DATA *) arg;
+ pthread_mutex_unlock(&mutex_drop_data);
draw_part(part1, 0, &mydata);
draw_part(part2, 1, &mydata);
draw_part(part4, 3, &mydata);
draw_part(part5, 4, &mydata);
draw_part(part6, 0, &mydata);
+
} while (get_next_drop());
return NULL;
curs_set(0);
timeout(0);
-#ifndef USE_PTHREADS
+#ifdef USE_PTHREADS
+ pthread_mutex_init(&mutex_drop_data, NULL);
+#else /* !USE_PTHREADS */
for (j = MAX_DROP; --j >= 0;) {
last[j].x = random_x();
last[j].y = random_y();
#endif
while (!done) {
+#ifdef USE_PTHREADS
+ pthread_mutex_lock(&mutex_drop_data);
+
drop.x = random_x();
drop.y = random_y();
-#ifdef USE_PTHREADS
if (start_drop(&drop) != 0) {
beep();
}
+
+ pthread_mutex_unlock(&mutex_drop_data);
#else
+ drop.x = random_x();
+ drop.y = random_y();
+
/*
* The non-threaded code draws parts of each drop on each loop.
*/
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************/
/*
- * $Id: test_mouse.c,v 1.20 2022/07/16 18:52:09 tom Exp $
+ * $Id: test_mouse.c,v 1.22 2022/07/24 15:18:53 tom Exp $
*
* Author: Leonid S Usov
*
cfmakeraw(&tty);
#else
tty = old;
- tty.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP
- | INLCR | IGNCR | ICRNL | IXON);
- tty.c_oflag &= ~OPOST;
- tty.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
- tty.c_cflag &= ~(CSIZE | PARENB);
+ tty.c_iflag &= (unsigned) (~(IGNBRK | BRKINT | PARMRK | ISTRIP
+ | INLCR | IGNCR | ICRNL | IXON));
+ tty.c_oflag &= (unsigned) (~OPOST);
+ tty.c_lflag &= (unsigned) (~(ECHO | ECHONL | ICANON | ISIG | IEXTEN));
+ tty.c_cflag &= (unsigned) (~(CSIZE | PARENB));
tty.c_cflag |= CS8;
tcsetattr(0, TCSANOW, &tty);
#endif
{
"Usage: test_mouse [options]",
"",
- "Test mouse events. These examples for $TERM demonstrate xterm"
+ "Test mouse events. These examples for $TERM demonstrate xterm",
"features:",
" xterm",
" xterm-1002",
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.83 2022/07/09 20:51:25 tom Exp $
+ $Id: worm.c,v 1.84 2022/07/23 17:06:16 tom Exp $
*/
#include <test.priv.h>
static chtype trail = ' ';
static unsigned pending;
+
+#ifdef USE_PTHREADS
+#define Locked(statement) { \
+ pthread_mutex_lock(&pending_mutex); \
+ statement; \
+ pthread_mutex_unlock(&pending_mutex); \
+ }
+pthread_mutex_t pending_mutex;
+#else
+#define Locked(statement) statement
+#endif
+
#ifdef TRACE
static int generation, trace_start, trace_end;
#endif /* TRACE */
WORM *w = (WORM *) data;
const struct options *op;
unsigned mask = (unsigned) (~(1 << (w - worm)));
- chtype attrs = w->attrs | ((mask & pending) ? A_REVERSE : 0);
+ chtype attrs;
int x;
int y;
int h;
bool done = FALSE;
+ bool is_pending;
+
+ Locked(is_pending = ((mask & pending) != 0));
+
+ attrs = w->attrs | (is_pending ? A_REVERSE : 0);
if ((x = w->xpos[h = w->head]) < 0) {
wmove(win, y = w->ypos[h] = last_y, x = w->xpos[h] = 0);
static bool
quit_worm(int bitnum)
{
- pending = (pending | (unsigned) (1 << bitnum));
+ Locked(pending = (pending | (unsigned) (1 << bitnum)));
+
napms(10); /* let the other thread(s) have a chance */
- pending = (pending & (unsigned) ~(1 << bitnum));
+
+ Locked(pending = (pending & (unsigned) ~(1 << bitnum)));
+
return quitting;
}
USING_WINDOW1(stdscr, wrefresh, safe_wrefresh);
nodelay(stdscr, TRUE);
+#ifdef USE_PTHREADS
+ pthread_mutex_init(&pending_mutex, NULL);
+#endif
+
while (!done) {
- ++sequence;
+ Locked(++sequence);
if ((ch = get_input()) > 0) {
#ifdef TRACE
if (trace_start || trace_end) {