From 02c4e383be9337e73a0e75844dfd1047745adb28 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 8 Apr 2018 00:58:31 +0000 Subject: [PATCH] ncurses 6.1 - patch 20180407 + clarify in manual pages that vwprintw and vwscanw are obsolete, not part of X/Open Curses since 2007. + use "const" in some prototypes rather than NCURSES_CONST where X/Open Curses was updated to do this, e.g., wscanw, newterm, the terminfo interface. Also use "const" for consistency in the termcap interface, which was withdrawn by X/Open Curses in Issue 5 (2007). As of Issue 7, X/Open Curses still lacks "const" for certain return values, e.g., keyname(). --- NEWS | 14 +++++- VERSION | 2 +- dist.mk | 4 +- doc/html/man/adacurses6-config.1.html | 2 +- doc/html/man/captoinfo.1m.html | 2 +- doc/html/man/clear.1.html | 2 +- doc/html/man/curs_initscr.3x.html | 6 +-- doc/html/man/curs_printw.3x.html | 33 ++++++++----- doc/html/man/curs_scanw.3x.html | 69 +++++++++++++++++---------- doc/html/man/curs_sp_funcs.3x.html | 16 +++---- doc/html/man/curs_termcap.3x.html | 51 +++++++++++--------- doc/html/man/curs_terminfo.3x.html | 12 +++-- doc/html/man/form.3x.html | 2 +- doc/html/man/infocmp.1m.html | 2 +- doc/html/man/infotocap.1m.html | 2 +- doc/html/man/menu.3x.html | 2 +- doc/html/man/ncurses.3x.html | 2 +- doc/html/man/ncurses6-config.1.html | 2 +- doc/html/man/panel.3x.html | 2 +- doc/html/man/tabs.1.html | 2 +- doc/html/man/terminfo.5.html | 2 +- doc/html/man/tic.1m.html | 2 +- doc/html/man/toe.1m.html | 2 +- doc/html/man/tput.1.html | 2 +- doc/html/man/tset.1.html | 2 +- include/MKterm.h.awk.in | 42 ++++++++-------- include/curses.h.in | 32 ++++++------- include/termcap.h.in | 13 ++--- man/curs_initscr.3x | 6 +-- man/curs_printw.3x | 35 ++++++++++---- man/curs_scanw.3x | 49 +++++++++++++++---- man/curs_sp_funcs.3x | 16 +++---- man/curs_termcap.3x | 16 +++++-- man/curs_terminfo.3x | 13 +++-- misc/terminfo.src | 28 +++++------ ncurses/base/lib_newterm.c | 8 ++-- ncurses/base/lib_scanw.c | 24 ++++++---- ncurses/curses.priv.h | 6 +-- ncurses/tinfo/lib_setup.c | 8 ++-- ncurses/tinfo/lib_termcap.c | 19 ++++---- ncurses/tinfo/lib_tgoto.c | 6 +-- ncurses/tinfo/lib_ti.c | 16 +++---- ncurses/tinfo/lib_tparm.c | 8 ++-- ncurses/tinfo/read_termcap.c | 8 ++-- package/debian-mingw/changelog | 4 +- package/debian-mingw64/changelog | 4 +- package/debian/changelog | 4 +- package/mingw-ncurses.nsi | 4 +- package/mingw-ncurses.spec | 2 +- package/ncurses.spec | 2 +- test/tracemunch | 4 +- 51 files changed, 363 insertions(+), 253 deletions(-) diff --git a/NEWS b/NEWS index 4c47bbb8..6027e9a8 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.3107 2018/03/31 22:45:41 tom Exp $ +-- $Id: NEWS,v 1.3111 2018/04/08 00:56:30 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,16 @@ 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. +20180407 + + clarify in manual pages that vwprintw and vwscanw are obsolete, + not part of X/Open Curses since 2007. + + use "const" in some prototypes rather than NCURSES_CONST where X/Open + Curses was updated to do this, e.g., wscanw, newterm, the terminfo + interface. Also use "const" for consistency in the termcap + interface, which was withdrawn by X/Open Curses in Issue 5 (2007). + As of Issue 7, X/Open Curses still lacks "const" for certain return + values, e.g., keyname(). + 20180331 + improve terminfo write/read by modifying the fourth item of the extended header to denote the number of valid strings in the extended @@ -54,6 +64,8 @@ it is not possible to add this information. + amend Scaled256() macro in test/picsmap.c to cover the full range 0..1000 (report by Roger Pau Monne). + add some checks in tracemunch for undefined variables. + + trim some redundant capabilities from st-0.7 -TD + + trim unnecessary setf/setb from interix -TD 20180317 + fix a check in infotocap which may not have detected a problem when diff --git a/VERSION b/VERSION index 2d4f32fc..087738b2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.1 20180331 +5:0:10 6.1 20180407 diff --git a/dist.mk b/dist.mk index 08281714..0496e0ec 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.1217 2018/03/31 15:26:33 tom Exp $ +# $Id: dist.mk,v 1.1218 2018/04/07 13:38:08 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -37,7 +37,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 6 NCURSES_MINOR = 1 -NCURSES_PATCH = 20180331 +NCURSES_PATCH = 20180407 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/doc/html/man/adacurses6-config.1.html b/doc/html/man/adacurses6-config.1.html index 8213d15b..bf3c2765 100644 --- a/doc/html/man/adacurses6-config.1.html +++ b/doc/html/man/adacurses6-config.1.html @@ -125,7 +125,7 @@

