-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3856 2022/09/10 22:31:34 tom Exp $
+-- $Id: NEWS,v 1.3858 2022/09/17 20:49:10 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.
+20220917
+ + reduce memory-leak in tic by separating allocations for struct entry
+ from TERMTYPE2 (cf: 20220430).
+ + improve interaction between tic -v option and NCURSES_TRACE, by
+ processing the latter only when -v option does not set _nc_tracing.
+ + modify curses_trace() to show the trace-mask as symbols, e.g.,
+ TRACE_ORDINARY, DEBUG_LEVEL(3).
+
20220910
+ amend verbose-option change to make this affect level 3, e.g., using
"tic -cv3 terminfo".
-5:0:10 6.3 20220910
+5:0:10 6.3 20220917
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.1501 2022/09/10 09:26:46 tom Exp $
+# $Id: dist.mk,v 1.1502 2022/09/17 10:53:30 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 = 20220910
+NCURSES_PATCH = 20220917
# 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 20220813).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
</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 20220813).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
</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 20220813).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
<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 20220813).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
https://invisible-island.net/ncurses/tctest.html
- This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220813).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
</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 20220813).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
</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 20220813).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
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 20220813).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
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 20220813).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
</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 20220813).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
</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 20220813).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
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 20220813).
+ This manual describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
</PRE><H3><a name="h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></H3><PRE>
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: tic.1m,v 1.82 2022/02/12 20:02:20 tom Exp @
+ * @Id: tic.1m,v 1.84 2022/09/17 19:01:24 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
<STRONG>-v</STRONG><EM>n</EM> specifies that (verbose) output be written to standard error trace
information showing <STRONG>tic</STRONG>'s progress.
- The optional parameter <EM>n</EM> is a number from 1 to 10, inclusive,
- indicating the desired level of detail of information. If ncurses
- is built without tracing support, the optional parameter is
- ignored. If <EM>n</EM> is omitted, the default level is 1. If <EM>n</EM> is
- specified and greater than 1, the level of detail is increased.
+ The optional parameter <EM>n</EM> is a number from 1 to 9, inclusive,
+ indicating the desired level of detail of information.
+
+ <STRONG>o</STRONG> If ncurses is built without tracing support, the optional
+ parameter is ignored.
+
+ <STRONG>o</STRONG> If <EM>n</EM> is omitted, the default level is 1.
+
+ <STRONG>o</STRONG> If <EM>n</EM> is specified and greater than 1, the level of detail is
+ increased, and the output is written (with tracing
+ information) to the "trace" file.
The debug flag levels are as follows:
- 1 Names of files created and linked
+ 1 Names of files created and linked
+
+ 2 Information related to the "use" facility
- 2 Information related to the "use" facility
+ 3 Statistics from the hashing algorithm
- 3 Statistics from the hashing algorithm
+ 4 Details of extended capabilities
- 5 String-table memory allocations
+ 5 (unused)
- 7 Entries into the string-table
+ 6 (unused)
- 8 List of tokens encountered by scanner
+ 7 Entries into the string-table
- 9 All values computed in construction of the hash table
+ 8 List of tokens encountered by scanner
- If the debug level <EM>n</EM> is not given, it is taken to be one.
+ 9 All values computed in construction of the hash table
<STRONG>-W</STRONG> By itself, the <STRONG>-w</STRONG> option will not force long strings to be
wrapped. Use the <STRONG>-W</STRONG> option to do this.
<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 20220813).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
</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 20220813).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
</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 20220813).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
<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 20220813).
+ This describes <STRONG>ncurses</STRONG> version 6.3 (patch 20220917).
****************************************************************************/
/*
- * $Id: tic.h,v 1.85 2022/09/03 19:11:20 tom Exp $
+ * $Id: tic.h,v 1.86 2022/09/17 16:01:45 tom Exp $
* tic.h - Global variables and structures for the terminfo compiler.
*/
#define DEBUG_LEVEL(n) ((n) << TRACE_SHIFT)
#define set_trace_level(n) \
- _nc_tracing &= DEBUG_LEVEL(MAX_DEBUG_LEVEL + 1) - 1, \
+ _nc_tracing &= TRACE_MAXIMUM, \
_nc_tracing |= DEBUG_LEVEL(n)
#ifdef TRACE
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: tic.1m,v 1.82 2022/02/12 20:02:20 tom Exp $
+.\" $Id: tic.1m,v 1.84 2022/09/17 19:01:24 tom Exp $
.TH @TIC@ 1M ""
.ie \n(.g .ds `` \(lq
.el .ds `` ``
specifies that (verbose) output be written to standard error trace
information showing \fB@TIC@\fP's progress.
.IP
-The optional parameter \fIn\fP is a number from 1 to 10, inclusive,
+The optional parameter \fIn\fP is a number from 1 to 9, inclusive,
indicating the desired level of detail of information.
+.RS
+.bP
If ncurses is built without tracing support, the optional parameter is ignored.
+.bP
If \fIn\fP is omitted, the default level is 1.
+.bP
If \fIn\fP is specified and greater than 1, the level of
-detail is increased.
+detail is increased, and the output is written (with tracing information)
+to the \*(``trace\*('' file.
+.RE
.RS
.PP
The debug flag levels are as follows:
-.TP
+.TP 4
1
Names of files created and linked
.TP
3
Statistics from the hashing algorithm
.TP
+4
+Details of extended capabilities
+.TP
5
-String-table memory allocations
+(unused)
+.TP
+6
+(unused)
.TP
7
Entries into the string-table
.TP
9
All values computed in construction of the hash table
-.LP
-If the debug level \fIn\fP is not given, it is taken to be one.
.RE
.TP
\fB\-W\fP
#include <tic.h>
-MODULE_ID("$Id: alloc_entry.c,v 1.74 2022/08/20 18:03:14 tom Exp $")
+MODULE_ID("$Id: alloc_entry.c,v 1.76 2022/09/17 21:45:44 tom Exp $")
#define ABSENT_OFFSET -1
#define CANCELLED_OFFSET -2
#endif
for (i = 0; i < nuses; i++) {
- if (useoffsets[i] == ABSENT_OFFSET)
+ if (useoffsets[i] == ABSENT_OFFSET) {
ep->uses[i].name = 0;
- else
- ep->uses[i].name = (tp->str_table + useoffsets[i]);
+ } else {
+ ep->uses[i].name = strdup(tp->str_table + useoffsets[i]);
+ }
}
DEBUG(2, (T_RETURN("")));
}
TERMTYPE2 *from = &(source->tterm);
#if NCURSES_XNAMES
TERMTYPE2 copy;
+ size_t str_size = 0;
+ char *str_table = NULL;
#endif
unsigned i;
_nc_copy_termtype2(©, from);
from = ©
_nc_align_termtype(to, from);
+ str_size += strlen(to->term_names) + 1;
+ for_each_string(i, from) {
+ if (VALID_STRING(from->Strings[i]))
+ str_size += strlen(from->Strings[i]) + 1;
+ }
+ for_each_string(i, to) {
+ if (VALID_STRING(to->Strings[i]))
+ str_size += strlen(to->Strings[i]) + 1;
+ }
+ /* allocate a string-table large enough for both source/target, and
+ * copy all of the strings into that table. In the merge, we will
+ * select from the original source/target lists to construct a new
+ * target list.
+ */
+ if (str_size != 0) {
+ char *str_copied;
+ if ((str_table = malloc(str_size)) == NULL)
+ _nc_err_abort(MSG_NO_MEMORY);
+ str_copied = str_table;
+ strcpy(str_copied, to->term_names);
+ to->term_names = str_copied;
+ str_copied += strlen(str_copied) + 1;
+ for_each_string(i, from) {
+ if (VALID_STRING(from->Strings[i])) {
+ strcpy(str_copied, from->Strings[i]);
+ from->Strings[i] = str_copied;
+ str_copied += strlen(str_copied) + 1;
+ }
+ }
+ for_each_string(i, to) {
+ if (VALID_STRING(to->Strings[i])) {
+ strcpy(str_copied, to->Strings[i]);
+ to->Strings[i] = str_copied;
+ str_copied += strlen(str_copied) + 1;
+ }
+ }
+ free(to->str_table);
+ to->str_table = str_table;
+ free(from->str_table);
+ }
#endif
for_each_boolean(i, from) {
if (to->Booleans[i] != (NCURSES_SBOOL) CANCELLED_BOOLEAN) {
#include <tic.h>
-MODULE_ID("$Id: alloc_ttype.c,v 1.44 2022/06/18 20:40:54 tom Exp $")
+MODULE_ID("$Id: alloc_ttype.c,v 1.46 2022/09/17 21:44:35 tom Exp $")
#if NCURSES_XNAMES
/*
}
str_size += strlen(src->term_names) + 1;
}
- for (i = 0; i < STRCOUNT; ++i) {
+ for_each_string(i, src) {
if (VALID_STRING(src->Strings[i])) {
if (pass) {
strcpy(new_table + str_size, src->Strings[i]);
dst->str_table = new_table;
} else {
++str_size;
- new_table = malloc(str_size);
+ if ((new_table = malloc(str_size)) == NULL)
+ _nc_err_abort(MSG_NO_MEMORY);
}
}
dst->ext_str_table = new_table;
} else {
++str_size;
- new_table = calloc(str_size, 1);
+ if ((new_table = calloc(str_size, 1)) == NULL)
+ _nc_err_abort(MSG_NO_MEMORY);
}
}
} else {
#include <tic.h>
-MODULE_ID("$Id: comp_parse.c,v 1.123 2022/09/03 20:02:45 tom Exp $")
+MODULE_ID("$Id: comp_parse.c,v 1.124 2022/09/10 19:54:59 tom Exp $")
static void sanity_check2(TERMTYPE2 *, bool);
NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2;
FreeIfNeeded(thisentry.tterm.Booleans);
FreeIfNeeded(thisentry.tterm.Numbers);
FreeIfNeeded(thisentry.tterm.Strings);
+ FreeIfNeeded(thisentry.tterm.str_table);
#if NCURSES_XNAMES
FreeIfNeeded(thisentry.tterm.ext_Names);
FreeIfNeeded(thisentry.tterm.ext_str_table);
int matchcount = 0;
for_entry_list(rp) {
- if (qp > rp
+ if (qp > rp // FIXME - pointer-comparison is wrong...
&& check_collisions(qp->tterm.term_names,
rp->tterm.term_names,
matchcount + 1)) {
#include <ctype.h>
-MODULE_ID("$Id: lib_trace.c,v 1.100 2022/07/23 20:08:45 tom Exp $")
+MODULE_ID("$Id: lib_trace.c,v 1.101 2022/09/17 14:57:02 tom Exp $")
NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */
curses_trace(unsigned tracelevel)
{
unsigned result;
+
#if defined(TRACE)
+ int bit;
+
+#define DATA(name) { name, #name }
+ static struct {
+ unsigned mask;
+ const char *name;
+ } trace_names[] = {
+ DATA(TRACE_TIMES),
+ DATA(TRACE_TPUTS),
+ DATA(TRACE_UPDATE),
+ DATA(TRACE_MOVE),
+ DATA(TRACE_CHARPUT),
+ DATA(TRACE_CALLS),
+ DATA(TRACE_VIRTPUT),
+ DATA(TRACE_IEVENT),
+ DATA(TRACE_BITS),
+ DATA(TRACE_ICALLS),
+ DATA(TRACE_CCALLS),
+ DATA(TRACE_DATABASE),
+ DATA(TRACE_ATTRS)
+ };
+#undef DATA
+
Locked(result = _nc_tracing);
+
if ((MyFP == 0) && tracelevel) {
MyInit = TRUE;
if (MyFD >= 0) {
NCURSES_VERSION,
NCURSES_VERSION_PATCH,
tracelevel);
+
+#define SPECIAL_MASK(mask) \
+ if ((tracelevel & mask) == mask) \
+ _tracef("- %s (%u)", #mask, mask)
+
+ for (bit = 0; bit < TRACE_SHIFT; ++bit) {
+ unsigned mask = (1U << bit) & tracelevel;
+ if ((mask & trace_names[bit].mask) != 0) {
+ _tracef("- %s (%u)", trace_names[bit].name, mask);
+ }
+ }
+ SPECIAL_MASK(TRACE_MAXIMUM);
+ else
+ SPECIAL_MASK(TRACE_ORDINARY);
+
+ if (tracelevel > TRACE_MAXIMUM) {
+ _tracef("- DEBUG_LEVEL(%u)", tracelevel >> TRACE_SHIFT);
+ }
} else if (tracelevel == 0) {
if (MyFP != 0) {
MyFD = dup(MyFD); /* allow reopen of same file */
-ncurses6 (6.3+20220910) unstable; urgency=low
+ncurses6 (6.3+20220917) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 10 Sep 2022 05:26:46 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 17 Sep 2022 06:53:31 -0400
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (6.3+20220910) unstable; urgency=low
+ncurses6 (6.3+20220917) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 10 Sep 2022 05:26:46 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 17 Sep 2022 06:53:31 -0400
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (6.3+20220910) unstable; urgency=low
+ncurses6 (6.3+20220917) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 10 Sep 2022 05:26:46 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 17 Sep 2022 06:53:31 -0400
ncurses6 (5.9-20120608) unstable; urgency=low
-; $Id: mingw-ncurses.nsi,v 1.541 2022/09/10 09:26:46 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.542 2022/09/17 10:53:30 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 "0910"\r
+!define VERSION_MMDD "0917"\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: 20220910
+Release: 20220917
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 6.3
-Release: 20220910
+Release: 20220917
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
Summary: Curses library with POSIX thread support.
Name: ncursest6
Version: 6.3
-Release: 20220910
+Release: 20220917
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
* Author: Thomas E. Dickey 1997-on *
****************************************************************************/
/*
- * $Id: progs.priv.h,v 1.55 2022/09/10 21:47:39 tom Exp $
+ * $Id: progs.priv.h,v 1.58 2022/09/17 18:58:05 tom Exp $
*
* progs.priv.h
*
#endif
#endif
-#define VtoTrace(opt) (unsigned) ((opt > 0) ? opt : (opt == 0))
-
/* error-returns for tput */
#define ErrUsage 2
#define ErrTermType 3
#define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
+#define VtoTrace(opt) (unsigned) ((opt > 0) ? opt : (opt == 0))
+
+/*
+ * If configured for tracing, the debug- and trace-output are merged together
+ * in the trace file for "upper" levels of the verbose option.
+ */
#ifdef TRACE
-#define use_verbosity(level) do { set_trace_level(level); if (_nc_tracing > DEBUG_LEVEL(2)) _nc_tracing |= TRACE_MAXIMUM; } while (0)
+#define use_verbosity(level) do { \
+ set_trace_level(level); \
+ if (_nc_tracing > DEBUG_LEVEL(2)) \
+ _nc_tracing |= TRACE_MAXIMUM; \
+ else if (_nc_tracing == DEBUG_LEVEL(2)) \
+ _nc_tracing |= TRACE_ORDINARY; \
+ if (level >= 2) \
+ curses_trace(_nc_tracing); \
+ } while (0)
#else
#define use_verbosity(level) do { set_trace_level(level); } while (0)
#endif
#include <parametrized.h>
#include <transform.h>
-MODULE_ID("$Id: tic.c,v 1.318 2022/09/03 23:29:16 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.320 2022/09/17 18:55:28 tom Exp $")
#define STDIN_NAME "<stdin>"
sortmode = S_TERMCAP;
}
#if NCURSES_XNAMES
- use_extended_names(FALSE);
+ /* set this directly to avoid interaction with -v and -D options */
+ _nc_user_definable = FALSE;
#endif
_nc_strict_bsd = 0;
_nc_disable_period = TRUE;
/* FALLTHRU */
case 'x':
- use_extended_names(TRUE);
using_extensions = TRUE;
break;
#endif
last_opt = this_opt;
}
+ /*
+ * If the -v option is set, it may override the $NCURSES_TRACE environment
+ * variable, e.g., for -v3 and up.
+ */
debug_level = VtoTrace(v_opt);
use_verbosity(debug_level);
+ /*
+ * Do this after setting debug_level, since the function calls START_TRACE,
+ * which uses the $NCURSES_TRACE environment variable if _nc_tracing bits
+ * for tracing are zero.
+ */
+#if NCURSES_XNAMES
+ if (using_extensions) {
+ use_extended_names(TRUE);
+ }
+#endif
+
if (_nc_tracing) {
save_check_termtype = _nc_check_termtype2;
_nc_check_termtype2 = check_termtype;