mirror of
https://github.com/ThomasDickey/ncurses-snapshots.git
synced 2026-01-26 11:04:35 +00:00
snapshot of project "ncurses", label v6_2_20200509
This commit is contained in:
parent
ca7165f8fb
commit
55aaff89b1
8
NEWS
8
NEWS
@ -26,7 +26,7 @@
|
||||
-- sale, use or other dealings in this Software without prior written --
|
||||
-- authorization. --
|
||||
-------------------------------------------------------------------------------
|
||||
-- $Id: NEWS,v 1.3482 2020/05/02 23:42:21 tom Exp $
|
||||
-- $Id: NEWS,v 1.3484 2020/05/09 14:53:16 tom Exp $
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
This is a log of changes that ncurses has gone through since Zeyd started
|
||||
@ -46,6 +46,12 @@ See the AUTHORS file for the corresponding full names.
|
||||
Changes through 1.9.9e did not credit all contributions;
|
||||
it is not possible to add this information.
|
||||
|
||||
20200509
|
||||
+ add "-r" option to the dots test-programs, to help with scripting
|
||||
a performance comparison.
|
||||
+ build-fix test/move_field.c for NetBSD curses, whose form headers
|
||||
use different names than SVr4 or ncurses.
|
||||
|
||||
20200502
|
||||
+ add details on the change to Linux SGR 21 in 2018 -TD
|
||||
+ add xterm-direct16 and xterm-direct256 -TD
|
||||
|
||||
4
dist.mk
4
dist.mk
@ -26,7 +26,7 @@
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
# $Id: dist.mk,v 1.1348 2020/05/02 09:32:34 tom Exp $
|
||||
# $Id: dist.mk,v 1.1349 2020/05/09 09:21:38 tom Exp $
|
||||
# Makefile for creating ncurses distributions.
|
||||
#
|
||||
# This only needs to be used directly as a makefile by developers, but
|
||||
@ -38,7 +38,7 @@ SHELL = /bin/sh
|
||||
# These define the major/minor/patch versions of ncurses.
|
||||
NCURSES_MAJOR = 6
|
||||
NCURSES_MINOR = 2
|
||||
NCURSES_PATCH = 20200502
|
||||
NCURSES_PATCH = 20200509
|
||||
|
||||
# We don't append the patch to the version, since this only applies to releases
|
||||
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
# Report bugs and new terminal descriptions to
|
||||
# bug-ncurses@gnu.org
|
||||
#
|
||||
# $Revision: 1.795 $
|
||||
# $Date: 2020/05/02 23:39:49 $
|
||||
# $Revision: 1.799 $
|
||||
# $Date: 2020/05/03 12:47:06 $
|
||||
#
|
||||
# The original header is preserved below for reference. It is noted that there
|
||||
# is a "newer" version which differs in some cosmetic details (but actually
|
||||
@ -1220,7 +1220,7 @@ mach-gnu-color|Mach Console with ANSI color,
|
||||
setaf=\E[3%p1%dm, use=mach-gnu,
|
||||
|
||||
# From: Marcus Brinkmann
|
||||
# http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/hurd/hurd/console/
|
||||
# http://git.savannah.gnu.org/cgit/hurd/hurd.git/log/console/
|
||||
#
|
||||
# Comments in the original are summarized here:
|
||||
#
|
||||
@ -5663,7 +5663,7 @@ xfce|Xfce Terminal,
|
||||
# https://github.com/thestinger/vte-ng
|
||||
# which (based on the default branch setting) seems to be a fork of vte
|
||||
# 0.48.2, and is noted as such in Arch:
|
||||
# https://www.archlinux.org/packages/community/x86_64/vte3-ng/
|
||||
# https://aur.archlinux.org/packages/vte3-ng/
|
||||
# It won't be merged:
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=679658#c10
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=78291
|
||||
@ -8649,7 +8649,7 @@ uwin|U/Win 3.2 console,
|
||||
# variables may be permanently set in the Control Panel\System applet.
|
||||
#
|
||||
# You can find out more about the restrictions of this facility at
|
||||
# <http://www.nentug.org/unix-to-nt/ntposix.htm>.
|
||||
# <https://jeffpar.github.io/kbarchive/kb/108/Q108581/>
|
||||
#
|
||||
# From: Federico Bianchi <bianchi@magna.cisid.unipi.it>, 15 Jan 1997
|
||||
ansi-nt|psx_ansi|Microsoft Windows NT console POSIX ANSI mode,
|
||||
@ -10226,6 +10226,7 @@ tvi912cc|tvi912 at cowell college,
|
||||
#
|
||||
# Someone has put a scanned copy of the manual online at:
|
||||
# http://vt100.net/televideo/912b-om/
|
||||
# (https://vt100.net/manx/details/6,5484)
|
||||
#
|
||||
# These terminals were produced ca. 1979, and had a 12" monochrome
|
||||
# screen, supported 75-9600 baud (no handshaking), monochrome, 7-bit
|
||||
@ -26534,4 +26535,7 @@ v3220|LANPAR Vision II model 3220/3221/3222,
|
||||
# + add details on the change to Linux SGR 21 in 2018 -TD
|
||||
# + add xterm-direct16 and xterm-direct256 -TD
|
||||
#
|
||||
# 2020-05-03
|
||||
# + fix some dead URLs -TD
|
||||
#
|
||||
######## SHANTIH! SHANTIH! SHANTIH!
|
||||
|
||||
@ -85,7 +85,7 @@
|
||||
#define CUR SP_TERMTYPE
|
||||
#endif
|
||||
|
||||
MODULE_ID("$Id: lib_mouse.c,v 1.186 2020/05/02 21:13:04 tom Exp $")
|
||||
MODULE_ID("$Id: lib_mouse.c,v 1.187 2020/05/09 23:24:03 tom Exp $")
|
||||
|
||||
#include <tic.h>
|
||||
|
||||
@ -970,9 +970,9 @@ decode_X10_bstate(SCREEN *sp, MEVENT * eventp, unsigned intro)
|
||||
|
||||
if (intro >= 96) {
|
||||
if (intro >= 160) {
|
||||
button = (intro - 152); /* buttons 8-11 */
|
||||
button = (int) (intro - 152); /* buttons 8-11 */
|
||||
} else if (intro >= 96) {
|
||||
button = (intro - 92); /* buttons 4-7 */
|
||||
button = (int) (intro - 92); /* buttons 4-7 */
|
||||
}
|
||||
} else {
|
||||
button = (intro & 3);
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
ncurses6 (6.2+20200502) unstable; urgency=low
|
||||
ncurses6 (6.2+20200509) unstable; urgency=low
|
||||
|
||||
* latest weekly patch
|
||||
|
||||
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 02 May 2020 05:32:34 -0400
|
||||
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 09 May 2020 05:21:38 -0400
|
||||
|
||||
ncurses6 (5.9-20131005) unstable; urgency=low
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
ncurses6 (6.2+20200502) unstable; urgency=low
|
||||
ncurses6 (6.2+20200509) unstable; urgency=low
|
||||
|
||||
* latest weekly patch
|
||||
|
||||
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 02 May 2020 05:32:34 -0400
|
||||
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 09 May 2020 05:21:38 -0400
|
||||
|
||||
ncurses6 (5.9-20131005) unstable; urgency=low
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
ncurses6 (6.2+20200502) unstable; urgency=low
|
||||
ncurses6 (6.2+20200509) unstable; urgency=low
|
||||
|
||||
* latest weekly patch
|
||||
|
||||
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 02 May 2020 05:32:34 -0400
|
||||
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 09 May 2020 05:21:38 -0400
|
||||
|
||||
ncurses6 (5.9-20120608) unstable; urgency=low
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
; $Id: mingw-ncurses.nsi,v 1.392 2020/05/02 09:32:34 tom Exp $
|
||||
; $Id: mingw-ncurses.nsi,v 1.393 2020/05/09 09:21:38 tom Exp $
|
||||
|
||||
; TODO add examples
|
||||
; TODO bump ABI to 6
|
||||
@ -10,7 +10,7 @@
|
||||
!define VERSION_MAJOR "6"
|
||||
!define VERSION_MINOR "2"
|
||||
!define VERSION_YYYY "2020"
|
||||
!define VERSION_MMDD "0502"
|
||||
!define VERSION_MMDD "0509"
|
||||
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
|
||||
|
||||
!define MY_ABI "5"
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
Summary: shared libraries for terminal handling
|
||||
Name: mingw32-ncurses6
|
||||
Version: 6.2
|
||||
Release: 20200502
|
||||
Release: 20200509
|
||||
License: X11
|
||||
Group: Development/Libraries
|
||||
Source: ncurses-%{version}-%{release}.tgz
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
Summary: shared libraries for terminal handling
|
||||
Name: ncurses6
|
||||
Version: 6.2
|
||||
Release: 20200502
|
||||
Release: 20200509
|
||||
License: X11
|
||||
Group: Development/Libraries
|
||||
Source: ncurses-%{version}-%{release}.tgz
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
Summary: Curses library with POSIX thread support.
|
||||
Name: ncursest6
|
||||
Version: 6.2
|
||||
Release: 20200502
|
||||
Release: 20200509
|
||||
License: X11
|
||||
Group: Development/Libraries
|
||||
Source: ncurses-%{version}-%{release}.tgz
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
/*
|
||||
* $Id: clip_printw.c,v 1.17 2020/02/02 23:34:34 tom Exp $
|
||||
* $Id: clip_printw.c,v 1.19 2020/05/10 00:40:23 tom Exp $
|
||||
*
|
||||
* demonstrate how to use printw without wrapping.
|
||||
*/
|
||||
@ -331,7 +331,10 @@ test_clipping(WINDOW *win)
|
||||
need = (unsigned) st.count + 1;
|
||||
_nc_SPRINTF(fmt, _nc_SLIMIT(sizeof(fmt)) "%%c%%%ds%%c", st.count);
|
||||
} else {
|
||||
need = (unsigned) getmaxx(win) - 1;
|
||||
int want = getmaxx(win);
|
||||
if (want < 10)
|
||||
want = 10;
|
||||
need = (unsigned) want - 1;
|
||||
_nc_STRCPY(fmt, "%c%s%c", sizeof(fmt));
|
||||
}
|
||||
if ((buffer = typeMalloc(char, need + 1)) != 0) {
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
/*
|
||||
* Author: Thomas E. Dickey
|
||||
*
|
||||
* $Id: demo_terminfo.c,v 1.50 2020/02/02 23:34:34 tom Exp $
|
||||
* $Id: demo_terminfo.c,v 1.51 2020/05/09 13:56:40 tom Exp $
|
||||
*
|
||||
* A simple demo of the terminfo interface.
|
||||
*/
|
||||
@ -842,10 +842,12 @@ main(int argc, char *argv[])
|
||||
case 's':
|
||||
s_opt = TRUE;
|
||||
break;
|
||||
#ifdef NCURSES_VERSION
|
||||
case 'x':
|
||||
#ifdef NCURSES_VERSION
|
||||
x_opt = TRUE;
|
||||
#endif
|
||||
break;
|
||||
#ifdef NCURSES_VERSION
|
||||
case 'y':
|
||||
y_opt = TRUE;
|
||||
x_opt = TRUE;
|
||||
|
||||
17
test/dots.c
17
test/dots.c
@ -30,7 +30,7 @@
|
||||
/*
|
||||
* Author: Thomas E. Dickey <dickey@clark.net> 1999
|
||||
*
|
||||
* $Id: dots.c,v 1.36 2020/02/02 23:34:34 tom Exp $
|
||||
* $Id: dots.c,v 1.39 2020/05/10 00:31:03 tom Exp $
|
||||
*
|
||||
* A simple demo of the terminfo interface.
|
||||
*/
|
||||
@ -79,9 +79,10 @@ cleanup(void)
|
||||
outs(clear_screen);
|
||||
outs(cursor_normal);
|
||||
|
||||
printf("\n\n%ld total cells, rate %.2f/sec\n",
|
||||
total_chars,
|
||||
((double) (total_chars) / (double) (time((time_t *) 0) - started)));
|
||||
fflush(stdout);
|
||||
fprintf(stderr, "\n\n%ld total cells, rate %.2f/sec\n",
|
||||
total_chars,
|
||||
((double) (total_chars) / (double) (time((time_t *) 0) - started)));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -123,6 +124,7 @@ usage(void)
|
||||
#endif
|
||||
," -f use tigetnum rather than <term.h> mapping"
|
||||
," -m SIZE set margin (default: 2)"
|
||||
," -r SECS self-interrupt/exit after specified number of seconds"
|
||||
," -s MSECS delay 1% of the time (default: 1 msecs)"
|
||||
};
|
||||
size_t n;
|
||||
@ -143,11 +145,12 @@ main(int argc,
|
||||
int my_colors;
|
||||
int f_option = 0;
|
||||
int m_option = 2;
|
||||
int r_option = 0;
|
||||
int s_option = 1;
|
||||
size_t need;
|
||||
char *my_env;
|
||||
|
||||
while ((ch = getopt(argc, argv, "T:efm:s:")) != -1) {
|
||||
while ((ch = getopt(argc, argv, "T:efm:r:s:")) != -1) {
|
||||
switch (ch) {
|
||||
case 'T':
|
||||
need = 6 + strlen(optarg);
|
||||
@ -166,6 +169,9 @@ main(int argc,
|
||||
case 'm':
|
||||
m_option = atoi(optarg);
|
||||
break;
|
||||
case 'r':
|
||||
r_option = atoi(optarg);
|
||||
break;
|
||||
case 's':
|
||||
s_option = atoi(optarg);
|
||||
break;
|
||||
@ -175,6 +181,7 @@ main(int argc,
|
||||
}
|
||||
}
|
||||
|
||||
SetupAlarm(r_option);
|
||||
InitAndCatch(setupterm((char *) 0, 1, (int *) 0), onsig);
|
||||
|
||||
srand((unsigned) time(0));
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
/*
|
||||
* Author: Thomas E. Dickey
|
||||
*
|
||||
* $Id: dots_curses.c,v 1.16 2020/02/02 23:34:34 tom Exp $
|
||||
* $Id: dots_curses.c,v 1.19 2020/05/10 00:31:59 tom Exp $
|
||||
*
|
||||
* A simple demo of the curses interface used for comparison with termcap.
|
||||
*/
|
||||
@ -51,9 +51,10 @@ cleanup(void)
|
||||
{
|
||||
endwin();
|
||||
|
||||
printf("\n\n%ld total cells, rate %.2f/sec\n",
|
||||
total_chars,
|
||||
((double) (total_chars) / (double) (time((time_t *) 0) - started)));
|
||||
fflush(stdout);
|
||||
fprintf(stderr, "\n\n%ld total cells, rate %.2f/sec\n",
|
||||
total_chars,
|
||||
((double) (total_chars) / (double) (time((time_t *) 0) - started)));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -101,6 +102,7 @@ usage(void)
|
||||
," -e allow environment $LINES / $COLUMNS"
|
||||
#endif
|
||||
," -m SIZE set margin (default: 2)"
|
||||
," -r SECS self-interrupt/exit after specified number of seconds"
|
||||
," -s MSECS delay 1% of the time (default: 1 msecs)"
|
||||
};
|
||||
size_t n;
|
||||
@ -122,11 +124,12 @@ main(int argc, char *argv[])
|
||||
bool d_option = FALSE;
|
||||
#endif
|
||||
int m_option = 2;
|
||||
int r_option = 0;
|
||||
int s_option = 1;
|
||||
size_t need;
|
||||
char *my_env;
|
||||
|
||||
while ((ch = getopt(argc, argv, "T:dem:s:")) != -1) {
|
||||
while ((ch = getopt(argc, argv, "T:dem:r:s:")) != -1) {
|
||||
switch (ch) {
|
||||
case 'T':
|
||||
need = 6 + strlen(optarg);
|
||||
@ -147,6 +150,9 @@ main(int argc, char *argv[])
|
||||
case 'm':
|
||||
m_option = atoi(optarg);
|
||||
break;
|
||||
case 'r':
|
||||
r_option = atoi(optarg);
|
||||
break;
|
||||
case 's':
|
||||
s_option = atoi(optarg);
|
||||
break;
|
||||
@ -158,7 +164,9 @@ main(int argc, char *argv[])
|
||||
|
||||
srand((unsigned) time(0));
|
||||
|
||||
SetupAlarm(r_option);
|
||||
InitAndCatch(initscr(), onsig);
|
||||
|
||||
if (has_colors()) {
|
||||
start_color();
|
||||
#if HAVE_USE_DEFAULT_COLORS
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
/*
|
||||
* Author: Thomas E. Dickey - 2007
|
||||
*
|
||||
* $Id: dots_mvcur.c,v 1.22 2020/02/02 23:34:34 tom Exp $
|
||||
* $Id: dots_mvcur.c,v 1.25 2020/05/10 00:32:11 tom Exp $
|
||||
*
|
||||
* A simple demo of the terminfo interface, and mvcur.
|
||||
*/
|
||||
@ -80,9 +80,10 @@ cleanup(void)
|
||||
outs(clear_screen);
|
||||
outs(cursor_normal);
|
||||
|
||||
printf("\n\n%ld total cells, rate %.2f/sec\n",
|
||||
total_chars,
|
||||
((double) (total_chars) / (double) (time((time_t *) 0) - started)));
|
||||
fflush(stdout);
|
||||
fprintf(stderr, "\n\n%ld total cells, rate %.2f/sec\n",
|
||||
total_chars,
|
||||
((double) (total_chars) / (double) (time((time_t *) 0) - started)));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -124,6 +125,7 @@ usage(void)
|
||||
#endif
|
||||
," -f use tigetnum rather than <term.h> mapping"
|
||||
," -m SIZE set margin (default: 2)"
|
||||
," -r SECS self-interrupt/exit after specified number of seconds"
|
||||
," -s MSECS delay 1% of the time (default: 1 msecs)"
|
||||
};
|
||||
size_t n;
|
||||
@ -146,11 +148,12 @@ main(int argc GCC_UNUSED,
|
||||
int my_colors;
|
||||
int f_option = 0;
|
||||
int m_option = 2;
|
||||
int r_option = 0;
|
||||
int s_option = 1;
|
||||
size_t need;
|
||||
char *my_env;
|
||||
|
||||
while ((ch = getopt(argc, argv, "T:efm:s:")) != -1) {
|
||||
while ((ch = getopt(argc, argv, "T:efm:r:s:")) != -1) {
|
||||
switch (ch) {
|
||||
case 'T':
|
||||
need = 6 + strlen(optarg);
|
||||
@ -169,6 +172,9 @@ main(int argc GCC_UNUSED,
|
||||
case 'm':
|
||||
m_option = atoi(optarg);
|
||||
break;
|
||||
case 'r':
|
||||
r_option = atoi(optarg);
|
||||
break;
|
||||
case 's':
|
||||
s_option = atoi(optarg);
|
||||
break;
|
||||
@ -178,6 +184,7 @@ main(int argc GCC_UNUSED,
|
||||
}
|
||||
}
|
||||
|
||||
SetupAlarm(r_option);
|
||||
InitAndCatch((sp = newterm((char *) 0, stdout, stdin)), onsig);
|
||||
refresh(); /* needed with Solaris curses to cancel endwin */
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
/*
|
||||
* Author: Thomas E. Dickey
|
||||
*
|
||||
* $Id: dots_termcap.c,v 1.20 2020/02/02 23:34:34 tom Exp $
|
||||
* $Id: dots_termcap.c,v 1.23 2020/05/10 00:32:22 tom Exp $
|
||||
*
|
||||
* A simple demo of the termcap interface.
|
||||
*/
|
||||
@ -131,9 +131,10 @@ cleanup(void)
|
||||
outs(t_cl);
|
||||
outs(t_ve);
|
||||
|
||||
printf("\n\n%ld total cells, rate %.2f/sec\n",
|
||||
total_chars,
|
||||
((double) (total_chars) / (double) (time((time_t *) 0) - started)));
|
||||
fflush(stdout);
|
||||
fprintf(stderr, "\n\n%ld total cells, rate %.2f/sec\n",
|
||||
total_chars,
|
||||
((double) (total_chars) / (double) (time((time_t *) 0) - started)));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -189,6 +190,7 @@ usage(void)
|
||||
," -T TERM override $TERM"
|
||||
," -e allow environment $LINES / $COLUMNS"
|
||||
," -m SIZE set margin (default: 2)"
|
||||
," -r SECS self-interrupt/exit after specified number of seconds"
|
||||
," -s MSECS delay 1% of the time (default: 1 msecs)"
|
||||
};
|
||||
size_t n;
|
||||
@ -208,6 +210,7 @@ main(int argc, char *argv[])
|
||||
int num_columns;
|
||||
int e_option = 0;
|
||||
int m_option = 2;
|
||||
int r_option = 0;
|
||||
int s_option = 1;
|
||||
double r;
|
||||
double c;
|
||||
@ -217,7 +220,7 @@ main(int argc, char *argv[])
|
||||
size_t need;
|
||||
char *my_env;
|
||||
|
||||
while ((ch = getopt(argc, argv, "T:em:s:")) != -1) {
|
||||
while ((ch = getopt(argc, argv, "T:em:r:s:")) != -1) {
|
||||
switch (ch) {
|
||||
case 'T':
|
||||
need = 6 + strlen(optarg);
|
||||
@ -231,6 +234,9 @@ main(int argc, char *argv[])
|
||||
case 'm':
|
||||
m_option = atoi(optarg);
|
||||
break;
|
||||
case 'r':
|
||||
r_option = atoi(optarg);
|
||||
break;
|
||||
case 's':
|
||||
s_option = atoi(optarg);
|
||||
break;
|
||||
@ -247,6 +253,7 @@ main(int argc, char *argv[])
|
||||
|
||||
srand((unsigned) time(0));
|
||||
|
||||
SetupAlarm((unsigned) r_option);
|
||||
InitAndCatch(ch = tgetent(buffer, name), onsig);
|
||||
if (ch < 0) {
|
||||
fprintf(stderr, "terminal description not found\n");
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
/*
|
||||
* Author: Thomas E. Dickey
|
||||
*
|
||||
* $Id: dots_xcurses.c,v 1.19 2020/02/02 23:34:34 tom Exp $
|
||||
* $Id: dots_xcurses.c,v 1.22 2020/05/10 00:32:33 tom Exp $
|
||||
*
|
||||
* A simple demo of the wide-curses interface used for comparison with termcap.
|
||||
*/
|
||||
@ -65,9 +65,10 @@ cleanup(void)
|
||||
{
|
||||
endwin();
|
||||
|
||||
printf("\n\n%ld total cells, rate %.2f/sec\n",
|
||||
total_chars,
|
||||
((double) (total_chars) / (double) (time((time_t *) 0) - started)));
|
||||
fflush(stdout);
|
||||
fprintf(stderr, "\n\n%ld total cells, rate %.2f/sec\n",
|
||||
total_chars,
|
||||
((double) (total_chars) / (double) (time((time_t *) 0) - started)));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -124,6 +125,7 @@ usage(void)
|
||||
," -e allow environment $LINES / $COLUMNS"
|
||||
#endif
|
||||
," -m SIZE set margin (default: 2)"
|
||||
," -r SECS self-interrupt/exit after specified number of seconds"
|
||||
," -s MSECS delay 1% of the time (default: 1 msecs)"
|
||||
#if HAVE_ALLOC_PAIR
|
||||
," -x use alloc_pair() rather than init_pair()"
|
||||
@ -148,11 +150,12 @@ main(int argc, char *argv[])
|
||||
bool d_option = FALSE;
|
||||
#endif
|
||||
int m_option = 2;
|
||||
int r_option = 0;
|
||||
int s_option = 1;
|
||||
size_t need;
|
||||
char *my_env;
|
||||
|
||||
while ((ch = getopt(argc, argv, "T:dem:s:x")) != -1) {
|
||||
while ((ch = getopt(argc, argv, "T:dem:r:s:x")) != -1) {
|
||||
switch (ch) {
|
||||
case 'T':
|
||||
need = 6 + strlen(optarg);
|
||||
@ -173,6 +176,9 @@ main(int argc, char *argv[])
|
||||
case 'm':
|
||||
m_option = atoi(optarg);
|
||||
break;
|
||||
case 'r':
|
||||
r_option = atoi(optarg);
|
||||
break;
|
||||
case 's':
|
||||
s_option = atoi(optarg);
|
||||
break;
|
||||
@ -189,6 +195,7 @@ main(int argc, char *argv[])
|
||||
|
||||
srand((unsigned) time(0));
|
||||
|
||||
SetupAlarm(r_option);
|
||||
InitAndCatch(initscr(), onsig);
|
||||
if (has_colors()) {
|
||||
start_color();
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
/*
|
||||
* $Id: move_field.c,v 1.6 2020/03/28 17:43:03 tom Exp $
|
||||
* $Id: move_field.c,v 1.7 2020/05/09 12:52:00 tom Exp $
|
||||
*
|
||||
* Demonstrate move_field().
|
||||
*/
|
||||
@ -38,6 +38,14 @@
|
||||
#include <edit_field.h>
|
||||
#include <popup_msg.h>
|
||||
|
||||
#ifdef HAVE_NETBSD_FORM_H
|
||||
#define form_field_row(field) (field)->form_row
|
||||
#define form_field_col(field) (field)->form_col
|
||||
#else /* e.g., SVr4, ncurses */
|
||||
#define form_field_row(field) (field)->frow
|
||||
#define form_field_col(field) (field)->fcol
|
||||
#endif
|
||||
|
||||
#define DO_DEMO CTRL('F') /* actual key for toggling demo-mode */
|
||||
#define MY_DEMO EDIT_FIELD('f') /* internal request-code */
|
||||
|
||||
@ -286,8 +294,8 @@ show_status(FORM *form, FIELD *field)
|
||||
getyx(stdscr, currow, curcol);
|
||||
mvprintw(LINES - 1, 0,
|
||||
"Field at [%d,%d]. Press %s to quit moving.",
|
||||
getbegy(sub) + field->frow,
|
||||
getbegx(sub) + field->fcol,
|
||||
getbegy(sub) + form_field_row(field),
|
||||
getbegx(sub) + form_field_col(field),
|
||||
keyname(DO_DEMO));
|
||||
clrtobot();
|
||||
move(currow, curcol);
|
||||
@ -332,8 +340,8 @@ do_demo(FORM *form)
|
||||
show_status(form, my_field);
|
||||
ch = '?';
|
||||
while ((ch = wgetch(form_win(form))) != DO_DEMO) {
|
||||
int field_y = my_field->frow;
|
||||
int field_x = my_field->fcol;
|
||||
int field_y = form_field_row(my_field);
|
||||
int field_x = form_field_col(my_field);
|
||||
|
||||
switch (ch) {
|
||||
case 'h':
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
/****************************************************************************
|
||||
* Author: Thomas E. Dickey 1996-on *
|
||||
****************************************************************************/
|
||||
/* $Id: test.priv.h,v 1.185 2020/02/02 23:34:34 tom Exp $ */
|
||||
/* $Id: test.priv.h,v 1.186 2020/05/10 00:36:06 tom Exp $ */
|
||||
|
||||
#ifndef __TEST_PRIV_H
|
||||
#define __TEST_PRIV_H 1
|
||||
@ -1022,6 +1022,12 @@ extern char *_nc_strstr(const char *, const char *);
|
||||
#define InitAndCatch(init,handler) do { init; CATCHALL(handler); } while (0)
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(USE_WIN32CON_DRIVER)
|
||||
#define SetupAlarm(opt) (void)opt
|
||||
#else
|
||||
#define SetupAlarm(opt) if (opt) alarm((unsigned)opt)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Workaround for clean(er) compile with Solaris's legacy curses.
|
||||
* The same would be needed for HPUX 10.20
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user