ncurses 6.1 - patch 20180714

+ add enum, regex examples to test/demo_forms
+ add configure check for pcre-posix library to help with MinGW port.
This commit is contained in:
Thomas E. Dickey 2018-07-15 00:59:40 +00:00
parent 746490c7ab
commit 32345daa97
16 changed files with 2798 additions and 2161 deletions

6
NEWS
View File

@ -25,7 +25,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: NEWS,v 1.3156 2018/07/07 23:38:46 tom Exp $
-- $Id: NEWS,v 1.3159 2018/07/14 23:25:22 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
@ -45,6 +45,10 @@ 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.
20180714
+ add enum, regex examples to test/demo_forms
+ add configure check for pcre-posix library to help with MinGW port.
20180707
+ build-fixes for gcc8.
+ correct order of WINDOW._ttytype versus WINDOW._windowlist in

View File

@ -1 +1 @@
5:0:10 6.1 20180707
5:0:10 6.1 20180714

71
aclocal.m4 vendored
View File

@ -28,7 +28,7 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
dnl $Id: aclocal.m4,v 1.839 2018/06/21 00:23:13 tom Exp $
dnl $Id: aclocal.m4,v 1.841 2018/07/14 23:48:44 tom Exp $
dnl Macros used in NCURSES auto-configuration script.
dnl
dnl These macros are maintained separately from NCURSES. The copyright on
@ -6931,6 +6931,33 @@ top_builddir=ifelse($1,,`pwd`,$1)
AC_SUBST(top_builddir)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_TRY_PKG_CONFIG version: 5 updated: 2013/07/06 21:27:06
dnl -----------------
dnl This is a simple wrapper to use for pkg-config, for libraries which may be
dnl available in that form.
dnl
dnl $1 = package name
dnl $2 = extra logic to use, if any, after updating CFLAGS and LIBS
dnl $3 = logic to use if pkg-config does not have the package
AC_DEFUN([CF_TRY_PKG_CONFIG],[
AC_REQUIRE([CF_PKG_CONFIG])
if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $1; then
CF_VERBOSE(found package $1)
cf_pkgconfig_incs="`$PKG_CONFIG --cflags $1 2>/dev/null`"
cf_pkgconfig_libs="`$PKG_CONFIG --libs $1 2>/dev/null`"
CF_VERBOSE(package $1 CFLAGS: $cf_pkgconfig_incs)
CF_VERBOSE(package $1 LIBS: $cf_pkgconfig_libs)
CF_ADD_CFLAGS($cf_pkgconfig_incs)
CF_ADD_LIBS($cf_pkgconfig_libs)
ifelse([$2],,:,[$2])
else
cf_pkgconfig_incs=
cf_pkgconfig_libs=
ifelse([$3],,:,[$3])
fi
])
dnl ---------------------------------------------------------------------------
dnl CF_TRY_XOPEN_SOURCE version: 2 updated: 2018/06/20 20:23:13
dnl -------------------
dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we
@ -7745,6 +7772,48 @@ case "x$cf_dst_eval" in
esac
AC_SUBST($3)dnl
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_WITH_PCRE2 version: 2 updated: 2018/07/14 16:47:56
dnl -------------
dnl Add PCRE2 (Perl-compatible regular expressions v2) to the build if it is
dnl available and the user requests it. Assume the application will otherwise
dnl use the POSIX interface.
dnl
dnl TODO allow $withval to specify package location
AC_DEFUN([CF_WITH_PCRE2],
[
AC_REQUIRE([CF_PKG_CONFIG])
AC_MSG_CHECKING(if you want to use PCRE2 for regular-expressions)
AC_ARG_WITH(pcre2,
[ --with-pcre2 use PCRE2 for regular-expressions])
test -z "$with_pcre2" && with_pcre2=no
AC_MSG_RESULT($with_pcre2)
if test "x$with_pcre2" != xno ; then
CF_TRY_PKG_CONFIG(libpcre2,,[
CF_TRY_PKG_CONFIG(libpcre,,[
AC_MSG_ERROR(Cannot find PCRE2 library)])])
AC_DEFINE(HAVE_LIB_PCRE2,1,[Define to 1 if we can/should compile with the PCRE2 library])
# if pkgconfig gave no results, look for the libraries directly
case $LIBS in
(*pcre2-posix*|*pcreposix*)
;;
(*)
AC_CHECK_LIB(pcre2-posix,regcomp,[
CF_ADD_LIB(pcre2-posix)],
[AC_CHECK_LIB(pcreposix,regcomp,[
CF_ADD_LIB(pcreposix)
],[AC_MSG_ERROR(Cannot find PCRE2 POSIX library)])])
;;
esac
# either way, check for the library header files
AC_CHECK_HEADERS(pcre2-posix.h pcreposix.h)
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_WITH_PKG_CONFIG_LIBDIR version: 10 updated: 2015/08/22 17:10:56

4685
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -28,14 +28,14 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
dnl $Id: configure.in,v 1.659 2018/06/16 21:26:41 tom Exp $
dnl $Id: configure.in,v 1.660 2018/07/14 19:04:04 tom Exp $
dnl Process this file with autoconf to produce a configure script.
dnl
dnl See https://invisible-island.net/autoconf/ for additional information.
dnl
dnl ---------------------------------------------------------------------------
AC_PREREQ(2.52.20170501)
AC_REVISION($Revision: 1.659 $)
AC_REVISION($Revision: 1.660 $)
AC_INIT(ncurses/base/lib_initscr.c)
AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
@ -521,6 +521,7 @@ if test "$with_gpm" != no ; then
CF_CHECK_GPM_WGETCH
fi
CF_WITH_PCRE2
CF_WITH_SYSMOUSE
# pretend that ncurses==ncursesw==ncursest

View File

@ -25,7 +25,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: dist.mk,v 1.1231 2018/07/01 14:34:06 tom Exp $
# $Id: dist.mk,v 1.1232 2018/07/14 14:25:29 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
@ -37,7 +37,7 @@ SHELL = /bin/sh
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 6
NCURSES_MINOR = 1
NCURSES_PATCH = 20180707
NCURSES_PATCH = 20180714
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2012,2015 Free Software Foundation, Inc. *
* Copyright (c) 1998-2015,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 *
@ -34,10 +34,17 @@
#include "form.priv.h"
MODULE_ID("$Id: fty_regex.c,v 1.26 2015/01/10 17:10:25 tom Exp $")
MODULE_ID("$Id: fty_regex.c,v 1.27 2018/07/14 21:41:39 tom Exp $")
#if HAVE_REGEX_H_FUNCS /* We prefer POSIX regex */
#if HAVE_REGEX_H_FUNCS || HAVE_LIB_PCRE2 /* We prefer POSIX regex */
#if HAVE_PCRE2_POSIX_H
#include <pcre2-posix.h>
#elif HAVE_PCREPOSIX_H
#include <pcreposix.h>
#else
#include <regex.h>
#endif
typedef struct
{

View File

@ -1,6 +1,6 @@
# $Id: ncurses_defs,v 1.84 2017/12/26 22:43:14 tom Exp $
# $Id: ncurses_defs,v 1.85 2018/07/14 21:20:36 tom Exp $
##############################################################################
# Copyright (c) 2000-2016,2017 Free Software Foundation, Inc. #
# Copyright (c) 2000-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"), #
@ -94,6 +94,7 @@ HAVE_LIBGPM
HAVE_LIBMENU
HAVE_LIBMPATROL
HAVE_LIBPANEL
HAVE_LIB_PCRE2
HAVE_LIMITS_H
HAVE_LINK
HAVE_LOCALE_H
@ -115,6 +116,8 @@ HAVE_NANOSLEEP
HAVE_NC_ALLOC_H
HAVE_NEWPAD 1
HAVE_PANEL_H
HAVE_PCRE2_POSIX_H
HAVE_PCREPOSIX_H
HAVE_POLL
HAVE_POLL_H
HAVE_PURIFY

View File

@ -1,5 +1,5 @@
.\"***************************************************************************
.\" Copyright (c) 1998-2010,2017 Free Software Foundation, Inc. *
.\" Copyright (c) 1998-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 *
@ -26,8 +26,12 @@
.\" authorization. *
.\"***************************************************************************
.\"
.\" $Id: form_field_validation.3x,v 1.21 2017/11/20 01:28:31 tom Exp $
.\" $Id: form_field_validation.3x,v 1.22 2018/07/14 22:39:06 tom Exp $
.TH form_field_validation 3X ""
.de bP
.ie n .IP \(bu 4
.el .IP \(bu 2
..
.SH NAME
\fBform_field_validation\fR \- data type validation for fields
.SH SYNOPSIS
@ -65,52 +69,92 @@ TYPE_ALPHA
Character data. Requires a third \fBint\fR argument, a minimum field width.
.TP 5
TYPE_ENUM
Accept one of a specified set of strings. Requires a third \fB(char **)\fR
argument pointing to a string list; a fourth \fBint\fR flag argument to enable
case-sensitivity; and a fifth \fBint\fR flag argument specifying whether a partial
match must be a unique one (if this flag is off, a prefix matches the first
of any set of more than one list elements with that prefix). Please notice
that the string list is copied. So you may use a list that lives in automatic variables on the stack.
Accept one of a specified set of strings. Requires additional
parameters:
.RS
.bP
a third \fB(char **)\fR argument pointing to a string list;
.bP
a fourth \fBint\fR flag argument to enable case-sensitivity;
.bP
and a fifth \fBint\fR flag argument specifying whether a partial
match must be a unique one.
If this flag is off, a prefix matches the first
of any set of more than one list elements with that prefix.
.IP
The library copies the string list,
so you may use a list that lives in automatic variables on the stack.
.RE
.TP 5
TYPE_INTEGER
Integer data, parsable to an integer by \fBatoi\fP(3). Requires a third
\fBint\fR argument controlling the precision, a fourth \fBlong\fR argument
constraining minimum value, and a fifth \fBlong\fR constraining maximum value.
Integer data, parsable to an integer by \fBatoi\fP(3).
Requires additional parameters:
.RS
.bP
a third \fBint\fR argument controlling the precision,
.bP
a fourth \fBlong\fR argument constraining minimum value,
.bP
and a fifth \fBlong\fR constraining maximum value.
If the maximum value is less than or equal to the minimum value, the range is
simply ignored. On return the field buffer is formatted according to the
simply ignored.
On return, the field buffer is formatted according to the
\fBprintf\fR format specification ".*ld", where the '*' is replaced by the
precision argument.
.IP
For details of the precision handling see \fBprintf's\fR man-page.
.RE
.TP 5
TYPE_NUMERIC
Numeric data (may have a decimal-point part). Requires a third
\fBint\fR argument controlling the precision, a fourth \fBdouble\fR
argument constraining minimum value, and a fifth \fBdouble\fR constraining
maximum value. If your system supports locales, the decimal point character
to be used must be the one specified by your locale.
If the maximum value is less than or equal to the minimum value, the range is
simply ignored. On return the field buffer is formatted according to the
Numeric data (may have a decimal-point part).
This requires additional parameters:
.RS
.bP
a third \fBint\fR argument controlling the precision,
.bP
a fourth \fBdouble\fR argument constraining minimum value,
.bP
and a fifth \fBdouble\fR constraining maximum value.
If your system supports locales,
the decimal point character must be the one specified by your locale.
If the maximum value is less than or equal to the minimum value,
the range is simply ignored.
.IP
On return, the field buffer is formatted according to the
\fBprintf\fR format specification ".*f", where the '*' is replaced by the
precision argument.
.IP
For details of the precision handling see \fBprintf's\fR man-page.
.RE
.TP 5
TYPE_REGEXP
Regular expression data. Requires a regular expression \fB(char *)\fR third argument;
the data is valid if the regular expression matches it. Regular expressions
are in the format of \fBregcomp\fR and \fBregexec\fR. Please notice
that the regular expression must match the whole field. If you have for
example an eight character wide field, a regular expression "^[0\-9]*$" always
means that you have to fill all eight positions with digits. If you want to
allow fewer digits, you may use for example "^[0\-9]* *$" which is good for
trailing spaces (up to an empty field), or "^ *[0\-9]* *$" which is good for
Regular expression data.
Requires a regular expression \fB(char *)\fR third argument.
The data is valid if the regular expression matches it.
.IP
Regular expressions
are in the format of \fBregcomp\fR and \fBregexec\fR.
.IP
The regular expression must match the whole field.
If you have for example, an eight character wide field,
a regular expression "^[0\-9]*$" always
means that you have to fill all eight positions with digits.
If you want to allow fewer digits,
you may use for example "^[0\-9]* *$" which is good for
trailing spaces (up to an empty field),
or "^ *[0\-9]* *$" which is good for
leading and trailing spaces around the digits.
.TP 5
TYPE_IPV4
An Internet Protocol Version 4 address. This requires no additional argument. It
is checked whether or not the buffer has the form a.b.c.d, where a,b,c and d are
numbers between 0 and 255. Trailing blanks in the buffer are ignored. The address
itself is not validated. Please note that this is an ncurses extension. This
field type may not be available in other curses implementations.
An Internet Protocol Version 4 address.
This requires no additional argument.
The library checks whether or not the buffer has the form a.b.c.d,
where a,b,c and d are numbers between 0 and 255.
Trailing blanks in the buffer are ignored.
The address itself is not validated.
.IP
This is an ncurses extension;
this field type may not be available in other curses implementations.
.PP
It is possible to set up new programmer-defined field types. See the
\fBform_fieldtype\fR(3X) manual page.

View File

@ -1,8 +1,8 @@
ncurses6 (6.1+20180707) unstable; urgency=low
ncurses6 (6.1+20180714) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 01 Jul 2018 10:34:06 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 14 Jul 2018 10:25:29 -0400
ncurses6 (5.9-20131005) unstable; urgency=low

View File

@ -1,8 +1,8 @@
ncurses6 (6.1+20180707) unstable; urgency=low
ncurses6 (6.1+20180714) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 01 Jul 2018 10:34:06 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 14 Jul 2018 10:25:29 -0400
ncurses6 (5.9-20131005) unstable; urgency=low

View File

@ -1,8 +1,8 @@
ncurses6 (6.1+20180707) unstable; urgency=low
ncurses6 (6.1+20180714) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 01 Jul 2018 10:34:06 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 14 Jul 2018 10:25:29 -0400
ncurses6 (5.9-20120608) unstable; urgency=low

View File

@ -1,4 +1,4 @@
; $Id: mingw-ncurses.nsi,v 1.278 2018/07/01 14:34:06 tom Exp $
; $Id: mingw-ncurses.nsi,v 1.279 2018/07/14 14:25:29 tom Exp $
; TODO add examples
; TODO bump ABI to 6
@ -10,7 +10,7 @@
!define VERSION_MAJOR "6"
!define VERSION_MINOR "1"
!define VERSION_YYYY "2018"
!define VERSION_MMDD "0707"
!define VERSION_MMDD "0714"
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
!define MY_ABI "5"

View File

@ -3,7 +3,7 @@
Summary: shared libraries for terminal handling
Name: mingw32-ncurses6
Version: 6.1
Release: 20180707
Release: 20180714
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
@ -70,6 +70,7 @@ This package is used for testing ABI %{MY_ABI} with cross-compiles to MinGW.
--with-fallbacks=unknown,xterm \\\
--with-install-prefix=$RPM_BUILD_ROOT \\\
--with-pc-suffix=%{MY_ABI} \\\
--with-pcre2 \\\
--with-shared \\\
--with-tparm-arg=intptr_t \\\
--with-trace \\\

View File

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

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 2003-2016,2017 Free Software Foundation, Inc. *
* Copyright (c) 2003-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 *
@ -26,14 +26,12 @@
* authorization. *
****************************************************************************/
/*
* $Id: demo_forms.c,v 1.53 2017/04/10 00:28:54 tom Exp $
* $Id: demo_forms.c,v 1.55 2018/07/14 23:26:02 tom Exp $
*
* Demonstrate a variety of functions from the form library.
* Thomas Dickey - 2003/4/26
*/
/*
TYPE_ENUM -
TYPE_REGEXP -
dup_field -
field_init -
field_just -
@ -440,6 +438,8 @@ demo_forms(void)
int pg;
WINDOW *also;
const char *fname;
static const char *my_enum[] =
{"first", "second", "third", 0};
#ifdef NCURSES_MOUSE_VERSION
mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0);
@ -478,23 +478,30 @@ demo_forms(void)
f[n++] = make_field(fname, 3, 34, 1, 12);
set_field_type(f[n - 1], TYPE_ALPHA, 1);
break;
case 1:
fname = "Last Name";
f[n++] = make_label(fname, 2, 0);
f[n++] = make_field(fname, 3, 0, 1, 18);
f[n++] = make_field(fname, 3, 0, 1, 12);
set_field_type(f[n - 1], TYPE_ALPHA, 1);
fname = "First Name";
f[n++] = make_label(fname, 2, 20);
f[n++] = make_field(fname, 3, 20, 1, 12);
f[n++] = make_label(fname, 2, 14);
f[n++] = make_field(fname, 3, 14, 1, 12);
set_field_type(f[n - 1], TYPE_ALPHA, 1);
fname = "MI";
f[n++] = make_label(fname, 2, 34);
f[n++] = make_field(fname, 3, 34, 1, 1);
f[n++] = make_label(fname, 2, 28);
f[n++] = make_field(fname, 3, 28, 1, 1);
set_field_pad(f[n - 1], '?');
set_field_type(f[n - 1], TYPE_ALPHA, 1);
fname = "First/Second/Third";
f[n++] = make_label(fname, 2, 32);
f[n++] = make_field(fname, 3, 32, 1, 12);
set_field_type(f[n - 1], TYPE_ENUM, my_enum, 0, 0);
break;
case 2:
fname = "Host Name";
f[n++] = make_label(fname, 2, 0);
@ -507,20 +514,24 @@ demo_forms(void)
f[n++] = make_field(fname, 3, 26, 1, 16);
set_field_type(f[n - 1], TYPE_IPV4, 1);
#endif
break;
case 3:
fname = "Four digits";
f[n++] = make_label(fname, 2, 0);
f[n++] = make_field(fname, 3, 0, 1, 18);
f[n++] = make_field(fname, 3, 0, 1, 10);
set_field_type(f[n - 1], TYPE_INTEGER, 4, 0, 0);
fname = "Numeric";
f[n++] = make_label(fname, 2, 20);
f[n++] = make_field(fname, 3, 20, 1, 12);
f[n++] = make_label(fname, 2, 13);
f[n++] = make_field(fname, 3, 13, 1, 12);
set_field_type(f[n - 1], TYPE_NUMERIC, 3, -10000.0, 100000000.0);
fname = "Phone number";
f[n++] = make_label(fname, 2, 27);
f[n++] = make_field(fname, 3, 27, 1, 16);
set_field_type(f[n - 1], TYPE_REGEXP,
"^([0-9]-)?[0-9]{3}-[0-9]{3}-[0-9]{4} *$");;
break;
}