]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.0 - patch 20171014
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 15 Oct 2017 01:25:24 +0000 (01:25 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 15 Oct 2017 01:25:24 +0000 (01:25 +0000)
+ minor cleanup to test/view.c:
  + eliminate "-n" option by simply reading the whole file.
  + implement page up/down commands.
+ add check in tput for init/reset operands to ensure those use a
  terminal.
+ improve manual pages which discuss chtype, cchar_t types and the
  attribute values which can be stored in those types.
+ correct array-index when parsing "-T" command-line option in tabs
  program.
+ modify demo_new_pair.c to pass extended pairs to setcchar().
+ add test/dots_xcurses.c to illustrate a different approach used for
  extended colors which can be contrasted with dots_curses.c.
+ add a check in tic to note when a description uses non-mandatory
  delays without xon_xoff.  This is not an error, but some descriptions
  for a terminal emulator may use the combination incorrectly.

48 files changed:
MANIFEST
NEWS
VERSION
dist.mk
doc/html/man/adacurses6-config.1.html
doc/html/man/captoinfo.1m.html
doc/html/man/clear.1.html
doc/html/man/curs_attr.3x.html
doc/html/man/curs_inch.3x.html
doc/html/man/form.3x.html
doc/html/man/infocmp.1m.html
doc/html/man/infotocap.1m.html
doc/html/man/menu.3x.html
doc/html/man/ncurses.3x.html
doc/html/man/ncurses6-config.1.html
doc/html/man/panel.3x.html
doc/html/man/tabs.1.html
doc/html/man/terminfo.5.html
doc/html/man/tic.1m.html
doc/html/man/toe.1m.html
doc/html/man/tput.1.html
doc/html/man/tset.1.html
man/curs_attr.3x
man/curs_inch.3x
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
progs/progs.priv.h
progs/tabs.c
progs/tic.c
progs/tput.c
test/demo_new_pair.c
test/dots.c
test/dots_curses.c
test/dots_mvcur.c
test/dots_termcap.c
test/dots_xcurses.c [new file with mode: 0644]
test/echochar.c
test/modules
test/programs
test/test.priv.h
test/test_termattrs.c
test/test_vid_puts.c
test/test_vidputs.c
test/view.c

index 801598ecb68d0510c6b172ba8dbec99055fa34cc..eb0593caa7c6203c4cd70d7042fdeb287547949a 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
 ./test/dots_curses.c
 ./test/dots_mvcur.c
 ./test/dots_termcap.c
 ./test/dots_curses.c
 ./test/dots_mvcur.c
 ./test/dots_termcap.c
+./test/dots_xcurses.c
 ./test/echochar.c
 ./test/edit_field.c
 ./test/edit_field.h
 ./test/echochar.c
 ./test/edit_field.c
 ./test/edit_field.h
diff --git a/NEWS b/NEWS
index 9892f2e3044b80ec9417482bc65bdb743c4a2229..64be9a918ae29a92e864ab1aecc8bbb57f3f1d1d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.2966 2017/10/07 23:37:31 tom Exp $
+-- $Id: NEWS,v 1.2975 2017/10/14 23:49:52 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,23 @@ 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.
 
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20171014
+       + minor cleanup to test/view.c:
+         + eliminate "-n" option by simply reading the whole file.
+         + implement page up/down commands.
+       + add check in tput for init/reset operands to ensure those use a
+         terminal.
+       + improve manual pages which discuss chtype, cchar_t types and the
+         attribute values which can be stored in those types.
+       + correct array-index when parsing "-T" command-line option in tabs
+         program.
+       + modify demo_new_pair.c to pass extended pairs to setcchar().
+       + add test/dots_xcurses.c to illustrate a different approach used for
+         extended colors which can be contrasted with dots_curses.c.
+       + add a check in tic to note when a description uses non-mandatory
+         delays without xon_xoff.  This is not an error, but some descriptions
+         for a terminal emulator may use the combination incorrectly.
+
 20171007
        + modify "-T" option of clear and tput to call use_tioctl() to obtain
          the operating system's notion of the screensize if possible.
 20171007
        + modify "-T" option of clear and tput to call use_tioctl() to obtain
          the operating system's notion of the screensize if possible.
diff --git a/VERSION b/VERSION
index 7264566f566b1002448723f3eff6d1e38f0da65b..a09a8abcde01c809e4ac8737e45dda19865ed4b0 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:9  6.0     20171007
+5:0:9  6.0     20171014
diff --git a/dist.mk b/dist.mk
index 83cbf58337736a63b84cc5d67224ed1f6ba40dff..04f266b3e2b0debf871f36f43587c693d8f98678 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.1186 2017/10/02 01:01:40 tom Exp $
+# $Id: dist.mk,v 1.1187 2017/10/08 23:38:02 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
 # 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
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 6
 NCURSES_MINOR = 0
-NCURSES_PATCH = 20171007
+NCURSES_PATCH = 20171014
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 7468ce6228ef5a5a44bfe1ce711f91742177b015..caa27fd0ba554741c55178b9132725a99be5ad0c 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
 
 </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.0 (patch 20171007).
+       This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20171014).
 
 
 
 
 
 
index be498ab5aae5862ae68e9518414dcf0cb75d2456..968588ec71d027dfd4c8f72d00937356569c1439 100644 (file)
 </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>
 
 </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.0 (patch 20171007).
+       This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20171014).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 85a830530add243398f27391323e4905afb25ede..bbefd61c50d1e65efbd2a9bc8ef282bb630d5526 100644 (file)
 </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>
 
 </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.0 (patch 20171007).
+       This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20171014).
 
 
 
 
 
 
index f359177eafb2575cacbd3ed6209644b171b1b851..56844fd7375cf9c5f155a2b91d58776d387d1741 100644 (file)
@@ -27,7 +27,8 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_attr.3x,v 1.53 2017/03/28 23:31:39 tom Exp @
+  * @Id: curs_attr.3x,v 1.60 2017/10/14 20:01:13 tom Exp @
+  * ---------------------------------------------------------------------------
   * attr_get
   * .br
   * .br
   * attr_get
   * .br
   * .br
   * ---------------------------------------------------------------------------
   * ---------------------------------------------------------------------------
   * ---------------------------------------------------------------------------
   * ---------------------------------------------------------------------------
   * ---------------------------------------------------------------------------
   * ---------------------------------------------------------------------------
+  * ---------------------------------------------------------------------------
+  * ---------------------------------------------------------------------------
+  * ---------------------------------------------------------------------------
+  * ---------------------------------------------------------------------------
+  * ---------------------------------------------------------------------------
+  * ---------------------------------------------------------------------------
+  * ---------------------------------------------------------------------------
+  * ---------------------------------------------------------------------------
 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <HTML>
 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <HTML>
        support more than 256 color pairs.
 
 
        support more than 256 color pairs.
 
 
+</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
+       X/Open Curses is largely based  on  SVr4  curses,  adding  support  for
+       "wide-characters"  (not  specific to Unicode).  Some of the X/Open dif-
+       ferences from SVr4 curses address the way video attributes can  be  ap-
+       plied  to  wide-characters.   But aside from that, <STRONG>attrset</STRONG> and <STRONG>attr_set</STRONG>
+       are similar.  SVr4 curses provided the basic features for  manipulating
+       video  attributes.  However, earlier versions of curses provided a part
+       of these features.
+
+       As seen in 2.8BSD, curses assumed 7-bit characters,  using  the  eighth
+       bit  of  a byte to represent the <EM>standout</EM> feature (often implemented as
+       bold and/or reverse video).  The BSD curses library provided  functions
+       <STRONG>standout</STRONG>  and  <STRONG>standend</STRONG> which were carried along into X/Open Curses due
+       to their pervasive use in legacy applications.
+
+       Some terminals in the 1980s  could  support  a  variety  of  video  at-
+       tributes,  although the BSD curses library could do nothing with those.
+       System V (1983) provided an improved curses library.  It defined the <STRONG>A_</STRONG>
+       symbols  for  use  by  applications to manipulate the other attributes.
+       There are few useful references for the chronology.
+
+       Goodheart's book <EM>UNIX</EM> <EM>Curses</EM> <EM>Explained</EM> (1991)  describes  SVr3  (1987),
+       commenting on several functions:
+
+       <STRONG>o</STRONG>   the  <STRONG>attron</STRONG>,  <STRONG>attroff</STRONG>, <STRONG>attrset</STRONG> functions (and most of the functions
+           found in SVr4 but not in BSD curses) were introduced by System V,
+
+       <STRONG>o</STRONG>   the alternate character set feature with <STRONG>A_ALTCHARSET</STRONG> was added  in
+           SVr2 and improved in SVr3 (by adding <STRONG>acs_map[]</STRONG>),
+
+       <STRONG>o</STRONG>   <STRONG>start_color</STRONG>  and  related color-functions were introduced by System
+           V.3.2,
+
+       <STRONG>o</STRONG>   pads, soft-keys were added in SVr3, and
+
+       Goodheart did not mention the background character or the <STRONG>cchar_t</STRONG> type.
+       Those are respectively SVr4 and X/Open features.  He did mention the <STRONG>A_</STRONG>
+       constants, but did not indicate their values.  Those were not the  same
+       in different systems, even for those marked as System V.
+
+       Different  Unix  systems  used  different  sizes  for the bit-fields in
+       <STRONG>chtype</STRONG> for <EM>characters</EM> and <EM>colors</EM>, and took into account  the  different
+       integer sizes (32-bit versus 64-bit).
+
+       This  table  showing  the number of bits for <STRONG>A_COLOR</STRONG> and <STRONG>A_CHARTEXT</STRONG> was
+       gleaned from the curses header files for various operating systems  and
+       architectures.   The inferred architecture and notes reflect the format
+       and size of the defined constants as well as clues such as  the  alter-
+       nate  character  set implementation.  A 32-bit library can be used on a
+       64-bit system, but not necessarily the reverse.
+
+              <EM>Year</EM>   <EM>System</EM>        <EM>Arch</EM>    <EM>Color</EM>   <EM>Char</EM>   <EM>Notes</EM>
+              ----------------------------------------------------------------
+              1992   Solaris 5.2   32      6       17     SVr4 curses
+              1992   HPUX 9        32      no      8      SVr2 curses
+              1992   AIX 3.2       32      no      23     SVr2 curses
+              1994   OSF/1 r3      32      no      23     SVr2 curses
+              1995   HP-UX 10.00   32      6       16     SVr3 "curses_colr"
+              1995   HP-UX 10.00   32      6       8      SVr4, X/Open curses
+              1995   Solaris 5.4   32/64   7       16     X/Open curses
+              1996   AIX 4.2       32      7       16     X/Open curses
+              1996   OSF/1 r4      32      6       16     X/Open curses
+              1997   HP-UX 11.00   32      6       8      X/Open curses
+              2000   U/Win         32/64   7/31    16     uses <STRONG>chtype</STRONG>
+
+       Notes:
+
+          Regarding HP-UX,
+
+          <STRONG>o</STRONG>   HP-UX 10.20 (1996) added support for 64-bit  PA-RISC  processors
+              in 1996.
+
+          <STRONG>o</STRONG>   HP-UX  10.30 (1997) marked "curses_colr" obsolete.  That version
+              of curses was dropped with HP-UX 11.30 in 2006.
+
+          Regarding OSF/1 (and Tru64),
+
+          <STRONG>o</STRONG>   These used 64-bit hardware.  Like ncurses, the OSF/1 curses  in-
+              terface is not customized for 32-bit and 64-bit versions.
+
+          <STRONG>o</STRONG>   Unlike other systems which evolved from AT&amp;T code, OSF/1 provid-
+              ed a new implementation for X/Open curses.
+
+          Regarding Solaris,
+
+          <STRONG>o</STRONG>   The initial release of Solaris was in 1992.
+
+          <STRONG>o</STRONG>   The <EM>xpg4</EM> (X/Open) curses was developed by MKS from 1990 to 1995.
+              Sun's copyright began in 1996.
+
+          <STRONG>o</STRONG>   Sun updated the X/Open curses interface after 64-bit support was
+              introduced in 1997, but did not modify the  SVr4  curses  inter-
+              face.
+
+          Regarding U/Win,
+
+          <STRONG>o</STRONG>   Development  of  the  curses  library  began in 1991, stopped in
+              2000.
+
+          <STRONG>o</STRONG>   Color support was added in 1998.
+
+          <STRONG>o</STRONG>   The library uses only <STRONG>chtype</STRONG> (no <STRONG>cchar_t</STRONG>).
+
+       Once X/Open curses was adopted in the mid-1990s, the  constraint  of  a
+       32-bit interface with many colors and wide-characters for <STRONG>chtype</STRONG> became
+       a moot point.  The <STRONG>cchar_t</STRONG> structure (whose size and  members  are  not
+       specified in X/Open Curses) could be extended as needed.
+
+       Other interfaces are rarely used now:
+
+       <STRONG>o</STRONG>   BSD  curses was improved slightly in 1993/1994 using Keith Bostic's
+           modification to make the library 8-bit clean  for  <STRONG>nvi</STRONG>.   He  moved
+           <EM>standout</EM> attribute to a structure member.
+
+           The  resulting  4.4BSD curses was replaced by ncurses over the next
+           ten years.
+
+       <STRONG>o</STRONG>   U/Win is rarely used now.
+
+
 </PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
        This implementation provides the <STRONG>A_ITALIC</STRONG> attribute for terminals which
        have  the  <STRONG>enter_italics_mode</STRONG> (<STRONG>sitm</STRONG>) and <STRONG>exit_italics_mode</STRONG> (<STRONG>ritm</STRONG>) capa-
 </PRE><H2><a name="h2-EXTENSIONS">EXTENSIONS</a></H2><PRE>
        This implementation provides the <STRONG>A_ITALIC</STRONG> attribute for terminals which
        have  the  <STRONG>enter_italics_mode</STRONG> (<STRONG>sitm</STRONG>) and <STRONG>exit_italics_mode</STRONG> (<STRONG>ritm</STRONG>) capa-
               <STRONG>WA_BOLD</STRONG>         Extra bright or bold
               <STRONG>WA_ALTCHARSET</STRONG>   Alternate character set
 
               <STRONG>WA_BOLD</STRONG>         Extra bright or bold
               <STRONG>WA_ALTCHARSET</STRONG>   Alternate character set
 
