ncurses 6.2 - patch 20210213
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 14 Feb 2021 02:07:27 +0000 (02:07 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 14 Feb 2021 02:07:27 +0000 (02:07 +0000)
+ add test/back_ground.c, to exercise the wide-character background
  functions.
+ add a check in _nc_build_wch() in case the background character is a
  wide-character, rather than a new part of a multibyte character.
+ improve tracemunch's coverage of form/menu/panel libraries.
+ improve tracemunch's checking/reporting the type for the first
  parameter, e.g., "WINDOW*" rather than "#1".

27 files changed:
MANIFEST
NEWS
VERSION
dist.mk
menu/m_item_new.c
menu/m_new.c
ncurses/base/lib_addch.c
ncurses/base/lib_bkgd.c
ncurses/base/lib_color.c
ncurses/base/lib_mouse.c
ncurses/base/new_pair.c
ncurses/tinfo/lib_options.c
ncurses/tinfo/lib_tparm.c
ncurses/tinfo/read_entry.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
package/ncursest.spec
test/README
test/back_ground.c [new file with mode: 0644]
test/background.c
test/modules
test/programs
test/tracemunch

index 42b640cbf84fbbb300bc4833772bf36e24c60bdf..1dbfb96b7a1ceb76ef23c7cd73ffd75b9b7b6aa2 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
 ./test/Makefile.in
 ./test/README
 ./test/aclocal.m4
+./test/back_ground.c
 ./test/background.c
 ./test/blue.c
 ./test/bs.6
diff --git a/NEWS b/NEWS
index 5550d697fc2a162fe30144ee34b603008efcebf3..f43ab93694c5239d8533c610813ad9e2fd783130 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,7 +26,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3629 2021/02/06 22:15:36 tom Exp $
+-- $Id: NEWS,v 1.3631 2021/02/13 22:39:42 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -46,6 +46,15 @@ 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.
 
+20210213
+       + add test/back_ground.c, to exercise the wide-character background
+         functions.
+       + add a check in _nc_build_wch() in case the background character is a
+         wide-character, rather than a new part of a multibyte character.
+       + improve tracemunch's coverage of form/menu/panel libraries.
+       + improve tracemunch's checking/reporting the type for the first
+         parameter, e.g., "WINDOW*" rather than "#1".
+
 20210206
        + provide for wide-characters as background character in wbkgrnd
          (report/testcase by Anton Vidovic)
diff --git a/VERSION b/VERSION
index a143e2c35f4e3592ce319435544a2e3a31b489c5..223b4c8f50780dafe0da39b6be1cf0e12deb9249 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.2     20210206
+5:0:10 6.2     20210213
diff --git a/dist.mk b/dist.mk
index a0348ab5a5ba371481bd1e96a66bf71cf1b6d044..d3a055a5bc0cd49fcba35f2fc08204e2cb57d702 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -26,7 +26,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.1399 2021/02/06 11:00:36 tom Exp $
+# $Id: dist.mk,v 1.1400 2021/02/13 12:29:00 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -38,7 +38,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 6
 NCURSES_MINOR = 2
-NCURSES_PATCH = 20210206
+NCURSES_PATCH = 20210213
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 1e6130e678e2426d36ef7fb099f6d819862aad1b..4e3f67bacdd0580de188fc5243509ecae3211380 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2010,2012 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -45,7 +45,7 @@
 #endif
 #endif
 
-MODULE_ID("$Id: m_item_new.c,v 1.36 2020/12/12 00:38:08 tom Exp $")
+MODULE_ID("$Id: m_item_new.c,v 1.37 2021/02/13 19:40:51 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -127,6 +127,7 @@ new_item(const char *name, const char *description)
 
       if (item)
        {
+         T((T_CREATE("item %p"), (void *)item));
          *item = _nc_Default_Item;     /* hope we have struct assignment */
 
          item->name.length = (unsigned short)strlen(name);
index 5526887c2e8ec0e961b94191ca113fe09364e880..82c410c6a96a5115d724918b059b8df3079368a9 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2009,2010 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_new.c,v 1.24 2020/12/12 00:38:08 tom Exp $")
+MODULE_ID("$Id: m_new.c,v 1.26 2021/02/13 19:43:10 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -60,6 +60,7 @@ NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM **items)
   T((T_CALLED("new_menu(%p,%p)"), (void *)SP_PARM, (void *)items));
   if (menu)
     {
+      T((T_CREATE("menu %p"), (void *)menu));
       *menu = _nc_Default_Menu;
       menu->status = 0;
       menu->rows = menu->frows;
index 7c9e407c6aa6495fccde7a5982607089964c65c4..0da27e0b424bb2d6c73bb43202f09836a3eeb606 100644 (file)
@@ -37,7 +37,7 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_addch.c,v 1.135 2021/01/31 00:42:53 tom Exp $")
+MODULE_ID("$Id: lib_addch.c,v 1.136 2021/02/13 22:33:05 tom Exp $")
 
 static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT);
 
@@ -208,6 +208,20 @@ _nc_build_wch(WINDOW *win, ARG_CH_T ch)
     WINDOW_EXT(win, addch_x) = x;
     WINDOW_EXT(win, addch_y) = y;
 
+    /*
+     * If the background character is a wide-character, that may interfere with
+     * processing multibyte characters in this function.
+     */
+    if (!is8bits(CharOf(CHDEREF(ch)))) {
+       if (WINDOW_EXT(win, addch_used) != 0) {
+           /* discard the incomplete multibyte character */
+           WINDOW_EXT(win, addch_used) = 0;
+           TR(TRACE_VIRTPUT,
+              ("Alert discarded incomplete multibyte"));
+       }
+       return 1;
+    }
+
     init_mb(state);
     buffer[WINDOW_EXT(win, addch_used)] = (char) CharOf(CHDEREF(ch));
     WINDOW_EXT(win, addch_used) += 1;
index 0ffb5a2d8898dc53f34310718083eea447564b1d..23effc7cd141f5a24f944ccf102e67c84a0367c2 100644 (file)
@@ -37,7 +37,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_bkgd.c,v 1.61 2021/02/06 21:18:08 tom Exp $")
+MODULE_ID("$Id: lib_bkgd.c,v 1.62 2021/02/13 20:06:54 tom Exp $")
 
 static const NCURSES_CH_T blank = NewChar(BLANK_TEXT);
 
@@ -51,7 +51,7 @@ static NCURSES_INLINE void
 #endif
 wbkgrndset(WINDOW *win, const ARG_CH_T ch)
 {
-    T((T_CALLED("wbkgdset(%p,%s)"), (void *) win, _tracech_t(ch)));
+    T((T_CALLED("wbkgrndset(%p,%s)"), (void *) win, _tracech_t(ch)));
 
     if (win) {
        attr_t off = AttrOf(win->_nc_bkgd);
@@ -105,8 +105,10 @@ NCURSES_EXPORT(void)
 wbkgdset(WINDOW *win, chtype ch)
 {
     NCURSES_CH_T wch;
+    T((T_CALLED("wbkgdset(%p,%s)"), (void *) win, _tracechtype(ch)));
     SetChar2(wch, ch);
     wbkgrndset(win, CHREF(wch));
+    returnVoid;
 }
 
 /*
index 2343219e0aec79514e3cea59614c28d090912fe7..907e9743fcdac924ce62502e3b0890853930472b 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -49,7 +49,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_color.c,v 1.145 2020/05/27 23:55:32 tom Exp $")
+MODULE_ID("$Id: lib_color.c,v 1.146 2021/02/14 00:17:09 tom Exp $")
 
 #ifdef USE_TERM_DRIVER
 #define CanChange      InfoOf(SP_PARM).canchange
@@ -252,14 +252,15 @@ init_direct_colors(NCURSES_SP_DCL0)
 {
     static NCURSES_CONST char name[] = "RGB";
 
-    int n;
-    const char *s;
-    int width;
     rgb_bits_t *result = &(SP_PARM->_direct_color);
 
     result->value = 0;
 
     if (COLORS >= 8) {
+       int n;
+       const char *s;
+       int width;
+
        /* find the number of bits needed for the maximum color value */
        for (width = 0; (1 << width) - 1 < (COLORS - 1); ++width) {
            ;
@@ -360,7 +361,6 @@ NCURSES_EXPORT(int)
 NCURSES_SP_NAME(start_color) (NCURSES_SP_DCL0)
 {
     int result = ERR;
-    int maxpairs = 0, maxcolors = 0;
 
     T((T_CALLED("start_color(%p)"), (void *) SP_PARM));
 
@@ -369,8 +369,8 @@ NCURSES_SP_NAME(start_color) (NCURSES_SP_DCL0)
     } else if (SP_PARM->_coloron) {
        result = OK;
     } else {
-       maxpairs = MaxPairs;
-       maxcolors = MaxColors;
+       int maxpairs = MaxPairs;
+       int maxcolors = MaxColors;
        if (reset_color_pair(NCURSES_SP_ARG) != TRUE) {
            set_foreground_color(NCURSES_SP_ARGx
                                 default_fg(NCURSES_SP_ARG),
index f6cdba95a2d2d6b0c980d5ba116abf1f341d6b3c..6caef327a3c02b404e420da90fc42494d9706e5a 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -85,7 +85,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_mouse.c,v 1.191 2020/06/13 21:05:02 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.192 2021/02/14 00:17:09 tom Exp $")
 
 #include <tic.h>
 
@@ -978,7 +978,7 @@ decode_X10_bstate(SCREEN *sp, MEVENT * eventp, unsigned intro)
     if (intro >= 96) {
        if (intro >= 160) {
            button = (int) (intro - 152);       /* buttons 8-11 */
-       } else if (intro >= 96) {
+       } else {
            button = (int) (intro - 92);        /* buttons 4-7 */
        }
     } else {
index 92131232e8695edf52b51f8902fac008176ef61c..c04f4acbb95d7166f875a76c242fb0834b70da21 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 2017 Free Software Foundation, Inc.                            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -61,7 +61,7 @@
 
 #endif
 
-MODULE_ID("$Id: new_pair.c,v 1.20 2020/04/11 16:06:56 tom Exp $")
+MODULE_ID("$Id: new_pair.c,v 1.21 2021/02/14 00:17:09 tom Exp $")
 
 #if NCURSES_EXT_COLORS
 
@@ -145,11 +145,11 @@ _nc_find_color_pair(SCREEN *sp, int fg, int bg)
 {
     colorpair_t find;
     int result = -1;
-    void *pp;
 
     find.fg = fg;
     find.bg = bg;
     if (sp != 0) {
+       void *pp;
        if ((pp = tfind(&find, &sp->_ordered_pairs, compare_data)) != 0) {
            colorpair_t *temp = *(colorpair_t **) pp;
            result = (int) (temp - sp->_color_pairs);
index 784e06c17fa1dde076a2f4bd0c4030381f4c05cd..017a34aac6e712e07899c9bc1c63f3198c2296d7 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 1998-2014,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -47,7 +47,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_options.c,v 1.81 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_options.c,v 1.82 2021/02/14 00:17:35 tom Exp $")
 
 NCURSES_EXPORT(int)
 idlok(WINDOW *win, bool flag)
@@ -361,7 +361,7 @@ _nc_keypad(SCREEN *sp, int flag)
 #else
            if (flag) {
                (void) NCURSES_PUTP2_FLUSH("keypad_xmit", keypad_xmit);
-           } else if (!flag && keypad_local) {
+           } else if (keypad_local) {
                (void) NCURSES_PUTP2_FLUSH("keypad_local", keypad_local);
            }
 
index 7f0b20b99f6720a13c6a4dbe337fe1708c0f2d09..b8104eabcd5e57cdf28d930ccbf6947ed6909085 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -53,7 +53,7 @@
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: lib_tparm.c,v 1.128 2020/10/10 21:18:09 tom Exp $")
+MODULE_ID("$Id: lib_tparm.c,v 1.129 2021/02/14 00:09:49 tom Exp $")
 
 /*
  *     char *
@@ -405,7 +405,7 @@ parse_format(const char *s, char *format, int *len)
  * may be cases that we cannot see the explicit parameter numbers.
  */
 NCURSES_EXPORT(int)
-_nc_tparm_analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount)
+_nc_tparm_analyze(const char *string, char **p_is_s, int *popcount)
 {
     size_t len2;
     int i;
@@ -589,7 +589,7 @@ tparm_setup(const char *string, TPARM_DATA * result)
                if ((fs = typeCalloc(TPARM_DATA, 1)) != 0) {
                    *fs = *result;
                    if ((fs->format = strdup(string)) != 0) {
-                       if ((ft = tsearch(fs, &MyCache, cmp_format)) != 0) {
+                       if (tsearch(fs, &MyCache, cmp_format) != 0) {
                            ++MyCount;
                        } else {
                            rc = ERR;
index 429f719a867383c86a28256fae33869cfb78f209..9741e103b7a9d3f954c90a9a7086ef631173a05c 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -42,7 +42,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: read_entry.c,v 1.158 2020/08/22 20:49:46 tom Exp $")
+MODULE_ID("$Id: read_entry.c,v 1.159 2021/02/14 00:17:09 tom Exp $")
 
 #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts))
 
@@ -257,7 +257,6 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
     char buf[MAX_ENTRY_SIZE + 2];
     char *string_table;
     unsigned want, have;
-    bool need_ints;
     size_t (*convert_numbers) (char *, NCURSES_INT2 *, int);
     int size_of_numbers;
     int max_entry_size = MAX_ENTRY_SIZE;
@@ -276,7 +275,7 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
        returnDB(TGETENT_NO);
     }
 #if NCURSES_EXT_NUMBERS
-    if ((need_ints = (LOW_MSB(buf) == MAGIC2))) {
+    if (LOW_MSB(buf) == MAGIC2) {
        convert_numbers = convert_32bits;
        size_of_numbers = SIZEOF_INT2;
     } else {
@@ -285,7 +284,7 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
        size_of_numbers = SIZEOF_SHORT;
     }
 #else
-    if ((need_ints = (LOW_MSB(buf) == MAGIC2))) {
+    if (LOW_MSB(buf) == MAGIC2) {
        convert_numbers = convert_32bits;
        size_of_numbers = SIZEOF_32BITS;
     } else {
@@ -666,11 +665,10 @@ decode_hex(const char **source)
 {
     int result = 0;
     int nibble;
-    int ch;
 
     for (nibble = 0; nibble < 2; ++nibble) {
+       int ch = UChar(**source);
        result <<= 4;
-       ch = UChar(**source);
        *source += 1;
        if (ch >= '0' && ch <= '9') {
            ch -= '0';
index dcd6a9a0a90d3ef1dac0ad5b5d2ae4221dda5e41..c1af362f83c5f9488aa3635b3f96126fe55ae7b2 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210206) unstable; urgency=low
+ncurses6 (6.2+20210213) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 06 Feb 2021 06:00:36 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 13 Feb 2021 07:29:01 -0500
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index dcd6a9a0a90d3ef1dac0ad5b5d2ae4221dda5e41..c1af362f83c5f9488aa3635b3f96126fe55ae7b2 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210206) unstable; urgency=low
+ncurses6 (6.2+20210213) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 06 Feb 2021 06:00:36 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 13 Feb 2021 07:29:01 -0500
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 32f75643e9d2050e2c6fb3b5bc79c97056bc84d7..65f233faee71c3995c17117557d37dac9083f8a6 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210206) unstable; urgency=low
+ncurses6 (6.2+20210213) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 06 Feb 2021 06:00:36 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 13 Feb 2021 07:29:01 -0500
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 5418eb22d3bd24fbe7f83e7206b9d802474e65c2..c9f6ce01c6ec8ef34bad7dec812cad5da93f2353 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.442 2021/02/06 11:00:36 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.443 2021/02/13 12:29:00 tom Exp $\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "2"\r
 !define VERSION_YYYY  "2021"\r
-!define VERSION_MMDD  "0206"\r
+!define VERSION_MMDD  "0213"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 2d4ff5a721a9bd021132953cb003d711f6f5a5ed..4fd03cfb553d44292f2ca0d9119f9b0f9c9365b3 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.2
-Release: 20210206
+Release: 20210213
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index fe538ff1d51a179318248d812d026b16f208457f..28843d3faa2ae85ae3967cc73f59dae5b9d779fb 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.2
-Release: 20210206
+Release: 20210213
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 0a2735f4970eed923d4bfd9bff7fad1b13534b4a..0cab7420dd3a6f31582fabeb8477bb0bda8730c1 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.2
-Release: 20210206
+Release: 20210213
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index f7618fc573e911e775c6f6b3f67b90522814472a..5dc07c657bfd54f491648169dbf678a24ebed617 100644 (file)
@@ -1,5 +1,5 @@
 -------------------------------------------------------------------------------
--- Copyright 2018-2019,2020 Thomas E. Dickey                                 --
+-- Copyright 2018-2020,2021 Thomas E. Dickey                                 --
 -- Copyright 1998-2017,2018 Free Software Foundation, Inc.                   --
 --                                                                           --
 -- Permission is hereby granted, free of charge, to any person obtaining a   --
@@ -26,7 +26,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: README,v 1.71 2020/12/19 16:56:00 tom Exp $
+-- $Id: README,v 1.72 2021/02/13 22:53:41 tom Exp $
 -------------------------------------------------------------------------------
 
 The programs in this directory are used to test and demonstrate ncurses.
@@ -242,11 +242,11 @@ PC                                test: demo_termcap
 SP                             lib: form
 TABSIZE                                test: test_opaque
 UP                             test: demo_termcap
-acs_map                                test: background gdc ins_wide inserts knight movewindow ncurses newdemo savescreen test_add_wchstr test_addchstr test_addstr test_addwstr testcurs
+acs_map                                test: back_ground background gdc ins_wide inserts knight movewindow ncurses newdemo savescreen test_add_wchstr test_addchstr test_addstr test_addwstr testcurs
 add_wch                                test: demo_new_pair demo_panels ncurses picsmap savescreen test_add_wchstr test_addwstr
 add_wchnstr                    test: test_add_wchstr
 add_wchstr                     test: test_add_wchstr view
-addch                          test: background blue bs color_content demo_tabs dots_curses echochar hashtest ncurses padview pair_content picsmap savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_opaque testaddch view worm
+addch                          test: back_ground background blue bs color_content demo_tabs dots_curses echochar hashtest ncurses padview pair_content picsmap savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_opaque testaddch view worm
 addchnstr                      test: test_addchstr
 addchstr                       test: test_addchstr
 addnstr                                test: test_addstr
@@ -255,7 +255,7 @@ addstr                              test: blue bs cardfile filter gdc hanoi lrtest ncurses test_addstr
 addwstr                                test: blue test_addwstr
 alloc_pair                     test: demo_new_pair dots_xcurses
 alloc_pair_sp                  -
-assume_default_colors          test: background ncurses
+assume_default_colors          test: back_ground background ncurses
 assume_default_colors_sp       -
 attr_get                       -
 attr_off                       test: dots_xcurses ncurses
@@ -271,7 +271,7 @@ beep_sp                             lib: ncurses
 bkgd                           test: background cardfile demo_forms dup_field move_field ncurses padview savescreen tclock view
 bkgdset                                test: background ncurses testaddch
 bkgrnd                         test: ncurses
-bkgrndset                      test: ncurses
+bkgrndset                      test: back_ground ncurses
 boolcodes                      test: demo_termcap test_arrays progs: dump_entry
 boolfnames                     test: demo_terminfo test_arrays progs: dump_entry
 boolnames                      test: demo_terminfo test_arrays progs: dump_entry infocmp
@@ -281,7 +281,7 @@ box                         test: cardfile chgat clip_printw demo_forms demo_menus demo_panels ditto
 box_set                                test: ncurses
 can_change_color               test: color_content extended_color ncurses
 can_change_color_sp            test: extended_color
-cbreak                         test: background blue bs cardfile chgat clip_printw color_content color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dup_field extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
+cbreak                         test: back_ground background blue bs cardfile chgat clip_printw color_content color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dup_field extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
 cbreak_sp                      test: sp_tinfo
 chgat                          test: chgat
 clear                          test: blue bs filter gdc ncurses padview testcurs xmas
@@ -320,7 +320,7 @@ echo                                test: bs hanoi ncurses test_get_wstr test_getstr testcurs testscanw
 echo_sp                                lib: ncurses
 echo_wchar                     test: ncurses
 echochar                       test: echochar ncurses
-endwin                         test: background blue bs cardfile chgat clip_printw color_content color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dots_curses dots_mvcur dots_xcurses dup_field echochar extended_color filter firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
+endwin                         test: back_ground background blue bs cardfile chgat clip_printw color_content color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dots_curses dots_mvcur dots_xcurses dup_field echochar extended_color filter firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
 endwin_sp                      lib: ncurses
 erase                          test: cardfile demo_menus filter firework firstlast hanoi lrtest ncurses picsmap tclock test_opaque testcurs
 erasechar                      test: ncurses
@@ -353,8 +353,8 @@ getbegx                             test: chgat clip_printw demo_menus demo_panels dump_window insdelln m
 getbegy                                test: chgat clip_printw demo_menus demo_panels dump_window insdelln move_field movewindow ncurses newdemo redraw testcurs
 getbkgd                                test: ncurses
 getbkgrnd                      test: ncurses
-getcchar                       test: ncurses savescreen view
-getch                          test: background blue bs chgat color_content color_set demo_altkeys demo_new_pair demo_tabs extended_color filter firework firstlast foldkeys hanoi hashtest insdelln lrtest padview pair_content picsmap savescreen tclock test_opaque testaddch testcurs view xmas
+getcchar                       test: demo_new_pair ncurses savescreen view
+getch                          test: back_ground background blue bs chgat color_content color_set demo_altkeys demo_new_pair demo_tabs extended_color filter firework firstlast foldkeys hanoi hashtest insdelln lrtest padview pair_content picsmap savescreen tclock test_opaque testaddch testcurs view xmas
 getcurx                                test: bs chgat clip_printw demo_altkeys demo_defkey demo_panels dump_window extended_color filter firstlast foldkeys insdelln move_field movewindow ncurses redraw savescreen test_get_wstr test_getstr test_opaque testcurs view
 getcury                                test: bs chgat clip_printw demo_altkeys demo_defkey demo_panels dump_window extended_color filter firstlast foldkeys insdelln move_field movewindow ncurses popup_msg redraw savescreen test_opaque testcurs view
 getmaxx                                test: chgat clip_printw demo_panels dump_window firstlast inch_wide inchs insdelln movewindow ncurses newdemo popup_msg redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
@@ -370,7 +370,7 @@ getwin                              test: ncurses
 getwin_sp                      -
 halfdelay                      test: padview view
 halfdelay_sp                   test: sp_tinfo
-has_colors                     test: background bs cardfile chgat clip_printw color_content color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses dots_xcurses dup_field echochar extended_color filter firework gdc hanoi ins_wide insdelln inserts knight move_field ncurses newdemo padview pair_content picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testcurs view worm xmas
+has_colors                     test: back_ground background bs cardfile chgat clip_printw color_content color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses dots_xcurses dup_field echochar extended_color filter firework gdc hanoi ins_wide insdelln inserts knight move_field ncurses newdemo padview pair_content picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testcurs view worm xmas
 has_colors_sp                  lib: ncurses
 has_ic                         test: lrtest ncurses
 has_ic_sp                      test: sp_tinfo
@@ -397,9 +397,9 @@ init_extended_color         test: color_content extended_color
 init_extended_color_sp         test: extended_color
 init_extended_pair             test: extended_color ncurses pair_content picsmap
 init_extended_pair_sp          test: extended_color
-init_pair                      test: background blue bs cardfile chgat clip_printw color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses dots_xcurses dup_field echochar filter firework gdc hanoi ins_wide insdelln inserts knight move_field ncurses newdemo padview pair_content picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
+init_pair                      test: back_ground background blue bs cardfile chgat clip_printw color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses dots_xcurses dup_field echochar filter firework gdc hanoi ins_wide insdelln inserts knight move_field ncurses newdemo padview pair_content picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
 init_pair_sp                   -
-initscr                                test: background blue bs cardfile chgat clip_printw color_content color_set demo_defkey demo_forms demo_keyok demo_menus demo_panels demo_tabs dots_curses dots_xcurses dup_field echochar filter firework firstlast form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
+initscr                                test: back_ground background blue bs cardfile chgat clip_printw color_content color_set demo_defkey demo_forms demo_keyok demo_menus demo_panels demo_tabs dots_curses dots_xcurses dup_field echochar filter firework firstlast form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest move_field movewindow ncurses newdemo padview pair_content picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
 innstr                         test: test_instr
 innwstr                                test: test_inwstr
 ins_nwstr                      test: ins_wide
@@ -496,7 +496,7 @@ mvinsnstr                   test: inserts
 mvinsstr                       test: inserts
 mvinstr                                test: test_instr
 mvinwstr                       test: test_inwstr
-mvprintw                       test: background bs firework form_driver_w hanoi move_field ncurses padview savescreen tclock view
+mvprintw                       test: back_ground background bs firework form_driver_w hanoi move_field ncurses padview savescreen tclock view
 mvscanw                                -
 mvvline                                test: ncurses
 mvvline_set                    test: ncurses
@@ -556,7 +556,7 @@ nl_sp                               lib: ncurses
 nocbreak                       test: testcurs
 nocbreak_sp                    test: sp_tinfo
 nodelay                                test: demo_new_pair ditto extended_color firework gdc lrtest ncurses newdemo padview rain tclock test_opaque view worm xmas
-noecho                         test: background bs cardfile chgat clip_printw color_content color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dup_field extended_color firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest move_field movewindow ncurses padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
+noecho                         test: back_ground background bs cardfile chgat clip_printw color_content color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels demo_tabs ditto dup_field extended_color firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest move_field movewindow ncurses padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
 noecho_sp                      lib: ncurses
 nofilter                       -
 nofilter_sp                    -
@@ -573,13 +573,13 @@ numnames                  test: demo_terminfo test_arrays progs: dump_entry infocmp
 ospeed                         test: demo_termcap progs: tset
 overlay                                test: ncurses testcurs xmas
 overwrite                      test: ncurses savescreen
-pair_content                   test: background color_set pair_content
+pair_content                   test: back_ground background color_set pair_content
 pair_content_sp                        lib: ncurses
 pecho_wchar                    -
 pechochar                      -
 pnoutrefresh                   test: ncurses padview popup_msg
 prefresh                       test: testcurs
-printw                         test: background blue bs color_content color_set demo_altkeys demo_defkey demo_keyok demo_tabs extended_color filter foldkeys ncurses pair_content savescreen testcurs testscanw view
+printw                         test: back_ground background blue bs color_content color_set demo_altkeys demo_defkey demo_keyok demo_tabs extended_color filter foldkeys ncurses pair_content savescreen testcurs testscanw view
 putp                           test: filter test_sgr progs: tput
 putp_sp                                test: sp_tinfo
 putwin                         test: ncurses
@@ -625,7 +625,7 @@ set_escdelay_sp                     lib: ncurses
 set_tabsize                    test: demo_tabs test_opaque
 set_tabsize_sp                 test: sp_tinfo
 set_term                       lib: ncurses
-setcchar                       test: demo_new_pair demo_panels ins_wide ncurses picsmap savescreen test_add_wchstr test_addwstr
+setcchar                       test: back_ground demo_new_pair demo_panels ins_wide ncurses picsmap savescreen test_add_wchstr test_addwstr
 setscrreg                      test: view
 setupterm                      test: demo_terminfo dots list_keys sp_tinfo test_setupterm test_sgr test_termattrs test_tparm test_vid_puts test_vidputs progs: clear tabs tput tset
 slk_attr                       -
@@ -661,9 +661,9 @@ slk_touch_sp                        lib: ncurses
 slk_wset                       test: ncurses
 standend                       test: blue gdc ncurses
 standout                       test: blue ncurses
-start_color                    test: background blue bs cardfile chgat clip_printw color_content color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses dots_xcurses dup_field echochar extended_color filter firework gdc hanoi ins_wide insdelln inserts knight move_field ncurses newdemo padview pair_content picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
+start_color                    test: back_ground background blue bs cardfile chgat clip_printw color_content color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses dots_xcurses dup_field echochar extended_color filter firework gdc hanoi ins_wide insdelln inserts knight move_field ncurses newdemo padview pair_content picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
 start_color_sp                 -
-stdscr                         test: background bs chgat clip_printw color_content demo_altkeys demo_forms demo_menus demo_new_pair demo_panels ditto dup_field edit_field extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest move_field movewindow ncurses padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view worm xmas
+stdscr                         test: back_ground background bs chgat clip_printw color_content demo_altkeys demo_forms demo_menus demo_new_pair demo_panels ditto dup_field edit_field extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest move_field movewindow ncurses padview pair_content picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view worm xmas
 strcodes                       test: demo_termcap test_arrays progs: dump_entry
 strfnames                      test: demo_terminfo list_keys test_arrays progs: dump_entry
 strnames                       test: demo_terminfo foldkeys list_keys test_arrays test_tparm progs: dump_entry infocmp tic
@@ -711,7 +711,7 @@ ungetch_sp                  lib: ncurses
 ungetmouse                     lib: menu
 ungetmouse_sp                  -
 untouchwin                     lib: form
-use_default_colors             test: background dots_curses dots_xcurses filter firework gdc hanoi knight ncurses picsmap rain tclock worm xmas
+use_default_colors             test: back_ground background dots_curses dots_xcurses filter firework gdc hanoi knight ncurses picsmap rain tclock worm xmas
 use_default_colors_sp          -
 use_env                                test: dots dots_curses dots_mvcur dots_xcurses ncurses progs: clear tput
 use_env_sp                     test: sp_tinfo
diff --git a/test/back_ground.c b/test/back_ground.c
new file mode 100644 (file)
index 0000000..f8661b9
--- /dev/null
@@ -0,0 +1,298 @@
+/****************************************************************************
+ * Copyright 2021 Thomas E. Dickey                                          *
+ *                                                                          *
+ * 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.                                                           *
+ ****************************************************************************/
+/*
+ * $Id: back_ground.c,v 1.3 2021/02/13 21:07:58 tom Exp $
+ */
+
+#define NEED_COLOR_CODE 1
+#define NEED_COLOR_NAME 1
+#include <color_name.h>
+#include <dump_window.h>
+
+#if USE_WIDEC_SUPPORT
+
+static int default_bg = COLOR_BLACK;
+static int default_fg = COLOR_WHITE;
+static wchar_t wide_fill = L' ';
+
+static wchar_t
+decode_wchar(const char *value)
+{
+    wchar_t result;
+    char *next = NULL;
+    int radix = 0;
+
+    if (!strncmp(value, "U+", 2)) {
+       value += 2;
+       radix = 16;
+    }
+    result = strtol(value, &next, radix);
+    if (next == value || (next == NULL || *next != '\0')) {
+       fprintf(stderr, "decoding wchar_t: %s\n", value);
+       exit(EXIT_FAILURE);
+    }
+    return result;
+}
+
+static void
+test_background(void)
+{
+    NCURSES_COLOR_T f, b;
+    int row;
+    int chr;
+    wchar_t blank[2];
+    wchar_t graphics[2];
+    cchar_t data;
+
+    if (pair_content(0, &f, &b) == ERR) {
+       printw("pair 0 contains no data\n");
+    } else {
+       printw("pair 0 contains (%d,%d)\n", (int) f, (int) b);
+    }
+    dump_window(stdscr);
+
+    blank[0] = wide_fill;
+    blank[1] = L'\0';
+
+    printw("Initializing pair 1 to red/%s\n", color_name(default_bg));
+    init_pair(1, COLOR_RED, (NCURSES_COLOR_T) default_bg);
+    setcchar(&data, blank, A_NORMAL, 1, NULL);
+    bkgrndset(&data);
+    printw("RED/BLACK\n");
+    dump_window(stdscr);
+
+    printw("Initializing pair 2 to %s/blue\n", color_name(default_fg));
+    init_pair(2, (NCURSES_COLOR_T) default_fg, COLOR_BLUE);
+    setcchar(&data, blank, A_NORMAL, 2, NULL);
+    bkgrndset(&data);
+    printw("This line should be %s/blue\n", color_name(default_fg));
+    dump_window(stdscr);
+
+    printw("Initializing pair 3 to %s/cyan (ACS_HLINE)\n", color_name(default_fg));
+    init_pair(3, (NCURSES_COLOR_T) default_fg, COLOR_CYAN);
+    printw("...and drawing a box which should be followed by lines\n");
+    graphics[0] = ACS_HLINE & A_CHARTEXT;
+    graphics[1] = L'\0';
+    setcchar(&data, graphics, A_ALTCHARSET, 3, NULL);
+    bkgrndset(&data);
+    /*
+     * Characters from vt100 line-drawing should be mapped to line-drawing,
+     * since A_ALTCHARSET is set in the background, and the character part
+     * of the background is replaced by the nonblank characters written.
+     *
+     * Characters not in the line-drawing range are usually sent as-is.
+     *
+     * With SVr4 curses it is possible to rely on this to mix uppercase text
+     * with the (lowercase) line-drawing characters.  ncurses uses some of
+     * the uppercase characters for encoding thick- and double-lines.
+     */
+    row = 7;
+    mvprintw(row++, 10, "l");
+    for (chr = 0; chr < 32; ++chr)
+       AddCh(' ');
+    printw("x\n");
+    chr = 32;
+    while (chr < 128) {
+       if ((chr % 32) == 0)
+           mvprintw(row++, 10, "x");
+       AddCh((chr == 127) ? ' ' : chr);
+       if ((++chr % 32) == 0)
+           printw("x\n");
+    }
+    mvprintw(row++, 10, "m");
+    for (chr = 0; chr < 32; ++chr)
+       AddCh(' ');
+    printw("j\n");
+    dump_window(stdscr);
+
+    setcchar(&data, blank, A_NORMAL, 0, NULL);
+    bkgrndset(&data);
+    printw("Default Colors\n");
+    dump_window(stdscr);
+
+    printw("Resetting colors to pair 1\n");
+    setcchar(&data, blank, A_NORMAL, 1, NULL);
+    bkgrndset(&data);
+    printw("This line should be red/%s\n", color_name(default_bg));
+    dump_window(stdscr);
+
+    printw("Setting screen to pair 0\n");
+    setcchar(&data, blank, A_NORMAL, 0, NULL);
+    bkgrndset(&data);
+    dump_window(stdscr);
+
+    printw("Setting screen to pair 1\n");
+    setcchar(&data, blank, A_NORMAL, 1, NULL);
+    bkgrndset(&data);
+    dump_window(stdscr);
+
+    printw("Setting screen to pair 2\n");
+    setcchar(&data, blank, A_NORMAL, 2, NULL);
+    bkgrndset(&data);
+    dump_window(stdscr);
+
+    printw("Setting screen to pair 3\n");
+    setcchar(&data, blank, A_NORMAL, 3, NULL);
+    bkgrndset(&data);
+    dump_window(stdscr);
+
+    printw("Setting screen to pair 0\n");
+    setcchar(&data, blank, A_NORMAL, 0, NULL);
+    bkgrndset(&data);
+    dump_window(stdscr);
+}
+
+static void
+usage(void)
+{
+    static const char *msg[] =
+    {
+       "Usage: background [options]"
+       ,""
+       ,"Options:"
+#if HAVE_ASSUME_DEFAULT_COLORS
+       ," -a       invoke assume_default_colors, repeat to use in init_pair"
+#endif
+       ," -b XXX   specify background color"
+#if HAVE_USE_DEFAULT_COLORS
+       ," -d       invoke use_default_colors, repeat to use in init_pair"
+#endif
+       ," -f XXX   specify foreground color"
+       ," -l FILE  log window-dumps to this file"
+       ," -w       fill background with stipple pattern"
+       ," -W CODE  fill background with this Unicode value"
+    };
+    size_t n;
+
+    for (n = 0; n < SIZEOF(msg); n++)
+       fprintf(stderr, "%s\n", msg[n]);
+
+    ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+#if HAVE_ASSUME_DEFAULT_COLORS
+    int a_option = 0;
+#endif
+#if HAVE_USE_DEFAULT_COLORS
+    int d_option = 0;
+#endif
+    int n;
+
+    setlocale(LC_ALL, "");
+
+    while ((n = getopt(argc, argv, "ab:df:l:wW:")) != -1) {
+       switch (n) {
+#if HAVE_ASSUME_DEFAULT_COLORS
+       case 'a':
+           ++a_option;
+           break;
+#endif
+       case 'b':
+           default_bg = color_code(optarg);
+           break;
+#if HAVE_USE_DEFAULT_COLORS
+       case 'd':
+           ++d_option;
+           break;
+#endif
+       case 'f':
+           default_fg = color_code(optarg);
+           break;
+       case 'l':
+           if (!open_dump(optarg))
+               usage();
+           break;
+       case 'w':
+           wide_fill = L'\u2591';
+           break;
+       case 'W':
+           wide_fill = decode_wchar(optarg);
+           break;
+       default:
+           usage();
+       }
+    }
+#if HAVE_USE_DEFAULT_COLORS && HAVE_ASSUME_DEFAULT_COLORS
+    if (a_option && d_option) {
+       fprintf(stderr, "Use either -a or -d option, but not both\n");
+       ExitProgram(EXIT_FAILURE);
+    }
+#endif
+
+    initscr();
+    cbreak();
+    noecho();
+
+    if (has_colors()) {
+       start_color();
+
+#if HAVE_USE_DEFAULT_COLORS
+       if (d_option) {
+           printw("Using default colors...\n");
+           use_default_colors();
+           if (d_option > 1) {
+               default_fg = -1;
+               default_bg = -1;
+           }
+       }
+#endif
+#if HAVE_ASSUME_DEFAULT_COLORS
+       if (a_option) {
+           printw("Using assumed colors %s/%s...\n",
+                  color_name(default_fg),
+                  color_name(default_bg));
+           assume_default_colors(default_fg, default_bg);
+           if (a_option > 1) {
+               default_fg = -1;
+               default_bg = -1;
+           }
+       }
+#endif
+
+       test_background();
+
+    } else {
+       printw("This demo requires a color terminal");
+       getch();
+    }
+    endwin();
+    close_dump();
+    ExitProgram(EXIT_SUCCESS);
+}
+
+#else
+int
+main(void)
+{
+    printf("This program requires the wide-curses library\n");
+    ExitProgram(EXIT_FAILURE);
+}
+#endif /* USE_WIDEC_SUPPORT */
index 391ab1a7d3298c7d7c15de6a6cdf9dc7c3bd932b..649ffcedb446a5377b2fabdb681493342e8f91e1 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey                                     *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 2003-2014,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: background.c,v 1.19 2020/02/02 23:34:34 tom Exp $
+ * $Id: background.c,v 1.20 2021/02/13 20:54:08 tom Exp $
  */
 
 #define NEED_COLOR_CODE 1
@@ -144,6 +144,7 @@ usage(void)
        ," -d       invoke use_default_colors, repeat to use in init_pair"
 #endif
        ," -f XXX   specify foreground color"
+       ," -l FILE  log window-dumps to this file"
     };
     size_t n;
 
index 524a6000440e36823ae0171d626016a20a248f53..de3d140abc6e1d039db5c62626e9062fddf2f2b8 100644 (file)
@@ -1,6 +1,6 @@
-# $Id: modules,v 1.73 2020/05/29 23:27:44 tom Exp $
+# $Id: modules,v 1.74 2021/02/13 16:33:43 tom Exp $
 ##############################################################################
-# Copyright 2018-2019,2020 Thomas E. Dickey                                  #
+# Copyright 2018-2020,2021 Thomas E. Dickey                                  #
 # Copyright 1998-2016,2017 Free Software Foundation, Inc.                    #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
@@ -33,6 +33,7 @@
 # Test-Program modules
 
 @ base
+back_ground    progs           $(srcdir)       $(HEADER_DEPS)
 background     progs           $(srcdir)       $(HEADER_DEPS)
 blue           progs           $(srcdir)       $(HEADER_DEPS)
 bs             progs           $(srcdir)       $(HEADER_DEPS)
index b9faf99de33997d7615de4d49bd6cdb54537b43d..8b0908332701bac18e138af8d2a0c8d22169a9f7 100644 (file)
@@ -1,6 +1,6 @@
-# $Id: programs,v 1.47 2020/05/29 23:27:58 tom Exp $
+# $Id: programs,v 1.48 2021/02/13 16:33:51 tom Exp $
 ##############################################################################
-# Copyright 2018-2019,2020 Thomas E. Dickey                                  #
+# Copyright 2018-2020,2021 Thomas E. Dickey                                  #
 # Copyright 2006-2016,2017 Free Software Foundation, Inc.                    #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
@@ -31,6 +31,7 @@
 # Author: Thomas E. Dickey
 #
 # programs used for ncurses tests
+back_ground    $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   back_ground dump_window
 background     $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   background dump_window
 blue           $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   blue
 bs             $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   bs
index 13a3b64719efffd68bd826552d14e9325fed8b93..cde06e576a0203e3a6816ba99f2001c6f62fcdb8 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env perl
-# $Id: tracemunch,v 1.33 2020/12/26 23:56:50 tom Exp $
+# $Id: tracemunch,v 1.40 2021/02/13 19:29:12 tom Exp $
 ##############################################################################
-# Copyright 2018-2019,2020 Thomas E. Dickey                                  #
+# Copyright 2018-2020,2021 Thomas E. Dickey                                  #
 # Copyright 1998-2005,2017 Free Software Foundation, Inc.                    #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
@@ -65,318 +65,451 @@ our %TR = qw(
 
 our $tracelevel = 0;
 
+our $tSCREEN   = 1;    # SCREEN*
+our $tWINDOW   = 2;    # WINDOW*
+our $tTERMINAL = 3;    # TERMINAL*
+our $tPANEL    = 4;    # PANEL*
+our $tFIELD    = 5;    # FIELD*
+our $tFORM     = 5;    # FORM*
+our $tMENU     = 6;    # MENU*
+our $tITEM     = 7;    # ITEM*
+
+our %known_p1_types = (
+    $tSCREEN   => "SCREEN*",
+    $tWINDOW   => "WINDOW*",
+    $tTERMINAL => "TERMINAL*",
+    $tPANEL    => "PANEL*",
+    $tFORM     => "FORM*",
+    $tFIELD    => "FIELD*",
+    $tMENU     => "MENU*",
+    $tITEM     => "ITEM*",
+);
+
 # If the trace is complete, we can infer addresses using the return value from
 # newwin, etc.  But if it is incomplete, we can still check for special cases
 # such as SCREEN* and WINDOW* parameters.  In this table, the type for the
 # first parameter is encoded, relying upon an ncurses programming convention:
-# 1 = SCREEN*
-# 2 = WINDOW*
-# 4 = TERMINAL*
-# 8 = PANEL*
-our %known_p1 = qw(
-  TransformLine           1
-  _nc_console_read        1
-  _nc_freewin             2
-  _nc_initscr             1
-  _nc_makenew             1
-  _nc_mingw_console_read  1
-  _nc_reset_colors        1
-  _nc_scroll_optimize     1
-  _nc_tinfo               1
-  _nc_tinfo_mvcur         1
-  _nc_wgetch              2
-  adjust_window           2
-  assume_default_colors   1
-  attr_get                2
-  baudrate                1
-  beep                    1
-  border_set              2
-  bottom_panel            8
-  box                     2
-  box_set                 2
-  can_change_color        1
-  cbreak                  1
-  clearok                 2
-  color_content           1
-  copywin                 2
-  curs_set                1
-  decrease_size           1
-  def_prog_mode           1
-  def_shell_mode          1
-  define_key              1
-  del_curterm             1
-  del_panel               8
-  delay_output            1
-  delscreen               1
-  delwin                  2
-  derwin                  2
-  doupdate                1
-  dupwin                  2
-  echo                    1
-  endwin                  1
-  erasechar               1
-  filter                  1
-  flash                   1
-  flushinp                1
-  getattrs                2
-  getbegx                 2
-  getbegy                 2
-  getbkgd                 2
-  getcurx                 2
-  getcury                 2
-  getmaxx                 2
-  getmaxy                 2
-  getmouse                1
-  getparx                 2
-  getpary                 2
-  halfdelay               1
-  has_ic                  1
-  has_il                  1
-  has_key                 1
-  hide_panel              8
-  idcok                   2
-  idlok                   2
-  immedok                 2
-  increase_size           1
-  init_color              1
-  init_pair               1
-  intrflush               1
-  is_cleared              2
-  is_idcok                2
-  is_idlok                2
-  is_immedok              2
-  is_keypad               2
-  is_leaveok              2
-  is_linetouched          2
-  is_nodelay              2
-  is_notimeout            2
-  is_pad                  2
-  is_scrollok             2
-  is_subwin               2
-  is_syncok               2
-  is_term_resized         1
-  is_wintouched           2
-  key_defined             1
-  keybound                1
-  keyok                   1
-  keypad                  2
-  killchar                1
-  leaveok                 2
-  longname                1
-  meta                    2
-  mouseinterval           1
-  mousemask               1
-  move_panel              8
-  mvcur                   1
-  mvderwin                2
-  mvwadd_wch              2
-  mvwadd_wchnstr          2
-  mvwadd_wchstr           2
-  mvwaddch                2
-  mvwaddchnstr            2
-  mvwaddchstr             2
-  mvwaddnstr              2
-  mvwaddnwstr             2
-  mvwaddstr               2
-  mvwaddwstr              2
-  mvwchgat                2
-  mvwdelch                2
-  mvwget_wch              2
-  mvwget_wstr             2
-  mvwgetch                2
-  mvwgetn_wstr            2
-  mvwgetnstr              2
-  mvwgetstr               2
-  mvwhline                2
-  mvwhline_set            2
-  mvwin                   2
-  mvwin_wch               2
-  mvwin_wchnstr           2
-  mvwin_wchstr            2
-  mvwinch                 2
-  mvwinchnstr             2
-  mvwinchstr              2
-  mvwins_nwstr            2
-  mvwins_wch              2
-  mvwins_wstr             2
-  mvwinsch                2
-  mvwinsnstr              2
-  mvwinsstr               2
-  mvwinstr                2
-  mvwinwstr               2
-  mvwvline                2
-  mvwvline_set            2
-  new_panel               2
-  newpad                  1
-  newterm                 1
-  newwin                  1
-  nl                      1
-  nocbreak                1
-  nodelay                 2
-  noecho                  1
-  nofilter                1
-  nonl                    1
-  noqiflush               1
-  noraw                   1
-  notimeout               2
-  overlap                 2
-  overlay                 2
-  overwrite               2
-  pair_content            1
-  panel_above             8
-  panel_below             8
-  panel_hidden            8
-  panel_userptr           8
-  panel_window            8
-  pecho_wchar             2
-  pechochar               2
-  pnoutrefresh            2
-  putwin                  2
-  qiflush                 1
-  raw                     1
-  redrawwin               2
-  replace_panel           8
-  reset_prog_mode         1
-  reset_shell_mode        1
-  resetty                 1
-  resize_term             1
-  resizeterm              1
-  restartterm             1
-  ripoffline              1
-  savetty                 1
-  scr_init                1
-  scr_restore             1
-  scr_set                 1
-  scroll                  2
-  scrollok                2
-  set_curterm             4
-  set_panel_userptr       8
-  set_term                1
-  show_panel              8
-  slk_attr                1
-  slk_attr_set            1
-  slk_attroff             1
-  slk_attron              1
-  slk_attrset             1
-  slk_clear               1
-  slk_color               1
-  slk_init                1
-  slk_label               1
-  slk_noutrefresh         1
-  slk_refresh             1
-  slk_restore             1
-  slk_set                 1
-  slk_touch               1
-  start_color             1
-  subwin                  2
-  syncok                  2
-  termattrs               1
-  termname                1
-  tgetflag                1
-  tgetnum                 1
-  tigetflag               1
-  tigetnum                1
-  tigetstr                1
-  tinfo                   1
-  top_panel               8
-  touchline               2
-  touchwin                2
-  typeahead               1
-  unget_wch               1
-  ungetch                 1
-  ungetmouse              1
-  untouchwin              2
-  use_default_colors      1
-  use_env                 1
-  use_legacy_coding       1
-  use_screen              1
-  use_tioctl              1
-  use_window              2
-  vidattr                 1
-  vidputs                 1
-  vw_printw               2
-  vwprintw                2
-  wadd_wch                2
-  wadd_wchnstr            2
-  wadd_wchstr             2
-  waddch                  2
-  waddchnstr              2
-  waddchstr               2
-  waddnstr                2
-  waddnwstr               2
-  waddstr                 2
-  waddwstr                2
-  wattr_get               2
-  wattr_off               2
-  wattr_on                2
-  wattr_set               2
-  wattroff                2
-  wattron                 2
-  wattrset                2
-  wbkgd                   2
-  wbkgdset                2
-  wborder                 2
-  wborder_set             2
-  wchgat                  2
-  wclear                  2
-  wclrtobot               2
-  wclrtoeol               2
-  wcolor_set              2
-  wcursyncup              2
-  wdelch                  2
-  wdeleteln               2
-  wechochar               2
-  wenclose                2
-  werase                  2
-  wget_wch                2
-  wget_wstr               2
-  wgetbkgrnd              2
-  wgetch                  2
-  wgetch_events           2
-  wgetdelay               2
-  wgetn_wstr              2
-  wgetnstr                2
-  wgetparent              2
-  wgetscrreg              2
-  wgetstr                 2
-  whline                  2
-  whline_set              2
-  win_wch                 2
-  win_wchnstr             2
-  win_wchstr              2
-  winch                   2
-  winchnstr               2
-  winchstr                2
-  winnstr                 2
-  winnwstr                2
-  wins_nwstr              2
-  wins_wch                2
-  wins_wstr               2
-  winsch                  2
-  winsdelln               2
-  winsertln               2
-  winsnstr                2
-  winsstr                 2
-  winstr                  2
-  winwstr                 2
-  wmouse_trafo            2
-  wmove                   2
-  wnoutrefresh            2
-  wprintw                 2
-  wredrawln               2
-  wrefresh                2
-  wresize                 2
-  wscrl                   2
-  wsetscrreg              2
-  wstandend               2
-  wstandout               2
-  wsyncdown               2
-  wsyncup                 2
-  wtimeout                2
-  wtouchln                2
-  wvline                  2
+our %known_p1 = (
+    TransformLine          => $tSCREEN,
+    _nc_console_read       => $tSCREEN,
+    _nc_freewin            => $tWINDOW,
+    _nc_initscr            => $tSCREEN,
+    _nc_makenew            => $tSCREEN,
+    _nc_mingw_console_read => $tSCREEN,
+    _nc_reset_colors       => $tSCREEN,
+    _nc_scroll_optimize    => $tSCREEN,
+    _nc_tinfo              => $tSCREEN,
+    _nc_tinfo_mvcur        => $tSCREEN,
+    _nc_wgetch             => $tWINDOW,
+    adjust_window          => $tWINDOW,
+    assume_default_colors  => $tSCREEN,
+    attr_get               => $tWINDOW,
+    baudrate               => $tSCREEN,
+    beep                   => $tSCREEN,
+    border_set             => $tWINDOW,
+    bottom_panel           => $tPANEL,
+    bottom_panel           => $tPANEL,
+    box                    => $tWINDOW,
+    box_set                => $tWINDOW,
+    can_change_color       => $tSCREEN,
+    cbreak                 => $tSCREEN,
+    ceiling_panel          => $tSCREEN,
+    clearok                => $tWINDOW,
+    color_content          => $tSCREEN,
+    copywin                => $tWINDOW,
+    current_item           => $tMENU,
+    curs_set               => $tSCREEN,
+    decrease_size          => $tSCREEN,
+    def_prog_mode          => $tSCREEN,
+    def_shell_mode         => $tSCREEN,
+    define_key             => $tSCREEN,
+    del_curterm            => $tSCREEN,
+    del_panel              => $tPANEL,
+    del_panel              => $tPANEL,
+    delay_output           => $tSCREEN,
+    delscreen              => $tSCREEN,
+    delwin                 => $tWINDOW,
+    derwin                 => $tWINDOW,
+    doupdate               => $tSCREEN,
+    dup_field              => $tFIELD,
+    dupwin                 => $tWINDOW,
+    echo                   => $tSCREEN,
+    endwin                 => $tSCREEN,
+    erasechar              => $tSCREEN,
+    field_opts_off         => $tFIELD,
+    field_opts_on          => $tFIELD,
+    filter                 => $tSCREEN,
+    flash                  => $tSCREEN,
+    flushinp               => $tSCREEN,
+    form_driver            => $tFORM,
+    form_driver_w          => $tFORM,
+    form_opts_off          => $tFORM,
+    form_opts_on           => $tFORM,
+    free_field             => $tFIELD,
+    free_form              => $tFORM,
+    free_item              => $tITEM,
+    free_menu              => $tMENU,
+    getattrs               => $tWINDOW,
+    getbegx                => $tWINDOW,
+    getbegy                => $tWINDOW,
+    getbkgd                => $tWINDOW,
+    getcurx                => $tWINDOW,
+    getcury                => $tWINDOW,
+    getmaxx                => $tWINDOW,
+    getmaxy                => $tWINDOW,
+    getmouse               => $tSCREEN,
+    getparx                => $tWINDOW,
+    getpary                => $tWINDOW,
+    ground_panel           => $tSCREEN,
+    halfdelay              => $tSCREEN,
+    has_ic                 => $tSCREEN,
+    has_il                 => $tSCREEN,
+    has_key                => $tSCREEN,
+    hide_panel             => $tPANEL,
+    hide_panel             => $tPANEL,
+    idcok                  => $tWINDOW,
+    idlok                  => $tWINDOW,
+    immedok                => $tWINDOW,
+    increase_size          => $tSCREEN,
+    init_color             => $tSCREEN,
+    init_pair              => $tSCREEN,
+    intrflush              => $tSCREEN,
+    is_cleared             => $tWINDOW,
+    is_idcok               => $tWINDOW,
+    is_idlok               => $tWINDOW,
+    is_immedok             => $tWINDOW,
+    is_keypad              => $tWINDOW,
+    is_leaveok             => $tWINDOW,
+    is_linetouched         => $tWINDOW,
+    is_nodelay             => $tWINDOW,
+    is_notimeout           => $tWINDOW,
+    is_pad                 => $tWINDOW,
+    is_scrollok            => $tWINDOW,
+    is_subwin              => $tWINDOW,
+    is_syncok              => $tWINDOW,
+    is_term_resized        => $tSCREEN,
+    is_wintouched          => $tWINDOW,
+    item_count             => $tMENU,
+    item_description       => $tITEM,
+    item_index             => $tITEM,
+    item_init              => $tMENU,
+    item_name              => $tITEM,
+    item_opts              => $tITEM,
+    item_opts_off          => $tITEM,
+    item_opts_on           => $tITEM,
+    item_term              => $tMENU,
+    item_userptr           => $tITEM,
+    item_value             => $tITEM,
+    item_visible           => $tITEM,
+    key_defined            => $tSCREEN,
+    keybound               => $tSCREEN,
+    keyok                  => $tSCREEN,
+    keypad                 => $tWINDOW,
+    killchar               => $tSCREEN,
+    leaveok                => $tWINDOW,
+    link_field             => $tFIELD,
+    longname               => $tSCREEN,
+    menu_back              => $tMENU,
+    menu_driver            => $tMENU,
+    menu_fore              => $tMENU,
+    menu_format            => $tMENU,
+    menu_grey              => $tMENU,
+    menu_init              => $tMENU,
+    menu_items             => $tMENU,
+    menu_mark              => $tMENU,
+    menu_opts              => $tMENU,
+    menu_opts_off          => $tMENU,
+    menu_opts_on           => $tMENU,
+    menu_pad               => $tMENU,
+    menu_pattern           => $tMENU,
+    menu_spacing           => $tMENU,
+    menu_sub               => $tMENU,
+    menu_term              => $tMENU,
+    menu_userptr           => $tMENU,
+    menu_win               => $tMENU,
+    meta                   => $tWINDOW,
+    mouseinterval          => $tSCREEN,
+    mousemask              => $tSCREEN,
+    move_field             => $tFIELD,
+    move_panel             => $tPANEL,
+    move_panel             => $tPANEL,
+    mvcur                  => $tSCREEN,
+    mvderwin               => $tWINDOW,
+    mvwadd_wch             => $tWINDOW,
+    mvwadd_wchnstr         => $tWINDOW,
+    mvwadd_wchstr          => $tWINDOW,
+    mvwaddch               => $tWINDOW,
+    mvwaddchnstr           => $tWINDOW,
+    mvwaddchstr            => $tWINDOW,
+    mvwaddnstr             => $tWINDOW,
+    mvwaddnwstr            => $tWINDOW,
+    mvwaddstr              => $tWINDOW,
+    mvwaddwstr             => $tWINDOW,
+    mvwchgat               => $tWINDOW,
+    mvwdelch               => $tWINDOW,
+    mvwget_wch             => $tWINDOW,
+    mvwget_wstr            => $tWINDOW,
+    mvwgetch               => $tWINDOW,
+    mvwgetn_wstr           => $tWINDOW,
+    mvwgetnstr             => $tWINDOW,
+    mvwgetstr              => $tWINDOW,
+    mvwhline               => $tWINDOW,
+    mvwhline_set           => $tWINDOW,
+    mvwin                  => $tWINDOW,
+    mvwin_wch              => $tWINDOW,
+    mvwin_wchnstr          => $tWINDOW,
+    mvwin_wchstr           => $tWINDOW,
+    mvwinch                => $tWINDOW,
+    mvwinchnstr            => $tWINDOW,
+    mvwinchstr             => $tWINDOW,
+    mvwins_nwstr           => $tWINDOW,
+    mvwins_wch             => $tWINDOW,
+    mvwins_wstr            => $tWINDOW,
+    mvwinsch               => $tWINDOW,
+    mvwinsnstr             => $tWINDOW,
+    mvwinsstr              => $tWINDOW,
+    mvwinstr               => $tWINDOW,
+    mvwinwstr              => $tWINDOW,
+    mvwvline               => $tWINDOW,
+    mvwvline_set           => $tWINDOW,
+    new_panel              => $tWINDOW,
+    new_panel              => $tWINDOW,
+    newpad                 => $tSCREEN,
+    newterm                => $tSCREEN,
+    newwin                 => $tSCREEN,
+    nl                     => $tSCREEN,
+    nocbreak               => $tSCREEN,
+    nodelay                => $tWINDOW,
+    noecho                 => $tSCREEN,
+    nofilter               => $tSCREEN,
+    nonl                   => $tSCREEN,
+    noqiflush              => $tSCREEN,
+    noraw                  => $tSCREEN,
+    notimeout              => $tWINDOW,
+    overlap                => $tWINDOW,
+    overlay                => $tWINDOW,
+    overwrite              => $tWINDOW,
+    pair_content           => $tSCREEN,
+    panel_above            => $tPANEL,
+    panel_above            => $tPANEL,
+    panel_below            => $tPANEL,
+    panel_below            => $tPANEL,
+    panel_hidden           => $tPANEL,
+    panel_hidden           => $tPANEL,
+    panel_userptr          => $tPANEL,
+    panel_userptr          => $tPANEL,
+    panel_window           => $tPANEL,
+    panel_window           => $tPANEL,
+    pecho_wchar            => $tWINDOW,
+    pechochar              => $tWINDOW,
+    pnoutrefresh           => $tWINDOW,
+    pos_form_cursor        => $tFORM,
+    pos_menu_cursor        => $tMENU,
+    post_form              => $tFORM,
+    post_menu              => $tMENU,
+    putwin                 => $tWINDOW,
+    qiflush                => $tSCREEN,
+    raw                    => $tSCREEN,
+    redrawwin              => $tWINDOW,
+    replace_panel          => $tPANEL,
+    replace_panel          => $tPANEL,
+    reset_prog_mode        => $tSCREEN,
+    reset_shell_mode       => $tSCREEN,
+    resetty                => $tSCREEN,
+    resize_term            => $tSCREEN,
+    resizeterm             => $tSCREEN,
+    restartterm            => $tSCREEN,
+    ripoffline             => $tSCREEN,
+    savetty                => $tSCREEN,
+    scale_menu             => $tMENU,
+    scr_init               => $tSCREEN,
+    scr_restore            => $tSCREEN,
+    scr_set                => $tSCREEN,
+    scroll                 => $tWINDOW,
+    scrollok               => $tWINDOW,
+    set_current_field      => $tFORM,
+    set_current_item       => $tMENU,
+    set_curterm            => $tTERMINAL,
+    set_field_back         => $tFIELD,
+    set_field_buffer       => $tFIELD,
+    set_field_fore         => $tFIELD,
+    set_field_init         => $tFORM,
+    set_field_just         => $tFIELD,
+    set_field_opts         => $tFIELD,
+    set_field_pad          => $tFIELD,
+    set_field_status       => $tFIELD,
+    set_field_term         => $tFORM,
+    set_field_type         => $tFIELD,
+    set_field_userptr      => $tFIELD,
+    set_form_fields        => $tFORM,
+    set_form_init          => $tFORM,
+    set_form_opts          => $tFORM,
+    set_form_page          => $tFORM,
+    set_form_sub           => $tFORM,
+    set_form_term          => $tFORM,
+    set_form_userptr       => $tFORM,
+    set_form_win           => $tFORM,
+    set_item_init          => $tMENU,
+    set_item_opts          => $tITEM,
+    set_item_term          => $tMENU,
+    set_item_userptr       => $tITEM,
+    set_item_value         => $tITEM,
+    set_menu_back          => $tMENU,
+    set_menu_fore          => $tMENU,
+    set_menu_format        => $tMENU,
+    set_menu_grey          => $tMENU,
+    set_menu_init          => $tMENU,
+    set_menu_items         => $tMENU,
+    set_menu_mark          => $tMENU,
+    set_menu_opts          => $tMENU,
+    set_menu_pad           => $tMENU,
+    set_menu_pattern       => $tMENU,
+    set_menu_spacing       => $tMENU,
+    set_menu_sub           => $tMENU,
+    set_menu_term          => $tMENU,
+    set_menu_userptr       => $tMENU,
+    set_menu_win           => $tMENU,
+    set_new_page           => $tFIELD,
+    set_panel_userptr      => $tPANEL,
+    set_panel_userptr      => $tPANEL,
+    set_term               => $tSCREEN,
+    set_top_row            => $tMENU,
+    show_panel             => $tPANEL,
+    show_panel             => $tPANEL,
+    slk_attr               => $tSCREEN,
+    slk_attr_set           => $tSCREEN,
+    slk_attroff            => $tSCREEN,
+    slk_attron             => $tSCREEN,
+    slk_attrset            => $tSCREEN,
+    slk_clear              => $tSCREEN,
+    slk_color              => $tSCREEN,
+    slk_init               => $tSCREEN,
+    slk_label              => $tSCREEN,
+    slk_noutrefresh        => $tSCREEN,
+    slk_refresh            => $tSCREEN,
+    slk_restore            => $tSCREEN,
+    slk_set                => $tSCREEN,
+    slk_touch              => $tSCREEN,
+    start_color            => $tSCREEN,
+    subwin                 => $tWINDOW,
+    syncok                 => $tWINDOW,
+    termattrs              => $tSCREEN,
+    termname               => $tSCREEN,
+    tgetflag               => $tSCREEN,
+    tgetnum                => $tSCREEN,
+    tigetflag              => $tSCREEN,
+    tigetnum               => $tSCREEN,
+    tigetstr               => $tSCREEN,
+    tinfo                  => $tSCREEN,
+    top_panel              => $tPANEL,
+    top_panel              => $tPANEL,
+    top_row                => $tMENU,
+    touchline              => $tWINDOW,
+    touchwin               => $tWINDOW,
+    typeahead              => $tSCREEN,
+    unfocus_current_field  => $tFORM,
+    unget_wch              => $tSCREEN,
+    ungetch                => $tSCREEN,
+    ungetmouse             => $tSCREEN,
+    unpost_form            => $tFORM,
+    unpost_menu            => $tMENU,
+    untouchwin             => $tWINDOW,
+    update_panels_sp       => $tSCREEN,
+    use_default_colors     => $tSCREEN,
+    use_env                => $tSCREEN,
+    use_legacy_coding      => $tSCREEN,
+    use_screen             => $tSCREEN,
+    use_tioctl             => $tSCREEN,
+    use_window             => $tWINDOW,
+    vidattr                => $tSCREEN,
+    vidputs                => $tSCREEN,
+    vw_printw              => $tWINDOW,
+    vwprintw               => $tWINDOW,
+    wadd_wch               => $tWINDOW,
+    wadd_wchnstr           => $tWINDOW,
+    wadd_wchstr            => $tWINDOW,
+    waddch                 => $tWINDOW,
+    waddchnstr             => $tWINDOW,
+    waddchstr              => $tWINDOW,
+    waddnstr               => $tWINDOW,
+    waddnwstr              => $tWINDOW,
+    waddstr                => $tWINDOW,
+    waddwstr               => $tWINDOW,
+    wattr_get              => $tWINDOW,
+    wattr_off              => $tWINDOW,
+    wattr_on               => $tWINDOW,
+    wattr_set              => $tWINDOW,
+    wattroff               => $tWINDOW,
+    wattron                => $tWINDOW,
+    wattrset               => $tWINDOW,
+    wbkgd                  => $tWINDOW,
+    wbkgdset               => $tWINDOW,
+    wborder                => $tWINDOW,
+    wborder_set            => $tWINDOW,
+    wchgat                 => $tWINDOW,
+    wclear                 => $tWINDOW,
+    wclrtobot              => $tWINDOW,
+    wclrtoeol              => $tWINDOW,
+    wcolor_set             => $tWINDOW,
+    wcursyncup             => $tWINDOW,
+    wdelch                 => $tWINDOW,
+    wdeleteln              => $tWINDOW,
+    wechochar              => $tWINDOW,
+    wenclose               => $tWINDOW,
+    werase                 => $tWINDOW,
+    wget_wch               => $tWINDOW,
+    wget_wstr              => $tWINDOW,
+    wgetbkgrnd             => $tWINDOW,
+    wgetch                 => $tWINDOW,
+    wgetch_events          => $tWINDOW,
+    wgetdelay              => $tWINDOW,
+    wgetn_wstr             => $tWINDOW,
+    wgetnstr               => $tWINDOW,
+    wgetparent             => $tWINDOW,
+    wgetscrreg             => $tWINDOW,
+    wgetstr                => $tWINDOW,
+    whline                 => $tWINDOW,
+    whline_set             => $tWINDOW,
+    win_wch                => $tWINDOW,
+    win_wchnstr            => $tWINDOW,
+    win_wchstr             => $tWINDOW,
+    winch                  => $tWINDOW,
+    winchnstr              => $tWINDOW,
+    winchstr               => $tWINDOW,
+    winnstr                => $tWINDOW,
+    winnwstr               => $tWINDOW,
+    wins_nwstr             => $tWINDOW,
+    wins_wch               => $tWINDOW,
+    wins_wstr              => $tWINDOW,
+    winsch                 => $tWINDOW,
+    winsdelln              => $tWINDOW,
+    winsertln              => $tWINDOW,
+    winsnstr               => $tWINDOW,
+    winsstr                => $tWINDOW,
+    winstr                 => $tWINDOW,
+    winwstr                => $tWINDOW,
+    wmouse_trafo           => $tWINDOW,
+    wmove                  => $tWINDOW,
+    wnoutrefresh           => $tWINDOW,
+    wprintw                => $tWINDOW,
+    wredrawln              => $tWINDOW,
+    wrefresh               => $tWINDOW,
+    wresize                => $tWINDOW,
+    wscrl                  => $tWINDOW,
+    wsetscrreg             => $tWINDOW,
+    wstandend              => $tWINDOW,
+    wstandout              => $tWINDOW,
+    wsyncdown              => $tWINDOW,
+    wsyncup                => $tWINDOW,
+    wtimeout               => $tWINDOW,
+    wtouchln               => $tWINDOW,
+    wvline                 => $tWINDOW,
 );
 
+our $fld_nums = 0;
+our $frm_nums = 0;
+our $itm_nums = 0;
+our $mnu_nums = 0;
 our $pan_nums = 0;
 our $scr_nums = 0;
 our $thr_nums = 0;
@@ -389,13 +522,17 @@ our $curscr = "";
 our $newscr = "";
 our $stdscr = "";
 
-our %pan_addr;
-our %scr_addr;
-our %thr_addr;
-our %trm_addr;
-our %try_addr;
-our %usr_addr;
-our %win_addr;
+our %fld_addr;    # FIELD*
+our %frm_addr;    # FORM*
+our %itm_addr;    # ITEM*
+our %mnu_addr;    # MENU*
+our %pan_addr;    # PANEL*
+our %scr_addr;    # SCREEN*
+our %thr_addr;    # thread-id
+our %trm_addr;    # TERMINAL*
+our %try_addr;    # tries-number
+our %usr_addr;    # user-pointer
+our %win_addr;    # WINDOW*
 
 sub has_addr($) {
     my $value  = shift;
@@ -411,6 +548,30 @@ sub transaddr($) {
     $arg =~ s/\b$curscr\b/curscr/g if ($curscr);
     $arg =~ s/\b$newscr\b/newscr/g if ($newscr);
     $arg =~ s/\b$stdscr\b/stdscr/g if ($stdscr);
+    if ( &has_addr($arg) ) {
+        foreach my $addr ( keys %fld_addr ) {
+            $n = $fld_addr{$addr};
+            $arg =~ s/\b$addr\b/field$n/g if ( defined $n );
+        }
+    }
+    if ( &has_addr($arg) ) {
+        foreach my $addr ( keys %frm_addr ) {
+            $n = $frm_addr{$addr};
+            $arg =~ s/\b$addr\b/form$n/g if ( defined $n );
+        }
+    }
+    if ( &has_addr($arg) ) {
+        foreach my $addr ( keys %itm_addr ) {
+            $n = $itm_addr{$addr};
+            $arg =~ s/\b$addr\b/item$n/g if ( defined $n );
+        }
+    }
+    if ( &has_addr($arg) ) {
+        foreach my $addr ( keys %mnu_addr ) {
+            $n = $mnu_addr{$addr};
+            $arg =~ s/\b$addr\b/menu$n/g if ( defined $n );
+        }
+    }
     if ( &has_addr($arg) ) {
         foreach my $addr ( keys %pan_addr ) {
             $n = $pan_addr{$addr};
@@ -475,26 +636,77 @@ sub transaddr($) {
             my $addr = $arg;
             my $type = $known_p1{$func};
             chomp $addr;
-            $addr =~ s/^[^(]+\((0x[[:xdigit:]]+).*/$1/i;
+            $addr =~ s/^[^(]+\((0x[[:xdigit:]]+).*$/$1/i;
             if ( $addr !~ /^0x[[:xdigit:]]+$/i ) {
-                printf "OOPS - expected type #$type, skipping\n>>$addr\n";
+                if ( $type == $tSCREEN and $addr =~ /^[^(]+\(screen\d+[,)]/ ) {
+
+                    # ignore
+                }
+                elsif ( $type == $tWINDOW
+                    and $addr =~
+                    /^[^(]+\((stdscr|newscr|curscr|window\d+)[,)]/ )
+                {
+
+                    # ignore
+                }
+                elsif ( $type == $tTERMINAL
+                    and $addr =~ /^[^(]+\(terminal\d+[,)]/ )
+                {
+                    # ignore
+                }
+                elsif ( $type == $tPANEL and $addr =~ /^[^(]+\(panel\d+[,)]/ ) {
+
+                    # ignore
+                }
+                elsif ( $type == $tFIELD and $addr =~ /^[^(]+\(field\d+[,)]/ ) {
+
+                    # ignore
+                }
+                elsif ( $type == $tMENU and $addr =~ /^[^(]+\(menu\d+[,)]/ ) {
+
+                    # ignore
+                }
+                elsif ( $type == $tITEM and $addr =~ /^[^(]+\(item\d+[,)]/ ) {
+
+                    # ignore
+                }
+                else {
+                    printf "OOPS - expected type \"%s\", skipping\n>>$addr\n",
+                      $known_p1_types{$type};
+                }
             }
-            elsif ( $type == 1 ) {
+            elsif ( $type == $tSCREEN ) {
                 $scr_addr{$addr} = ++$scr_nums;
                 $arg = &transaddr($arg);
             }
-            elsif ( $type == 2 ) {
+            elsif ( $type == $tWINDOW ) {
                 $win_addr{$addr} = ++$win_nums;
                 $arg = &transaddr($arg);
             }
-            elsif ( $type == 4 ) {
+            elsif ( $type == $tTERMINAL ) {
                 $trm_addr{$addr} = ++$trm_nums;
                 $arg = &transaddr($arg);
             }
-            elsif ( $type == 8 ) {
+            elsif ( $type == $tPANEL ) {
                 $pan_addr{$addr} = ++$pan_nums;
                 $arg = &transaddr($arg);
             }
+            elsif ( $type == $tFIELD ) {
+                $fld_addr{$addr} = ++$fld_nums;
+                $arg = &transaddr($arg);
+            }
+            elsif ( $type == $tFORM ) {
+                $frm_addr{$addr} = ++$frm_nums;
+                $arg = &transaddr($arg);
+            }
+            elsif ( $type == $tMENU ) {
+                $mnu_addr{$addr} = ++$mnu_nums;
+                $arg = &transaddr($arg);
+            }
+            elsif ( $type == $tITEM ) {
+                $itm_addr{$addr} = ++$itm_nums;
+                $arg = &transaddr($arg);
+            }
         }
     }
 
@@ -563,6 +775,26 @@ sub muncher($) {
                 $usr_addr{$addr} = $usr_nums++;
                 $_               = &transaddr($_);
             }
+            elsif ( $_ =~ /^create :field 0x([[:xdigit:]]+)/ ) {
+                $addr            = "0x$1";
+                $fld_addr{$addr} = $fld_nums++;
+                $_               = &transaddr($_);
+            }
+            elsif ( $_ =~ /^create :form 0x([[:xdigit:]]+)/ ) {
+                $addr            = "0x$1";
+                $frm_addr{$addr} = $frm_nums++;
+                $_               = &transaddr($_);
+            }
+            elsif ( $_ =~ /^create :menu 0x([[:xdigit:]]+)/ ) {
+                $addr            = "0x$1";
+                $mnu_addr{$addr} = $mnu_nums++;
+                $_               = &transaddr($_);
+            }
+            elsif ( $_ =~ /^create :item 0x([[:xdigit:]]+)/ ) {
+                $addr            = "0x$1";
+                $itm_addr{$addr} = $itm_nums++;
+                $_               = &transaddr($_);
+            }
             elsif ( $_ =~ /^(\+ )*called \{set_curterm\((0x[[:xdigit:]]+)\)/ ) {
                 $trm_addr{$2} = ++$trm_nums unless defined $trm_addr{$2};
             }
@@ -602,6 +834,26 @@ sub muncher($) {
                 $_    = &transaddr($_);
                 undef $pan_addr{$addr};
             }
+            elsif ( $_ =~ /^([+ ])*called \{free_field\(0x([[:xdigit:]]+)\)/ ) {
+                $addr = "0x$2";
+                $_    = &transaddr($_);
+                undef $fld_addr{$addr};
+            }
+            elsif ( $_ =~ /^([+ ])*called \{free_form\(0x([[:xdigit:]]+)\)/ ) {
+                $addr = "0x$2";
+                $_    = &transaddr($_);
+                undef $frm_addr{$addr};
+            }
+            elsif ( $_ =~ /^([+ ])*called \{free_menu\(0x([[:xdigit:]]+)\)/ ) {
+                $addr = "0x$2";
+                $_    = &transaddr($_);
+                undef $mnu_addr{$addr};
+            }
+            elsif ( $_ =~ /^([+ ])*called \{free_item\(0x([[:xdigit:]]+)\)/ ) {
+                $addr = "0x$2";
+                $_    = &transaddr($_);
+                undef $itm_addr{$addr};
+            }
 
             # Compactify runs of PutAttrChar
             if ( ( ( $tracelevel & $TR{CHARPUT} ) != 0 ) and $_ =~ /$putattr/ )