./test/cardfile.dat
./test/chgat.c
./test/clip_printw.c
+./test/color_content.c
./test/color_name.h
./test/color_set.c
./test/configure
./test/package/mingw-ncurses-examples.spec
./test/package/ncurses-examples.spec
./test/padview.c
+./test/pair_content.c
./test/parse_rgb.h
./test/picsmap.c
./test/picsmap.h
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3231 2018/12/16 00:18:46 tom Exp $
+-- $Id: NEWS,v 1.3236 2018/12/29 23:45:51 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.
+20181229
+ + improve man/curs_mouse.3x with regard to xterm
+ + modify tracemunch to accept filename parameters in addition to use
+ as a pipe/filter.
+ + minor optimization to reduce calls to _nc_reserve_pairs (prompted by
+ discussion with Bryan Christ).
+ + add test/pair_content.c and test/color_content.c
+ + modify infocmp to omit filtering of "OTxx" names which are used for
+ obsolete capabilities, when the output is sorted by long-names.
+ Doing this helps when making a table of the short/long capability
+ names.
+
20181215
+ several fixes for gcc8 strict compiler warnings.
+ fix a typo in comments (Aaron Gyes).
-5:0:10 6.1 20181215
+5:0:10 6.1 20181229
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.1256 2018/12/15 19:14:57 tom Exp $
+# $Id: dist.mk,v 1.1258 2018/12/29 15:15:21 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 = 1
-NCURSES_PATCH = 20181215
+NCURSES_PATCH = 20181229
# 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.1 (patch 20181208).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181229).
</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.1 (patch 20181208).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181229).
</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>
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181229).
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: curs_mouse.3x,v 1.49 2018/07/28 22:19:56 tom Exp @
+ * @Id: curs_mouse.3x,v 1.50 2018/12/29 23:40:47 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
\E[?1000%?%p1%{1}%=%th%el%;
+ The mouse driver also recognizes a newer xterm private mode 1006, e.g.,
+
+ \E[?1006;1000%?%p1%{1}%=%th%el%;
+
The <EM>z</EM> member in the event structure is not presently used. It is in-
tended for use with touch screens (which may be pressure-sensitive) or
with 3D-mice/trackballs/power gloves.
identify terminals which support the xterm mouse protocol, <STRONG>ncurses</STRONG> as-
sumes that if your $TERM environment variable contains "xterm", or
<STRONG>kmous</STRONG> is defined in the terminal description, then the terminal may
- send mouse events.
+ send mouse events. The <STRONG>kmous</STRONG> capability is checked first, allowing the
+ use of newer xterm mouse protocols.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<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.1 (patch 20181208).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181229).
https://invisible-island.net/ncurses/tctest.html
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181229).
</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="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181229).
</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.1 (patch 20181208).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181229).
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.1 (patch 20181208).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181229).
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.1 (patch 20181208).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181229).
</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.1 (patch 20181208).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181229).
</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="tset.1.html">tset(1)</A></STRONG>, <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.1 (patch 20181208).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181229).
<EM>Terminfo</EM> describes terminals by giving a set of capabilities which they
have, by specifying how to perform screen operations, and by specifying
padding requirements and initialization sequences. This describes
- <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
+ <STRONG>ncurses</STRONG> version 6.1 (patch 20181229).
</PRE><H3><a name="h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></H3><PRE>
<STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="captoinfo.1m.html">captoinfo(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>.
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181229).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
<STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG>ter-</STRONG>
<STRONG><A HREF="terminfo.5.html">minfo(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181229).
</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="terminfo.5.html">terminfo(5)</A></STRONG>, <STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181208).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181229).
<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.1 (patch 20181208).
+ This describes <STRONG>ncurses</STRONG> version 6.1 (patch 20181229).
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: curs_mouse.3x,v 1.49 2018/07/28 22:19:56 tom Exp $
+.\" $Id: curs_mouse.3x,v 1.50 2018/12/29 23:40:47 tom Exp $
.ie \n(.g .ds `` \(lq
.el .ds `` ``
.ie \n(.g .ds '' \(rq
\\E[?1000%?%p1%{1}%=%th%el%;
.RE
.PP
+The mouse driver also recognizes a newer xterm private mode 1006, e.g.,
+.PP
+.RS 3
+\\E[?1006;1000%?%p1%{1}%=%th%el%;
+.RE
+.PP
The \fIz\fP member in the event structure is not presently used.
It is intended
for use with touch screens (which may be pressure-sensitive) or with
.PP
Because there are no standard terminal responses that would serve to identify
terminals which support the xterm mouse protocol, \fBncurses\fR assumes that
-if your $TERM environment variable contains "xterm",
+if your $TERM environment variable contains \*(``xterm\*('',
or \fBkmous\fR is defined in
the terminal description, then the terminal may send mouse events.
+The \fBkmous\fP capability is checked first, allowing the
+use of newer xterm mouse protocols.
.SH SEE ALSO
\fBcurses\fR(3X),
\fBcurs_kernel\fR(3X),
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_color.c,v 1.138 2018/05/16 08:24:08 tom Exp $")
+MODULE_ID("$Id: lib_color.c,v 1.139 2018/12/29 20:10:07 tom Exp $")
#ifdef USE_TERM_DRIVER
#define CanChange InfoOf(SP_PARM).canchange
COLORS = maxcolors;
#endif
- _nc_reserve_pairs(SP_PARM, 16);
+ ReservePairs(SP_PARM, 16);
if (SP_PARM->_color_pairs != 0) {
if (init_direct_colors(NCURSES_SP_ARG)) {
result = OK;
}
}
-NCURSES_EXPORT(colorpair_t *)
+NCURSES_EXPORT(void)
_nc_reserve_pairs(SCREEN *sp, int want)
{
- colorpair_t *result = 0;
int have = sp->_pair_alloc;
- if ((sp->_color_pairs != 0) && (want < sp->_pair_alloc)) {
- result = &(sp->_color_pairs[want]);
- } else {
-
- if (have == 0)
- have = 1;
- while (have <= want)
- have *= 2;
- if (have > sp->_pair_limit)
- have = sp->_pair_limit;
+ if (have == 0)
+ have = 1;
+ while (have <= want)
+ have *= 2;
+ if (have > sp->_pair_limit)
+ have = sp->_pair_limit;
- if (sp->_color_pairs == 0) {
- sp->_color_pairs = TYPE_CALLOC(colorpair_t, have);
- } else if (have > sp->_pair_alloc) {
+ if (sp->_color_pairs == 0) {
+ sp->_color_pairs = TYPE_CALLOC(colorpair_t, have);
+ } else if (have > sp->_pair_alloc) {
#if NCURSES_EXT_COLORS
- colorpair_t *next;
-
- if ((next = typeCalloc(colorpair_t, have)) == 0)
- _nc_err_abort(MSG_NO_MEMORY);
- memcpy(next, sp->_color_pairs, (size_t) sp->_pair_alloc * sizeof(*next));
- _nc_copy_pairs(sp, next, sp->_color_pairs, sp->_pair_alloc);
- free(sp->_color_pairs);
- sp->_color_pairs = next;
+ colorpair_t *next;
+
+ if ((next = typeCalloc(colorpair_t, have)) == 0)
+ _nc_err_abort(MSG_NO_MEMORY);
+ memcpy(next, sp->_color_pairs, (size_t) sp->_pair_alloc * sizeof(*next));
+ _nc_copy_pairs(sp, next, sp->_color_pairs, sp->_pair_alloc);
+ free(sp->_color_pairs);
+ sp->_color_pairs = next;
#else
- TYPE_REALLOC(colorpair_t, have, sp->_color_pairs);
- if (sp->_color_pairs != 0) {
- memset(sp->_color_pairs + sp->_pair_alloc, 0,
- sizeof(colorpair_t) * (size_t) (have - sp->_pair_alloc));
- }
-#endif
- }
+ TYPE_REALLOC(colorpair_t, have, sp->_color_pairs);
if (sp->_color_pairs != 0) {
- sp->_pair_alloc = have;
- result = &(sp->_color_pairs[want]);
+ memset(sp->_color_pairs + sp->_pair_alloc, 0,
+ sizeof(colorpair_t) * (size_t) (have - sp->_pair_alloc));
}
+#endif
+ }
+ if (sp->_color_pairs != 0) {
+ sp->_pair_alloc = have;
}
- return result;
}
/*
maxcolors = MaxColors;
- _nc_reserve_pairs(sp, pair);
+ ReservePairs(sp, pair);
previous = sp->_color_pairs[pair];
#if NCURSES_EXT_FUNCS
if (sp->_default_color || sp->_assumed_color) {
int fg;
int bg;
- _nc_reserve_pairs(sp, pair);
+ ReservePairs(sp, pair);
fg = FORE_OF(sp->_color_pairs[pair]);
bg = BACK_OF(sp->_color_pairs[pair]);
#if NCURSES_EXT_FUNCS
free(SP_PARM->_color_pairs);
SP_PARM->_color_pairs = 0;
SP_PARM->_pair_alloc = 0;
- _nc_reserve_pairs(SP_PARM, 16);
+ ReservePairs(SP_PARM, 16);
clearok(CurScreen(SP_PARM), TRUE);
touchwin(StdScreen(SP_PARM));
}
#endif
-MODULE_ID("$Id: new_pair.c,v 1.15 2018/03/01 15:02:12 tom Exp $")
+MODULE_ID("$Id: new_pair.c,v 1.17 2018/12/29 21:27:21 tom Exp $")
#if NCURSES_EXT_COLORS
{
colorpair_t *last;
if (ValidPair(sp, pair)) {
- last = _nc_reserve_pairs(sp, pair);
+ ReservePairs(sp, pair);
+ last = &(sp->_color_pairs[pair]);
delink_color_pair(sp, pair);
if (last->mode > cpFREE &&
(last->fg != next->fg || last->bg != next->bg)) {
}
if (!found && (SP_PARM->_pair_alloc < SP_PARM->_pair_limit)) {
pair = SP_PARM->_pair_alloc;
- if (_nc_reserve_pairs(sp, pair) == 0) {
+ ReservePairs(SP_PARM, pair);
+ if (SP_PARM->_color_pairs == 0) {
pair = -1;
} else {
found = TRUE;
****************************************************************************/
/*
- * $Id: curses.priv.h,v 1.612 2018/12/16 01:16:58 tom Exp $
+ * $Id: curses.priv.h,v 1.613 2018/12/29 20:07:04 tom Exp $
*
* curses.priv.h
*
#define PUTC_INIT init_mb (PUT_st)
#define PUTC(ch) do { if(!isWidecExt(ch)) { \
if (Charable(ch)) { \
- TR_PUTC(CharOf(ch)); \
- NCURSES_OUTC_FUNC (NCURSES_SP_ARGx CharOf(ch)); \
+ TR_PUTC(CharOf(ch)); \
+ NCURSES_OUTC_FUNC (NCURSES_SP_ARGx CharOf(ch)); \
COUNT_OUTCHARS(1); \
} else { \
for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) { \
PUTC_ch = (ch).chars[PUTC_i]; \
if (PUTC_ch == L'\0') \
break; \
- PUTC_INIT; \
+ PUTC_INIT; \
PUTC_n = (int) wcrtomb(PUTC_buf, \
(ch).chars[PUTC_i], &PUT_st); \
if (PUTC_n <= 0) { \
- if (PUTC_ch && is8bits(PUTC_ch) && PUTC_i == 0) \
- TR_PUTC(CharOf(ch)); \
+ if (PUTC_ch && is8bits(PUTC_ch) && PUTC_i == 0) { \
+ TR_PUTC(CharOf(ch)); \
NCURSES_OUTC_FUNC (NCURSES_SP_ARGx CharOf(ch)); \
+ } \
break; \
} else { \
int PUTC_j; \
for (PUTC_j = 0; PUTC_j < PUTC_n; ++PUTC_j) { \
- TR_PUTC(PUTC_buf[PUTC_j]); \
+ TR_PUTC(PUTC_buf[PUTC_j]); \
NCURSES_OUTC_FUNC (NCURSES_SP_ARGx PUTC_buf[PUTC_j]); \
} \
} \
extern NCURSES_EXPORT(int) _nc_init_pair(SCREEN *, int, int, int);
extern NCURSES_EXPORT(int) _nc_pair_content(SCREEN *, int, int *, int *);
extern NCURSES_EXPORT(bool) _nc_reset_colors(void);
-extern NCURSES_EXPORT(colorpair_t *) _nc_reserve_pairs(SCREEN *, int);
+extern NCURSES_EXPORT(void) _nc_reserve_pairs(SCREEN *, int);
extern NCURSES_EXPORT(void) _nc_change_pair(SCREEN *, int);
+#define ReservePairs(sp,want) \
+ if ((sp->_color_pairs == 0) || (want >= sp->_pair_alloc)) \
+ _nc_reserve_pairs(sp, want)
+
/* lib_getch.c */
extern NCURSES_EXPORT(int) _nc_wgetch(WINDOW *, int *, int EVENTLIST_2nd(_nc_eventlist *));
-ncurses6 (6.1+20181215) unstable; urgency=low
+ncurses6 (6.1+20181229) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 15 Dec 2018 14:14:57 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 29 Dec 2018 10:15:21 -0500
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (6.1+20181215) unstable; urgency=low
+ncurses6 (6.1+20181229) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 15 Dec 2018 14:14:57 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 29 Dec 2018 10:15:21 -0500
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (6.1+20181215) unstable; urgency=low
+ncurses6 (6.1+20181229) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 15 Dec 2018 14:14:57 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 29 Dec 2018 10:15:21 -0500
ncurses6 (5.9-20120608) unstable; urgency=low
-; $Id: mingw-ncurses.nsi,v 1.303 2018/12/15 19:14:57 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.305 2018/12/29 15:15:21 tom Exp $\r
\r
; TODO add examples\r
; TODO bump ABI to 6\r
!define VERSION_MAJOR "6"\r
!define VERSION_MINOR "1"\r
!define VERSION_YYYY "2018"\r
-!define VERSION_MMDD "1215"\r
+!define VERSION_MMDD "1229"\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.1
-Release: 20181215
+Release: 20181229
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 6.1
-Release: 20181215
+Release: 20181229
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
Summary: Curses library with POSIX thread support.
Name: ncursest6
Version: 6.1
-Release: 20181215
+Release: 20181229
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
#include "termsort.c" /* this C file is generated */
#include <parametrized.h> /* so is this */
-MODULE_ID("$Id: dump_entry.c,v 1.168 2017/09/02 21:01:54 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.169 2018/12/23 00:37:35 tom Exp $")
#define DISCARD(string) string = ABSENT_STRING
#define PRINTF (void) printf
#define OBSOLETE(n) (n[0] == 'O' && n[1] == 'T')
#endif
-#define isObsolete(f,n) ((f == F_TERMINFO || f == F_VARIABLE) && OBSOLETE(n))
+#define isObsolete(f,n) ((f == F_TERMINFO || f == F_VARIABLE) && (sortmode != S_VARIABLE) && OBSOLETE(n))
#if NCURSES_XNAMES
#define BoolIndirect(j) ((j >= BOOLCOUNT) ? (j) : ((sortmode == S_NOSORT) ? j : bool_indirect[j]))
--- /dev/null
+/****************************************************************************
+ * Copyright (c) 2018 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), 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: color_content.c,v 1.2 2018/12/30 00:52:58 tom Exp $
+ */
+
+#define NEED_TIME_H
+#include <test.priv.h>
+
+typedef struct {
+ NCURSES_COLOR_T r;
+ NCURSES_COLOR_T g;
+ NCURSES_COLOR_T b;
+} MYCOLOR;
+
+static int i_opt;
+static int l_opt;
+static int n_opt;
+static int r_opt;
+static int s_opt;
+
+static MYCOLOR *expected;
+
+#if HAVE_GETTIMEOFDAY
+static struct timeval initial_time;
+static struct timeval finish_time;
+#endif
+
+static void
+failed(const char *msg)
+{
+ printw("%s", msg);
+ getch();
+ endwin();
+ ExitProgram(EXIT_FAILURE);
+}
+
+static NCURSES_COLOR_T
+random_color(void)
+{
+ return (NCURSES_COLOR_T) (rand() % 1000);
+}
+
+static void
+setup_test(void)
+{
+ initscr();
+ cbreak();
+ noecho();
+ scrollok(stdscr, TRUE);
+ if (has_colors()) {
+ start_color();
+ if (!can_change_color())
+ failed("this terminal cannot initialize colors");
+
+ if (!l_opt)
+ l_opt = COLORS;
+ if (l_opt <= 0)
+ failed("color limit must be greater than zero");
+
+ if (!n_opt) {
+ NCURSES_PAIRS_T color;
+
+ expected = typeCalloc(MYCOLOR, l_opt);
+ if (s_opt) {
+ NCURSES_COLOR_T r;
+ NCURSES_COLOR_T g;
+ NCURSES_COLOR_T b;
+ color = 0;
+ for (r = 0; r < 1000; ++r) {
+ for (g = 0; g < 1000; ++g) {
+ for (b = 0; b < 1000; ++b) {
+ if (color < l_opt) {
+ init_color(color, r, g, b);
+ expected[color].r = r;
+ expected[color].g = g;
+ expected[color].b = b;
+ ++color;
+ } else {
+ break;
+ }
+ }
+ }
+ }
+ } else {
+ for (color = 1; color < l_opt; ++color) {
+ expected[color].r = random_color();
+ expected[color].g = random_color();
+ expected[color].b = random_color();
+ init_color(color, expected[color].r, expected[color].g,
+ expected[color].b);
+ }
+ }
+ }
+ } else {
+ failed("This demo requires a color terminal");
+ }
+#if HAVE_GETTIMEOFDAY
+ gettimeofday(&initial_time, 0);
+#endif
+}
+
+static void
+run_test(void)
+{
+ NCURSES_PAIRS_T color;
+ bool success = TRUE;
+ for (color = 0; color < l_opt; ++color) {
+ NCURSES_COLOR_T r;
+ NCURSES_COLOR_T g;
+ NCURSES_COLOR_T b;
+ if (color_content(color, &r, &g, &b) == OK) {
+ if (expected != 0) {
+ if (r != expected[color].r)
+ success = FALSE;
+ if (g != expected[color].g)
+ success = FALSE;
+ if (b != expected[color].b)
+ success = FALSE;
+ }
+ }
+ }
+ if (i_opt) {
+ addch(success ? '.' : '?');
+ refresh();
+ }
+}
+
+static void
+finish_test(void)
+{
+ getch();
+ endwin();
+}
+
+#if HAVE_GETTIMEOFDAY
+static double
+seconds(struct timeval *mark)
+{
+ double result = (double) mark->tv_sec;
+ result += ((double) mark->tv_usec / 1e6);
+ return result;
+}
+#endif
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: pair_content [options]"
+ ,""
+ ,"Options:"
+ ," -i interactive, showing test-progress"
+ ," -l NUM test NUM color pairs, rather than terminal description"
+ ," -n do not initialize color pairs"
+ ," -r COUNT repeat for given count"
+ ," -s initialize pairs sequentially rather than random"
+ };
+ size_t n;
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+ ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ int i;
+ int repeat;
+
+ while ((i = getopt(argc, argv, "il:nr:s")) != -1) {
+ switch (i) {
+ case 'i':
+ i_opt = 1;
+ break;
+ case 'l':
+ if ((l_opt = atoi(optarg)) <= 0)
+ usage();
+ break;
+ case 'n':
+ n_opt = 1;
+ break;
+ case 'r':
+ if ((r_opt = atoi(optarg)) <= 0)
+ usage();
+ break;
+ case 's':
+ s_opt = 1;
+ break;
+ default:
+ usage();
+ }
+ }
+ if (optind < argc)
+ usage();
+ if (r_opt <= 0)
+ r_opt = 1;
+
+ setup_test();
+
+ for (repeat = 0; repeat < r_opt; ++repeat) {
+ run_test();
+ if (i_opt) {
+ addch('.');
+ refresh();
+ }
+ }
+
+ if (i_opt) {
+ addch('\n');
+ }
+ printw("DONE: ");
+#if HAVE_GETTIMEOFDAY
+ gettimeofday(&finish_time, 0);
+ printw("%.03f seconds",
+ seconds(&finish_time)
+ - seconds(&initial_time));
+#endif
+ finish_test();
+
+ ExitProgram(EXIT_SUCCESS);
+}
/****************************************************************************
- * Copyright (c) 2011-2012,2016 Free Software Foundation, Inc. *
+ * Copyright (c) 2011-2016,2018 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* authorization. *
****************************************************************************/
/*
- * $Id: color_name.h,v 1.5 2016/09/04 20:11:36 tom Exp $
+ * $Id: color_name.h,v 1.6 2018/12/29 15:19:30 tom Exp $
*/
#ifndef __COLORNAME_H
}
return result;
}
-#endif /* NEED_COLOR_NAME */
+#endif /* NEED_COLOR_CODE */
#ifdef NEED_COLOR_NAME
static const char *
/****************************************************************************
- * Copyright (c) 2005-2016,2017 Free Software Foundation, Inc. *
+ * Copyright (c) 2005-2017,2018 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* authorization. *
****************************************************************************/
/*
- * $Id: demo_altkeys.c,v 1.11 2017/06/17 18:33:03 tom Exp $
+ * $Id: demo_altkeys.c,v 1.12 2018/12/29 17:52:53 tom Exp $
*
* Demonstrate the define_key() function.
* Thomas Dickey - 2005/10/22
*/
+#define NEED_TIME_H
#include <test.priv.h>
#if defined(NCURSES_VERSION) && NCURSES_EXT_FUNCS
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
#define MY_LOGFILE "demo_altkeys.log"
#define MY_KEYS (KEY_MAX + 1)
/****************************************************************************
- * Copyright (c) 2017 Free Software Foundation, Inc. *
+ * Copyright (c) 2017,2018 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* authorization. *
****************************************************************************/
/*
- * $Id: extended_color.c,v 1.10 2017/04/15 21:40:50 tom Exp $
+ * $Id: extended_color.c,v 1.11 2018/12/29 21:50:33 tom Exp $
*/
#include <test.priv.h>
#define SHOW(n) ((n) == ERR ? "ERR" : "OK")
+#if USE_SP_FUNCS
static bool opt_s = FALSE;
+#define if_opt_s(a,b) (opt_s ? (a) : (b))
+#else
+#define if_opt_s(a,b) (b)
+#endif
static void
failed(const char *name)
{
int i, f, b;
- if (opt_s) {
- i = extended_pair_content_sp(sp, pair, &f, &b);
- } else {
- i = extended_pair_content(0, &f, &b);
- }
+ (void) sp;
+ i = if_opt_s(extended_pair_content_sp(sp, pair, &f, &b),
+ extended_pair_content(0, &f, &b));
if (i != OK)
failed("pair_content");
printw("pair %d contains (%d,%d)\n", pair, f, b);
do_init_pair(SCREEN *sp, int pair, int fg, int bg)
{
int i;
- if (opt_s) {
- i = init_extended_pair_sp(sp, pair, fg, bg);
- } else {
- i = init_extended_pair(pair, fg, bg);
- }
+
+ (void) sp;
+ i = if_opt_s(init_extended_pair_sp(sp, pair, fg, bg),
+ init_extended_pair(pair, fg, bg));
if (i != OK)
failed("init_pair");
}
{
int r, g, b;
int i;
- if (opt_s) {
- i = extended_color_content_sp(sp, color, &r, &g, &b);
- } else {
- i = extended_color_content(color, &r, &g, &b);
- }
+
+ (void) sp;
+ i = if_opt_s(extended_color_content_sp(sp, color, &r, &g, &b),
+ extended_color_content(color, &r, &g, &b));
if (i != OK)
failed("color_content");
g = (adjust + 1000 + g) % 1000;
b = (adjust + 1000 + b) % 1000;
- if (opt_s) {
- i = init_extended_color_sp(sp, color, r, g, b);
- } else {
- i = init_extended_color(color, r, g, b);
- }
+ i = if_opt_s(init_extended_color_sp(sp, color, r, g, b),
+ init_extended_color(color, r, g, b));
if (i != OK)
failed("init_color");
}
{
int r, g, b;
int i;
- if (opt_s) {
- i = extended_color_content_sp(sp, color, &r, &g, &b);
- } else {
- i = extended_color_content(color, &r, &g, &b);
- }
+
+ (void) sp;
+ i = if_opt_s(extended_color_content_sp(sp, color, &r, &g, &b),
+ extended_color_content(color, &r, &g, &b));
wmove(stdscr, y, x);
if (i == OK) {
printw("%-8s %3d/%3d/%3d", name, r, g, b);
while ((i = getopt(argc, argv, "s")) != -1) {
switch (i) {
+#if USE_SP_FUNCS
case 's':
opt_s = TRUE;
break;
+#endif
default:
usage();
/* NOTREACHED */
printw("Drawing soft-key tabs with pair 2\n");
slk_attrset(A_BOLD); /* reverse-video is hard to see */
- if (opt_s) {
- extended_slk_color_sp(sp, 2);
- } else {
- extended_slk_color(2);
- }
+ i = if_opt_s(extended_slk_color_sp(sp, 2),
+ extended_slk_color(2));
for (i = 1; i <= 8; ++i) {
char temp[80];
sprintf(temp, "(SLK-%d)", i);
slk_touch();
slk_noutrefresh();
- if (opt_s ? can_change_color_sp(sp) : can_change_color()) {
+ i = if_opt_s(can_change_color_sp(sp),
+ can_change_color());
+ if (i) {
do_color_set("Default Colors", 0);
printw("Press any key to stop...\n");
nodelay(stdscr, TRUE);
/****************************************************************************
- * Copyright (c) 2006-2016,2017 Free Software Foundation, Inc. *
+ * Copyright (c) 2006-2017,2018 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
/*
* Author: Thomas E. Dickey, 2006
*
- * $Id: foldkeys.c,v 1.6 2017/06/17 19:36:33 tom Exp $
+ * $Id: foldkeys.c,v 1.7 2018/12/29 17:53:03 tom Exp $
*
* Demonstrate a method for altering key definitions at runtime.
*
* merging only for the keys which are defined in the terminal description.
*/
+#define NEED_TIME_H
#include <test.priv.h>
#if defined(NCURSES_VERSION) && NCURSES_EXT_FUNCS
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
#define MY_LOGFILE "demo_foldkeys.log"
#define MY_KEYS (KEY_MAX + 1)
-# $Id: modules,v 1.68 2018/11/24 17:59:04 tom Exp $
+# $Id: modules,v 1.69 2018/12/29 15:32:12 tom Exp $
##############################################################################
# Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. #
# #
cardfile progs $(srcdir) $(HEADER_DEPS) ../include/panel.h ../include/form.h
chgat progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
clip_printw progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
+color_content progs $(srcdir) $(HEADER_DEPS)
color_set progs $(srcdir) $(HEADER_DEPS)
demo_altkeys progs $(srcdir) $(HEADER_DEPS)
demo_defkey progs $(srcdir) $(HEADER_DEPS)
ncurses progs $(srcdir) $(HEADER_DEPS) ../include/panel.h ../include/menu.h ../include/form.h
newdemo progs $(srcdir) $(HEADER_DEPS)
padview progs $(srcdir) $(HEADER_DEPS) $(srcdir)/widechars.h $(srcdir)/popup_msg.h
+pair_content progs $(srcdir) $(HEADER_DEPS)
picsmap progs $(srcdir) $(HEADER_DEPS)
popup_msg progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h
railroad progs $(srcdir) $(HEADER_DEPS)
--- /dev/null
+/****************************************************************************
+ * Copyright (c) 2018 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), 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: pair_content.c,v 1.2 2018/12/30 00:54:48 tom Exp $
+ */
+
+#define NEED_TIME_H
+#include <test.priv.h>
+
+typedef struct {
+ NCURSES_COLOR_T fg;
+ NCURSES_COLOR_T bg;
+} MYPAIR;
+
+static int i_opt;
+static int l_opt;
+static int n_opt;
+static int r_opt;
+static int s_opt;
+
+static MYPAIR *expected;
+
+#if HAVE_GETTIMEOFDAY
+static struct timeval initial_time;
+static struct timeval finish_time;
+#endif
+
+static void
+failed(const char *msg)
+{
+ printw("%s", msg);
+ getch();
+ endwin();
+ ExitProgram(EXIT_FAILURE);
+}
+
+static NCURSES_COLOR_T
+random_color(void)
+{
+ return (NCURSES_COLOR_T) (rand() % COLORS);
+}
+
+static void
+setup_test(void)
+{
+ initscr();
+ cbreak();
+ noecho();
+ scrollok(stdscr, TRUE);
+ if (has_colors()) {
+ start_color();
+
+ if (!l_opt)
+ l_opt = COLOR_PAIRS;
+ if (l_opt <= 1)
+ failed("color-pair limit must be greater than one");
+
+ if (!n_opt) {
+ NCURSES_PAIRS_T pair;
+
+ expected = typeCalloc(MYPAIR, l_opt);
+ if (s_opt) {
+ NCURSES_COLOR_T fg;
+ NCURSES_COLOR_T bg;
+ pair = 1;
+ for (fg = 0; fg < COLORS; ++fg) {
+ for (bg = 0; bg < COLORS; ++bg) {
+ if (pair < l_opt) {
+ init_pair(pair, fg, bg);
+ expected[pair].fg = fg;
+ expected[pair].bg = bg;
+ ++pair;
+ } else {
+ break;
+ }
+ }
+ }
+ } else {
+ for (pair = 1; (int) pair < l_opt; ++pair) {
+ expected[pair].fg = random_color();
+ expected[pair].bg = random_color();
+ init_pair(pair, expected[pair].fg, expected[pair].bg);
+ }
+ }
+ }
+ } else {
+ failed("This demo requires a color terminal");
+ }
+#if HAVE_GETTIMEOFDAY
+ gettimeofday(&initial_time, 0);
+#endif
+}
+
+static void
+run_test(void)
+{
+ NCURSES_PAIRS_T pair;
+ bool success = TRUE;
+ for (pair = 1; (int) pair < l_opt; ++pair) {
+ NCURSES_COLOR_T fg;
+ NCURSES_COLOR_T bg;
+ if (pair_content(pair, &fg, &bg) == OK) {
+ if (expected != 0) {
+ if (fg != expected[pair].fg)
+ success = FALSE;
+ if (bg != expected[pair].bg)
+ success = FALSE;
+ }
+ }
+ }
+ if (i_opt) {
+ addch(success ? '.' : '?');
+ refresh();
+ }
+}
+
+static void
+finish_test(void)
+{
+ getch();
+ endwin();
+}
+
+#if HAVE_GETTIMEOFDAY
+static double
+seconds(struct timeval *mark)
+{
+ double result = (double) mark->tv_sec;
+ result += ((double) mark->tv_usec / 1e6);
+ return result;
+}
+#endif
+
+static void
+usage(void)
+{
+ static const char *msg[] =
+ {
+ "Usage: pair_content [options]"
+ ,""
+ ,"Options:"
+ ," -i interactive, showing test-progress"
+ ," -l NUM test NUM color pairs, rather than terminal description"
+ ," -n do not initialize color pairs"
+ ," -r COUNT repeat for given count"
+ ," -s initialize pairs sequentially rather than random"
+ };
+ size_t n;
+ for (n = 0; n < SIZEOF(msg); n++)
+ fprintf(stderr, "%s\n", msg[n]);
+ ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ int i;
+ int repeat;
+
+ while ((i = getopt(argc, argv, "il:nr:s")) != -1) {
+ switch (i) {
+ case 'i':
+ i_opt = 1;
+ break;
+ case 'l':
+ if ((l_opt = atoi(optarg)) <= 0)
+ usage();
+ break;
+ case 'n':
+ n_opt = 1;
+ break;
+ case 'r':
+ if ((r_opt = atoi(optarg)) <= 0)
+ usage();
+ break;
+ case 's':
+ s_opt = 1;
+ break;
+ default:
+ usage();
+ }
+ }
+ if (optind < argc)
+ usage();
+ if (r_opt <= 0)
+ r_opt = 1;
+
+ setup_test();
+
+ for (repeat = 0; repeat < r_opt; ++repeat) {
+ run_test();
+ if (i_opt) {
+ addch('.');
+ refresh();
+ }
+ }
+
+ if (i_opt) {
+ addch('\n');
+ }
+ printw("DONE: ");
+#if HAVE_GETTIMEOFDAY
+ gettimeofday(&finish_time, 0);
+ printw("%.03f seconds",
+ seconds(&finish_time)
+ - seconds(&initial_time));
+#endif
+ finish_test();
+
+ ExitProgram(EXIT_SUCCESS);
+}
-# $Id: programs,v 1.42 2018/11/24 17:56:32 tom Exp $
+# $Id: programs,v 1.43 2018/12/29 15:32:00 tom Exp $
##############################################################################
-# Copyright (c) 2006-2016,2017 Free Software Foundation, Inc. #
+# Copyright (c) 2006-2017,2018 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
cardfile $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) cardfile
chgat $(LDFLAGS_CURSES) $(LOCAL_LIBS) chgat popup_msg
clip_printw $(LDFLAGS_CURSES) $(LOCAL_LIBS) clip_printw popup_msg
+color_content $(LDFLAGS_CURSES) $(LOCAL_LIBS) color_content
color_set $(LDFLAGS_CURSES) $(LOCAL_LIBS) color_set
demo_altkeys $(LDFLAGS_CURSES) $(LOCAL_LIBS) demo_altkeys
demo_defkey $(LDFLAGS_CURSES) $(LOCAL_LIBS) demo_defkey
lrtest $(LDFLAGS_CURSES) $(LOCAL_LIBS) lrtest
movewindow $(LDFLAGS_CURSES) $(LOCAL_LIBS) movewindow popup_msg
ncurses $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) ncurses
+newdemo $(LDFLAGS_CURSES) $(LOCAL_LIBS) newdemo
padview $(LDFLAGS_CURSES) $(LOCAL_LIBS) padview popup_msg
+pair_content $(LDFLAGS_CURSES) $(LOCAL_LIBS) pair_content
picsmap $(LDFLAGS_CURSES) $(LOCAL_LIBS) picsmap
-newdemo $(LDFLAGS_CURSES) $(LOCAL_LIBS) newdemo
railroad $(LDFLAGS_TINFO) $(LOCAL_LIBS) railroad
rain $(LDFLAGS_THREADS) $(LOCAL_LIBS) rain popup_msg
redraw $(LDFLAGS_CURSES) $(LOCAL_LIBS) redraw popup_msg
* authorization. *
****************************************************************************/
/*
- * $Id: savescreen.c,v 1.53 2018/05/12 15:11:16 tom Exp $
+ * $Id: savescreen.c,v 1.54 2018/12/29 17:25:56 tom Exp $
*
* Demonstrate save/restore functions from the curses library.
* Thomas Dickey - 2007/7/14
*/
+#define NEED_TIME_H
#include <test.priv.h>
#include <popup_msg.h>
#include <parse_rgb.h>
#include <sys/types.h>
#include <sys/stat.h>
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
#if defined(__hpux)
#define MyMarker 'X'
#else
-/* $Id: tclock.c,v 1.38 2017/09/09 00:37:06 tom Exp $ */
+/* $Id: tclock.c,v 1.39 2018/12/29 17:23:42 tom Exp $ */
+#define NEED_TIME_H
#include <test.priv.h>
#if HAVE_MATH_H
#include <math.h>
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
/*
tclock - analog/digital clock for curses.
If it gives you joy, then
/****************************************************************************
* Author: Thomas E. Dickey 1996-on *
****************************************************************************/
-/* $Id: test.priv.h,v 1.169 2018/08/19 00:28:27 tom Exp $ */
+/* $Id: test.priv.h,v 1.171 2018/12/29 21:44:07 tom Exp $ */
#ifndef __TEST_PRIV_H
#define __TEST_PRIV_H 1
#define slk_clear() /* nothing */
#endif
+#if HAVE_TPUTS_SP
+#define USE_SP_FUNCS 1
+#else
+#define USE_SP_FUNCS 0
+#endif
+
#ifndef HAVE_WSYNCDOWN
#define wsyncdown(win) /* nothing */
#endif
#endif
+#ifdef NEED_TIME_H
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#endif
+
/* Use this to quiet gcc's -Wwrite-strings warnings, but accommodate SVr4
* curses which doesn't have const parameters declared (so far) in the places
* that XSI shows.
#!/usr/bin/env perl
-# $Id: tracemunch,v 1.20 2018/05/02 00:14:29 tom Exp $
+# $Id: tracemunch,v 1.24 2018/12/29 22:20:06 tom Exp $
##############################################################################
# Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. #
# #
return $arg;
}
-while (<STDIN>) {
- my $addr;
- my $n;
- my $awaiting = "";
-
- CLASSIFY: {
-
- my $thread = "";
- if ( $_ =~ /^(0x[[:xdigit:]]+):/ ) {
- $thr_addr{$1} = ++$thr_nums unless defined $thr_addr{$1};
- $thread = "thread" . $thr_addr{$1} . ":";
- $_ =~ s/^[^:]*://;
- }
-
- # Transform window pointer addresses so it's easier to compare logs
- $awaiting = "curscr" if ( $_ =~ /creating curscr/ );
- $awaiting = "newscr" if ( $_ =~ /creating newscr/ );
- $awaiting = "stdscr" if ( $_ =~ /creating stdscr/ );
- $awaiting = "screen" if ( $_ =~ /^(\+ )*called \{new_prescr\(\)/ );
- if ( $_ =~ /^create :window 0x([[:xdigit:]]+)/ ) {
- $addr = "0x$1";
- if ( $awaiting eq "curscr" ) {
- $curscr = $addr;
- }
- elsif ( $awaiting eq "newscr" ) {
- $newscr = $addr;
+sub muncher($) {
+ my $STDIN = shift;
+
+ while (<$STDIN>) {
+ my $addr;
+ my $n;
+ my $awaiting = "";
+
+ CLASSIFY: {
+
+ # just in case someone tries a file with cr/lf line-endings:
+ $_ =~ s/\r\n/\n/g;
+ $_ =~ s/\r/\n/g;
+
+ my $thread = "";
+ if ( $_ =~ /^(0x[[:xdigit:]]+):/ ) {
+ $thr_addr{$1} = ++$thr_nums unless defined $thr_addr{$1};
+ $thread = "thread" . $thr_addr{$1} . ":";
+ $_ =~ s/^[^:]*://;
}
- elsif ( $awaiting eq "stdscr" ) {
- $stdscr = $addr;
+
+ # Transform window pointer addresses so it's easier to compare logs
+ $awaiting = "curscr" if ( $_ =~ /creating curscr/ );
+ $awaiting = "newscr" if ( $_ =~ /creating newscr/ );
+ $awaiting = "stdscr" if ( $_ =~ /creating stdscr/ );
+ $awaiting = "screen" if ( $_ =~ /^(\+ )*called \{new_prescr\(\)/ );
+ if ( $_ =~ /^create :window 0x([[:xdigit:]]+)/ ) {
+ $addr = "0x$1";
+ if ( $awaiting eq "curscr" ) {
+ $curscr = $addr;
+ }
+ elsif ( $awaiting eq "newscr" ) {
+ $newscr = $addr;
+ }
+ elsif ( $awaiting eq "stdscr" ) {
+ $stdscr = $addr;
+ }
+ else {
+ $win_addr{$addr} = $win_nums++;
+ }
+ $awaiting = "";
}
- else {
- $win_addr{$addr} = $win_nums++;
+ elsif ( $_ =~ /^(\+ )*called \{_nc_add_to_try\((0x[[:xdigit:]]+),/ )
+ {
+ $try_addr{$2} = ++$try_nums unless defined $try_addr{$2};
}
- $awaiting = "";
- }
- elsif ( $_ =~ /^(\+ )*called \{_nc_add_to_try\((0x[[:xdigit:]]+),/ ) {
- $try_addr{$2} = ++$try_nums unless defined $try_addr{$2};
- }
- elsif ( $_ =~ /^(\+ )*_nc_alloc_screen_sp 0x([[:xdigit:]]+)/ ) {
- $addr = "0x$2";
- $scr_addr{$addr} = ++$scr_nums unless ( $scr_addr{$addr} );
- $awaiting = "";
- }
- elsif ( $_ =~ /^(\+ )*return }0x([[:xdigit:]]+)/ ) {
- $addr = "0x$2";
- if ( $awaiting eq "screen" ) {
+ elsif ( $_ =~ /^(\+ )*_nc_alloc_screen_sp 0x([[:xdigit:]]+)/ ) {
+ $addr = "0x$2";
$scr_addr{$addr} = ++$scr_nums unless ( $scr_addr{$addr} );
+ $awaiting = "";
}
- }
- elsif ( $_ =~ /^\.\.\.deleted win=0x([[:xdigit:]]+)/ ) {
- $addr = "0x$1";
- $_ = &transaddr($_);
- if ( $addr eq $curscr ) {
- $curscr = "";
- }
- elsif ( $addr eq $newscr ) {
- $newscr = "";
- }
- elsif ( $addr eq $stdscr ) {
- $stdscr = "";
- }
- else {
- undef $win_addr{$addr};
+ elsif ( $_ =~ /^(\+ )*return }0x([[:xdigit:]]+)/ ) {
+ $addr = "0x$2";
+ if ( $awaiting eq "screen" ) {
+ $scr_addr{$addr} = ++$scr_nums unless ( $scr_addr{$addr} );
+ }
}
- }
-
- # Compactify runs of PutAttrChar calls (TR_CHARPUT)
- if ( $_ =~ /$putattr/ ) {
- my $putattr_chars = $1;
- my $starty = $2;
- my $startx = $3;
- while (<STDIN>) {
- if ( $_ =~ /$putattr/ ) {
- $putattr_chars .= $1;
+ elsif ( $_ =~ /^\.\.\.deleted win=0x([[:xdigit:]]+)/ ) {
+ $addr = "0x$1";
+ $_ = &transaddr($_);
+ if ( $addr eq $curscr ) {
+ $curscr = "";
+ }
+ elsif ( $addr eq $newscr ) {
+ $newscr = "";
+ }
+ elsif ( $addr eq $stdscr ) {
+ $stdscr = "";
}
else {
- last;
+ undef $win_addr{$addr};
}
}
- print
+
+ # Compactify runs of PutAttrChar calls (TR_CHARPUT)
+ if ( $_ =~ /$putattr/ ) {
+ my $putattr_chars = $1;
+ my $starty = $2;
+ my $startx = $3;
+ while (<$STDIN>) {
+ if ( $_ =~ /$putattr/ ) {
+ $putattr_chars .= $1;
+ }
+ else {
+ last;
+ }
+ }
+ print
"RUN of PutAttrChar()s: \"$putattr_chars\" from ${starty}, ${startx}\n";
- redo CLASSIFY;
- }
-
- # Compactify runs of waddnstr calls (TR_CALLS)
- if ( $_ =~ /$waddnstr/ ) {
- my $waddnstr_chars = $2;
- my $winaddr = $1;
- while (<STDIN>) {
- if ( $_ =~ /$waddnstr/ && $1 eq $winaddr ) {
- $waddnstr_chars .= $2;
+ redo CLASSIFY;
+ }
+
+ # Compactify runs of waddnstr calls (TR_CALLS)
+ if ( $_ =~ /$waddnstr/ ) {
+ my $waddnstr_chars = $2;
+ my $winaddr = $1;
+ while (<$STDIN>) {
+ if ( $_ =~ /$waddnstr/ && $1 eq $winaddr ) {
+ $waddnstr_chars .= $2;
+ }
+ else {
+ last;
+ }
+ }
+ my $winaddstr = &transaddr($winaddr);
+ print "RUN of waddnstr()s: $winaddr, \"$waddnstr_chars\"\n";
+ redo CLASSIFY;
+ }
+
+ # More transformations can go here
+
+ # Repeated runs of anything
+ my $anyline = &transaddr($_);
+ my $repeatcount = 1;
+ while (<$STDIN>) {
+ if ( &transaddr($_) eq $anyline ) {
+ $repeatcount++;
}
else {
last;
}
}
- my $winaddstr = &transaddr($winaddr);
- print "RUN of waddnstr()s: $winaddr, \"$waddnstr_chars\"\n";
- redo CLASSIFY;
- }
-
- # More transformations can go here
-
- # Repeated runs of anything
- my $anyline = &transaddr($_);
- my $repeatcount = 1;
- while (<STDIN>) {
- if ( &transaddr($_) eq $anyline ) {
- $repeatcount++;
+ if ( $repeatcount > 1 ) {
+ print "${repeatcount} REPEATS OF $anyline";
}
else {
- last;
+ print $thread . $anyline;
}
- }
- if ( $repeatcount > 1 ) {
- print "${repeatcount} REPEATS OF $anyline";
- }
- else {
- print $thread . $anyline;
- }
- redo CLASSIFY if $_;
-
- } # :CLASSIFY
+ redo CLASSIFY if $_;
+
+ } # :CLASSIFY
+ }
+}
+
+if ( $#ARGV >= 0 ) {
+ while ( $#ARGV >= 0 ) {
+ my $file = shift @ARGV;
+ open my $ifh, "<", $file or die $!;
+ &muncher($ifh);
+ }
+}
+else {
+ &muncher( \*STDIN );
}
# tracemunch ends here