-       The  XSI  curses  standard specifies that each pair of corresponding <STRONG>A_</STRONG>
-       and <STRONG>WA_</STRONG>-using functions operates on the same current-highlight informa-
-       tion.
+       XSI  curses  does not assign values to these symbols, nor does it state
+       whether or not they are related to the similarly-named A_NORMAL, etc.:
+
+       <STRONG>o</STRONG>   The XSI curses standard specifies that each pair  of  corresponding
+           <STRONG>A_</STRONG>  and  <STRONG>WA_</STRONG>-using functions operates on the same current-highlight
+           information.
+
+       <STRONG>o</STRONG>   However, in some implementations, those symbols have unrelated val-
+           ues.
+
+           For example, the Solaris <EM>xpg4</EM> (X/Open) curses declares <STRONG>attr_t</STRONG> to be
+           an unsigned short integer (16-bits), while <STRONG>chtype</STRONG> is a unsigned in-
+           teger  (32-bits).   The <STRONG>WA_</STRONG> symbols in this case are different from
+           the <STRONG>A_</STRONG> symbols because they are used for a smaller  datatype  which
+           does not represent <STRONG>A_CHARTEXT</STRONG> or <STRONG>A_COLOR</STRONG>.
+
+           In this implementation (as in many others), the values happen to be
+           the same because it simplifies copying information  between  <STRONG>chtype</STRONG>
+           and <STRONG>cchar_t</STRONG> variables.
 
        The XSI standard extended conformance level adds new highlights <STRONG>A_HORI-</STRONG>
        <STRONG>ZONTAL</STRONG>, <STRONG>A_LEFT</STRONG>, <STRONG>A_LOW</STRONG>, <STRONG>A_RIGHT</STRONG>, <STRONG>A_TOP</STRONG>,  <STRONG>A_VERTICAL</STRONG>  (and  corresponding
 
        The XSI standard extended conformance level adds new highlights <STRONG>A_HORI-</STRONG>
        <STRONG>ZONTAL</STRONG>, <STRONG>A_LEFT</STRONG>, <STRONG>A_LOW</STRONG>, <STRONG>A_RIGHT</STRONG>, <STRONG>A_TOP</STRONG>,  <STRONG>A_VERTICAL</STRONG>  (and  corresponding
 </li>
 <li><a href="#h2-VIDEO-ATTRIBUTES">VIDEO ATTRIBUTES</a></li>
 <li><a href="#h2-NOTES">NOTES</a></li>
 </li>
 <li><a href="#h2-VIDEO-ATTRIBUTES">VIDEO ATTRIBUTES</a></li>
 <li><a href="#h2-NOTES">NOTES</a></li>
+<li><a href="#h2-HISTORY">HISTORY</a></li>
 <li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li>
 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
 <li><a href="#h2-EXTENSIONS">EXTENSIONS</a></li>
 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
index e360994a93edefeebd433b5b8af0579a952aec45..6d376744b8bb26b30fbeaf84e1a81e1ae5c46dd3 100644 (file)
@@ -1,7 +1,7 @@
 <!-- 
   * t
   ****************************************************************************
 <!-- 
   * t
   ****************************************************************************
-  * Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
+  * Copyright (c) 1998-2010,2017 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            *
   *                                                                          *
   * Permission is hereby granted, free of charge, to any person obtaining a  *
   * copy of this software and associated documentation files (the            *
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_inch.3x,v 1.17 2010/12/04 18:36:44 tom Exp @
+  * @Id: curs_inch.3x,v 1.18 2017/10/14 19:14:47 tom Exp @
 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <HTML>
 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <HTML>
        <STRONG>wmove</STRONG>, and return an error if the position is outside the window, or if
        the window pointer is null.
 
        <STRONG>wmove</STRONG>, and return an error if the position is outside the window, or if
        the window pointer is null.
 
+       The  <STRONG>winch</STRONG>  function  does  not  return an error if the window contains
+       characters larger than 8-bits (255).  Only the low-order 8 bits of  the
+       character are used by <STRONG>winch</STRONG>.
+
 
 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
        Note that all of these routines may be macros.
 
 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
        Note that all of these routines may be macros.
 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
        These functions are described in the XSI Curses standard, Issue 4.
 
 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
        These functions are described in the XSI Curses standard, Issue 4.
 
+       Very  old systems (before standardization) provide a different function
+       with the same name:
+
+       <STRONG>o</STRONG>   The <STRONG>winch</STRONG> function was part of the  original  BSD  curses  library,
+           which   stored   a  7-bit  character  combined  with  the  <EM>standout</EM>
+           attribute.
+
+           In BSD curses, <STRONG>winch</STRONG> returned only the character  (as  an  integer)
+           with the <EM>standout</EM> attribute removed.
+
+       <STRONG>o</STRONG>   System  V  curses  added support for several video attributes which
+           could be combined with characters in the window.
+
+           Reflecting this improvment, the function was altered to return  the
+           character combined with all video attributes in a <STRONG>chtype</STRONG> value.
+
+       X/Open Curses does not specify the size and layout of attributes, color
+       and character values in <STRONG>chtype</STRONG>; it is  implementation-dependent.   This
+       implementation  uses 8 bits for character values.  An application using
+       more bits, e.g., a Unicode value, should use the wide-character equiva-
+       lents to these functions.
+
 
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</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="ncurses.3x.html">curses(3x)</A></STRONG>
+            gives an overview of the WINDOW and <STRONG>chtype</STRONG> data types.
+
+       <STRONG><A HREF="curs_attr.3x.html">curs_attr(3x)</A></STRONG>
+            goes  into more detail, pointing out portability problems and con-
+            straints on the use of <STRONG>chtype</STRONG> for returning window information.
 
 
-       Comparable  functions  in  the  wide-character  (ncursesw)  library are
-       described in <STRONG><A HREF="curs_in_wch.3x.html">curs_in_wch(3x)</A></STRONG>.
+       <STRONG><A HREF="curs_in_wch.3x.html">curs_in_wch(3x)</A></STRONG>
+            describes comparable functions for the  wide-character  (ncursesw)
+            library.
 
 
 
 
 
 
index da0733f816d47a222a0764e35b058fde59fedfe2..8a6a1fcd4e85a8cfc8d8a16ead0380a60f066783 100644 (file)
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>  and  related  pages  whose names begin "form_" for detailed
        descriptions of the entry points.
 
        <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.0 (patch 20171007).
+       This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20171014).
 
 
 
 
 
 
index 210097bd401e0c47453f28bf967beb9341381495..8658f77719fc92fd5b8060120a93d7c83ddbb126 100644 (file)
 
        http://invisible-island.net/ncurses/tctest.html
 
 
        http://invisible-island.net/ncurses/tctest.html
 
-       This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20171007).
+       This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20171014).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index f3c7db5313129cbab8db9653767f51d94afbff56..3006556b46e0921b850fdeb71009ac6c374e8560 100644 (file)
@@ -85,7 +85,7 @@
 </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>
 
 </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.0 (patch 20171007).
+       This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20171014).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 7843459d6e1ca6c8096b24645f42909650fe6ce6..9d1f818b77667273045802ef1ba30658039260c1 100644 (file)
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names  begin  "menu_"  for  detailed
        descriptions of the entry points.
 
        <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.0 (patch 20171007).
+       This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20171014).
 
 
 
 
 
 
index 69069d51ad4a4cb945809416e2c41a7e16e3b34c..17a0feadad7033cc414382b24a9baf9d636a82a5 100644 (file)
@@ -59,7 +59,7 @@
        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.
        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.0 (patch 20171007).
+       This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20171014).
 
        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
 
        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
index fc93f9369fbdc91dbd5783410fdfea447eae53a5..19ce50e1970c24b49e3bc2b90fa4c23103b50424 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
 
 </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.0 (patch 20171007).
+       This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20171014).
 
 
 
 
 
 
index 216698b6ae9c3895dc2e981eb82f0f9cb230014a..ab84cd471c376fad66624d37c882e9f3f1275746 100644 (file)
 </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>,
 
 </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.0 (patch 20171007).
+       This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20171014).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 073235edc3abc5c791b3bb30ce1ae1b176707d67..86255f618f64eb369a9a27d13b0ccb9485c78e38 100644 (file)
 </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>.
 
 </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.0 (patch 20171007).
+       This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20171014).
 
 
 
 
 
 
index d0b50f37901a3ef7d024c02ea388a74819e24c57..7e52bd52a7ce62c8623d1d193628612bc4fe5195 100644 (file)
@@ -74,7 +74,7 @@
        <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
        <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.0 (patch 20171007).
+       <STRONG>ncurses</STRONG> version 6.0 (patch 20171014).
 
 
 </PRE><H3><a name="h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></H3><PRE>
 
 
 </PRE><H3><a name="h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></H3><PRE>
index cd87c08497d6069375531ba36375af4bb9dba31e..27e64e351c454cdd56b57e4432ed751886b34f7a 100644 (file)
        <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>.
 
        <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.0 (patch 20171007).
+       This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20171014).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 7c80703585166ba927b929dce4f74bc1ee13978a..718f40aa0e6c6190777d041ed789e55d5842d130 100644 (file)
        <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>.
 
        <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.0 (patch 20171007).
+       This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20171014).
 
 
 
 
 
 
index eafd4ba362f98a9921bda415608abad7c98750b2..a855831c8c5b7f7f7a497f6108bb14ff6895653c 100644 (file)
 </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>.
 
 </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.0 (patch 20171007).
+       This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20171014).
 
 
 
 
 
 
index d49ef9e5af28cc02cacd17a2a86c019cdb9aabe9..40b12eb3214ac200825b303ee577121872616121 100644 (file)
        <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>
 
        <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.0 (patch 20171007).
+       This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20171014).
 
 
 
 
 
 
index 4d336083347498ebaa5b94a0a8b4d81ecc5c864f..c3113e151e9c72faf09b9775fe801a4736fa7e6c 100644 (file)
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_attr.3x,v 1.53 2017/03/28 23:31:39 tom Exp $
+.\" $Id: curs_attr.3x,v 1.60 2017/10/14 20:01:13 tom Exp $
 .TH curs_attr 3X ""
 .TH curs_attr 3X ""