SEE ALSO

        curses(3x)
 
-       This describes ncurses version 6.1 (patch 20180331).
+       This describes ncurses version 6.1 (patch 20180407).
 
 
 
diff --git a/doc/html/man/captoinfo.1m.html b/doc/html/man/captoinfo.1m.html
index 5eec8f9a..1b7e97a2 100644
--- a/doc/html/man/captoinfo.1m.html
+++ b/doc/html/man/captoinfo.1m.html
@@ -190,7 +190,7 @@
 

SEE ALSO

        infocmp(1m), curses(3x), terminfo(5)
 
-       This describes ncurses version 6.1 (patch 20180331).
+       This describes ncurses version 6.1 (patch 20180407).
 
 
 

AUTHOR

diff --git a/doc/html/man/clear.1.html b/doc/html/man/clear.1.html
index 171b3994..54a1c753 100644
--- a/doc/html/man/clear.1.html
+++ b/doc/html/man/clear.1.html
@@ -148,7 +148,7 @@
 

SEE ALSO

        tput(1), terminfo(5)
 
-       This describes ncurses version 6.1 (patch 20180331).
+       This describes ncurses version 6.1 (patch 20180407).
 
 
 
diff --git a/doc/html/man/curs_initscr.3x.html b/doc/html/man/curs_initscr.3x.html
index a0c1cdae..2b1d0272 100644
--- a/doc/html/man/curs_initscr.3x.html
+++ b/doc/html/man/curs_initscr.3x.html
@@ -1,6 +1,6 @@
 
 
 
@@ -56,7 +56,7 @@
        WINDOW *initscr(void);
        int endwin(void);
        bool isendwin(void);
-       SCREEN *newterm(char *type, FILE *outfd, FILE *infd);
+       SCREEN *newterm(const char *type, FILE *outfd, FILE *infd);
        SCREEN *set_term(SCREEN *new);
        void delscreen(SCREEN* sp);
 
diff --git a/doc/html/man/curs_printw.3x.html b/doc/html/man/curs_printw.3x.html
index 482cc336..88adfe4a 100644
--- a/doc/html/man/curs_printw.3x.html
+++ b/doc/html/man/curs_printw.3x.html
@@ -1,6 +1,6 @@
 
 
 
@@ -57,9 +57,11 @@
        int wprintw(WINDOW *win, const char *fmt, ...);
        int mvprintw(int y, int x, const char *fmt, ...);
        int mvwprintw(WINDOW *win, int y, int x, const char *fmt, ...);
-       int vwprintw(WINDOW *win, const char *fmt, va_list varglist);
        int vw_printw(WINDOW *win, const char *fmt, va_list varglist);
 
+       /* obsolete */
+       int vwprintw(WINDOW *win, const char *fmt, va_list varglist);
+
 
 

DESCRIPTION

        The printw, wprintw, mvprintw and mvwprintw routines are  analogous  to
@@ -89,17 +91,26 @@
 
 
 

PORTABILITY

-       The  XSI Curses standard, Issue 4 describes these functions.  The func-
-       tion vwprintw is marked TO BE WITHDRAWN, and is to  be  replaced  by  a
-       function  vw_printw  using  the  <stdarg.h> interface.  The Single Unix
-       Specification, Version 2 states that vw_printw   is  preferred  to  vw-
-       printw since the latter requires including <varargs.h>, which cannot be
-       used  in  the  same  file  as  <stdarg.h>.   This  implementation  uses
-       <stdarg.h> for both, because that header is included in <curses.h>.
+       In  this implementation, vw_printw and vwprintw are equivalent, to sup-
+       port legacy applications.  However, the latter (vwprintw) is obsolete:
+
+       o   The XSI Curses standard, Issue 4 described  these  functions.   The
+           function  vwprintw is marked TO BE WITHDRAWN, and is to be replaced
+           by a function vw_printw using the <stdarg.h> interface.
+
+       o   The Single Unix Specification, Version 2 states that vw_printw   is
+           preferred   to   vwprintw   since  the  latter  requires  including
+           <varargs.h>, which cannot be used in the same file  as  <stdarg.h>.
+           This  implementation  uses <stdarg.h> for both, because that header
+           is included in <curses.h>.
+
+       o   X/Open Curses, Issue 5 (December 2007) marked vwprintw (along  with
+           vwscanw and the termcap interface) as withdrawn.
 
 
 

