]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.3 - patch 20220507
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 8 May 2022 00:52:05 +0000 (00:52 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 8 May 2022 00:52:05 +0000 (00:52 +0000)
+ add test/test_mouse.c (patch by Leonid S Usov).
+ add a few debug-traces for tic, fix a couple of memory-leaks.

21 files changed:
MANIFEST
NEWS
VERSION
dist.mk
ncurses/tinfo/alloc_entry.c
ncurses/tinfo/alloc_ttype.c
ncurses/tinfo/comp_parse.c
ncurses/tinfo/comp_scan.c
ncurses/tinfo/entries.c
ncurses/tinfo/parse_entry.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/modules
test/programs
test/test_mouse.c [new file with mode: 0644]

index ff14eb8e7960056a3f033d1f4d413bbf57586835..8c3a1dc1d5fe9cd8cee1c2cc0bc2176ab4c5ecf2 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
 ./test/test_getstr.c
 ./test/test_instr.c
 ./test/test_inwstr.c
 ./test/test_getstr.c
 ./test/test_instr.c
 ./test/test_inwstr.c
+./test/test_mouse.c
 ./test/test_opaque.c
 ./test/test_setupterm.c
 ./test/test_sgr.c
 ./test/test_opaque.c
 ./test/test_setupterm.c
 ./test/test_sgr.c
diff --git a/NEWS b/NEWS
index aad5f0d4165915194a96a272b9c67ce274c9476c..bc881eb72aa4c07a98cb423771cb931882e8f098 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,7 +26,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3803 2022/05/01 15:16:36 tom Exp $
+-- $Id: NEWS,v 1.3805 2022/05/07 22:42:19 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -46,6 +46,10 @@ See the AUTHORS file for the corresponding full names.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20220507
+       + add test/test_mouse.c (patch by Leonid S Usov).
+       + add a few debug-traces for tic, fix a couple of memory-leaks.
+
 20220501
        + build-fix for debug-traces (report/patch by Chris Clayton).
 
 20220501
        + build-fix for debug-traces (report/patch by Chris Clayton).
 
diff --git a/VERSION b/VERSION
index 7996e30dfc7c966c057b6eb964f3ff2d2101695b..59123a3165188bc964f53885e4130c818007dc30 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.3     20220501
+5:0:10 6.3     20220507
diff --git a/dist.mk b/dist.mk
index 85c204db8811bf8fab424e4106c33cf64745ed7c..5c0e01ad2dae4e3687a69bffde848ff3e812f62a 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -26,7 +26,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.1478 2022/05/01 10:28:56 tom Exp $
+# $Id: dist.mk,v 1.1479 2022/05/07 11:09:45 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -38,7 +38,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 6
 NCURSES_MINOR = 3
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 6
 NCURSES_MINOR = 3
-NCURSES_PATCH = 20220501
+NCURSES_PATCH = 20220507
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 48df0fd66dee6f6b1e11853f632c411ba0794f77..10c4fc75cb738e2f8ea3a3a5c5e8109acf3d0499 100644 (file)
@@ -48,7 +48,7 @@
 
 #include <tic.h>
 
 
 #include <tic.h>
 
-MODULE_ID("$Id: alloc_entry.c,v 1.71 2022/04/30 18:36:01 tom Exp $")
+MODULE_ID("$Id: alloc_entry.c,v 1.73 2022/05/08 00:11:44 tom Exp $")
 
 #define ABSENT_OFFSET    -1
 #define CANCELLED_OFFSET -2
 
 #define ABSENT_OFFSET    -1
 #define CANCELLED_OFFSET -2
@@ -60,7 +60,7 @@ NCURSES_EXPORT(void)
 _nc_init_entry(ENTRY * const tp)
 /* initialize a terminal type data block */
 {
 _nc_init_entry(ENTRY * const tp)
 /* initialize a terminal type data block */
 {
-    DEBUG(2, (T_CALLED("_nc_init_entry(tp=%p)"), tp));
+    DEBUG(2, (T_CALLED("_nc_init_entry(tp=%p)"), (void *) tp));
 
     if (tp == NULL) {
 #if NO_LEAKS
 
     if (tp == NULL) {
 #if NO_LEAKS
@@ -88,7 +88,7 @@ _nc_copy_entry(ENTRY * oldp)
 {
     ENTRY *newp;
 
 {
     ENTRY *newp;
 
-    DEBUG(2, (T_CALLED("_nc_copy_entry(oldp=%p)"), oldp));
+    DEBUG(2, (T_CALLED("_nc_copy_entry(oldp=%p)"), (void *) oldp));
 
     newp = typeCalloc(ENTRY, 1);
     if (newp != NULL) {
 
     newp = typeCalloc(ENTRY, 1);
     if (newp != NULL) {
@@ -96,7 +96,7 @@ _nc_copy_entry(ENTRY * oldp)
        _nc_copy_termtype2(&(newp->tterm), &(oldp->tterm));
     }
 
        _nc_copy_termtype2(&(newp->tterm), &(oldp->tterm));
     }
 
-    DEBUG(2, (T_RETURN("%p"), newp));
+    DEBUG(2, (T_RETURN("%p"), (void *) newp));
     return (newp);
 }
 
     return (newp);
 }
 
@@ -144,6 +144,8 @@ _nc_wrap_entry(ENTRY * const ep, bool copy_strings)
     unsigned nuses;
     TERMTYPE2 *tp;
 
     unsigned nuses;
     TERMTYPE2 *tp;
 
+    DEBUG(2, (T_CALLED("_nc_wrap_entry(ep=%p, copy_strings=%d)"), (void *)
+             ep, copy_strings));
     if (ep == NULL || stringbuf == NULL)
        _nc_err_abort("_nc_wrap_entry called without initialization");
 
     if (ep == NULL || stringbuf == NULL)
        _nc_err_abort("_nc_wrap_entry called without initialization");
 
@@ -236,6 +238,7 @@ _nc_wrap_entry(ENTRY * const ep, bool copy_strings)
        else
            ep->uses[i].name = (tp->str_table + useoffsets[i]);
     }
        else
            ep->uses[i].name = (tp->str_table + useoffsets[i]);
     }
+    DEBUG(2, (T_RETURN("")));
 }
 
 NCURSES_EXPORT(void)
 }
 
 NCURSES_EXPORT(void)
index eef8170cf21c6ebc4ddb7431b7aebfd39cb493e8..9f866323058ee373f6b0f6368a9d952a31dff2e8 100644 (file)
@@ -43,7 +43,7 @@
 
 #include <tic.h>
 
 
 #include <tic.h>
 
-MODULE_ID("$Id: alloc_ttype.c,v 1.37 2022/04/30 17:00:05 tom Exp $")
+MODULE_ID("$Id: alloc_ttype.c,v 1.40 2022/05/08 00:11:44 tom Exp $")
 
 #if NCURSES_XNAMES
 /*
 
 #if NCURSES_XNAMES
 /*
@@ -429,7 +429,7 @@ _nc_align_termtype(TERMTYPE2 *to, TERMTYPE2 *from)
     na = to ? ((int) NUM_EXT_NAMES(to)) : 0;
     nb = from ? ((int) NUM_EXT_NAMES(from)) : 0;
 
     na = to ? ((int) NUM_EXT_NAMES(to)) : 0;
     nb = from ? ((int) NUM_EXT_NAMES(from)) : 0;
 
-    DEBUG(2, (T_CALLED("align_termtype to(%d:%s), from(%d:%s)"),
+    DEBUG(2, (T_CALLED("_nc_align_termtype to(%d:%s), from(%d:%s)"),
              na, to ? NonNull(to->term_names) : "?",
              nb, from ? NonNull(from->term_names) : "?"));
 
              na, to ? NonNull(to->term_names) : "?",
              nb, from ? NonNull(from->term_names) : "?"));
 
@@ -450,8 +450,10 @@ _nc_align_termtype(TERMTYPE2 *to, TERMTYPE2 *from)
                    break;
                }
            }
                    break;
                }
            }
-           if (same)
+           if (same) {
+               DEBUG(2, (T_RETURN("")));
                return;
                return;
+           }
        }
        /*
         * This is where we pay for having a simple extension representation.
        }
        /*
         * This is where we pay for having a simple extension representation.
@@ -533,7 +535,8 @@ copy_termtype(TERMTYPE2 *dst, const TERMTYPE2 *src, int mode)
     int *newptr = 0;
 #endif
 
     int *newptr = 0;
 #endif
 
-    DEBUG(2, (T_CALLED("copy_termtype(dst=%p, src=%p, mode=%d)"), dst, src, mode));
+    DEBUG(2, (T_CALLED("copy_termtype(dst=%p, src=%p, mode=%d)"), (void *)
+             dst, (const void *) src, mode));
     *dst = *src;               /* ...to copy the sizes and string-tables */
 
     TYPE_MALLOC(NCURSES_SBOOL, NUM_BOOLEANS(dst), dst->Booleans);
     *dst = *src;               /* ...to copy the sizes and string-tables */
 
     TYPE_MALLOC(NCURSES_SBOOL, NUM_BOOLEANS(dst), dst->Booleans);
@@ -549,6 +552,11 @@ copy_termtype(TERMTYPE2 *dst, const TERMTYPE2 *src, int mode)
     new_table = NULL;
     for (pass = 0; pass < 2; ++pass) {
        size_t str_size = 0;
     new_table = NULL;
     for (pass = 0; pass < 2; ++pass) {
        size_t str_size = 0;
+       if (pass) {
+           dst->term_names = new_table + str_size;
+           strcpy(dst->term_names + str_size, src->term_names);
+       }
+       str_size += strlen(src->term_names) + 1;
        for (i = 0; i < NUM_STRINGS(dst); ++i) {
            if (VALID_STRING(src->Strings[i])) {
                if (pass) {
        for (i = 0; i < NUM_STRINGS(dst); ++i) {
            if (VALID_STRING(src->Strings[i])) {
                if (pass) {
@@ -646,7 +654,8 @@ copy_termtype(TERMTYPE2 *dst, const TERMTYPE2 *src, int mode)
 NCURSES_EXPORT(void)
 _nc_copy_termtype(TERMTYPE *dst, const TERMTYPE *src)
 {
 NCURSES_EXPORT(void)
 _nc_copy_termtype(TERMTYPE *dst, const TERMTYPE *src)
 {
-    DEBUG(2, (T_CALLED("_nc_copy_termtype(dst=%p, src=%p)"), dst, src));
+    DEBUG(2, (T_CALLED("_nc_copy_termtype(dst=%p, src=%p)"), (void *) dst,
+             (const void *) src));
     copy_termtype((TERMTYPE2 *) dst, (const TERMTYPE2 *) src, 0);
     DEBUG(2, (T_RETURN("")));
 }
     copy_termtype((TERMTYPE2 *) dst, (const TERMTYPE2 *) src, 0);
     DEBUG(2, (T_RETURN("")));
 }
@@ -655,7 +664,8 @@ _nc_copy_termtype(TERMTYPE *dst, const TERMTYPE *src)
 NCURSES_EXPORT(void)
 _nc_copy_termtype2(TERMTYPE2 *dst, const TERMTYPE2 *src)
 {
 NCURSES_EXPORT(void)
 _nc_copy_termtype2(TERMTYPE2 *dst, const TERMTYPE2 *src)
 {
-    DEBUG(2, (T_CALLED("_nc_copy_termtype2(dst=%p, src=%p)"), dst, src));
+    DEBUG(2, (T_CALLED("_nc_copy_termtype2(dst=%p, src=%p)"), (void *) dst,
+             (const void *) src));
     copy_termtype(dst, src, srcINT | dstINT);
     DEBUG(2, (T_RETURN("")));
 }
     copy_termtype(dst, src, srcINT | dstINT);
     DEBUG(2, (T_RETURN("")));
 }
@@ -667,7 +677,8 @@ _nc_copy_termtype2(TERMTYPE2 *dst, const TERMTYPE2 *src)
 NCURSES_EXPORT(void)
 _nc_export_termtype2(TERMTYPE *dst, const TERMTYPE2 *src)
 {
 NCURSES_EXPORT(void)
 _nc_export_termtype2(TERMTYPE *dst, const TERMTYPE2 *src)
 {
-    DEBUG(2, (T_CALLED("_nc_export_termtype2(dst=%p, src=%p)"), dst, src));
+    DEBUG(2, (T_CALLED("_nc_export_termtype2(dst=%p, src=%p)"), (void *)
+             dst, (const void *) src));
     copy_termtype((TERMTYPE2 *) dst, src, srcINT);
     DEBUG(2, (T_RETURN("")));
 }
     copy_termtype((TERMTYPE2 *) dst, src, srcINT);
     DEBUG(2, (T_RETURN("")));
 }
index 82672fa8ce2ed46693665fb320e9bbce723b527a..52ebac49cbed10e6eddb322c15edf1349a6cfb6e 100644 (file)
@@ -48,7 +48,7 @@
 
 #include <tic.h>
 
 
 #include <tic.h>
 
-MODULE_ID("$Id: comp_parse.c,v 1.117 2022/04/30 15:57:27 tom Exp $")
+MODULE_ID("$Id: comp_parse.c,v 1.122 2022/05/08 00:11:44 tom Exp $")
 
 static void sanity_check2(TERMTYPE2 *, bool);
 NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2;
 
 static void sanity_check2(TERMTYPE2 *, bool);
 NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2;
@@ -61,7 +61,7 @@ enqueue(ENTRY * ep)
 {
     ENTRY *newp;
 
 {
     ENTRY *newp;
 
-    DEBUG(1, (T_CALLED("enqueue(ep=%p)"), ep));
+    DEBUG(1, (T_CALLED("enqueue(ep=%p)"), (void *) ep));
 
     newp = _nc_copy_entry(ep);
     if (newp == 0)
 
     newp = _nc_copy_entry(ep);
     if (newp == 0)
@@ -73,6 +73,7 @@ enqueue(ENTRY * ep)
     newp->next = 0;
     if (newp->last)
        newp->last->next = newp;
     newp->next = 0;
     if (newp->last)
        newp->last->next = newp;
+    DEBUG(1, (T_RETURN("")));
 }
 
 #define NAMEBUFFER_SIZE (MAX_NAME_SIZE + 2)
 }
 
 #define NAMEBUFFER_SIZE (MAX_NAME_SIZE + 2)
@@ -222,7 +223,7 @@ _nc_read_entry_source(FILE *fp, char *buf,
 
     DEBUG(1,
          (T_CALLED("_nc_read_entry_source(file=%p, buf=%p, literal=%d, silent=%d, hook=%p)"),
 
     DEBUG(1,
          (T_CALLED("_nc_read_entry_source(file=%p, buf=%p, literal=%d, silent=%d, hook=%p)"),
-          fp, buf, literal, silent, hook));
+          (void *) fp, buf, literal, silent, (void *) hook));
 
     if (silent)
        _nc_suppress_warnings = TRUE;   /* shut the lexer up, too */
 
     if (silent)
        _nc_suppress_warnings = TRUE;   /* shut the lexer up, too */
@@ -253,6 +254,7 @@ _nc_read_entry_source(FILE *fp, char *buf,
            FreeIfNeeded(thisentry.tterm.Strings);
 #if NCURSES_XNAMES
            FreeIfNeeded(thisentry.tterm.ext_Names);
            FreeIfNeeded(thisentry.tterm.Strings);
 #if NCURSES_XNAMES
            FreeIfNeeded(thisentry.tterm.ext_Names);
+           FreeIfNeeded(thisentry.tterm.ext_str_table);
 #endif
        }
     }
 #endif
        }
     }
@@ -583,8 +585,10 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
                    FreeIfNeeded(qp->tterm.Booleans);
                    FreeIfNeeded(qp->tterm.Numbers);
                    FreeIfNeeded(qp->tterm.Strings);
                    FreeIfNeeded(qp->tterm.Booleans);
                    FreeIfNeeded(qp->tterm.Numbers);
                    FreeIfNeeded(qp->tterm.Strings);
+                   FreeIfNeeded(qp->tterm.str_table);
 #if NCURSES_XNAMES
                    FreeIfNeeded(qp->tterm.ext_Names);
 #if NCURSES_XNAMES
                    FreeIfNeeded(qp->tterm.ext_Names);
+                   FreeIfNeeded(qp->tterm.ext_str_table);
 #endif
                    qp->tterm = merged.tterm;
                    _nc_wrap_entry(qp, TRUE);
 #endif
                    qp->tterm = merged.tterm;
                    _nc_wrap_entry(qp, TRUE);
@@ -745,7 +749,7 @@ sanity_check2(TERMTYPE2 *tp, bool literal)
 NCURSES_EXPORT(void)
 _nc_leaks_tic(void)
 {
 NCURSES_EXPORT(void)
 _nc_leaks_tic(void)
 {
-    T((T_CALLED("_nc_free_tic()")));
+    T((T_CALLED("_nc_leaks_tic()")));
     _nc_globals.leak_checking = TRUE;
     _nc_alloc_entry_leaks();
     _nc_captoinfo_leaks();
     _nc_globals.leak_checking = TRUE;
     _nc_alloc_entry_leaks();
     _nc_captoinfo_leaks();
@@ -755,11 +759,13 @@ _nc_leaks_tic(void)
     _nc_codes_leaks();
 #endif
     _nc_tic_expand(0, FALSE, 0);
     _nc_codes_leaks();
 #endif
     _nc_tic_expand(0, FALSE, 0);
+    T((T_RETURN("")));
 }
 
 NCURSES_EXPORT(void)
 _nc_free_tic(int code)
 {
 }
 
 NCURSES_EXPORT(void)
 _nc_free_tic(int code)
 {
+    T((T_CALLED("_nc_free_tic(%d)"), code));
     _nc_leaks_tic();
     exit_terminfo(code);
 }
     _nc_leaks_tic();
     exit_terminfo(code);
 }
index 7f9075c7bef441867e105b313687752032149e4a..1d9a99852544e1ea8c55c4280d23271d186bc9b8 100644 (file)
@@ -51,7 +51,7 @@
 #include <ctype.h>
 #include <tic.h>
 
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: comp_scan.c,v 1.115 2022/04/30 16:21:01 tom Exp $")
+MODULE_ID("$Id: comp_scan.c,v 1.116 2022/05/08 00:11:44 tom Exp $")
 
 /*
  * Maximum length of string capability we'll accept before raising an error.
 
 /*
  * Maximum length of string capability we'll accept before raising an error.
@@ -113,7 +113,7 @@ NCURSES_EXPORT(void)
 _nc_reset_input(FILE *fp, char *buf)
 {
     TR(TRACE_DATABASE,
 _nc_reset_input(FILE *fp, char *buf)
 {
     TR(TRACE_DATABASE,
-       (T_CALLED("_nc_reset_input(fp=%p, buf=%p)"), fp, buf));
+       (T_CALLED("_nc_reset_input(fp=%p, buf=%p)"), (void *) fp, buf));
 
     pushtype = NO_PUSHBACK;
     if (pushname != 0)
 
     pushtype = NO_PUSHBACK;
     if (pushname != 0)
index c928f7ec2911aab5532f2aa5791d2b3c6e7d3725..5f49ece90b7b5f130c4427df80dbfe334726d96c 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright 2019-2020,2021 Thomas E. Dickey                                *
+ * Copyright 2019-2021,2022 Thomas E. Dickey                                *
  * Copyright 2006-2012,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * Copyright 2006-2012,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -38,7 +38,7 @@
 
 #include <tic.h>
 
 
 #include <tic.h>
 
-MODULE_ID("$Id: entries.c,v 1.32 2021/11/20 23:40:57 tom Exp $")
+MODULE_ID("$Id: entries.c,v 1.33 2022/05/07 17:08:11 tom Exp $")
 
 /****************************************************************************
  *
 
 /****************************************************************************
  *
@@ -119,7 +119,7 @@ _nc_leaks_tinfo(void)
     char *s;
 #endif
 
     char *s;
 #endif
 
-    T((T_CALLED("_nc_free_tinfo()")));
+    T((T_CALLED("_nc_leaks_tinfo()")));
 #if NO_LEAKS
     _nc_globals.leak_checking = TRUE;
     _nc_free_tparm(cur_term);
 #if NO_LEAKS
     _nc_globals.leak_checking = TRUE;
     _nc_free_tparm(cur_term);
@@ -161,6 +161,7 @@ _nc_leaks_tinfo(void)
 NCURSES_EXPORT(void)
 _nc_free_tinfo(int code)
 {
 NCURSES_EXPORT(void)
 _nc_free_tinfo(int code)
 {
+    T((T_CALLED("_nc_free_tinfo(%d)"), code));
     _nc_leaks_tinfo();
     exit(code);
 }
     _nc_leaks_tinfo();
     exit(code);
 }
@@ -169,6 +170,7 @@ _nc_free_tinfo(int code)
 NCURSES_EXPORT(void)
 exit_terminfo(int code)
 {
 NCURSES_EXPORT(void)
 exit_terminfo(int code)
 {
+    T((T_CALLED("exit_terminfo(%d)"), code));
 #if NO_LEAKS
     _nc_leaks_tinfo();
 #endif
 #if NO_LEAKS
     _nc_leaks_tinfo();
 #endif
index e39adade747ba8a53caf2d2f022f28cc892a6a02..14bcb67ed6bdff5400438b8697f68966dd9275f5 100644 (file)
@@ -48,7 +48,7 @@
 #include <ctype.h>
 #include <tic.h>
 
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: parse_entry.c,v 1.106 2022/04/30 20:50:06 tom Exp $")
+MODULE_ID("$Id: parse_entry.c,v 1.107 2022/05/08 00:11:44 tom Exp $")
 
 #ifdef LINT
 static short const parametrized[] =
 
 #ifdef LINT
 static short const parametrized[] =
@@ -287,7 +287,7 @@ _nc_parse_entry(ENTRY * entryp, int literal, bool silent)
 
     TR(TRACE_DATABASE,
        (T_CALLED("_nc_parse_entry(entry=%p, literal=%d, silent=%d)"),
 
     TR(TRACE_DATABASE,
        (T_CALLED("_nc_parse_entry(entry=%p, literal=%d, silent=%d)"),
-       entryp, literal, silent));
+       (void *) entryp, literal, silent));
 
     token_type = _nc_get_token(silent);
 
 
     token_type = _nc_get_token(silent);
 
@@ -766,7 +766,7 @@ postprocess_termcap(TERMTYPE2 *tp, bool has_base)
 
     TR(TRACE_DATABASE,
        (T_CALLED("postprocess_termcap(tp=%p, has_base=%d)"),
 
     TR(TRACE_DATABASE,
        (T_CALLED("postprocess_termcap(tp=%p, has_base=%d)"),
-       tp, has_base));
+       (void *) tp, has_base));
 
     /*
      * TERMCAP DEFAULTS AND OBSOLETE-CAPABILITY TRANSLATIONS
 
     /*
      * TERMCAP DEFAULTS AND OBSOLETE-CAPABILITY TRANSLATIONS
@@ -1062,7 +1062,7 @@ postprocess_terminfo(TERMTYPE2 *tp)
 {
     TR(TRACE_DATABASE,
        (T_CALLED("postprocess_terminfo(tp=%p)"),
 {
     TR(TRACE_DATABASE,
        (T_CALLED("postprocess_terminfo(tp=%p)"),
-       tp));
+       (void *) tp));
 
     /*
      * TERMINFO-TO-TERMINFO MAPPINGS FOR SOURCE TRANSLATION
 
     /*
      * TERMINFO-TO-TERMINFO MAPPINGS FOR SOURCE TRANSLATION
index d61e577bc1fc0967837b6544d91912d681fa2e28..2b1875edf13fdb84b44003c44420ee5aa6557319 100644 (file)
@@ -42,7 +42,7 @@
 
 #include <tic.h>
 
 
 #include <tic.h>
 
-MODULE_ID("$Id: read_entry.c,v 1.163 2022/04/30 18:35:46 tom Exp $")
+MODULE_ID("$Id: read_entry.c,v 1.164 2022/05/08 00:11:44 tom Exp $")
 
 #define MyNumber(n) (short) LOW_MSB(n)
 
 
 #define MyNumber(n) (short) LOW_MSB(n)
 
@@ -214,7 +214,7 @@ _nc_init_termtype(TERMTYPE2 *const tp)
 {
     unsigned i;
 
 {
     unsigned i;
 
-    DEBUG(2, (T_CALLED("_nc_init_termtype(tp=%p)"), tp));
+    DEBUG(2, (T_CALLED("_nc_init_termtype(tp=%p)"), (void *) tp));
 
 #if NCURSES_XNAMES
     tp->num_Booleans = BOOLCOUNT;
 
 #if NCURSES_XNAMES
     tp->num_Booleans = BOOLCOUNT;
index ad22e9c428ec52fd7f7e76386eb567fc9804988f..4a68d709c5a76ada2f9a66b5f83c6c3853dc9c61 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20220501) unstable; urgency=low
+ncurses6 (6.3+20220507) unstable; urgency=low
 
   * latest weekly patch
 
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 01 May 2022 06:28:56 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 07 May 2022 07:09:45 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index ad22e9c428ec52fd7f7e76386eb567fc9804988f..4a68d709c5a76ada2f9a66b5f83c6c3853dc9c61 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20220501) unstable; urgency=low
+ncurses6 (6.3+20220507) unstable; urgency=low
 
   * latest weekly patch
 
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 01 May 2022 06:28:56 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 07 May 2022 07:09:45 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index b023fe12606c3d3dc29da952f238f8f41ad80ac6..1c7bc2e6425bb451545677c4babe9bffd35d5ff5 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.3+20220501) unstable; urgency=low
+ncurses6 (6.3+20220507) unstable; urgency=low
 
   * latest weekly patch
 
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 01 May 2022 06:28:56 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 07 May 2022 07:09:45 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 2fd68b92828d51fd04c6502f46865ecb79ec8178..19d5c83ecf18334ab91058ac0f1050dcfc5c41bf 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.518 2022/05/01 10:28:56 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.519 2022/05/07 11:09:45 tom Exp $\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "3"\r
 !define VERSION_YYYY  "2022"\r
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "3"\r
 !define VERSION_YYYY  "2022"\r
-!define VERSION_MMDD  "0501"\r
+!define VERSION_MMDD  "0507"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 51cb8e615971d236a20df1e553f9e620fdc12a31..64364f9aeb9e96292bc6328f86effee3d7aa1b64 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.3
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.3
-Release: 20220501
+Release: 20220507
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 66263223b7e90ab00aca17f3736f8288f9feb8fe..ad46e5ed7f77e20e2abd70565780608c24a644a6 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.3
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.3
-Release: 20220501
+Release: 20220507
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index e7d420577b0f977ad3bf6108ec0e0119557d015b..a9be86f2c7f526a535fdae3fd0a475628d02f133 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.3
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.3
-Release: 20220501
+Release: 20220507
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 8ade4d7a11e9c058484bb210596f54708a02f611..6c5125f7518a10ab633d98c8583c418d69942a3c 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: modules,v 1.76 2022/04/09 21:27:31 tom Exp $
+# $Id: modules,v 1.77 2022/05/07 22:39:21 tom Exp $
 ##############################################################################
 # Copyright 2018-2021,2022 Thomas E. Dickey                                  #
 # Copyright 1998-2016,2017 Free Software Foundation, Inc.                    #
 ##############################################################################
 # Copyright 2018-2021,2022 Thomas E. Dickey                                  #
 # Copyright 1998-2016,2017 Free Software Foundation, Inc.                    #
@@ -105,6 +105,7 @@ test_get_wstr       progs           $(srcdir)       $(HEADER_DEPS)
 test_getstr    progs           $(srcdir)       $(HEADER_DEPS)
 test_instr     progs           $(srcdir)       $(HEADER_DEPS)
 test_inwstr    progs           $(srcdir)       $(HEADER_DEPS)
 test_getstr    progs           $(srcdir)       $(HEADER_DEPS)
 test_instr     progs           $(srcdir)       $(HEADER_DEPS)
 test_inwstr    progs           $(srcdir)       $(HEADER_DEPS)
+test_mouse     progs           $(srcdir)       $(HEADER_DEPS)
 test_opaque    progs           $(srcdir)       $(HEADER_DEPS)
 test_setupterm progs           $(srcdir)       $(HEADER_DEPS)
 test_sgr       progs           $(srcdir)       $(HEADER_DEPS)
 test_opaque    progs           $(srcdir)       $(HEADER_DEPS)
 test_setupterm progs           $(srcdir)       $(HEADER_DEPS)
 test_sgr       progs           $(srcdir)       $(HEADER_DEPS)
index 10c879bb803cd40e90a12e389f5b12a7edb07b17..306a1b075f0d446eea6e7606019ec750bc1d98d9 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: programs,v 1.52 2022/04/09 21:27:24 tom Exp $
+# $Id: programs,v 1.53 2022/05/07 22:39:49 tom Exp $
 ##############################################################################
 # Copyright 2018-2021,2022 Thomas E. Dickey                                  #
 # Copyright 2006-2016,2017 Free Software Foundation, Inc.                    #
 ##############################################################################
 # Copyright 2018-2021,2022 Thomas E. Dickey                                  #
 # Copyright 2006-2016,2017 Free Software Foundation, Inc.                    #
@@ -100,6 +100,7 @@ test_get_wstr       $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_get_wstr popup_msg
 test_getstr    $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_getstr popup_msg
 test_instr     $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_instr
 test_inwstr    $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_inwstr
 test_getstr    $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_getstr popup_msg
 test_instr     $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_instr
 test_inwstr    $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_inwstr
+test_mouse     $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_mouse
 test_opaque    $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_opaque
 test_setupterm $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_setupterm
 test_sgr       $(LDFLAGS_TINFO)        $(LOCAL_LIBS)   test_sgr
 test_opaque    $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_opaque
 test_setupterm $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   test_setupterm
 test_sgr       $(LDFLAGS_TINFO)        $(LOCAL_LIBS)   test_sgr
diff --git a/test/test_mouse.c b/test/test_mouse.c
new file mode 100644 (file)
index 0000000..f96d658
--- /dev/null
@@ -0,0 +1,244 @@
+/****************************************************************************
+ * Copyright 2022 Leonid S. Usov <leonid.s.usov at gmail.com>               *
+ * Copyright 2022 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.                               *
+ ****************************************************************************/
+/*
+ * $Id: test_mouse.c,v 1.8 2022/05/08 00:36:07 tom Exp $
+ *
+ * Author: Leonid S Usov
+ *
+ * Observe mouse events in the raw terminal or parsed ncurses modes
+ */
+
+#include <test.priv.h>
+
+#if defined(NCURSES_MOUSE_VERSION) && !defined(_NC_WINDOWS)
+
+static int logoffset = 0;
+
+static int
+raw_loop(void)
+{
+    struct termios tty;
+    struct termios old;
+    char *xtermcap;
+
+    tcgetattr(0, &old);
+    cfmakeraw(&tty);
+
+    setupterm(NULL, 0, 0);
+    xtermcap = tigetstr("XM");
+    if (xtermcap == 0 || xtermcap == (char *) -1) {
+       fprintf(stderr, "couldn't get XM terminfo");
+       return 1;
+    }
+
+    putp(tparm(xtermcap, 1));
+    fflush(stdout);
+
+    tcsetattr(0, TCSANOW, &tty);
+
+    while (true) {
+       int c = getc(stdin);
+       const char *pretty;
+
+       if (c == ERR || c == '\003') {
+           break;
+       } else if (c == '\033') {
+           printf("\r\n");
+       } else if ((pretty = unctrl((chtype) c)) != NULL) {
+           printf("%s", pretty);
+       } else if (isprint(c)) {
+           printf("%c", c);
+       } else {
+           printf("{%x}", c);
+       }
+    }
+
+    putp(tparm(xtermcap, 0));
+    fflush(stdout);
+    tcsetattr(0, TCSANOW, &old);
+    return 0;
+}
+
+static int logw(int line, const char *fmt, ...) GCC_PRINTFLIKE(2, 3);
+
+static int
+logw(int line, const char *fmt, ...)
+{
+    va_list args;
+    va_start(args, fmt);
+    wmove(stdscr, line++, 0);
+    vw_printw(stdscr, fmt, args);
+    clrtoeol();
+
+    line %= (getmaxy(stdscr) - logoffset);
+    if (line < logoffset) {
+       line = logoffset;
+    }
+
+    wmove(stdscr, line, 0);
+    wprintw(stdscr, ">");
+    clrtoeol();
+    return line;
+}
+
+static void
+usage(void)
+{
+    static const char *msg[] =
+    {
+       "Usage: test_mouse [options]",
+       "",
+       "Test mouse events.  These examples for $TERM demonstrate xterm"
+       "features:",
+       "    xterm",
+       "    xterm-1002",
+       "    xterm-1003",
+       "",
+       "Options:",
+       " -r       show raw input stream, injecting a new line before every ESC",
+       " -i n     set mouse interval to n; default is 0",
+       " -h       show this message",
+       " -T term  use terminal description other than $TERM"
+    };
+    unsigned n;
+    for (n = 0; n < sizeof(msg) / sizeof(char *); ++n) {
+       fprintf(stderr, "%s\n", msg[n]);
+    }
+}
+
+int
+main(int argc, char *argv[])
+{
+    bool rawmode = FALSE;
+    int interval = 0;
+    int curline;
+    int c;
+    MEVENT event;
+    char *my_environ;
+    const char *term_format = "TERM=%s";
+
+    while ((c = getopt(argc, argv, "hi:rT:")) != -1) {
+       switch (c) {
+       case 'h':
+           usage();
+           ExitProgram(EXIT_SUCCESS);
+       case 'i':
+           interval = atoi(optarg);
+           break;
+       case 'r':
+           rawmode = TRUE;
+           break;
+       case 'T':
+           my_environ = malloc(strlen(term_format) + strlen(optarg));
+           sprintf(my_environ, term_format, optarg);
+           putenv(my_environ);
+           break;
+       default:
+           usage();
+           ExitProgram(EXIT_FAILURE);
+       }
+    }
+    if (optind < argc) {
+       usage();
+       ExitProgram(EXIT_FAILURE);
+    }
+
+    if (rawmode) {
+       printf("Entering raw mode. Ctrl-c to quit.\n");
+       return raw_loop();
+    }
+
+    initscr();
+    clear();
+    noecho();
+    cbreak();                  /* Line buffering disabled; pass everything */
+    nonl();
+    keypad(stdscr, TRUE);
+
+    /* Get all the mouse events */
+    mousemask(ALL_MOUSE_EVENTS | REPORT_MOUSE_POSITION, NULL);
+    mouseinterval(interval);
+
+    logoffset = logw(logoffset, "Ctrl-c to quit");
+    logoffset = logw(logoffset, "--------------");
+
+    curline = logoffset;
+
+    while (1) {
+       c = getch();
+
+       switch (c) {
+       case KEY_MOUSE:
+           if (getmouse(&event) == OK) {
+               unsigned btn;
+               mmask_t events;
+#if NCURSES_MOUSE_VERSION > 1
+               const int max_btn = 5;
+#else
+               const int max_btn = 4;
+#endif
+               for (btn = 1; btn <= max_btn; btn++) {
+                   events = (mmask_t) (event.bstate
+                                       & NCURSES_MOUSE_MASK(btn,
+                                                            NCURSES_BUTTON_RELEASED |
+                                                            NCURSES_BUTTON_PRESSED |
+                                                            NCURSES_BUTTON_CLICKED |
+                                                            NCURSES_DOUBLE_CLICKED |
+                                                            NCURSES_TRIPLE_CLICKED));
+                   if (events == 0)
+                       continue;
+#define Show(btn,name) ((event.bstate & NCURSES_MOUSE_MASK(btn, name)) != 0) ? #name : ""
+                   curline = logw(curline,
+                                  "button %d %s %s %s %s %s %d[%x] @ %d, %d",
+                                  btn,
+                                  Show(btn, NCURSES_BUTTON_RELEASED),
+                                  Show(btn, NCURSES_BUTTON_PRESSED),
+                                  Show(btn, NCURSES_BUTTON_CLICKED),
+                                  Show(btn, NCURSES_DOUBLE_CLICKED),
+                                  Show(btn, NCURSES_TRIPLE_CLICKED),
+                                  (event.bstate & REPORT_MOUSE_POSITION) != 0,
+                                  events,
+                                  event.y, event.x);
+               }
+           }
+           break;
+       case '\003':
+           goto end;
+       default:
+           curline = logw(curline, "got another char: 0x%x", c);
+       }
+       refresh();
+    }
+  end:
+    endwin();
+    ExitProgram(EXIT_SUCCESS);
+}
+#else
+int
+main(void)
+{
+    printf("This program requires the ncurses library\n");
+    ExitProgram(EXIT_FAILURE);
+}
+#endif