+.ie \n(.g .ds `` \(lq
+.el       .ds `` ``
+.ie \n(.g .ds '' \(rq
+.el       .ds '' ''
 .de bP
 .IP \(bu 4
 ..
 .na
 .hy 0
 .de bP
 .IP \(bu 4
 ..
 .na
 .hy 0
+.\" ---------------------------------------------------------------------------
 .SH NAME
 .\" attr_get
 \fBattr_get\fR,
 .SH NAME
 .\" attr_get
 \fBattr_get\fR,
@@ -67,6 +72,7 @@
 \fBwstandout\fR \- \fBcurses\fR character and window attribute control routines
 .ad
 .hy
 \fBwstandout\fR \- \fBcurses\fR character and window attribute control routines
 .ad
 .hy
+.\" ---------------------------------------------------------------------------
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
 .SH SYNOPSIS
 \fB#include <curses.h>\fR
 .sp
 \fBint standout(void);\fR
 .br
 \fBint wstandout(WINDOW *\fP\fIwin\fP\fB);\fR
 \fBint standout(void);\fR
 .br
 \fBint wstandout(WINDOW *\fP\fIwin\fP\fB);\fR
+.\" ---------------------------------------------------------------------------
 .SH DESCRIPTION
 .PP
 These routines manipulate the current attributes of the named window,
 .SH DESCRIPTION
 .PP
 These routines manipulate the current attributes of the named window,
@@ -260,6 +267,7 @@ l l .
 The return values of many of these routines are not meaningful (they are
 implemented as macro-expanded assignments and simply return their argument).
 The SVr4 manual page claims (falsely) that these routines always return \fB1\fR.
 The return values of many of these routines are not meaningful (they are
 implemented as macro-expanded assignments and simply return their argument).
 The SVr4 manual page claims (falsely) that these routines always return \fB1\fR.
+.\" ---------------------------------------------------------------------------
 .SH NOTES
 These functions may be macros:
 .sp
 .SH NOTES
 These functions may be macros:
 .sp
@@ -274,6 +282,137 @@ The alternate functions such as \fBcolor_set\fP can pass a color pair
 value directly.
 However, ncurses ABI 4 and 5 simply OR this value within the alternate functions.
 You must use ncurses ABI 6 to support more than 256 color pairs.
 value directly.
 However, ncurses ABI 4 and 5 simply OR this value within the alternate functions.
 You must use ncurses ABI 6 to support more than 256 color pairs.
+.\" ---------------------------------------------------------------------------
+.SH HISTORY
+X/Open Curses is largely based on SVr4 curses,
+adding support for \*(``wide-characters\*('' (not specific to Unicode).
+Some of the X/Open differences from SVr4 curses address the way
+video attributes can be applied to wide-characters.
+But aside from that, \fBattrset\fP and \fBattr_set\fP are similar.
+SVr4 curses provided the basic features for manipulating video attributes.
+However, earlier versions of curses provided a part of these features.
+.PP
+As seen in 2.8BSD, curses assumed 7-bit characters,
+using the eighth bit of a byte to represent the \fIstandout\fP
+feature (often implemented as bold and/or reverse video).
+The BSD curses library provided functions \fBstandout\fP and \fBstandend\fP
+which were carried along into X/Open Curses due to their pervasive use
+in legacy applications.
+.PP
+Some terminals in the 1980s could support a variety of video attributes,
+although the BSD curses library could do nothing with those.
+System V (1983) provided an improved curses library.
+It defined the \fBA_\fP symbols for use by applications to manipulate the
+other attributes.
+There are few useful references for the chronology.
+.PP
+Goodheart's book
+\fIUNIX Curses Explained\fP (1991) describes SVr3 (1987),
+commenting on several functions:
+.bP
+the \fBattron\fP, \fBattroff\fP, \fBattrset\fP functions
+(and most of the functions found in SVr4 but not in BSD curses) were
+introduced by System V,
+.bP
+the alternate character set feature with \fBA_ALTCHARSET\fP was
+added in SVr2 and improved in SVr3 (by adding \fBacs_map[]\fP),
+.bP
+\fBstart_color\fP and related color-functions were introduced by System V.3.2,
+.bP
+pads, soft-keys were added in SVr3, and
+.PP
+Goodheart did not mention the background character or the \fBcchar_t\fP type.
+Those are respectively SVr4 and X/Open features.
+He did mention the \fBA_\fP constants, but did not indicate their values.
+Those were not the same in different systems,
+even for those marked as System V.
+.PP
+Different Unix systems used different sizes for the bit-fields in \fBchtype\fP
+for \fIcharacters\fP and \fIcolors\fP, and took into account the different
+integer sizes (32-bit versus 64-bit).
+.PP
+This table showing the number of bits for \fBA_COLOR\fP
+and \fBA_CHARTEXT\fP
+was gleaned from the curses header files for
+various operating systems and architectures.
+The inferred architecture and notes reflect
+the format and size of the defined constants
+as well as clues such as the alternate character set implementation.
+A 32-bit library can be used on a 64-bit system,
+but not necessarily the reverse.
+.RS
+.TS
+l l l l l l
+_ _ _ _ _ _
+l l l l l l .
+\fIYear\fR     \fISystem\fR    \fIArch\fP      \fIColor\fR     \fIChar\fR      \fINotes\fR
+1992   Solaris 5.2     32      6       17      SVr4 curses
+1992   HPUX 9  32      no      8       SVr2 curses
+1992   AIX 3.2 32      no      23      SVr2 curses
+1994   OSF/1 r3        32      no      23      SVr2 curses
+1995   HP-UX 10.00     32      6       16      SVr3 \*(``curses_colr\*('' 
+1995   HP-UX 10.00     32      6       8       SVr4, X/Open curses
+1995   Solaris 5.4     32/64   7       16      X/Open curses
+1996   AIX 4.2 32      7       16      X/Open curses
+1996   OSF/1 r4        32      6       16      X/Open curses
+1997   HP-UX 11.00     32      6       8       X/Open curses
+2000   U/Win   32/64   7/31    16      uses \fBchtype\fP
+.TE
+.RE
+.PP
+Notes:
+.RS 3
+.PP
+Regarding HP-UX,
+.bP
+HP-UX 10.20 (1996) added support for 64-bit PA-RISC processors in 1996.
+.bP
+HP-UX 10.30 (1997) marked \*(``curses_colr\*('' obsolete.
+That version of curses was dropped with HP-UX 11.30 in 2006.
+.PP
+Regarding OSF/1 (and Tru64),
+.bP
+These used 64-bit hardware.
+Like ncurses, the OSF/1 curses interface is not customized for 32-bit
+and 64-bit versions.
+.bP
+Unlike other systems which evolved from AT&T code,
+OSF/1 provided a new implementation for X/Open curses.
+.PP
+Regarding Solaris,
+.bP
+The initial release of Solaris was in 1992.
+.bP
+The \fIxpg4\fP (X/Open) curses was developed by MKS from 1990 to 1995.
+Sun's copyright began in 1996.
+.bP
+Sun updated the X/Open curses interface after 64-bit support was introduced in 1997,
+but did not modify the SVr4 curses interface.
+.PP
+Regarding U/Win,
+.bP
+Development of the curses library began in 1991, stopped in 2000. 
+.bP
+Color support was added in 1998.
+.bP
+The library uses only \fBchtype\fP (no \fBcchar_t\fP).
+.RE
+.PP
+Once X/Open curses was adopted in the mid-1990s, the constraint of
+a 32-bit interface with many colors and wide-characters for \fBchtype\fP
+became a moot point.  The \fBcchar_t\fP structure (whose size and
+members are not specified in X/Open Curses) could be extended as needed.
+.PP
+Other interfaces are rarely used now:
+.bP
+BSD curses was improved slightly in 1993/1994 using Keith Bostic's
+modification to make the library 8-bit clean for \fBnvi\fP.
+He moved \fIstandout\fP attribute to a structure member.
+.IP
+The resulting 4.4BSD curses was replaced by ncurses over the next ten years.
+.bP
+U/Win is rarely used now.
+.\" ---------------------------------------------------------------------------
 .SH EXTENSIONS
 .PP
 This implementation provides the \fBA_ITALIC\fP attribute for terminals
 .SH EXTENSIONS
 .PP
 This implementation provides the \fBA_ITALIC\fP attribute for terminals
@@ -307,6 +446,7 @@ The remaining functions which have \fIopts\fP,
 but do not manipulate color,
 e.g., \fBwattr_on\fP and \fBwattr_off\fP
 are not used by this implementation except to check that they are \fBNULL\fP.
 but do not manipulate color,
 e.g., \fBwattr_on\fP and \fBwattr_off\fP
 are not used by this implementation except to check that they are \fBNULL\fP.
+.\" ---------------------------------------------------------------------------
 .SH PORTABILITY
 These functions are supported in the XSI Curses standard, Issue 4.
 The standard defined the dedicated type for highlights,
 .SH PORTABILITY
 These functions are supported in the XSI Curses standard, Issue 4.
 The standard defined the dedicated type for highlights,
@@ -355,9 +495,26 @@ l l .
 .TE
 .RE
 .PP
 .TE
 .RE
 .PP
+XSI curses does not assign values to these symbols,
+nor does it state whether or not they are related to the
+similarly-named A_NORMAL, etc.:
+.bP
 The XSI curses standard specifies that each pair of corresponding \fBA_\fR
 and \fBWA_\fR-using functions operates on the same current-highlight
 information.
 The XSI curses standard specifies that each pair of corresponding \fBA_\fR
 and \fBWA_\fR-using functions operates on the same current-highlight
 information.
+.bP
+However, in some implementations, those symbols have unrelated values.
+.IP
+For example, the Solaris \fIxpg4\fP (X/Open) curses declares
+\fBattr_t\fP to be an unsigned short integer (16-bits),
+while \fBchtype\fP is a unsigned integer (32-bits).
+The \fBWA_\fP symbols in this case are different from the \fBA_\fP symbols
+because they are used for a smaller datatype which does not
+represent \fBA_CHARTEXT\fP or \fBA_COLOR\fP.
+.IP
+In this implementation (as in many others), the values happen to be
+the same because it simplifies copying information between
+\fBchtype\fP and \fBcchar_t\fP variables.
 .PP
 The XSI standard extended conformance level adds new highlights
 \fBA_HORIZONTAL\fR, \fBA_LEFT\fR, \fBA_LOW\fR, \fBA_RIGHT\fR, \fBA_TOP\fR,
 .PP
 The XSI standard extended conformance level adds new highlights
 \fBA_HORIZONTAL\fR, \fBA_LEFT\fR, \fBA_LOW\fR, \fBA_RIGHT\fR, \fBA_TOP\fR,
@@ -365,6 +522,7 @@ The XSI standard extended conformance level adds new highlights
 As of August 2013,
 no known terminal provides these highlights
 (i.e., via the \fBsgr1\fP capability).
 As of August 2013,
 no known terminal provides these highlights
 (i.e., via the \fBsgr1\fP capability).
+.\" ---------------------------------------------------------------------------
 .SH RETURN VALUE
 All routines return the integer \fBOK\fR on success, or \fBERR\fP on failure.
 .PP
 .SH RETURN VALUE
 All routines return the integer \fBOK\fR on success, or \fBERR\fP on failure.
 .PP
@@ -383,6 +541,7 @@ used for retrieving attribute or color-pair values is \fBNULL\fP.
 Functions with a "mv" prefix first perform a cursor movement using
 \fBwmove\fP, and return an error if the position is outside the window,
 or if the window pointer is null.
 Functions with a "mv" prefix first perform a cursor movement using
 \fBwmove\fP, and return an error if the position is outside the window,
 or if the window pointer is null.
+.\" ---------------------------------------------------------------------------
 .SH SEE ALSO
 .na
 \fBcurses\fR(3X),
 .SH SEE ALSO
 .na
 \fBcurses\fR(3X),
index 7e1e3b439177b5694afa9930506c02441138bcbc..4fe29e430584225320f0b97977bf9d885c08eb12 100644 (file)
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2010,2017 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            *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_inch.3x,v 1.17 2010/12/04 18:36:44 tom Exp $
+.\" $Id: curs_inch.3x,v 1.18 2017/10/14 19:14:47 tom Exp $
 .TH curs_inch 3X ""
 .TH curs_inch 3X ""
+.de bP
+.IP \(bu 4
+..
 .SH NAME
 \fBinch\fR,
 \fBwinch\fR,
 .SH NAME
 \fBinch\fR,
 \fBwinch\fR,
@@ -65,13 +68,44 @@ l l .
 Functions with a "mv" prefix first perform a cursor movement using
 \fBwmove\fP, and return an error if the position is outside the window,
 or if the window pointer is null.
 Functions with a "mv" prefix first perform a cursor movement using
 \fBwmove\fP, and return an error if the position is outside the window,
 or if the window pointer is null.
+.PP
+The \fBwinch\fP function does not return an error if the window contains
+characters larger than 8-bits (255).
+Only the low-order 8 bits of the character are used by \fBwinch\fP.
 .SH NOTES
 Note that all of these routines may be macros.
 .SH PORTABILITY
 These functions are described in the XSI Curses standard, Issue 4.
 .SH NOTES
 Note that all of these routines may be macros.
 .SH PORTABILITY
 These functions are described in the XSI Curses standard, Issue 4.
-.SH SEE ALSO
-\fBcurses\fR(3X).
 .PP
 .PP
-Comparable functions in the wide-character (ncursesw) library are
-described in
-\fBcurs_in_wch\fR(3X).
+Very old systems (before standardization) provide a different function
+with the same name:
+.bP
+The \fBwinch\fP function was part of the original BSD curses library,
+which stored a 7-bit character combined with the \fIstandout\fP attribute.
+.IP
+In BSD curses, \fBwinch\fP returned only the character (as an integer)
+with the \fIstandout\fP attribute removed.
+.bP
+System V curses added support for several video attributes which
+could be combined with characters in the window.
+.IP
+Reflecting this improvment, the function was altered to return the
+character combined with all video attributes in a \fBchtype\fP value.
+.PP
+X/Open Curses does not specify 
+the size and layout of attributes, color and character values in
+\fBchtype\fP; it is implementation-dependent.
+This implementation uses 8 bits for character values.
+An application using more bits, e.g., a Unicode value,
+should use the wide-character equivalents to these functions.
+.SH SEE ALSO
+.TP 5
+\fBcurses\fR(3X)
+gives an overview of the WINDOW and \fBchtype\fP data types.
+.TP 5
+\fBcurs_attr\fR(3X)
+goes into more detail, pointing out portability problems and
+constraints on the use of \fBchtype\fP for returning window information.
+.TP 5
+\fBcurs_in_wch\fR(3X)
+describes comparable functions for the wide-character (ncursesw) library.
index cf73ff7ecbe1023cc36e543a8f36f7d615bf4b5d..65545df2bd5bcfe50f7860bd739e24d17db96bc6 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20171007) unstable; urgency=low
+ncurses6 (6.0+20171014) unstable; urgency=low
 
   * latest weekly patch
 
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 01 Oct 2017 21:01:40 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 08 Oct 2017 19:38:02 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index cf73ff7ecbe1023cc36e543a8f36f7d615bf4b5d..65545df2bd5bcfe50f7860bd739e24d17db96bc6 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20171007) unstable; urgency=low
+ncurses6 (6.0+20171014) unstable; urgency=low
 
   * latest weekly patch
 
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 01 Oct 2017 21:01:40 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 08 Oct 2017 19:38:02 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 086ea2b2325d03db5fdd892fa38165b4632c11cf..ceaef328c2f83e8fc12dd16f43a4398f21ba4aeb 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20171007) unstable; urgency=low
+ncurses6 (6.0+20171014) unstable; urgency=low
 
   * latest weekly patch
 
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 01 Oct 2017 21:01:40 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 08 Oct 2017 19:38:02 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 7992e15d603d78c912a316fbf054b201f18508fa..f300c595ce7f3ca5eeac01fdf07ef26dd6176600 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.234 2017/10/02 01:01:40 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.235 2017/10/08 23:38:02 tom Exp $\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "0"\r
 !define VERSION_YYYY  "2017"\r
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "0"\r
 !define VERSION_YYYY  "2017"\r
-!define VERSION_MMDD  "1007"\r
+!define VERSION_MMDD  "1014"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index d86b3153498fa8abf61dc8f4ef1c2c8bd7ce6543..3ed343755be8e76b5f8853a0fe519a5ccf137a2a 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.0
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.0
-Release: 20171007
+Release: 20171014
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 9ec39c8ef7f496d539fa75dded2120eb6f9b4ef3..4c1cd095d0af748a61518693e958b7729c7ab456 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.0
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.0
-Release: 20171007
+Release: 20171014
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 4b1b53811328494f858a4931ea096a8da06b861d..54e6215d28ed92b94dc4711ed9103c5fc4ca6c4f 100644 (file)
@@ -30,7 +30,7 @@
  *  Author: Thomas E. Dickey                    1997-on                     *
  ****************************************************************************/
 /*
  *  Author: Thomas E. Dickey                    1997-on                     *
  ****************************************************************************/
 /*
- * $Id: progs.priv.h,v 1.45 2017/10/07 20:42:10 tom Exp $
+ * $Id: progs.priv.h,v 1.46 2017/10/09 00:30:38 tom Exp $
  *
  *     progs.priv.h
  *
  *
  *     progs.priv.h
  *
@@ -138,6 +138,8 @@ extern int optind;
 #endif
 #endif
 
 #endif
 #endif
 
+#define VtoTrace(opt) (unsigned) ((opt > 0) ? opt : (opt == 0))
+
 /* error-returns for tput */
 #define ErrUsage       2
 #define ErrTermType    3
 /* error-returns for tput */
 #define ErrUsage       2
 #define ErrTermType    3
index 7e2d12dfa77ce8da29ba68f5575fd3e255d52c47..01325c329cb986e1101eb1110c4f1828380b8315 100644 (file)
@@ -38,7 +38,7 @@
 #include <progs.priv.h>
 #include <tty_settings.h>
 
 #include <progs.priv.h>
 #include <tty_settings.h>
 
-MODULE_ID("$Id: tabs.c,v 1.40 2017/10/07 19:34:58 tom Exp $")
+MODULE_ID("$Id: tabs.c,v 1.41 2017/10/12 22:42:08 tom Exp $")
 
 static void usage(void) GCC_NORETURN;
 
 
 static void usage(void) GCC_NORETURN;
 
@@ -458,7 +458,7 @@ main(int argc, char *argv[])
                    if (*++option != '\0') {
                        term_name = option;
                    } else {
                    if (*++option != '\0') {
                        term_name = option;
                    } else {
-                       term_name = argv[n++];
+                       term_name = argv[n];
                        option--;
                    }
                    option += ((int) strlen(option)) - 1;
                        option--;
                    }
                    option += ((int) strlen(option)) - 1;
index 3545c3c92a9b401db68eceddf5f99477e3f6d8d4..e89c477b68e534a8cffbc41962b3c00e3f8f9a8c 100644 (file)
@@ -48,7 +48,7 @@
 #include <parametrized.h>
 #include <transform.h>
 
 #include <parametrized.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.244 2017/09/20 00:39:37 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.247 2017/10/09 15:16:15 tom Exp $")
 
 #define STDIN_NAME "<stdin>"
 
 
 #define STDIN_NAME "<stdin>"
 
@@ -674,8 +674,6 @@ add_digit(int *target, int source)
     *target = (*target * 10) + (source - '0');
 }
 
     *target = (*target * 10) + (source - '0');
 }
 
-#define VtoTrace(opt) (unsigned) ((opt > 0) ? opt : (opt == 0))
-
 int
 main(int argc, char *argv[])
 {
 int
 main(int argc, char *argv[])
 {
@@ -1925,7 +1923,7 @@ skip_DECSCNM(const char *value, int *flag)
 }
 
 static void
 }
 
 static void
-check_delays(const char *name, const char *value)
+check_delays(TERMTYPE2 *tp, const char *name, const char *value)
 {
     const char *p, *q;
     const char *first = 0;
 {
     const char *p, *q;
     const char *first = 0;
@@ -1975,6 +1973,14 @@ check_delays(const char *name, const char *value)
                    _nc_warning("function-key %s has delay", name);
                } else if (proportional && !line_capability(name)) {
                    _nc_warning("non-line capability using proportional delay: %s", name);
                    _nc_warning("function-key %s has delay", name);
                } else if (proportional && !line_capability(name)) {
                    _nc_warning("non-line capability using proportional delay: %s", name);
+               } else if (!xon_xoff &&
+                          !mandatory &&
+                          strchr(_nc_first_name(tp->term_names), '+') == 0) {
+                   _nc_warning("%s in %s is used since no xon/xoff",
+                               (proportional
+                                ? "proportional delay"
+                                : "delay"),
+                               name);
                }
            } else {
                p = q - 1;      /* restart scan */
                }
            } else {
                p = q - 1;      /* restart scan */
@@ -2703,7 +2709,7 @@ check_termtype(TERMTYPE2 *tp, bool literal)
                parametrized[j] > 0) {
                check_params(tp, name, a, (j >= STRCOUNT));
            }
                parametrized[j] > 0) {
                check_params(tp, name, a, (j >= STRCOUNT));
            }
-           check_delays(ExtStrname(tp, (int) j, strnames), a);
+           check_delays(tp, ExtStrname(tp, (int) j, strnames), a);
            if (capdump) {
                check_infotocap(tp, (int) j, a);
            }
            if (capdump) {
                check_infotocap(tp, (int) j, a);
            }
index 76370cbcb74cc8cb3355da93d041d67a17935a03..fd051eb40571935edeedc4af7b92d759a1b0538d 100644 (file)
@@ -50,7 +50,7 @@
 #include <transform.h>
 #include <tty_settings.h>
 
 #include <transform.h>
 #include <tty_settings.h>
 
-MODULE_ID("$Id: tput.c,v 1.77 2017/10/07 23:51:01 tom Exp $")
+MODULE_ID("$Id: tput.c,v 1.78 2017/10/14 20:46:43 tom Exp $")
 
 #define PUTS(s)                fputs(s, stdout)
 
 
 #define PUTS(s)                fputs(s, stdout)
 
@@ -316,7 +316,10 @@ main(int argc, char **argv)
     }
 
     is_alias = (is_clear || is_reset || is_init);
     }
 
     is_alias = (is_clear || is_reset || is_init);
-    need_tty = (is_reset || is_init);
+    need_tty = ((is_reset || is_init) ||
+               (optind < argc &&
+                (!strcmp(argv[optind], "reset") ||
+                 !strcmp(argv[optind], "init"))));
 
     /*
      * Modify the argument list to omit the options we processed.
 
     /*
      * Modify the argument list to omit the options we processed.
index a0beb85c40dbfc2cb7c7c3dff98a4a984fcdff40..4067c8817ad3532f43174415272233e90fdbb860 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_new_pair.c,v 1.17 2017/09/28 23:17:56 tom Exp $
+ * $Id: demo_new_pair.c,v 1.18 2017/10/11 22:16:14 tom Exp $
  *
  * Demonstrate the alloc_pair() function.
  */
  *
  * Demonstrate the alloc_pair() function.
  */
@@ -323,7 +323,9 @@ main(int argc, char *argv[])
            break;
        wch[0] = use_wide ? 0xff03 : '#';
        wch[1] = 0;
            break;
        wch[0] = use_wide ? 0xff03 : '#';
        wch[1] = 0;
-       setcchar(&temp, wch, my_attrs, (short) my_pair, NULL);
+       setcchar(&temp, wch, my_attrs,
+                (short) my_pair,
+                (use_init ? NULL : (void *) &my_pair));
        /*
         * At the end of a page, move the cursor to the home position.
         */
        /*
         * At the end of a page, move the cursor to the home position.
         */
index f9d2ef693fc0aec70b67ecdbc58b14bf6709b23c..a03148bdb57f4b9c136273b95a3709cb4fbec2d5 100644 (file)
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey <dickey@clark.net> 1999
  *
 /*
  * Author: Thomas E. Dickey <dickey@clark.net> 1999
  *
- * $Id: dots.c,v 1.26 2017/09/30 17:55:22 tom Exp $
+ * $Id: dots.c,v 1.28 2017/10/11 08:15:27 tom Exp $
  *
  * A simple demo of the terminfo interface.
  */
  *
  * A simple demo of the terminfo interface.
  */
@@ -40,8 +40,6 @@
 
 #include <time.h>
 
 
 #include <time.h>
 
-#define valid(s) ((s != 0) && s != (char *)-1)
-
 static bool interrupted = FALSE;
 static long total_chars = 0;
 static time_t started;
 static bool interrupted = FALSE;
 static long total_chars = 0;
 static time_t started;
@@ -64,7 +62,7 @@ TPUTS_PROTO(outc, c)
 static bool
 outs(const char *s)
 {
 static bool
 outs(const char *s)
 {
-    if (valid(s)) {
+    if (VALID_STRING(s)) {
        tputs(s, 1, outc);
        return TRUE;
     }
        tputs(s, 1, outc);
        return TRUE;
     }
@@ -80,7 +78,7 @@ cleanup(void)
     outs(clear_screen);
     outs(cursor_normal);
 
     outs(clear_screen);
     outs(cursor_normal);
 
-    printf("\n\n%ld total chars, rate %.2f/sec\n",
+    printf("\n\n%ld total cells, rate %.2f/sec\n",
           total_chars,
           ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
 }
           total_chars,
           ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
 }
@@ -113,9 +111,9 @@ main(int argc GCC_UNUSED,
     outs(cursor_invisible);
     my_colors = max_colors;
     if (my_colors > 1) {
     outs(cursor_invisible);
     my_colors = max_colors;
     if (my_colors > 1) {
-       if (!valid(set_a_foreground)
-           || !valid(set_a_background)
-           || (!valid(orig_colors) && !valid(orig_pair)))
+       if (!VALID_STRING(set_a_foreground)
+           || !VALID_STRING(set_a_background)
+           || (!VALID_STRING(orig_colors) && !VALID_STRING(orig_pair)))
            my_colors = -1;
     }
 
            my_colors = -1;
     }
 
@@ -137,8 +135,8 @@ main(int argc GCC_UNUSED,
                tputs(tparm2(set_a_background, z), 1, outc);
                napms(1);
            }
                tputs(tparm2(set_a_background, z), 1, outc);
                napms(1);
            }
-       } else if (valid(exit_attribute_mode)
-                  && valid(enter_reverse_mode)) {
+       } else if (VALID_STRING(exit_attribute_mode)
+                  && VALID_STRING(enter_reverse_mode)) {
            if (ranf() <= 0.01) {
                outs((ranf() > 0.6)
                     ? enter_reverse_mode
            if (ranf() <= 0.01) {
                outs((ranf() > 0.6)
                     ? enter_reverse_mode
index d27f2e2303d77492f8607bb101fd413fd3f4b574..477c4a14ef116b60854324901ce83b86c725d7be 100644 (file)
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: dots_curses.c,v 1.5 2017/09/30 15:41:17 tom Exp $
+ * $Id: dots_curses.c,v 1.7 2017/10/11 08:16:33 tom Exp $
  *
  * A simple demo of the curses interface used for comparison with termcap.
  */
  *
  * A simple demo of the curses interface used for comparison with termcap.
  */
@@ -41,8 +41,6 @@
 
 #include <time.h>
 
 
 #include <time.h>
 
-#define valid(s) ((s != 0) && s != (char *)-1)
-
 static bool interrupted = FALSE;
 static long total_chars = 0;
 static time_t started;
 static bool interrupted = FALSE;
 static long total_chars = 0;
 static time_t started;
@@ -52,7 +50,7 @@ cleanup(void)
 {
     endwin();
 
 {
     endwin();
 
-    printf("\n\n%ld total chars, rate %.2f/sec\n",
+    printf("\n\n%ld total cells, rate %.2f/sec\n",
           total_chars,
           ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
 }
           total_chars,
           ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
 }
index ed9de8c289e4e20c2115d491f37cbe374db3ef88..d6ce9329014a5a761fc6650800d6da4e3ad09321 100644 (file)
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey - 2007
  *
 /*
  * Author: Thomas E. Dickey - 2007
  *
- * $Id: dots_mvcur.c,v 1.13 2017/09/30 21:34:15 tom Exp $
+ * $Id: dots_mvcur.c,v 1.15 2017/10/11 08:15:46 tom Exp $
  *
  * A simple demo of the terminfo interface, and mvcur.
  */
  *
  * A simple demo of the terminfo interface, and mvcur.
  */
@@ -40,8 +40,6 @@
 
 #include <time.h>
 
 
 #include <time.h>
 
-#define valid(s) ((s != 0) && s != (char *)-1)
-
 static bool interrupted = FALSE;
 static long total_chars = 0;
 static time_t started;
 static bool interrupted = FALSE;
 static long total_chars = 0;
 static time_t started;
@@ -65,7 +63,7 @@ TPUTS_PROTO(outc, c)
 static bool
 outs(const char *s)
 {
 static bool
 outs(const char *s)
 {
-    if (valid(s)) {
+    if (VALID_STRING(s)) {
        tputs(s, 1, outc);
        return TRUE;
     }
        tputs(s, 1, outc);
        return TRUE;
     }
@@ -81,7 +79,7 @@ cleanup(void)
     outs(clear_screen);
     outs(cursor_normal);
 
     outs(clear_screen);
     outs(cursor_normal);
 
-    printf("\n\n%ld total chars, rate %.2f/sec\n",
+    printf("\n\n%ld total cells, rate %.2f/sec\n",
           total_chars,
           ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
 }
           total_chars,
           ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
 }
@@ -125,9 +123,9 @@ main(int argc GCC_UNUSED,
     outs(cursor_invisible);
     my_colors = max_colors;
     if (my_colors > 1) {
     outs(cursor_invisible);
     my_colors = max_colors;
     if (my_colors > 1) {
-       if (!valid(set_a_foreground)
-           || !valid(set_a_background)
-           || (!valid(orig_colors) && !valid(orig_pair)))
+       if (!VALID_STRING(set_a_foreground)
+           || !VALID_STRING(set_a_background)
+           || (!VALID_STRING(orig_colors) && !VALID_STRING(orig_pair)))
            my_colors = -1;
     }
 
            my_colors = -1;
     }
 
@@ -153,8 +151,8 @@ main(int argc GCC_UNUSED,
                tputs(tparm2(set_a_background, z), 1, outc);
                napms(1);
            }
                tputs(tparm2(set_a_background, z), 1, outc);
                napms(1);
            }
-       } else if (valid(exit_attribute_mode)
-                  && valid(enter_reverse_mode)) {
+       } else if (VALID_STRING(exit_attribute_mode)
+                  && VALID_STRING(enter_reverse_mode)) {
            if (ranf() <= 0.01) {
                outs((ranf() > 0.6)
                     ? enter_reverse_mode
            if (ranf() <= 0.01) {
                outs((ranf() > 0.6)
                     ? enter_reverse_mode
index cd88b3eb2b2ef710c81e583900e2cc8453cc5131..c3eef5cf43087ac1c28a5b6cb1eef6ec98cbfb4a 100644 (file)
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: dots_termcap.c,v 1.10 2017/09/30 17:55:22 tom Exp $
+ * $Id: dots_termcap.c,v 1.12 2017/10/11 08:15:07 tom Exp $
  *
  * A simple demo of the termcap interface.
  */
  *
  * A simple demo of the termcap interface.
  */
@@ -44,8 +44,6 @@
 
 #include <time.h>
 
 
 #include <time.h>
 
-#define valid(s) ((s != 0) && s != (char *)-1)
-
 static bool interrupted = FALSE;
 static long total_chars = 0;
 static time_t started;
 static bool interrupted = FALSE;
 static long total_chars = 0;
 static time_t started;
@@ -116,7 +114,7 @@ TPUTS_PROTO(outc, c)
 static bool
 outs(char *s)
 {
 static bool
 outs(char *s)
 {
-    if (valid(s)) {
+    if (VALID_STRING(s)) {
        tputs(s, 1, outc);
        return TRUE;
     }
        tputs(s, 1, outc);
        return TRUE;
     }
@@ -132,7 +130,7 @@ cleanup(void)
     outs(t_cl);
     outs(t_ve);
 
     outs(t_cl);
     outs(t_ve);
 
-    printf("\n\n%ld total chars, rate %.2f/sec\n",
+    printf("\n\n%ld total cells, rate %.2f/sec\n",
           total_chars,
           ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
 }
           total_chars,
           ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
 }
@@ -203,9 +201,9 @@ main(int argc GCC_UNUSED,
     outs(t_cl);
     outs(t_vi);
     if (num_colors > 1) {
     outs(t_cl);
     outs(t_vi);
     if (num_colors > 1) {
-       if (!valid(t_AF)
-           || !valid(t_AB)
-           || (!valid(t_oc) && !valid(t_op)))
+       if (!VALID_STRING(t_AF)
+           || !VALID_STRING(t_AB)
+           || (!VALID_STRING(t_oc) && !VALID_STRING(t_op)))
            num_colors = -1;
     }
 
            num_colors = -1;
     }
 
@@ -227,8 +225,8 @@ main(int argc GCC_UNUSED,
                tputs(tgoto(t_AB, 0, z), 1, outc);
                my_napms(1);
            }
                tputs(tgoto(t_AB, 0, z), 1, outc);
                my_napms(1);
            }
-       } else if (valid(t_me)
-                  && valid(t_mr)) {
+       } else if (VALID_STRING(t_me)
+                  && VALID_STRING(t_mr)) {
            if (ranf() <= 0.01) {
                outs((ranf() > 0.6)
                     ? t_mr
            if (ranf() <= 0.01) {
                outs((ranf() > 0.6)
                     ? t_mr
diff --git a/test/dots_xcurses.c b/test/dots_xcurses.c
new file mode 100644 (file)
index 0000000..abf0a00
--- /dev/null
@@ -0,0 +1,237 @@
+/****************************************************************************
+ * Copyright (c) 2017 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.                                                           *
+ ****************************************************************************/
+
+/*
+ * Author: Thomas E. Dickey
+ *
+ * $Id: dots_xcurses.c,v 1.8 2017/10/12 00:20:41 tom Exp $
+ *
+ * A simple demo of the wide-curses interface used for comparison with termcap.
+ */
+#include <test.priv.h>
+
+#if !defined(__MINGW32__)
+#include <sys/time.h>
+#endif
+
+#include <time.h>
+
+#if USE_WIDEC_SUPPORT
+
+#if HAVE_ALLOC_PAIR
+#define NewPair(n) x_option ? ((void *)&(n)) : NULL
+#else
+#define NewPair(n) NULL
+#endif
+
+#define InitPair(p,fg,bg) init_pair((short) (p), (short) (fg), (short) (bg))
+
+static bool interrupted = FALSE;
+static long total_chars = 0;
+static time_t started;
+
+#ifdef NCURSES_VERSION
+static bool d_option = FALSE;
+static bool x_option = FALSE;
+#endif
+
+static void
+cleanup(void)
+{
+    endwin();
+
+    printf("\n\n%ld total cells, rate %.2f/sec\n",
+          total_chars,
+          ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
+}
+
+static void
+onsig(int n GCC_UNUSED)
+{
+    interrupted = TRUE;
+}
+
+static double
+ranf(void)
+{
+    long r = (rand() & 077777);
+    return ((double) r / 32768.);
+}
+
+static int
+mypair(int fg, int bg)
+{
+    int result;
+#if HAVE_ALLOC_PAIR
+    if (x_option) {
+       result = alloc_pair(fg, bg);
+    } else
+#endif
+    {
+       int pair = (fg * COLORS) + bg;
+       result = (pair >= COLOR_PAIRS) ? -1 : pair;
+    }
+    return result;
+}
+
+static void
+set_colors(int fg, int bg)
+{
+    int pair = mypair(fg, bg);
+    if (pair > 0) {
+       color_set((short) pair, NewPair(pair));
+    }
+}
+
+#if defined(NCURSES_VERSION)
+static void
+usage(void)
+{
+    static const char *msg[] =
+    {
+       "Usage: firework [options]"
+       ,""
+       ,"Options:"
+#if HAVE_USE_DEFAULT_COLORS
+       ," -d       invoke use_default_colors()"
+#endif
+#if HAVE_ALLOC_PAIR
+       ," -x       use alloc_pair() rather than init_pair()"
+#endif
+    };
+    size_t n;
+
+    for (n = 0; n < SIZEOF(msg); n++)
+       fprintf(stderr, "%s\n", msg[n]);
+
+    ExitProgram(EXIT_FAILURE);
+}
+#endif
+
+int
+main(int argc GCC_UNUSED,
+     char *argv[]GCC_UNUSED)
+{
+    int margin = 2;
+    int x, y, z, p;
+    int fg, bg, ch;
+    wchar_t wch[2];
+    int pair;
+    double r;
+    double c;
+
+#if defined(NCURSES_VERSION)
+    while ((ch = getopt(argc, argv, "dx")) != -1) {
+       switch (ch) {
+       case 'd':
+           d_option = TRUE;
+           break;
+#if HAVE_ALLOC_PAIR
+       case 'x':
+           x_option = TRUE;
+           break;
+#endif
+       default:
+           usage();
+           break;
+       }
+    }
+#endif
+
+    srand((unsigned) time(0));
+
+    InitAndCatch(initscr(), onsig);
+    if (has_colors()) {
+       start_color();
+#if HAVE_USE_DEFAULT_COLORS
+       if (d_option)
+           use_default_colors();
+#endif
+       if (x_option) {
+           ;                   /* nothing */
+       } else {
+           for (fg = 0; fg < COLORS; fg++) {
+               for (bg = 0; bg < COLORS; bg++) {
+                   pair = mypair(fg, bg);
+                   if (pair > 0) {
+                       InitPair(pair, fg, bg);
+                   }
+               }
+           }
+       }
+    }
+
+    r = (double) (LINES - (2 * margin));
+    c = (double) (COLS - (2 * margin));
+    started = time((time_t *) 0);
+
+    fg = COLOR_WHITE;
+    bg = COLOR_BLACK;
+    pair = 0;
+    wch[1] = 0;
+    while (!interrupted) {
+       x = (int) (c * ranf()) + margin;
+       y = (int) (r * ranf()) + margin;
+       p = (ranf() > 0.9) ? '*' : ' ';
+
+       move(y, x);
+       if (has_colors()) {
+           z = (int) (ranf() * COLORS);
+           if (ranf() > 0.01) {
+               set_colors(fg = z, bg);
+           } else {
+               set_colors(fg, bg = z);
+               napms(1);
+           }
+       } else {
+           if (ranf() <= 0.01) {
+               if (ranf() > 0.6) {
+                   attr_on(WA_REVERSE, NULL);
+               } else {
+                   attr_off(WA_REVERSE, NULL);
+               }
+               napms(1);
+           }
+       }
+       wch[0] = p;
+       addnwstr(wch, 1);
+       refresh();
+       ++total_chars;
+    }
+    cleanup();
+    ExitProgram(EXIT_SUCCESS);
+}
+
+#else
+int
+main(void)
+{
+    printf("This program requires the wide-ncurses library\n");
+    ExitProgram(EXIT_FAILURE);
+}
+#endif
index 1a3fd7d3a7833d68ef0b8ed9452f71aa7e96d75a..be8e68fc6fa404f1b2cefffadea3b78cf94d37ae 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: echochar.c,v 1.15 2017/09/30 15:42:10 tom Exp $
+ * $Id: echochar.c,v 1.17 2017/10/11 08:16:12 tom Exp $
  *
  * Demonstrate the echochar function (compare to dots.c).
  * Thomas Dickey - 2006/11/4
  *
  * Demonstrate the echochar function (compare to dots.c).
  * Thomas Dickey - 2006/11/4
@@ -36,8 +36,6 @@
 
 #include <time.h>
 
 
 #include <time.h>
 
-#define valid(s) ((s != 0) && s != (char *)-1)
-
 static bool interrupted = FALSE;
 static long total_chars = 0;
 static time_t started;
 static bool interrupted = FALSE;
 static long total_chars = 0;
 static time_t started;
@@ -47,7 +45,7 @@ cleanup(void)
 {
     exit_curses();
 
 {
     exit_curses();
 
-    printf("\n\n%ld total chars, rate %.2f/sec\n",
+    printf("\n\n%ld total cells, rate %.2f/sec\n",
           total_chars,
           ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
 }
           total_chars,
           ((double) (total_chars) / (double) (time((time_t *) 0) - started)));
 }
index ec490cec1979a43037706535639d483bd4222943..938acf068e85825b9446670bb2fd001a5993154d 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: modules,v 1.64 2017/06/24 18:26:44 tom Exp $
+# $Id: modules,v 1.65 2017/10/11 08:08:41 tom Exp $
 ##############################################################################
 # Copyright (c) 1998-2016,2017 Free Software Foundation, Inc.                #
 #                                                                            #
 ##############################################################################
 # Copyright (c) 1998-2016,2017 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -53,6 +53,7 @@ dots          progs           $(srcdir)       $(HEADER_DEPS)
 dots_curses    progs           $(srcdir)       $(HEADER_DEPS)
 dots_mvcur     progs           $(srcdir)       $(HEADER_DEPS)
 dots_termcap   progs           $(srcdir)       $(HEADER_DEPS)
 dots_curses    progs           $(srcdir)       $(HEADER_DEPS)
 dots_mvcur     progs           $(srcdir)       $(HEADER_DEPS)
 dots_termcap   progs           $(srcdir)       $(HEADER_DEPS)
+dots_xcurses   progs           $(srcdir)       $(HEADER_DEPS)
 echochar       progs           $(srcdir)       $(HEADER_DEPS)
 edit_field     progs           $(srcdir)       $(HEADER_DEPS)  $(srcdir)/edit_field.h  $(srcdir)/popup_msg.h
 extended_color progs           $(srcdir)       $(HEADER_DEPS)
 echochar       progs           $(srcdir)       $(HEADER_DEPS)
 edit_field     progs           $(srcdir)       $(HEADER_DEPS)  $(srcdir)/edit_field.h  $(srcdir)/popup_msg.h
 extended_color progs           $(srcdir)       $(HEADER_DEPS)
index 6a3a710fc3a5a3fac4c15c60e3ffe3621e2d9fba..76b7c3b31867c2790909a402d17d76ca2e1a7008 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: programs,v 1.39 2017/07/01 20:14:35 tom Exp $
+# $Id: programs,v 1.40 2017/10/11 08:08:41 tom Exp $
 ##############################################################################
 # Copyright (c) 2006-2016,2017 Free Software Foundation, Inc.                #
 #                                                                            #
 ##############################################################################
 # Copyright (c) 2006-2016,2017 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -51,6 +51,7 @@ dots          $(LDFLAGS_TINFO)        $(LOCAL_LIBS)   dots
 dots_curses    $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   dots_curses
 dots_mvcur     $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   dots_mvcur
 dots_termcap   $(LDFLAGS_TINFO)        $(LOCAL_LIBS)   dots_termcap
 dots_curses    $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   dots_curses
 dots_mvcur     $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   dots_mvcur
 dots_termcap   $(LDFLAGS_TINFO)        $(LOCAL_LIBS)   dots_termcap
+dots_xcurses   $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   dots_xcurses
 echochar       $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   echochar
 extended_color $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   extended_color
 filter         $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   filter
 echochar       $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   echochar
 extended_color $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   extended_color
 filter         $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   filter
index a7cc109cf9f8b2561f8d35ed1ca5d0136bd8458c..c2b4bd4695cbee29d83bdc5706bea3210b47e809 100644 (file)
@@ -29,7 +29,7 @@
 /****************************************************************************
  *  Author: Thomas E. Dickey                    1996-on                     *
  ****************************************************************************/
 /****************************************************************************
  *  Author: Thomas E. Dickey                    1996-on                     *
  ****************************************************************************/
-/* $Id: test.priv.h,v 1.158 2017/09/30 17:58:37 tom Exp $ */
+/* $Id: test.priv.h,v 1.160 2017/10/12 01:00:59 tom Exp $ */
 
 #ifndef __TEST_PRIV_H
 #define __TEST_PRIV_H 1
 
 #ifndef __TEST_PRIV_H
 #define __TEST_PRIV_H 1
@@ -571,38 +571,46 @@ extern int optind;
 #undef WACS_NEQUAL
 #undef WACS_STERLING
 
 #undef WACS_NEQUAL
 #undef WACS_STERLING
 
-#define        WACS_RARROW     &(CURSES_WACS_ARRAY['+'])
-#define        WACS_LARROW     &(CURSES_WACS_ARRAY[','])
-#define        WACS_UARROW     &(CURSES_WACS_ARRAY['-'])
-#define        WACS_DARROW     &(CURSES_WACS_ARRAY['.'])
-#define        WACS_BLOCK      &(CURSES_WACS_ARRAY['0'])
-#define        WACS_DIAMOND    &(CURSES_WACS_ARRAY['`'])
-#define        WACS_CKBOARD    &(CURSES_WACS_ARRAY['a'])
-#define        WACS_DEGREE     &(CURSES_WACS_ARRAY['f'])
-#define        WACS_PLMINUS    &(CURSES_WACS_ARRAY['g'])
-#define        WACS_BOARD      &(CURSES_WACS_ARRAY['h'])
-#define        WACS_LANTERN    &(CURSES_WACS_ARRAY['i'])
-#define        WACS_LRCORNER   &(CURSES_WACS_ARRAY['j'])
-#define        WACS_URCORNER   &(CURSES_WACS_ARRAY['k'])
-#define        WACS_ULCORNER   &(CURSES_WACS_ARRAY['l'])
-#define        WACS_LLCORNER   &(CURSES_WACS_ARRAY['m'])
-#define        WACS_PLUS       &(CURSES_WACS_ARRAY['n'])
-#define        WACS_HLINE      &(CURSES_WACS_ARRAY['q'])
-#define        WACS_S1         &(CURSES_WACS_ARRAY['o'])
-#define        WACS_S9         &(CURSES_WACS_ARRAY['s'])
-#define        WACS_LTEE       &(CURSES_WACS_ARRAY['t'])
-#define        WACS_RTEE       &(CURSES_WACS_ARRAY['u'])
-#define        WACS_BTEE       &(CURSES_WACS_ARRAY['v'])
-#define        WACS_TTEE       &(CURSES_WACS_ARRAY['w'])
-#define        WACS_VLINE      &(CURSES_WACS_ARRAY['x'])
-#define        WACS_BULLET     &(CURSES_WACS_ARRAY['~'])
-#define        WACS_S3         &(CURSES_WACS_ARRAY['p'])
-#define        WACS_S7         &(CURSES_WACS_ARRAY['r'])
-#define        WACS_LEQUAL     &(CURSES_WACS_ARRAY['y'])
-#define        WACS_GEQUAL     &(CURSES_WACS_ARRAY['z'])
-#define        WACS_PI         &(CURSES_WACS_ARRAY['{'])
-#define        WACS_NEQUAL     &(CURSES_WACS_ARRAY['|'])
-#define        WACS_STERLING   &(CURSES_WACS_ARRAY['}'])
+#define WACS_RARROW     &(CURSES_WACS_ARRAY['+'])
+#define WACS_LARROW     &(CURSES_WACS_ARRAY[','])
+#define WACS_UARROW     &(CURSES_WACS_ARRAY['-'])
+#define WACS_DARROW     &(CURSES_WACS_ARRAY['.'])
+#define WACS_BLOCK      &(CURSES_WACS_ARRAY['0'])
+#define WACS_DIAMOND    &(CURSES_WACS_ARRAY['`'])
+#define WACS_CKBOARD    &(CURSES_WACS_ARRAY['a'])
+#define WACS_DEGREE     &(CURSES_WACS_ARRAY['f'])
+#define WACS_PLMINUS    &(CURSES_WACS_ARRAY['g'])
+#define WACS_BOARD      &(CURSES_WACS_ARRAY['h'])
+#define WACS_LANTERN    &(CURSES_WACS_ARRAY['i'])
+#define WACS_LRCORNER   &(CURSES_WACS_ARRAY['j'])
+#define WACS_URCORNER   &(CURSES_WACS_ARRAY['k'])
+#define WACS_ULCORNER   &(CURSES_WACS_ARRAY['l'])
+#define WACS_LLCORNER   &(CURSES_WACS_ARRAY['m'])
+#define WACS_PLUS       &(CURSES_WACS_ARRAY['n'])
+#define WACS_HLINE      &(CURSES_WACS_ARRAY['q'])
+#define WACS_S1         &(CURSES_WACS_ARRAY['o'])
+#define WACS_S9         &(CURSES_WACS_ARRAY['s'])
+#define WACS_LTEE       &(CURSES_WACS_ARRAY['t'])
+#define WACS_RTEE       &(CURSES_WACS_ARRAY['u'])
+#define WACS_BTEE       &(CURSES_WACS_ARRAY['v'])
+#define WACS_TTEE       &(CURSES_WACS_ARRAY['w'])
+#define WACS_VLINE      &(CURSES_WACS_ARRAY['x'])
+#define WACS_BULLET     &(CURSES_WACS_ARRAY['~'])
+#define WACS_S3         &(CURSES_WACS_ARRAY['p'])
+#define WACS_S7         &(CURSES_WACS_ARRAY['r'])
+#define WACS_LEQUAL     &(CURSES_WACS_ARRAY['y'])
+#define WACS_GEQUAL     &(CURSES_WACS_ARRAY['z'])
+#define WACS_PI         &(CURSES_WACS_ARRAY['{'])
+#define WACS_NEQUAL     &(CURSES_WACS_ARRAY['|'])
+#define WACS_STERLING   &(CURSES_WACS_ARRAY['}'])
+#endif
+
+#ifndef WA_NORMAL
+#define WA_NORMAL       A_NORMAL
+#define WA_BOLD         A_BOLD
+#define WA_REVERSE      A_REVERSE
+#define WA_UNDERLINE    A_UNDERLINE
+#define WA_BLINK        A_BLINK
 #endif
 
 #ifndef OK
 #endif
 
 #ifndef OK
@@ -691,7 +699,7 @@ extern char *strnames[], *strcodes[], *strfnames[];
 #define DECL_CURSES_DATA_TTYTYPE 0
 #endif
 
 #define DECL_CURSES_DATA_TTYTYPE 0
 #endif
 
-#if !HAVE_CURSES_DATA_TTYTYPE || DECL_CURSES_DATA_TTYTYPE
+#if !defined(ttytype) && (!HAVE_CURSES_DATA_TTYTYPE || DECL_CURSES_DATA_TTYTYPE)
 #define ttytype termname()
 #endif
 
 #define ttytype termname()
 #endif
 
index 5831f987362e40c3a6eb3918b587f6e178699e46..398bbcd86c9fefbb00dd983922e0cb1852da3676 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_termattrs.c,v 1.1 2017/06/24 18:26:15 tom Exp $
+ * $Id: test_termattrs.c,v 1.2 2017/10/11 08:16:02 tom Exp $
  *
  * Demonstrate the termattrs and term_attrs functions.
  */
  *
  * Demonstrate the termattrs and term_attrs functions.
  */
@@ -36,8 +36,6 @@
 
 #if HAVE_SETUPTERM
 
 
 #if HAVE_SETUPTERM
 
-#define valid(s) ((s != 0) && s != (char *)-1)
-
 static FILE *my_fp;
 
 static void
 static FILE *my_fp;
 
 static void
index 81812322ac23d34a654bf7aecb230b2785d61b2c..463e59576ba62fcc418fa5a4d9ff31bd30c7828d 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_vid_puts.c,v 1.9 2017/06/24 17:48:04 tom Exp $
+ * $Id: test_vid_puts.c,v 1.10 2017/10/11 08:16:24 tom Exp $
  *
  * Demonstrate the vid_puts and vid_attr functions.
  * Thomas Dickey - 2013/01/12
  *
  * Demonstrate the vid_puts and vid_attr functions.
  * Thomas Dickey - 2013/01/12
@@ -37,8 +37,6 @@
 
 #if USE_WIDEC_SUPPORT && HAVE_SETUPTERM && HAVE_VID_PUTS
 
 
 #if USE_WIDEC_SUPPORT && HAVE_SETUPTERM && HAVE_VID_PUTS
 
-#define valid(s) ((s != 0) && s != (char *)-1)
-
 static FILE *my_fp;
 static bool p_opt = FALSE;
 
 static FILE *my_fp;
 static bool p_opt = FALSE;
 
@@ -54,7 +52,7 @@ TPUTS_PROTO(outc, c)
 static bool
 outs(const char *s)
 {
 static bool
 outs(const char *s)
 {
-    if (valid(s)) {
+    if (VALID_STRING(s)) {
        tputs(s, 1, outc);
        return TRUE;
     }
        tputs(s, 1, outc);
        return TRUE;
     }
index 0b16f2cd298a68055bff8cbdc6d7abc95fccba23..3cf004768bba443311acfde5e7a441d7fdbabff8 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_vidputs.c,v 1.8 2017/06/24 17:48:17 tom Exp $
+ * $Id: test_vidputs.c,v 1.9 2017/10/11 08:17:07 tom Exp $
  *
  * Demonstrate the vidputs and vidattr functions.
  * Thomas Dickey - 2013/01/12
  *
  * Demonstrate the vidputs and vidattr functions.
  * Thomas Dickey - 2013/01/12
@@ -37,8 +37,6 @@
 
 #if HAVE_SETUPTERM && HAVE_VIDPUTS
 
 
 #if HAVE_SETUPTERM && HAVE_VIDPUTS
 
-#define valid(s) ((s != 0) && s != (char *)-1)
-
 static FILE *my_fp;
 static bool p_opt = FALSE;
 
 static FILE *my_fp;
 static bool p_opt = FALSE;
 
@@ -54,7 +52,7 @@ TPUTS_PROTO(outc, c)
 static bool
 outs(const char *s)
 {
 static bool
 outs(const char *s)
 {
-    if (valid(s)) {
+    if (VALID_STRING(s)) {
        tputs(s, 1, outc);
        return TRUE;
     }
        tputs(s, 1, outc);
        return TRUE;
     }
index e24628e2fb263f4b1e66e46ecfd1db9d94e81813..00062e8edb138e196e4cb8f341554c10131fe72f 100644 (file)
  * scroll operation worked, and the refresh() code only had to do a
  * partial repaint.
  *
  * scroll operation worked, and the refresh() code only had to do a
  * partial repaint.
  *
- * $Id: view.c,v 1.104 2017/09/30 17:50:38 tom Exp $
+ * $Id: view.c,v 1.111 2017/10/15 00:56:58 tom Exp $
  */
 
 #include <test.priv.h>
 #include <widechars.h>
 #include <popup_msg.h>
 
  */
 
 #include <test.priv.h>
 #include <widechars.h>
 #include <popup_msg.h>
 
+#include <sys/stat.h>
 #include <time.h>
 
 #undef CTRL                    /* conflict on AIX 5.2 with <sys/ioctl.h> */
 
 #include <time.h>
 
 #undef CTRL                    /* conflict on AIX 5.2 with <sys/ioctl.h> */
 
+static void finish(int sig) GCC_NORETURN;
+
 #if HAVE_TERMIOS_H
 # include <termios.h>
 #else
 #if HAVE_TERMIOS_H
 # include <termios.h>
 #else
@@ -86,9 +89,6 @@
 #undef CTRL
 #define CTRL(x)        ((x) & 0x1f)
 
 #undef CTRL
 #define CTRL(x)        ((x) & 0x1f)
 
-static void finish(int sig) GCC_NORETURN;
-static void show_all(const char *tag);
-
 #if defined(SIGWINCH) && defined(TIOCGWINSZ) && HAVE_RESIZE_TERM
 #define CAN_RESIZE 1
 #else
 #if defined(SIGWINCH) && defined(TIOCGWINSZ) && HAVE_RESIZE_TERM
 #define CAN_RESIZE 1
 #else
@@ -96,7 +96,6 @@ static void show_all(const char *tag);
 #endif
 
 #if CAN_RESIZE
 #endif
 
 #if CAN_RESIZE
-static void adjust(int sig);
 static int interrupted;
 static bool waiting = FALSE;
 #endif
 static int interrupted;
 static bool waiting = FALSE;
 #endif
@@ -111,6 +110,13 @@ static int num_lines;
 
 static void usage(void) GCC_NORETURN;
 
 
 static void usage(void) GCC_NORETURN;
 
+static void
+failed(const char *msg)
+{
+    fprintf(stderr, "%s\n", msg);
+    ExitProgram(EXIT_FAILURE);
+}
+
 static void
 usage(void)
 {
 static void
 usage(void)
 {
@@ -121,7 +127,6 @@ usage(void)
        ,"Options:"
        ," -c       use color if terminal supports it"
        ," -i       ignore INT, QUIT, TERM signals"
        ,"Options:"
        ," -c       use color if terminal supports it"
        ," -i       ignore INT, QUIT, TERM signals"
-       ," -n NUM   specify maximum number of lines (default 1000)"
 #if defined(KEY_RESIZE)
        ," -r       use old-style sigwinch handler rather than KEY_RESIZE"
 #endif
 #if defined(KEY_RESIZE)
        ," -r       use old-style sigwinch handler rather than KEY_RESIZE"
 #endif
@@ -225,6 +230,233 @@ ch_dup(char *src)
     return dst;
 }
 
     return dst;
 }
 
+static void
+finish(int sig)
+{
+    endwin();
+#if NO_LEAKS
+    if (vec_lines != 0) {
+       int n;
+       for (n = 0; n < num_lines; ++n) {
+           free(vec_lines[n]);
+       }
+       free(vec_lines);
+    }
+#endif
+    ExitProgram(sig != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
+}
+
+static void
+show_all(const char *tag)
+{
+    int i;
+    char temp[BUFSIZ];
+    NCURSES_CH_T *s;
+    time_t this_time;
+
+#if CAN_RESIZE
+    _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
+               "%.20s (%3dx%3d) col %d ", tag, LINES, COLS, shift);
+    i = (int) strlen(temp);
+    if ((i + 7) < (int) sizeof(temp)) {
+       _nc_SPRINTF(temp + i, _nc_SLIMIT(sizeof(temp) - (size_t) i)
+                   "view %.*s",
+                   (int) (sizeof(temp) - 7 - (size_t) i),
+                   fname);
+    }
+#else
+    (void) tag;
+    _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
+               "view %.*s", (int) sizeof(temp) - 7, fname);
+#endif
+    move(0, 0);
+    printw("%.*s", COLS, temp);
+    clrtoeol();
+    this_time = time((time_t *) 0);
+    _nc_STRNCPY(temp, ctime(&this_time), (size_t) 30);
+    if ((i = (int) strlen(temp)) != 0) {
+       temp[--i] = 0;
+       if (move(0, COLS - i - 2) != ERR)
+           printw("  %s", temp);
+    }
+
+    scrollok(stdscr, FALSE);   /* prevent screen from moving */
+    for (i = 1; i < LINES; i++) {
+       int len;
+       int actual = (int) (lptr + i - vec_lines);
+       if (actual >= num_lines) {
+           clrtobot();
+           break;
+       }
+       move(i, 0);
+       printw("%3d:", actual);
+       clrtoeol();
+       if ((s = lptr[i - 1]) == 0) {
+           continue;
+       }
+       len = ch_len(s);
+       if (len > shift) {
+#if USE_WIDEC_SUPPORT
+           add_wchstr(s + shift);
+#else
+           addchstr(s + shift);
+#endif
+       }
+#if defined(NCURSES_VERSION) || defined(HAVE_WCHGAT)
+       if (try_color)
+           wchgat(stdscr, -1, WA_NORMAL, my_pair, NULL);
+#endif
+    }
+    setscrreg(1, LINES - 1);
+    scrollok(stdscr, TRUE);
+    refresh();
+}
+
+#if CAN_RESIZE
+/*
+ * This uses functions that are "unsafe", but it seems to work on SunOS. 
+ * Usually: the "unsafe" refers to the functions that POSIX lists which may be
+ * called from a signal handler.  Those do not include buffered I/O, which is
+ * used for instance in wrefresh().  To be really portable, you should use the
+ * KEY_RESIZE return (which relies on ncurses' sigwinch handler).
+ *
+ * The 'wrefresh(curscr)' is needed to force the refresh to start from the top
+ * of the screen -- some xterms mangle the bitmap while resizing.
+ */
+static void
+adjust(int sig)
+{
+    if (waiting || sig == 0) {
+       struct winsize size;
+
+       if (ioctl(fileno(stdout), TIOCGWINSZ, &size) == 0) {
+           resize_term(size.ws_row, size.ws_col);
+           wrefresh(curscr);
+           show_all(sig ? "SIGWINCH" : "interrupt");
+       }
+       interrupted = FALSE;
+    } else {
+       interrupted = TRUE;
+    }
+    (void) signal(SIGWINCH, adjust);   /* some systems need this */
+}
+#endif /* CAN_RESIZE */
+
+static void
+read_file(const char *filename)
+{
+    FILE *fp;
+    int pass;
+    int k;
+    size_t j;
+    size_t len;
+    struct stat sb;
+    char *my_blob;
+    char **my_vec = 0;
+
+    if (stat(filename, &sb) != 0
+       || (sb.st_mode & S_IFMT) != S_IFREG) {
+       failed("input is not a file");
+    }
+
+    if (sb.st_size == 0) {
+       failed("input is empty");
+    }
+
+    if ((fp = fopen(filename, "r")) == 0) {
+       failed("cannot open input-file");
+    }
+
+    if ((my_blob = malloc((size_t) sb.st_size + 1)) == 0) {
+       failed("cannot allocate memory for input-file");
+    }
+
+    len = fread(my_blob, sizeof(char), (size_t) sb.st_size, fp);
+    my_blob[sb.st_size] = '\0';
+    fclose(fp);
+
+    for (pass = 0; pass < 2; ++pass) {
+       char *base = my_blob;
+       k = 0;
+       for (j = 0; j < len; ++j) {
+           if (my_blob[j] == '\n') {
+               if (pass) {
+                   my_vec[k] = base;
+                   my_blob[j] = '\0';
+               }
+               base = my_blob + j + 1;
+               ++k;
+           }
+       }
+       num_lines = k;
+       if (base != (my_blob + j))
+           ++num_lines;
+       if (!pass &&
+           ((my_vec = typeCalloc(char *, (size_t) k + 2)) == 0)) {
+           failed("cannot allocate line-vector #1");
+       }
+    }
+    if ((vec_lines = typeCalloc(NCURSES_CH_T *, (size_t) num_lines + 2)) == 0)
+       failed("cannot allocate line-vector #2");
+
+    Trace(("slurp the file"));
+    for (k = 0; k < num_lines; ++k) {
+       char *buf = my_vec[k];
+       char temp[BUFSIZ], *s, *d;
+       int col;
+
+       lptr = &vec_lines[k];
+
+#if USE_WIDEC_SUPPORT
+       if (lptr == vec_lines) {
+           if (!memcmp("", buf, 3)) {
+               Trace(("trim BOM"));
+               s = buf + 3;
+               d = buf;
+               do {
+               } while ((*d++ = *s++) != '\0');
+           }
+       }
+#endif
+
+       /* convert tabs and nonprinting chars so that shift will work properly */
+       for (s = buf, d = temp, col = 0; (*d = *s) != '\0'; s++) {
+           if (*d == '\r') {
+               if (s[1] == '\n') {
+                   continue;
+               } else {
+                   break;
+               }
+           }
+           if (*d == '\n') {
+               *d = '\0';
+               break;
+           } else if (*d == '\t') {
+               col = (col | 7) + 1;
+               while ((d - temp) != col)
+                   *d++ = ' ';
+           } else
+#if USE_WIDEC_SUPPORT
+               col++, d++;
+#else
+           if (isprint(UChar(*d))) {
+               col++;
+               d++;
+           } else {
+               _nc_SPRINTF(d, _nc_SLIMIT(sizeof(temp) - (d - buf))
+                           "\\%03o", UChar(*s));
+               d += strlen(d);
+               col = (int) (d - temp);
+           }
+#endif
+       }
+       *lptr = ch_dup(temp);
+    }
+
+    free(my_vec);
+    free(my_blob);
+}
+
 int
 main(int argc, char *argv[])
 {
 int
 main(int argc, char *argv[])
 {
@@ -239,6 +471,8 @@ main(int argc, char *argv[])
        "  r,<Right>      - scroll the viewport right by one column",
        "",
        "  h,<Home>       - scroll the viewport to top of file",
        "  r,<Right>      - scroll the viewport right by one column",
        "",
        "  h,<Home>       - scroll the viewport to top of file",
+       "  ^F,<PageDn>    - scroll to the next page",
+       "  ^B,<PageUp>    - scroll to the previous page",
        "  e,<End>        - scroll the viewport to end of file",
        "",
        "  ^L             - repaint using redrawwin()",
        "  e,<End>        - scroll the viewport to end of file",
        "",
        "  ^L             - repaint using redrawwin()",
@@ -250,9 +484,6 @@ main(int argc, char *argv[])
        0
     };
 
        0
     };
 
-    int MAXLINES = 1000;
-    FILE *fp;
-    char buf[BUFSIZ];
     int i;
     int my_delay = 0;
     NCURSES_CH_T **olptr;
     int i;
     int my_delay = 0;
     NCURSES_CH_T **olptr;
@@ -268,15 +499,7 @@ main(int argc, char *argv[])
 
     setlocale(LC_ALL, "");
 
 
     setlocale(LC_ALL, "");
 
-#ifndef NCURSES_VERSION
-    /*
-     * We know ncurses will catch SIGINT if we don't establish our own handler.
-     * Other versions of curses may/may not catch it.
-     */
-    (void) signal(SIGINT, finish);     /* arrange interrupts to terminate */
-#endif
-
-    while ((i = getopt(argc, argv, "cin:rstT:")) != -1) {
+    while ((i = getopt(argc, argv, "cirstT:")) != -1) {
        switch (i) {
        case 'c':
            try_color = TRUE;
        switch (i) {
        case 'c':
            try_color = TRUE;
@@ -284,11 +507,6 @@ main(int argc, char *argv[])
        case 'i':
            ignore_sigs = TRUE;
            break;
        case 'i':
            ignore_sigs = TRUE;
            break;
-       case 'n':
-           if ((MAXLINES = atoi(optarg)) < 1 ||
-               (MAXLINES + 2) <= 1)
-               usage();
-           break;
 #if CAN_RESIZE
        case 'r':
            nonposix_resize = TRUE;
 #if CAN_RESIZE
        case 'r':
            nonposix_resize = TRUE;
@@ -318,82 +536,14 @@ main(int argc, char *argv[])
     if (optind + 1 != argc)
        usage();
 
     if (optind + 1 != argc)
        usage();
 
-    if ((vec_lines = typeCalloc(NCURSES_CH_T *, (size_t) MAXLINES + 2)) == 0)
-       usage();
-
-    assert(vec_lines != 0);
+    read_file(fname = argv[optind]);
 
 
-    fname = argv[optind];
-    if ((fp = fopen(fname, "r")) == 0) {
-       perror(fname);
-       ExitProgram(EXIT_FAILURE);
-    }
 #if CAN_RESIZE
     if (nonposix_resize)
        (void) signal(SIGWINCH, adjust);        /* arrange interrupts to resize */
 #endif
 
 #if CAN_RESIZE
     if (nonposix_resize)
        (void) signal(SIGWINCH, adjust);        /* arrange interrupts to resize */
 #endif
 
-    Trace(("slurp the file"));
-    for (lptr = &vec_lines[0]; (lptr - vec_lines) < MAXLINES; lptr++) {
-       char temp[BUFSIZ], *s, *d;
-       int col;
-
-       if (fgets(buf, sizeof(buf), fp) == 0)
-           break;
-
-#if USE_WIDEC_SUPPORT
-       if (lptr == vec_lines) {
-           if (!memcmp("", buf, 3)) {
-               Trace(("trim BOM"));
-               s = buf + 3;
-               d = buf;
-               do {
-               } while ((*d++ = *s++) != '\0');
-           }
-       }
-#endif
-
-       /* convert tabs and nonprinting chars so that shift will work properly */
-       for (s = buf, d = temp, col = 0; (*d = *s) != '\0'; s++) {
-           if (*d == '\r') {
-               if (s[1] == '\n') {
-                   continue;
-               } else {
-                   break;
-               }
-           }
-           if (*d == '\n') {
-               *d = '\0';
-               break;
-           } else if (*d == '\t') {
-               col = (col | 7) + 1;
-               while ((d - temp) != col)
-                   *d++ = ' ';
-           } else
-#if USE_WIDEC_SUPPORT
-               col++, d++;
-#else
-           if (isprint(UChar(*d))) {
-               col++;
-               d++;
-           } else {
-               _nc_SPRINTF(d, _nc_SLIMIT(sizeof(temp) - (d - buf))
-                           "\\%03o", UChar(*s));
-               d += strlen(d);
-               col = (int) (d - temp);
-           }
-#endif
-       }
-       *lptr = ch_dup(temp);
-    }
-    (void) fclose(fp);
-    num_lines = (int) (lptr - vec_lines);
-
-    if (ignore_sigs) {
-       InitAndCatch(initscr(), SIG_IGN);
-    } else {
-       initscr();
-    }
+    InitAndCatch(initscr(), ignore_sigs ? SIG_IGN : finish);
     keypad(stdscr, TRUE);      /* enable keyboard mapping */
     (void) nonl();             /* tell curses not to do NL->CR/NL on output */
     (void) cbreak();           /* take input chars one at a time, no wait for \n */
     keypad(stdscr, TRUE);      /* enable keyboard mapping */
     (void) nonl();             /* tell curses not to do NL->CR/NL on output */
     (void) cbreak();           /* take input chars one at a time, no wait for \n */
@@ -473,15 +623,41 @@ main(int argc, char *argv[])
            scrl((int) (lptr - olptr));
            break;
 
            scrl((int) (lptr - olptr));
            break;
 
+       case '<':
+           shift = 0;
+           /* FALLTHRU */
        case 'h':
        case 'h':
+           /* FALLTHRU */
        case KEY_HOME:
            lptr = vec_lines;
            break;
 
        case KEY_HOME:
            lptr = vec_lines;
            break;
 
+       case '>':
+           shift = 0;
+           /* FALLTHRU */
        case 'e':
        case 'e':
+           /* FALLTHRU */
        case KEY_END:
            if (num_lines > LINES)
        case KEY_END:
            if (num_lines > LINES)
-               lptr = vec_lines + num_lines - LINES + 1;
+               lptr = (vec_lines + num_lines - LINES + 1);
+           else
+               lptr = (vec_lines + (num_lines - 2));
+           break;
+
+       case CTRL('F'):
+           /* FALLTHRU */
+       case KEY_NPAGE:
+           if ((lptr - vec_lines) < (num_lines - 5))
+               lptr += (LINES - 1);
+           else
+               lptr = (vec_lines + num_lines - 2);
+           break;
+
+       case CTRL('B'):
+           /* FALLTHRU */
+       case KEY_PPAGE:
+           if ((lptr - vec_lines) >= LINES)
+               lptr -= (LINES - 1);
            else
                lptr = vec_lines;
            break;
            else
                lptr = vec_lines;
            break;
@@ -549,108 +725,3 @@ main(int argc, char *argv[])
 
     finish(0);                 /* we're done */
 }
 
     finish(0);                 /* we're done */
 }
-
-static void
-finish(int sig)
-{
-    endwin();
-#if NO_LEAKS
-    if (vec_lines != 0) {
-       int n;
-       for (n = 0; n < num_lines; ++n) {
-           free(vec_lines[n]);
-       }
-       free(vec_lines);
-    }
-#endif
-    ExitProgram(sig != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
-}
-
-#if CAN_RESIZE
-/*
- * This uses functions that are "unsafe", but it seems to work on SunOS. 
- * Usually: the "unsafe" refers to the functions that POSIX lists which may be
- * called from a signal handler.  Those do not include buffered I/O, which is
- * used for instance in wrefresh().  To be really portable, you should use the
- * KEY_RESIZE return (which relies on ncurses' sigwinch handler).
- *
- * The 'wrefresh(curscr)' is needed to force the refresh to start from the top
- * of the screen -- some xterms mangle the bitmap while resizing.
- */
-static void
-adjust(int sig)
-{
-    if (waiting || sig == 0) {
-       struct winsize size;
-
-       if (ioctl(fileno(stdout), TIOCGWINSZ, &size) == 0) {
-           resize_term(size.ws_row, size.ws_col);
-           wrefresh(curscr);
-           show_all(sig ? "SIGWINCH" : "interrupt");
-       }
-       interrupted = FALSE;
-    } else {
-       interrupted = TRUE;
-    }
-    (void) signal(SIGWINCH, adjust);   /* some systems need this */
-}
-#endif /* CAN_RESIZE */
-
-static void
-show_all(const char *tag)
-{
-    int i;
-    char temp[BUFSIZ];
-    NCURSES_CH_T *s;
-    time_t this_time;
-
-#if CAN_RESIZE
-    _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
-               "%.20s (%3dx%3d) col %d ", tag, LINES, COLS, shift);
-    i = (int) strlen(temp);
-    if ((i + 7) < (int) sizeof(temp)) {
-       _nc_SPRINTF(temp + i, _nc_SLIMIT(sizeof(temp) - (size_t) i)
-                   "view %.*s",
-                   (int) (sizeof(temp) - 7 - (size_t) i),
-                   fname);
-    }
-#else
-    (void) tag;
-    _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
-               "view %.*s", (int) sizeof(temp) - 7, fname);
-#endif
-    move(0, 0);
-    printw("%.*s", COLS, temp);
-    clrtoeol();
-    this_time = time((time_t *) 0);
-    _nc_STRNCPY(temp, ctime(&this_time), (size_t) 30);
-    if ((i = (int) strlen(temp)) != 0) {
-       temp[--i] = 0;
-       if (move(0, COLS - i - 2) != ERR)
-           printw("  %s", temp);
-    }
-
-    scrollok(stdscr, FALSE);   /* prevent screen from moving */
-    for (i = 1; i < LINES; i++) {
-       move(i, 0);
-       printw("%3ld:", (long) (lptr + i - vec_lines));
-       clrtoeol();
-       if ((s = lptr[i - 1]) != 0) {
-           int len = ch_len(s);
-           if (len > shift) {
-#if USE_WIDEC_SUPPORT
-               add_wchstr(s + shift);
-#else
-               addchstr(s + shift);
-#endif
-           }
-#if defined(NCURSES_VERSION) || defined(HAVE_WCHGAT)
-           if (try_color)
-               wchgat(stdscr, -1, WA_NORMAL, my_pair, NULL);
-#endif
-       }
-    }
-    setscrreg(1, LINES - 1);
-    scrollok(stdscr, TRUE);
-    refresh();
-}