SEE ALSO

-       curses(3x), printf(3), vprintf(3).
+       curses(3x), curs_addstr(3x), curs_scanw(3x), curs_termcap(3x),
+       printf(3), vprintf(3).
 
 
 
diff --git a/doc/html/man/curs_scanw.3x.html b/doc/html/man/curs_scanw.3x.html
index b6331f09..5a4c957d 100644
--- a/doc/html/man/curs_scanw.3x.html
+++ b/doc/html/man/curs_scanw.3x.html
@@ -1,6 +1,6 @@
 
 
 
@@ -53,12 +53,14 @@
 

SYNOPSIS

        #include <curses.h>
 
-       int scanw(char *fmt, ...);
-       int wscanw(WINDOW *win, char *fmt, ...);
-       int mvscanw(int y, int x, char *fmt, ...);
-       int mvwscanw(WINDOW *win, int y, int x, char *fmt, ...);
-       int vw_scanw(WINDOW *win, char *fmt, va_list varglist);
-       int vwscanw(WINDOW *win, char *fmt, va_list varglist);
+       int scanw(const char *fmt, ...);
+       int wscanw(WINDOW *win, const char *fmt, ...);
+       int mvscanw(int y, int x, const char *fmt, ...);
+       int mvwscanw(WINDOW *win, int y, int x, const char *fmt, ...);
+       int vw_scanw(WINDOW *win, const char *fmt, va_list varglist);
+
+       /* obsolete */
+       int vwscanw(WINDOW *win, const char *fmt, va_list varglist);
 
 
 

DESCRIPTION

@@ -87,27 +89,46 @@
 
 
 

PORTABILITY

-       The  XSI Curses standard, Issue 4 describes these functions.  The func-
-       tion vwscanw is marked TO BE WITHDRAWN, and is  to  be  replaced  by  a
-       function  vw_scanw  using  the  <stdarg.h>  interface.  The Single Unix
-       Specification, Version 2 states that vw_scanw  is preferred to  vwscanw
-       since  the  latter requires including <varargs.h>, which cannot be used
-       in the same file as <stdarg.h>.  This  implementation  uses  <stdarg.h>
-       for both, because that header is included in <curses.h>.
+       In this implementation, vw_scanw and vwscanw are equivalent, to support
+       legacy applications.  However, the latter (vwscanw) is obsolete:
+
+       o   The XSI Curses standard, Issue 4 described these functions,  noting
+           that  the  function vwscanw is marked TO BE WITHDRAWN, and is to be
+           replaced by a function vw_scanw using the <stdarg.h> interface.
+
+       o   The Single Unix Specification, Version 2 states that  vw_scanw   is
+           preferred   to   vwscanw   since   the  latter  requires  including
+           <varargs.h>, which cannot be used in the same file  as  <stdarg.h>.
+           This  implementation  uses <stdarg.h> for both, because that header
+           is included in <curses.h>.
+
+       o   X/Open Curses, Issue 5 (December 2007) marked vwscanw  (along  with
+           vwprintw and the termcap interface) as withdrawn.
 
        Both  XSI and The Single Unix Specification, Version 2 state that these
-       functions return ERR or OK.  Since the underlying scanf(3)  can  return
-       the  number  of  items scanned, and the SVr4 code was documented to use
-       this feature, this is probably an editing error which was introduced in
-       XSI,  rather  than  being  done  intentionally.   Portable applications
-       should only test if the return value is ERR, since the OK value  (zero)
-       is  likely  to  be  misleading.  One possible way to get useful results
-       would be to use a "%n" conversion at the end of the  format  string  to
-       ensure that something was processed.
+       functions return ERR or OK.
+
+       o   Since the underlying  scanf(3)  can  return  the  number  of  items
+           scanned, and the SVr4 code was documented to use this feature, this
+           is probably an editing error which was introduced  in  XSI,  rather
+           than being done intentionally.
+
+       o   This  implementation  returns the number of items scanned, for com-
+           patibility with SVr4  curses.   As  of  2018,  NetBSD  curses  also
+           returns  the  number  of  items  scanned.   Both ncurses and NetBSD
+           curses call vsscanf to scan the string, which returns EOF on error.
+
+       o   Portable applications should only test if the return value is  ERR,
+           since the OK value (zero) is likely to be misleading.
+
+           One  possible way to get useful results would be to use a "%n" con-
+           version at the end of the format string to  ensure  that  something
+           was processed.
 
 
 

