ncurses 6.0 - patch 20160409

+ modify test/blue.c to use Unicode values for card-glyphs when
  available, as well as improving the check for CP437 and CP850.
This commit is contained in:
Thomas E. Dickey 2016-04-10 00:35:23 +00:00
parent 092f1e4b79
commit 11dcb05d1b
15 changed files with 1646 additions and 1316 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.2589 2016/04/02 23:49:12 tom Exp $
-- $Id: NEWS,v 1.2591 2016/04/09 20:58:02 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.
20160409
+ modify test/blue.c to use Unicode values for card-glyphs when
available, as well as improving the check for CP437 and CP850.
20160402
+ regenerate HTML manpages.
+ improve manual pages for utilities with respect to POSIX versus

View File

@ -1 +1 @@
5:0:9 6.0 20160402
5:0:9 6.0 20160409

View File

@ -25,7 +25,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: dist.mk,v 1.1100 2016/04/02 19:01:57 tom Exp $
# $Id: dist.mk,v 1.1101 2016/04/09 00:31:41 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 = 0
NCURSES_PATCH = 20160402
NCURSES_PATCH = 20160409
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)

View File

@ -1,8 +1,8 @@
ncurses6 (6.0+20160402) unstable; urgency=low
ncurses6 (6.0+20160409) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 02 Apr 2016 15:01:57 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Fri, 08 Apr 2016 20:31:41 -0400
ncurses6 (5.9-20131005) unstable; urgency=low

View File

@ -1,8 +1,8 @@
ncurses6 (6.0+20160402) unstable; urgency=low
ncurses6 (6.0+20160409) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 02 Apr 2016 15:01:57 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Fri, 08 Apr 2016 20:31:41 -0400
ncurses6 (5.9-20131005) unstable; urgency=low

View File

@ -1,8 +1,8 @@
ncurses6 (6.0+20160402) unstable; urgency=low
ncurses6 (6.0+20160409) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 02 Apr 2016 15:01:57 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Fri, 08 Apr 2016 20:31:41 -0400
ncurses6 (5.9-20120608) unstable; urgency=low

View File

@ -1,4 +1,4 @@
; $Id: mingw-ncurses.nsi,v 1.152 2016/04/02 19:01:57 tom Exp $
; $Id: mingw-ncurses.nsi,v 1.153 2016/04/09 00:31:41 tom Exp $
; TODO add examples
; TODO bump ABI to 6
@ -10,7 +10,7 @@
!define VERSION_MAJOR "6"
!define VERSION_MINOR "0"
!define VERSION_YYYY "2016"
!define VERSION_MMDD "0402"
!define VERSION_MMDD "0409"
!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.0
Release: 20160402
Release: 20160409
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz

View File

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

84
test/aclocal.m4 vendored
View File

@ -26,7 +26,7 @@ dnl sale, use or other dealings in this Software without prior written *
dnl authorization. *
dnl***************************************************************************
dnl
dnl $Id: aclocal.m4,v 1.126 2016/02/21 00:28:12 tom Exp $
dnl $Id: aclocal.m4,v 1.127 2016/04/09 21:39:32 tom Exp $
dnl
dnl Author: Thomas E. Dickey
dnl
@ -40,6 +40,29 @@ dnl See http://invisible-island.net/autoconf/ for additional information.
dnl
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl AM_LANGINFO_CODESET version: 4 updated: 2015/04/18 08:56:57
dnl -------------------
dnl Inserted as requested by gettext 0.10.40
dnl File from /usr/share/aclocal
dnl codeset.m4
dnl ====================
dnl serial AM1
dnl
dnl From Bruno Haible.
AC_DEFUN([AM_LANGINFO_CODESET],
[
AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
[AC_TRY_LINK([#include <langinfo.h>],
[char* cs = nl_langinfo(CODESET);],
am_cv_langinfo_codeset=yes,
am_cv_langinfo_codeset=no)
])
if test $am_cv_langinfo_codeset = yes; then
AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49
dnl ------------------
dnl Conditionally generate script according to whether we're using a given autoconf.
@ -2804,6 +2827,65 @@ CF_VERBOSE(...checked $1 [$]$1)
AC_SUBST(EXTRA_LDFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_SIGWINCH version: 1 updated: 2006/04/02 16:41:09
dnl -----------
dnl Use this macro after CF_XOPEN_SOURCE, but do not require it (not all
dnl programs need this test).
dnl
dnl This is really a MacOS X 10.4.3 workaround. Defining _POSIX_C_SOURCE
dnl forces SIGWINCH to be undefined (breaks xterm, ncurses). Oddly, the struct
dnl winsize declaration is left alone - we may revisit this if Apple choose to
dnl break that part of the interface as well.
AC_DEFUN([CF_SIGWINCH],
[
AC_CACHE_CHECK(if SIGWINCH is defined,cf_cv_define_sigwinch,[
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/signal.h>
],[int x = SIGWINCH],
[cf_cv_define_sigwinch=yes],
[AC_TRY_COMPILE([
#undef _XOPEN_SOURCE
#undef _POSIX_SOURCE
#undef _POSIX_C_SOURCE
#include <sys/types.h>
#include <sys/signal.h>
],[int x = SIGWINCH],
[cf_cv_define_sigwinch=maybe],
[cf_cv_define_sigwinch=no])
])
])
if test "$cf_cv_define_sigwinch" = maybe ; then
AC_CACHE_CHECK(for actual SIGWINCH definition,cf_cv_fixup_sigwinch,[
cf_cv_fixup_sigwinch=unknown
cf_sigwinch=32
while test $cf_sigwinch != 1
do
AC_TRY_COMPILE([
#undef _XOPEN_SOURCE
#undef _POSIX_SOURCE
#undef _POSIX_C_SOURCE
#include <sys/types.h>
#include <sys/signal.h>
],[
#if SIGWINCH != $cf_sigwinch
make an error
#endif
int x = SIGWINCH],
[cf_cv_fixup_sigwinch=$cf_sigwinch
break])
cf_sigwinch=`expr $cf_sigwinch - 1`
done
])
if test "$cf_cv_fixup_sigwinch" != unknown ; then
CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
fi
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_SIG_ATOMIC_T version: 3 updated: 2012/10/04 20:12:20
dnl ---------------
dnl signal handler, but there are some gcc depedencies in that recommendation.

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2009,2013 Free Software Foundation, Inc. *
* Copyright (c) 1998-2013,2016 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 *
@ -36,17 +36,17 @@
*****************************************************************************/
/*
* Compile this with the command `cc -O blue.c -lcurses -o blue'. For best
* results, use the ncurses(3) library. On non-Intel machines, SVr4 curses is
* just as good.
*
* $Id: blue.c,v 1.35 2013/04/27 19:46:53 tom Exp $
* $Id: blue.c,v 1.42 2016/04/09 23:55:52 tom Exp $
*/
#include <test.priv.h>
#include <time.h>
#if HAVE_LANGINFO_CODESET
#include <langinfo.h>
#endif
#define NOCARD (-1)
#define ACE 0
@ -97,40 +97,38 @@ static chtype ranks[SUIT_LENGTH][2] =
{' ', 'K'}
};
/* Please note, that this is a bad example.
Color values should not be or'ed in. This
only works, because the characters used here
are plain and have no color attribute themselves. */
#ifdef COLOR_PAIR
#define OR_COLORS(value,pair) ((value) | COLOR_PAIR(pair))
#else
#define OR_COLORS(value,pair) (value)
static int letters[4] =
{
'h', /* hearts */
's', /* spades */
'd', /* diamonds */
'c', /* clubs */
};
#ifdef HAVE_LANGINFO_CODESET
#if HAVE_TIGETSTR
static int glyphs[] =
{
'\003', /* hearts */
'\006', /* spades */
'\004', /* diamonds */
'\005', /* clubs */
};
#endif
#define PC_COLORS(value,pair) (OR_COLORS(value,pair) | A_ALTCHARSET)
static chtype letters[4] =
#if USE_WIDEC_SUPPORT
static int uglyphs[] =
{
OR_COLORS('h', RED_ON_WHITE), /* hearts */
OR_COLORS('s', BLACK_ON_WHITE), /* spades */
OR_COLORS('d', RED_ON_WHITE), /* diamonds */
OR_COLORS('c', BLACK_ON_WHITE), /* clubs */
0x2665, /* hearts */
0x2660, /* spades */
0x2666, /* diamonds */
0x2663 /* clubs */
};
#endif
#endif /* HAVE_LANGINFO_CODESET */
#if defined(__i386__) && defined(A_ALTCHARSET) && HAVE_TIGETSTR
static chtype glyphs[] =
{
PC_COLORS('\003', RED_ON_WHITE), /* hearts */
PC_COLORS('\006', BLACK_ON_WHITE), /* spades */
PC_COLORS('\004', RED_ON_WHITE), /* diamonds */
PC_COLORS('\005', BLACK_ON_WHITE), /* clubs */
};
#define USE_CP437 1
#else
#define USE_CP437 0
#endif /* __i386__ */
static chtype *suits = letters; /* this may change to glyphs below */
static int *suits = letters; /* this may change to glyphs below */
static void
die(int onsig)
@ -199,12 +197,30 @@ static void
printcard(int value)
{
(void) addch(' ');
if (value == NOCARD)
if (value == NOCARD) {
(void) addstr(" ");
else {
addch(ranks[value % SUIT_LENGTH][0] | (chtype) COLOR_PAIR(BLUE_ON_WHITE));
addch(ranks[value % SUIT_LENGTH][1] | (chtype) COLOR_PAIR(BLUE_ON_WHITE));
addch(suits[value / SUIT_LENGTH]);
} else {
int which = (value / SUIT_LENGTH);
int isuit = (value % SUIT_LENGTH);
attr_t color = COLOR_PAIR(((which % 2) == 0)
? RED_ON_WHITE
: BLACK_ON_WHITE);
addch(ranks[isuit][0] | (chtype) COLOR_PAIR(BLUE_ON_WHITE));
addch(ranks[isuit][1] | (chtype) COLOR_PAIR(BLUE_ON_WHITE));
attr_on(color, NULL);
#if USE_WIDEC_SUPPORT
{
wchar_t values[2];
values[0] = (wchar_t) suits[which];
values[1] = 0;
addwstr(values);
}
#else
addch((chtype) suits[which]);
#endif
attr_off(color, NULL);
}
(void) addch(' ');
}
@ -402,6 +418,44 @@ game_finished(int deal)
refresh();
}
#if HAVE_LANGINFO_CODESET
/*
* This program first appeared in ncurses in January 1995. At that point, the
* Linux console was able to display CP437 graphic characters, e.g., in the
* range 0-31. As of 2016, most Linux consoles are running with the UTF-8
* (partial) support. Incidentally, that makes all of the cards diamonds.
*/
static void
use_pc_display(void)
{
char *check = nl_langinfo(CODESET);
if (!strcmp(check, "UTF-8")) {
#if USE_WIDEC_SUPPORT
suits = uglyphs;
#endif
} else {
#if HAVE_TIGETSTR
if (!strcmp(check, "IBM437") ||
!strcmp(check, "CP437") ||
!strcmp(check, "IBM850") ||
!strcmp(check, "CP850")) {
char *smacs = tigetstr("smacs");
char *smpch = tigetstr("smpch");
/*
* The ncurses library makes this check to decide whether to allow
* the alternate character set for the (normally) nonprinting codes.
*/
if (smacs != 0 && smpch != 0 && !strcmp(smacs, smpch)) {
suits = glyphs;
}
}
#endif
}
}
#else
#define use_pc_display() /* nothing */
#endif /* HAVE_LANGINFO_CODESET */
int
main(int argc, char *argv[])
{
@ -409,34 +463,15 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
use_pc_display();
initscr();
/*
* We use COLOR_GREEN because COLOR_BLACK is wired to the wrong thing.
*/
start_color();
init_pair(RED_ON_WHITE, COLOR_RED, COLOR_WHITE);
init_pair(BLUE_ON_WHITE, COLOR_BLUE, COLOR_WHITE);
init_pair(BLACK_ON_WHITE, COLOR_BLACK, COLOR_WHITE);
#ifndef COLOR_PAIR
letters[0] = OR_COLORS('h', RED_ON_WHITE); /* hearts */
letters[1] = OR_COLORS('s', BLACK_ON_WHITE); /* spades */
letters[2] = OR_COLORS('d', RED_ON_WHITE); /* diamonds */
letters[3] = OR_COLORS('c', BLACK_ON_WHITE); /* clubs */
#if USE_CP437
glyphs[0] = PC_COLORS('\003', RED_ON_WHITE); /* hearts */
glyphs[1] = PC_COLORS('\006', BLACK_ON_WHITE); /* spades */
glyphs[2] = PC_COLORS('\004', RED_ON_WHITE); /* diamonds */
glyphs[3] = PC_COLORS('\005', BLACK_ON_WHITE); /* clubs */
#endif
#endif
#if USE_CP437
if (tigetstr("smpch"))
suits = glyphs;
#endif /* USE_CP437 */
cbreak();
if (argc == 2)

2665
test/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
dnl***************************************************************************
dnl Copyright (c) 1998-2014,2015 Free Software Foundation, Inc. *
dnl Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. *
dnl *
dnl Permission is hereby granted, free of charge, to any person obtaining a *
dnl copy of this software and associated documentation files (the *
@ -28,7 +28,7 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey 1996, etc.
dnl
dnl $Id: configure.in,v 1.125 2015/10/10 20:23:49 tom Exp $
dnl $Id: configure.in,v 1.126 2016/04/09 21:37:32 tom Exp $
dnl This is a simple configuration-script for the ncurses test programs that
dnl allows the test-directory to be separately configured against a reference
dnl system (i.e., sysvr4 curses)
@ -100,6 +100,12 @@ CF_GCC_ATTRIBUTES
CF_XOPEN_SOURCE
CF_SIG_ATOMIC_T
# Work around breakage on OS X
CF_SIGWINCH
# Checks for CODESET support.
AM_LANGINFO_CODESET
dnl ---------------------------------------------------------------------------
CF_HELP_MESSAGE(General Options:)
CF_PKG_CONFIG

View File

@ -29,7 +29,7 @@
/*
* Author: Thomas E. Dickey 1998
*
* $Id: filter.c,v 1.22 2016/03/13 00:41:43 tom Exp $
* $Id: filter.c,v 1.23 2016/04/09 23:52:22 tom Exp $
*
* An example of the 'filter()' function in ncurses, this program prompts
* for commands and executes them (like a command shell). It illustrates
@ -92,7 +92,7 @@ show_prompt(int underline, bool clocked)
move(y, x);
}
}
attron(underline);
attron((chtype) underline);
return limit;
}
@ -251,7 +251,7 @@ new_command(char *buffer, int length, int underline, bool clocked, bool polled)
}
#endif
}
attroff(underline);
attroff((chtype) underline);
attroff(A_BOLD);
printw("\n");

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
* Copyright (c) 1998-2014,2016 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 *
@ -29,7 +29,7 @@
/****************************************************************************
* Author: Thomas E. Dickey 1996-on *
****************************************************************************/
/* $Id: test.priv.h,v 1.131 2014/10/25 01:20:34 tom Exp $ */
/* $Id: test.priv.h,v 1.132 2016/04/09 23:55:01 tom Exp $ */
#ifndef __TEST_PRIV_H
#define __TEST_PRIV_H 1
@ -118,6 +118,10 @@
#define HAVE_LIBPANEL 0
#endif
#ifndef HAVE_LANGINFO_CODESET
#define HAVE_LANGINFO_CODESET 0
#endif
#ifndef HAVE_LOCALE_H
#define HAVE_LOCALE_H 0
#endif