SEE ALSO

-       curses(3x), curs_getstr(3x), curs_printw(3x), scanf(3)
+       curses(3x), curs_getstr(3x), curs_printw(3x), curs_termcap(3x),
+       scanf(3).
 
 
 
diff --git a/doc/html/man/curs_sp_funcs.3x.html b/doc/html/man/curs_sp_funcs.3x.html
index 9e38103d..8c7f3fb7 100644
--- a/doc/html/man/curs_sp_funcs.3x.html
+++ b/doc/html/man/curs_sp_funcs.3x.html
@@ -1,6 +1,6 @@
 
 
 
@@ -59,10 +59,10 @@
        extern char * BC;
        extern short ospeed;
 
-       int tgetent(char *bp, const char *name);
-       int tgetflag(char *id);
-       int tgetnum(char *id);
-       char *tgetstr(char *id, char **area);
+       int tgetent(const char *bp, const char *name);
+       int tgetflag(const char *id);
+       int tgetnum(const char *id);
+       char *tgetstr(const char *id, char **area);
        char *tgoto(const char *cap, int col, int row);
        int tputs(const char *str, int affcnt, int (*putc)(int));
 
@@ -194,38 +194,45 @@
 
 
 

PORTABILITY

-       The XSI Curses standard, Issue 4 describes these  functions.   However,
-       they are marked TO BE WITHDRAWN and may be removed in future versions.
-
-       Neither  the  XSI Curses standard nor the SVr4 man pages documented the
-       return values of tgetent correctly, though all three were in  fact  re-
-       turned  ever  since SVr1.  In particular, an omission in the XSI Curses
-       documentation has been misinterpreted to mean that tgetent  returns  OK
-       or  ERR.  Because the purpose of these functions is to provide compati-
-       bility with the termcap library, that is a defect in XCurses, Issue  4,
+       These functions are provided for supporting  legacy  applications,  and
+       should not be used in new programs:
+
+       o   The XSI Curses standard, Issue 4 describes these functions.  Howev-
+           er, they are marked TO BE WITHDRAWN and may be  removed  in  future
+           versions.
+
+       o   X/Open Curses, Issue 5 (December 2007) marked the termcap interface
+           (along with vwprintw and vwscanw) as withdrawn.
+
+       Neither the XSI Curses standard nor the SVr4 man pages  documented  the
+       return  values  of tgetent correctly, though all three were in fact re-
+       turned ever since SVr1.  In particular, an omission in the  XSI  Curses
+       documentation  has  been misinterpreted to mean that tgetent returns OK
+       or ERR.  Because the purpose of these functions is to provide  compati-
+       bility  with the termcap library, that is a defect in XCurses, Issue 4,
        Version 2 rather than in ncurses.
 
        External variables are provided for support of certain termcap applica-
        tions.  However, termcap applications' use of those variables is poorly
        documented, e.g., not distinguishing between input and output.  In par-
-       ticular, some applications are reported to declare  and/or  modify  os-
+       ticular,  some  applications  are reported to declare and/or modify os-
        peed.
 
-       The  comment that only the first two characters of the id parameter are
+       The comment that only the first two characters of the id parameter  are
        used escapes many application developers.  The original BSD 4.2 termcap
        library (and historical relics thereof) did not require a trailing null
-       NUL on the parameter name passed  to  tgetstr,  tgetnum  and  tgetflag.
-       Some  applications  assume  that the termcap interface does not require
+       NUL  on  the  parameter  name  passed to tgetstr, tgetnum and tgetflag.
+       Some applications assume that the termcap interface  does  not  require
        the trailing NUL for the parameter name.  Taking into account these is-
        sues:
 
-       o   As  a  special  case,  tgetflag  matched against a single-character
-           identifier provided that was at the end of  the  terminal  descrip-
+       o   As a special case,  tgetflag  matched  against  a  single-character
+           identifier  provided  that  was at the end of the terminal descrip-
            tion.  You should not rely upon this behavior in portable programs.
-           This implementation disallows matches against single-character  ca-
+           This  implementation disallows matches against single-character ca-
            pability names.
 
-       o   This  implementation  disallows  matches  by  the termcap interface
+       o   This implementation disallows  matches  by  the  termcap  interface
            against extended capability names which are longer than two charac-
            ters.
 
diff --git a/doc/html/man/curs_terminfo.3x.html b/doc/html/man/curs_terminfo.3x.html
index 64b9ea1d..36d4f66c 100644
--- a/doc/html/man/curs_terminfo.3x.html
+++ b/doc/html/man/curs_terminfo.3x.html
@@ -1,6 +1,6 @@