From: Thomas E. Dickey Date: Sun, 16 Apr 2017 01:08:25 +0000 (+0000) Subject: ncurses 6.0 - patch 20170415 X-Git-Tag: v6.1~41 X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=5e1e572b71ae31a6071daa24e2460a68a6f1003c ncurses 6.0 - patch 20170415 + modify several test programs to use new popup_msgs, adapted from help-screen used in test/edit_field.c + drop two symbols obsoleted in 2004: _nc_check_termtype, and _nc_resolve_uses + fix some old copyright dates (cf: 20031025). + build-fixes for test/savescreen.c to work with AIX and HPUX. + minor fix to configure script, adding a backslash/continuation. + extend TERMINAL structure for ABI 6 to store numbers internally as integers rather than short, by adding new data for this purpose. + more fixes for minor memory-leaks in test-programs. --- diff --git a/Ada95/README b/Ada95/README index be842596..ea9ae80e 100644 --- a/Ada95/README +++ b/Ada95/README @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- diff --git a/Ada95/include/MKncurses_def.sh b/Ada95/include/MKncurses_def.sh index 4aac8655..1740bccb 100755 --- a/Ada95/include/MKncurses_def.sh +++ b/Ada95/include/MKncurses_def.sh @@ -1,7 +1,7 @@ #! /bin/sh -# $Id: MKncurses_def.sh,v 1.2 2003/10/25 16:19:46 tom Exp $ +# $Id: MKncurses_def.sh,v 1.3 2003/10/25 16:19:46 tom Exp $ ############################################################################## -# Copyright (c) 2000 Free Software Foundation, Inc. # +# Copyright (c) 2000,2003 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # diff --git a/Ada95/samples/rain.ads b/Ada95/samples/rain.ads index 3ad1912c..9c7242e9 100644 --- a/Ada95/samples/rain.ads +++ b/Ada95/samples/rain.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -36,7 +36,7 @@ -- Author: Laurent Pautet -- Modified by: Juergen Pfeifer, 1997 -- Version Control --- $Revision: 1.6 $ +-- $Revision: 1.7 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- -- diff --git a/Ada95/samples/sample-curses_demo-attributes.adb b/Ada95/samples/sample-curses_demo-attributes.adb index c49f37d6..b0f60d4a 100644 --- a/Ada95/samples/sample-curses_demo-attributes.adb +++ b/Ada95/samples/sample-curses_demo-attributes.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.12 $ +-- $Revision: 1.13 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-curses_demo-attributes.ads b/Ada95/samples/sample-curses_demo-attributes.ads index 6d9b4e8d..d1032d99 100644 --- a/Ada95/samples/sample-curses_demo-attributes.ads +++ b/Ada95/samples/sample-curses_demo-attributes.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Curses_Demo.Attributes is diff --git a/Ada95/samples/sample-curses_demo-mouse.ads b/Ada95/samples/sample-curses_demo-mouse.ads index ad78d0d0..e48834df 100644 --- a/Ada95/samples/sample-curses_demo-mouse.ads +++ b/Ada95/samples/sample-curses_demo-mouse.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Curses_Demo.Mouse is diff --git a/Ada95/samples/sample-curses_demo.ads b/Ada95/samples/sample-curses_demo.ads index ed4ad0f0..2ee0d9d2 100644 --- a/Ada95/samples/sample-curses_demo.ads +++ b/Ada95/samples/sample-curses_demo.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Curses_Demo is diff --git a/Ada95/samples/sample-form_demo.ads b/Ada95/samples/sample-form_demo.ads index bd33f578..ebdb0d42 100644 --- a/Ada95/samples/sample-form_demo.ads +++ b/Ada95/samples/sample-form_demo.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Form_Demo is diff --git a/Ada95/samples/sample-header_handler.ads b/Ada95/samples/sample-header_handler.ads index aa0a0c29..a81379dc 100644 --- a/Ada95/samples/sample-header_handler.ads +++ b/Ada95/samples/sample-header_handler.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-keyboard_handler.ads b/Ada95/samples/sample-keyboard_handler.ads index ac5b1399..9ad9535f 100644 --- a/Ada95/samples/sample-keyboard_handler.ads +++ b/Ada95/samples/sample-keyboard_handler.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-manifest.ads b/Ada95/samples/sample-manifest.ads index bb76c4cb..331cffc8 100644 --- a/Ada95/samples/sample-manifest.ads +++ b/Ada95/samples/sample-manifest.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.11 $ +-- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; diff --git a/Ada95/samples/sample-menu_demo.ads b/Ada95/samples/sample-menu_demo.ads index b071afc8..87537aac 100644 --- a/Ada95/samples/sample-menu_demo.ads +++ b/Ada95/samples/sample-menu_demo.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Menu_Demo is diff --git a/Ada95/samples/sample-text_io_demo.ads b/Ada95/samples/sample-text_io_demo.ads index d3f5a188..3bbc1b2c 100644 --- a/Ada95/samples/sample-text_io_demo.ads +++ b/Ada95/samples/sample-text_io_demo.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample.Text_IO_Demo is diff --git a/Ada95/samples/sample.ads b/Ada95/samples/sample.ads index 9d0647da..791c33ae 100644 --- a/Ada95/samples/sample.ads +++ b/Ada95/samples/sample.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package Sample is diff --git a/Ada95/samples/status.adb b/Ada95/samples/status.adb index e6581317..5da9a922 100644 --- a/Ada95/samples/status.adb +++ b/Ada95/samples/status.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -36,7 +36,7 @@ -- Author: Laurent Pautet -- Modified by: Juergen Pfeifer, 1997 -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.8 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- This package has been contributed by Laurent Pautet -- diff --git a/Ada95/samples/status.ads b/Ada95/samples/status.ads index e9e3ee8b..37ad5f1c 100644 --- a/Ada95/samples/status.ads +++ b/Ada95/samples/status.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -36,7 +36,7 @@ -- Author: Laurent Pautet -- Modified by: Juergen Pfeifer, 1997 -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- This package has been contributed by Laurent Pautet -- diff --git a/Ada95/samples/tour.adb b/Ada95/samples/tour.adb index 1cc91c15..e71310bf 100644 --- a/Ada95/samples/tour.adb +++ b/Ada95/samples/tour.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Sample; use Sample; diff --git a/Ada95/samples/tour.ads b/Ada95/samples/tour.ads index 88881691..3f9ce30c 100644 --- a/Ada95/samples/tour.ads +++ b/Ada95/samples/tour.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ procedure Tour; diff --git a/Ada95/src/library.gpr b/Ada95/src/library.gpr index dc31103a..a05b2c10 100644 --- a/Ada95/src/library.gpr +++ b/Ada95/src/library.gpr @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------ --- Copyright (c) 2010-2011,2014 Free Software Foundation, Inc. -- +-- Copyright (c) 2010-2014,2016 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- $Id: library.gpr,v 1.10 2016/09/18 00:25:54 tom Exp $ +-- $Id: library.gpr,v 1.11 2016/09/18 00:25:54 tom Exp $ -- http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Library-Projects.html -- http://www.adaworld.com/debian/debian-ada-policy.html project AdaCurses is diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads index 48fad09c..198071cf 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.10 $ +-- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic diff --git a/Ada95/src/terminal_interface-curses-putwin.adb b/Ada95/src/terminal_interface-curses-putwin.adb index 986cd6b9..c5724d11 100644 --- a/Ada95/src/terminal_interface-curses-putwin.adb +++ b/Ada95/src/terminal_interface-curses-putwin.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- Copyright (c) 2000,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.3 $ +-- $Revision: 1.4 $ -- Binding Version 01.00 with Ada.Streams.Stream_IO.C_Streams; diff --git a/Ada95/src/terminal_interface-curses-putwin.ads b/Ada95/src/terminal_interface-curses-putwin.ads index d302bdce..24d05063 100644 --- a/Ada95/src/terminal_interface-curses-putwin.ads +++ b/Ada95/src/terminal_interface-curses-putwin.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- Copyright (c) 2000,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.3 $ +-- $Revision: 1.4 $ -- Binding Version 01.00 with Ada.Streams.Stream_IO; diff --git a/Ada95/src/terminal_interface-curses-termcap.ads b/Ada95/src/terminal_interface-curses-termcap.ads index dd01396e..e5f19f65 100644 --- a/Ada95/src/terminal_interface-curses-termcap.ads +++ b/Ada95/src/terminal_interface-curses-termcap.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- Copyright (c) 2000,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.3 $ +-- $Revision: 1.4 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ diff --git a/Ada95/src/terminal_interface-curses-terminfo.ads b/Ada95/src/terminal_interface-curses-terminfo.ads index fb39bf1e..67f951d0 100644 --- a/Ada95/src/terminal_interface-curses-terminfo.ads +++ b/Ada95/src/terminal_interface-curses-terminfo.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- Copyright (c) 2000,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.3 $ +-- $Revision: 1.4 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ diff --git a/MANIFEST b/MANIFEST index a2511d16..742c5a20 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1157,6 +1157,8 @@ ./test/package/debian/watch ./test/package/mingw-ncurses-examples.spec ./test/package/ncurses-examples.spec +./test/popup_msg.c +./test/popup_msg.h ./test/programs ./test/railroad.c ./test/rain.c diff --git a/NEWS b/NEWS index acd62994..93932ab8 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.2799 2017/04/08 22:54:04 tom Exp $ +-- $Id: NEWS,v 1.2806 2017/04/15 18:00:38 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,18 @@ 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. +20170415 + + modify several test programs to use new popup_msgs, adapted from + help-screen used in test/edit_field.c + + drop two symbols obsoleted in 2004: _nc_check_termtype, and + _nc_resolve_uses + + fix some old copyright dates (cf: 20031025). + + build-fixes for test/savescreen.c to work with AIX and HPUX. + + minor fix to configure script, adding a backslash/continuation. + + extend TERMINAL structure for ABI 6 to store numbers internally as + integers rather than short, by adding new data for this purpose. + + more fixes for minor memory-leaks in test-programs. + 20170408 + change logic in wins_nwstr() to avoid addressing data past the output of mbstowcs(). diff --git a/VERSION b/VERSION index dd3f3e10..c5e6d969 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:9 6.0 20170408 +5:0:9 6.0 20170415 diff --git a/configure b/configure index 06f014d2..679e5ad7 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1.640 . +# From configure.in Revision: 1.641 . # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52.20150926. # @@ -17379,7 +17379,7 @@ EOF fi done -if test "x$ac_cv_func_getopt" = xno && +if test "x$ac_cv_func_getopt" = xno && \ test "x$cf_with_progs$cf_with_tests" != xnono; then { { echo "$as_me:17384: error: getopt is required for building programs" >&5 echo "$as_me: error: getopt is required for building programs" >&2;} diff --git a/configure.in b/configure.in index 04e09bf3..c3cf1fbe 100644 --- a/configure.in +++ b/configure.in @@ -28,14 +28,14 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: configure.in,v 1.640 2017/04/01 21:10:59 tom Exp $ +dnl $Id: configure.in,v 1.641 2017/04/13 23:35:03 tom Exp $ dnl Process this file with autoconf to produce a configure script. dnl dnl See http://invisible-island.net/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- AC_PREREQ(2.52.20030208) -AC_REVISION($Revision: 1.640 $) +AC_REVISION($Revision: 1.641 $) AC_INIT(ncurses/base/lib_initscr.c) AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) @@ -1631,7 +1631,7 @@ times \ vsnprintf \ ) -if test "x$ac_cv_func_getopt" = xno && +if test "x$ac_cv_func_getopt" = xno && \ test "x$cf_with_progs$cf_with_tests" != xnono; then AC_MSG_ERROR(getopt is required for building programs) fi diff --git a/dist.mk b/dist.mk index 95d78c39..ff78c862 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.1155 2017/04/02 10:36:57 tom Exp $ +# $Id: dist.mk,v 1.1156 2017/04/09 10:43:26 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -37,7 +37,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 6 NCURSES_MINOR = 0 -NCURSES_PATCH = 20170408 +NCURSES_PATCH = 20170415 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/include/MKncurses_def.sh b/include/MKncurses_def.sh index 4aac8655..1740bccb 100755 --- a/include/MKncurses_def.sh +++ b/include/MKncurses_def.sh @@ -1,7 +1,7 @@ #! /bin/sh -# $Id: MKncurses_def.sh,v 1.2 2003/10/25 16:19:46 tom Exp $ +# $Id: MKncurses_def.sh,v 1.3 2003/10/25 16:19:46 tom Exp $ ############################################################################## -# Copyright (c) 2000 Free Software Foundation, Inc. # +# Copyright (c) 2000,2003 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # diff --git a/include/MKterm.h.awk.in b/include/MKterm.h.awk.in index 3146ee8d..c6dbccc8 100644 --- a/include/MKterm.h.awk.in +++ b/include/MKterm.h.awk.in @@ -1,4 +1,27 @@ # vile:awkmode +function declare_termtype(number,suffix) { + printf "typedef struct termtype%s { /* in-core form of terminfo data */\n", suffix; + print " char *term_names; /* str_table offset of term names */" + print " char *str_table; /* pointer to string table */" + print " NCURSES_SBOOL *Booleans; /* array of boolean values */" + printf " %-5s *Numbers; /* array of integer values */\n", number; + print " char **Strings; /* array of string offsets */" + print "" + print "#if NCURSES_XNAMES" + print " char *ext_str_table; /* pointer to extended string table */" + print " char **ext_Names; /* corresponding names */" + print "" + print " unsigned short num_Booleans;/* count total Booleans */"; + print " unsigned short num_Numbers; /* count total Numbers */"; + print " unsigned short num_Strings; /* count total Strings */"; + print "" + print " unsigned short ext_Booleans;/* count extensions to Booleans */"; + print " unsigned short ext_Numbers; /* count extensions to Numbers */"; + print " unsigned short ext_Strings; /* count extensions to Strings */"; + print "#endif /* NCURSES_XNAMES */" + print "" + printf "} TERMTYPE%s;\n", suffix; +} BEGIN { lcurl = "{"; rcurl = "}"; @@ -36,7 +59,7 @@ BEGIN { print "/* and: Thomas E. Dickey 1995-on */" print "/****************************************************************************/" print "" - print "/* $Id: MKterm.h.awk.in,v 1.66 2017/04/03 08:16:54 tom Exp $ */" + print "/* $Id: MKterm.h.awk.in,v 1.67 2017/04/06 00:19:26 tom Exp $ */" print "" print "/*" print "** term.h -- Definition of struct term" @@ -179,27 +202,7 @@ END { print "/* used by code for comparing entries */" print "#define acs_chars_index ", acsindex print "" - print "typedef struct termtype { /* in-core form of terminfo data */" - print " char *term_names; /* str_table offset of term names */" - print " char *str_table; /* pointer to string table */" - print " NCURSES_SBOOL *Booleans; /* array of boolean values */" - print " short *Numbers; /* array of integer values */" - print " char **Strings; /* array of string offsets */" - print "" - print "#if NCURSES_XNAMES" - print " char *ext_str_table; /* pointer to extended string table */" - print " char **ext_Names; /* corresponding names */" - print "" - print " unsigned short num_Booleans;/* count total Booleans */" - print " unsigned short num_Numbers; /* count total Numbers */" - print " unsigned short num_Strings; /* count total Strings */" - print "" - print " unsigned short ext_Booleans;/* count extensions to Booleans */" - print " unsigned short ext_Numbers; /* count extensions to Numbers */" - print " unsigned short ext_Strings; /* count extensions to Strings */" - print "#endif /* NCURSES_XNAMES */" - print "" - print "} TERMTYPE;" + declare_termtype("short",""); print "" print "/*" print " * The only reason these structures are visible is for read-only use." @@ -207,6 +210,13 @@ END { print " * curses implementations." print " */" print "#ifdef NCURSES_INTERNALS" + print "" + if (@NCURSES_EXT_COLORS@) { + declare_termtype("int","2"); + } else { + print "typedef TERMTYPE TERMTYPE2;" + } + print "" print "typedef struct term { /* describe an actual terminal */" print " TERMTYPE type; /* terminal type description */" print " short Filedes; /* file description being written to */" @@ -214,6 +224,9 @@ END { print " TTY Nttyb; /* current state of the terminal */" print " int _baudrate; /* used to compute padding */" print " char * _termname; /* used for termname() */" + if (@NCURSES_EXT_COLORS@) { + print " TERMTYPE2 type2; /* extended terminal type description */" + } print "} TERMINAL;" print "#else" print "typedef struct term TERMINAL;" @@ -270,9 +283,9 @@ END { print "#ifdef NCURSES_INTERNALS" print "" print "extern NCURSES_EXPORT(int) _nc_set_tty_mode (TTY *buf);" - print "extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE *);" - print "extern NCURSES_EXPORT(void) _nc_init_termtype (TERMTYPE *const);" - print "extern NCURSES_EXPORT(int) _nc_read_termtype (TERMTYPE *, char *, int);" + print "extern NCURSES_EXPORT(int) _nc_read_entry2 (const char * const, char * const, TERMTYPE2 *const);" + print "extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE2 *);" + print "extern NCURSES_EXPORT(int) _nc_read_termtype (TERMTYPE2 *, char *, int);" print "extern NCURSES_EXPORT(char *) _nc_first_name (const char *const);" print "extern NCURSES_EXPORT(int) _nc_name_match (const char *const, const char *const, const char *const);" print "" diff --git a/include/term_entry.h b/include/term_entry.h index c0222d05..b97cc12b 100644 --- a/include/term_entry.h +++ b/include/term_entry.h @@ -32,7 +32,7 @@ * and: Thomas E. Dickey 1998-on * ****************************************************************************/ -/* $Id: term_entry.h,v 1.54 2017/04/03 21:36:00 tom Exp $ */ +/* $Id: term_entry.h,v 1.55 2017/04/06 22:45:34 tom Exp $ */ /* * term_entry.h -- interface to entry-manipulation code @@ -118,8 +118,7 @@ typedef struct { } ENTRY_USES; struct entry { - TERMTYPE tterm; - int *XNumbers; /* array of integer values */ + TERMTYPE2 tterm; unsigned nuses; ENTRY_USES uses[MAX_USES]; int ncrosslinks; @@ -167,15 +166,18 @@ extern NCURSES_EXPORT_VAR(ENTRY *) _nc_tail; /* alloc_entry.c: elementary allocation code */ extern NCURSES_EXPORT(ENTRY *) _nc_copy_entry (ENTRY *oldp); extern NCURSES_EXPORT(char *) _nc_save_str (const char *const); -extern NCURSES_EXPORT(void) _nc_init_entry (TERMTYPE *const); -extern NCURSES_EXPORT(void) _nc_merge_entry (TERMTYPE *const, TERMTYPE *const); +extern NCURSES_EXPORT(void) _nc_init_entry (ENTRY *const); +extern NCURSES_EXPORT(void) _nc_merge_entry (ENTRY *const, ENTRY *const); extern NCURSES_EXPORT(void) _nc_wrap_entry (ENTRY *const, bool); /* alloc_ttype.c: elementary allocation code */ -extern NCURSES_EXPORT(void) _nc_align_termtype (TERMTYPE *, TERMTYPE *); +extern NCURSES_EXPORT(void) _nc_align_termtype (TERMTYPE2 *, TERMTYPE2 *); + +/* free_ttype.c: elementary allocation code */ +extern NCURSES_EXPORT(void) _nc_free_termtype2 (TERMTYPE2 *); /* lib_termcap.c: trim sgr0 string for termcap users */ -extern NCURSES_EXPORT(char *) _nc_trim_sgr0 (TERMTYPE *); +extern NCURSES_EXPORT(char *) _nc_trim_sgr0 (TERMTYPE2 *); /* parse_entry.c: entry-parsing code */ #if NCURSES_XNAMES @@ -187,8 +189,8 @@ extern NCURSES_EXPORT(int) _nc_capcmp (const char *, const char *); /* write_entry.c: writing an entry to the file system */ extern NCURSES_EXPORT(void) _nc_set_writedir (const char *); -extern NCURSES_EXPORT(void) _nc_write_entry (TERMTYPE *const); -extern NCURSES_EXPORT(int) _nc_write_object(TERMTYPE *, char *, unsigned *, unsigned); +extern NCURSES_EXPORT(void) _nc_write_entry (TERMTYPE2 *const); +extern NCURSES_EXPORT(int) _nc_write_object (TERMTYPE2 *, char *, unsigned *, unsigned); /* comp_parse.c: entry list handling */ extern NCURSES_EXPORT(void) _nc_read_entry_source (FILE*, char*, int, bool, bool (*)(ENTRY*)); @@ -197,7 +199,7 @@ extern NCURSES_EXPORT(int) _nc_resolve_uses (bool); /* obs 20040705 */ extern NCURSES_EXPORT(int) _nc_resolve_uses2 (bool, bool); extern NCURSES_EXPORT(void) _nc_free_entries (ENTRY *); extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype)(TERMTYPE *); /* obs 20040705 */ -extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype2)(TERMTYPE *, bool); +extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype2)(TERMTYPE2 *, bool); /* trace_xnames.c */ extern NCURSES_EXPORT(void) _nc_trace_xnames (TERMTYPE *); diff --git a/include/termcap.h.in b/include/termcap.h.in index 6adc3122..457a5c78 100644 --- a/include/termcap.h.in +++ b/include/termcap.h.in @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2001 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,7 +31,7 @@ * and: Eric S. Raymond * ****************************************************************************/ -/* $Id: termcap.h.in,v 1.16 2001/03/24 21:53:27 tom Exp $ */ +/* $Id: termcap.h.in,v 1.17 2001/03/24 21:53:27 tom Exp $ */ #ifndef NCURSES_TERMCAP_H_incl #define NCURSES_TERMCAP_H_incl 1 diff --git a/man/term_variables.3x b/man/term_variables.3x index 14fa7e9a..2644e15a 100644 --- a/man/term_variables.3x +++ b/man/term_variables.3x @@ -26,9 +26,13 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: term_variables.3x,v 1.8 2017/01/07 19:25:15 tom Exp $ +.\" $Id: term_variables.3x,v 1.9 2017/04/14 08:33:25 tom Exp $ .TH term_variables 3X "" .ds n 5 +.ie \n(.g .ds `` \(lq +.el .ds `` `` +.ie \n(.g .ds '' \(rq +.el .ds '' '' .na .hy 0 .SH NAME @@ -135,8 +139,10 @@ These are the corresponding names used for termcap descriptions: \fBstrcodes\fP. .\" .SS Terminal Type +A terminal description begins with one or more terminal names +separated by \*(``|\*('' (vertical bars). On initialization of the curses or terminfo interfaces, -\fBsetupterm\fP(3X) copies the terminal name to the array \fBttytype\fP. +\fBsetupterm\fP(3X) copies the terminal names to the array \fBttytype\fP. .\" .SS Terminfo Names .PP @@ -147,12 +153,16 @@ which is defined .PP .nf .ft CW -#define CUR cur_term->type. +#define CUR ((TERMTYPE *)(cur_term))-> .fi .ft R .PP These symbols provide a faster method of accessing terminfo capabilities than using \fBtigetstr\fR(3X), etc. +.PP +The actual definition of \fBCUR\fP depends upon the implementation, +but each terminfo library provides these long names defined to point +into the current terminal description loaded into memory. .\" .SH NOTES The low-level terminfo interface is initialized using diff --git a/misc/shlib b/misc/shlib index a3ed8101..f0eb2afc 100755 --- a/misc/shlib +++ b/misc/shlib @@ -1,6 +1,6 @@ #!/bin/sh ############################################################################## -# Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. # +# Copyright (c) 1998-2005,2007 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -29,7 +29,7 @@ # # Author: Thomas E. Dickey 1996 # -# $Id: shlib,v 1.11 2007/01/13 17:09:52 tom Exp $ +# $Id: shlib,v 1.12 2007/01/13 17:09:52 tom Exp $ # Use this script as a wrapper when running executables linked to shared # libraries on systems that use the $LD_LIBRARY_PATH variable and don't embed # the soname's path within the linked executable (such as IRIX), e.g, diff --git a/misc/tdlint b/misc/tdlint index c0e652b6..4a5a05cf 100755 --- a/misc/tdlint +++ b/misc/tdlint @@ -1,6 +1,6 @@ #!/bin/sh ############################################################################## -# Copyright (c) 1998 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -29,7 +29,7 @@ # # Author: Thomas E. Dickey 1996 # -# $Id: tdlint,v 1.5 2000/10/28 20:53:36 tom Exp $ +# $Id: tdlint,v 1.6 2000/10/28 20:53:36 tom Exp $ # # Lint-script that allows user's own lint libraries, in addition to the ones # installed in the system. diff --git a/ncurses/SigAction.h b/ncurses/SigAction.h index 5dfde643..4467fc62 100644 --- a/ncurses/SigAction.h +++ b/ncurses/SigAction.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ ****************************************************************************/ /* - * $Id: SigAction.h,v 1.8 2005/08/06 20:05:32 tom Exp $ + * $Id: SigAction.h,v 1.9 2005/08/06 20:05:32 tom Exp $ * * This file exists to handle non-POSIX systems which don't have , * and usually no sigaction() nor diff --git a/ncurses/base/MKkeyname.awk b/ncurses/base/MKkeyname.awk index 89cacb28..e133858f 100644 --- a/ncurses/base/MKkeyname.awk +++ b/ncurses/base/MKkeyname.awk @@ -1,6 +1,6 @@ -# $Id: MKkeyname.awk,v 1.49 2016/05/28 23:11:26 tom Exp $ +# $Id: MKkeyname.awk,v 1.50 2017/04/11 01:18:08 tom Exp $ ############################################################################## -# Copyright (c) 1999-2013,2016 Free Software Foundation, Inc. # +# Copyright (c) 1999-2016,2017 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -134,7 +134,7 @@ END { print " } else if (result == 0 && HasTerminal(sp)) {" print " int j, k;" print " char * bound;" - print " TERMTYPE *tp = &(TerminalOf(sp)->type);" + print " TERMTYPE2 *tp = &TerminalType(TerminalOf(sp));" print " unsigned save_trace = _nc_tracing;" print "" print " _nc_tracing = 0; /* prevent recursion via keybound() */" diff --git a/ncurses/base/lib_set_term.c b/ncurses/base/lib_set_term.c index 854270bc..6cbf36ec 100644 --- a/ncurses/base/lib_set_term.c +++ b/ncurses/base/lib_set_term.c @@ -43,11 +43,10 @@ #include #include -#ifndef CUR +#undef CUR #define CUR SP_TERMTYPE -#endif -MODULE_ID("$Id: lib_set_term.c,v 1.159 2017/04/02 14:26:18 tom Exp $") +MODULE_ID("$Id: lib_set_term.c,v 1.162 2017/04/15 21:44:03 tom Exp $") #ifdef USE_TERM_DRIVER #define MaxColors InfoOf(sp).maxcolors @@ -193,6 +192,8 @@ delscreen(SCREEN *sp) NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx sp->_term); FreeIfNeeded(sp->out_buffer); + if (_nc_prescreen.allocated == sp) + _nc_prescreen.allocated = 0; free(sp); /* @@ -261,7 +262,7 @@ extract_fgbg(const char *src, int *result) if ((dst = tmp) == 0) { dst = src; } else if (value >= 0) { - *result = value; + *result = (int) value; } while (*dst != 0 && *dst != ';') dst++; diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index d01109c5..fe17d45c 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -34,7 +34,7 @@ ****************************************************************************/ /* - * $Id: curses.priv.h,v 1.567 2017/04/01 17:10:55 tom Exp $ + * $Id: curses.priv.h,v 1.570 2017/04/12 00:50:57 tom Exp $ * * curses.priv.h * @@ -358,6 +358,9 @@ color_t; #include +#include +#include + #define IsPreScreen(sp) (((sp) != 0) && sp->_prescreen) #define HasTerminal(sp) (((sp) != 0) && (0 != ((sp)->_term))) #define IsValidScreen(sp) (HasTerminal(sp) && !IsPreScreen(sp)) @@ -374,8 +377,22 @@ color_t; #define TerminalOf(sp) CurTerm #endif -#include -#include +/* + * The legacy layout for TERMTYPE uses "short" for all of the numbers. Moving + * past that, numeric capabilities can be "int" by using a TERMTYPE2 structure + * in TERMINAL, and doing most of the internal work using TERMTYPE2. There are + * a few places (mostly to expose the legacy layout) where the distinction + * needs attention. + */ +#if NCURSES_EXT_COLORS && HAVE_INIT_EXTENDED_COLOR +#define NCURSES_EXT_NUMBERS 1 +#define NCURSES_INT2 int +#define TerminalType(tp) (tp)->type2 +#else +#define NCURSES_EXT_NUMBERS 0 +#define NCURSES_INT2 short +#define TerminalType(tp) (tp)->type +#endif /* * Reduce dependency on cur_term global by using terminfo data from SCREEN's @@ -635,6 +652,9 @@ extern NCURSES_EXPORT(int) _nc_sigprocmask(int, const sigset_t *, sigset_t *); /* * Definitions for color pairs */ + +#define MAX_OF_TYPE(t) (int)(((unsigned t)(~0))>>1) + #include /* @@ -954,6 +974,7 @@ extern NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals; * It may be modified before the next SCREEN is created. */ typedef struct { + struct screen * allocated; bool use_env; bool filter_mode; attr_t previous_attr; @@ -2039,7 +2060,6 @@ extern NCURSES_EXPORT(int) _nc_remove_key (TRIES **, unsigned); extern NCURSES_EXPORT(int) _nc_remove_string (TRIES **, const char *); /* elsewhere ... */ -extern NCURSES_EXPORT(ENTRY *) _nc_delink_entry (ENTRY *, TERMTYPE *); extern NCURSES_EXPORT(SCREEN *) _nc_screen_of (WINDOW *); extern NCURSES_EXPORT(TERMINAL*) _nc_get_cur_term (void); extern NCURSES_EXPORT(WINDOW *) _nc_makenew (int, int, int, int, int); @@ -2058,14 +2078,15 @@ extern NCURSES_EXPORT(int) _nc_outch (int); extern NCURSES_EXPORT(int) _nc_putchar (int); extern NCURSES_EXPORT(int) _nc_putp(const char *, const char *); extern NCURSES_EXPORT(int) _nc_putp_flush(const char *, const char *); -extern NCURSES_EXPORT(int) _nc_read_termcap_entry (const char *const, TERMTYPE *const); -extern NCURSES_EXPORT(int) _nc_setup_tinfo(const char *, TERMTYPE *); +extern NCURSES_EXPORT(int) _nc_read_termcap_entry (const char *const, TERMTYPE2 *const); +extern NCURSES_EXPORT(int) _nc_setup_tinfo(const char *, TERMTYPE2 *); extern NCURSES_EXPORT(int) _nc_setupscreen (int, int, FILE *, int, int); extern NCURSES_EXPORT(int) _nc_timed_wait (SCREEN *, int, int, int * EVENTLIST_2nd(_nc_eventlist *)); +extern NCURSES_EXPORT(void) _nc_init_termtype (TERMTYPE2 *const); extern NCURSES_EXPORT(void) _nc_do_color (int, int, int, NCURSES_OUTC); extern NCURSES_EXPORT(void) _nc_flush (void); extern NCURSES_EXPORT(void) _nc_free_and_exit (int) GCC_NORETURN; -extern NCURSES_EXPORT(void) _nc_free_entry (ENTRY *, TERMTYPE *); +extern NCURSES_EXPORT(void) _nc_free_entry (ENTRY *, TERMTYPE2 *); extern NCURSES_EXPORT(void) _nc_freeall (void); extern NCURSES_EXPORT(void) _nc_hash_map (void); extern NCURSES_EXPORT(void) _nc_init_keytry (SCREEN *); @@ -2079,6 +2100,23 @@ extern NCURSES_EXPORT(void) _nc_signal_handler (int); extern NCURSES_EXPORT(void) _nc_synchook (WINDOW *); extern NCURSES_EXPORT(void) _nc_trace_tries (TRIES *); +#if NCURSES_EXT_NUMBERS +extern NCURSES_EXPORT(const TERMTYPE2 *) _nc_fallback2 (const char *); +#else +#define _nc_fallback2(tp) _nc_fallback(tp) +#endif + +#if NCURSES_EXT_NUMBERS +extern NCURSES_EXPORT(void) _nc_copy_termtype2 (TERMTYPE2 *, const TERMTYPE2 *); +extern NCURSES_EXPORT(void) _nc_export_termtype2(TERMTYPE *, const TERMTYPE2 *); +extern NCURSES_EXPORT(void) _nc_import_termtype2(TERMTYPE2 *, const TERMTYPE *); +#else +#define _nc_copy_termtype2(dst,src) _nc_copy_termtype((dst),(src)) +#define _nc_export_termtype2(dst,src) /* nothing */ +#define _nc_import_termtype2(dst,src) /* nothing */ +#define _nc_free_termtype2(t) _nc_free_termtype(t) +#endif + #if NO_LEAKS extern NCURSES_EXPORT(void) _nc_alloc_entry_leaks(void); extern NCURSES_EXPORT(void) _nc_captoinfo_leaks(void); diff --git a/ncurses/llib-lncurses b/ncurses/llib-lncurses index 41f1e6db..ebd3b528 100644 --- a/ncurses/llib-lncurses +++ b/ncurses/llib-lncurses @@ -2805,8 +2805,8 @@ int _nc_add_to_try( #undef _nc_align_termtype void _nc_align_termtype( - TERMTYPE *to, - TERMTYPE *from) + TERMTYPE2 *to, + TERMTYPE2 *from) { /* void */ } #undef _nc_copy_termtype @@ -2953,7 +2953,7 @@ ENTRY *_nc_tail; #undef _nc_free_entry void _nc_free_entry( ENTRY *headp, - TERMTYPE *tterm) + TERMTYPE2 *tterm) { /* void */ } #undef _nc_free_entries @@ -2961,12 +2961,6 @@ void _nc_free_entries( ENTRY *headp) { /* void */ } -#undef _nc_delink_entry -ENTRY *_nc_delink_entry( - ENTRY *headp, - TERMTYPE *tterm) - { return(*(ENTRY **)0); } - #undef _nc_leaks_tinfo void _nc_leaks_tinfo(void) { /* void */ } @@ -2974,9 +2968,9 @@ void _nc_leaks_tinfo(void) /* ./fallback.c */ #undef _nc_fallback -const TERMTYPE *_nc_fallback( +const TERMTYPE2 *_nc_fallback( const char *name) - { return(*(const TERMTYPE **)0); } + { return(*(const TERMTYPE2 **)0); } /* ./tinfo/free_ttype.c */ @@ -3430,7 +3424,7 @@ void _nc_update_screensize( #undef _nc_setup_tinfo int _nc_setup_tinfo( const char *const tn, - TERMTYPE *const tp) + TERMTYPE2 *const tp) { return(*(int *)0); } #undef _nc_tinfo_cmdch @@ -3982,12 +3976,12 @@ void _nc_set_buffer( #undef _nc_init_termtype void _nc_init_termtype( - TERMTYPE *const tp) + TERMTYPE2 *const tp) { /* void */ } #undef _nc_read_termtype int _nc_read_termtype( - TERMTYPE *ptr, + TERMTYPE2 *ptr, char *buffer, int limit) { return(*(int *)0); } @@ -3995,14 +3989,14 @@ int _nc_read_termtype( #undef _nc_read_file_entry int _nc_read_file_entry( const char *const filename, - TERMTYPE *ptr) + TERMTYPE2 *ptr) { return(*(int *)0); } -#undef _nc_read_entry -int _nc_read_entry( +#undef _nc_read_entry2 +int _nc_read_entry2( const char *const name, char *const filename, - TERMTYPE *const tp) + TERMTYPE2 *const tp) { return(*(int *)0); } /* ./tinfo/read_termcap.c */ @@ -4093,7 +4087,7 @@ int _nc_remove_string( #undef _nc_trim_sgr0 char *_nc_trim_sgr0( - TERMTYPE *tp) + TERMTYPE2 *tp) { return(*(char **)0); } /* ./unctrl.c */ @@ -4145,7 +4139,7 @@ const char *_nc_viscbuf( #undef _nc_init_entry void _nc_init_entry( - TERMTYPE *const tp) + ENTRY *const tp) { /* void */ } #undef _nc_copy_entry @@ -4166,8 +4160,8 @@ void _nc_wrap_entry( #undef _nc_merge_entry void _nc_merge_entry( - TERMTYPE *const to, - TERMTYPE *const from) + ENTRY *const target, + ENTRY *const source) { /* void */ } /* ./tinfo/captoinfo.c */ @@ -4199,7 +4193,7 @@ char *_nc_tic_expand( #undef _nc_check_termtype2 void (*_nc_check_termtype2)( - TERMTYPE *p1, + TERMTYPE2 *p1, NCURSES_BOOL p2); #undef _nc_check_termtype void (*_nc_check_termtype)( @@ -4282,7 +4276,7 @@ void _nc_panic_mode( #undef _nc_parse_entry int _nc_parse_entry( - struct entry *entryp, + ENTRY *entryp, int literal, NCURSES_BOOL silent) { return(*(int *)0); } @@ -4302,12 +4296,12 @@ void _nc_set_writedir( #undef _nc_write_entry void _nc_write_entry( - TERMTYPE *const tp) + TERMTYPE2 *const tp) { /* void */ } #undef _nc_write_object int _nc_write_object( - TERMTYPE *tp, + TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit) diff --git a/ncurses/llib-lncursest b/ncurses/llib-lncursest index b88c9426..04255bae 100644 --- a/ncurses/llib-lncursest +++ b/ncurses/llib-lncursest @@ -2814,8 +2814,8 @@ int _nc_add_to_try( #undef _nc_align_termtype void _nc_align_termtype( - TERMTYPE *to, - TERMTYPE *from) + TERMTYPE2 *to, + TERMTYPE2 *from) { /* void */ } #undef _nc_copy_termtype @@ -2967,7 +2967,7 @@ ENTRY *_nc_tail; #undef _nc_free_entry void _nc_free_entry( ENTRY *headp, - TERMTYPE *tterm) + TERMTYPE2 *tterm) { /* void */ } #undef _nc_free_entries @@ -2975,12 +2975,6 @@ void _nc_free_entries( ENTRY *headp) { /* void */ } -#undef _nc_delink_entry -ENTRY *_nc_delink_entry( - ENTRY *headp, - TERMTYPE *tterm) - { return(*(ENTRY **)0); } - #undef _nc_leaks_tinfo void _nc_leaks_tinfo(void) { /* void */ } @@ -2988,9 +2982,9 @@ void _nc_leaks_tinfo(void) /* ./fallback.c */ #undef _nc_fallback -const TERMTYPE *_nc_fallback( +const TERMTYPE2 *_nc_fallback( const char *name) - { return(*(const TERMTYPE **)0); } + { return(*(const TERMTYPE2 **)0); } /* ./tinfo/free_ttype.c */ @@ -3507,7 +3501,7 @@ void _nc_update_screensize( #undef _nc_setup_tinfo int _nc_setup_tinfo( const char *const tn, - TERMTYPE *const tp) + TERMTYPE2 *const tp) { return(*(int *)0); } #undef _nc_tinfo_cmdch @@ -4095,12 +4089,12 @@ void _nc_set_buffer( #undef _nc_init_termtype void _nc_init_termtype( - TERMTYPE *const tp) + TERMTYPE2 *const tp) { /* void */ } #undef _nc_read_termtype int _nc_read_termtype( - TERMTYPE *ptr, + TERMTYPE2 *ptr, char *buffer, int limit) { return(*(int *)0); } @@ -4108,14 +4102,14 @@ int _nc_read_termtype( #undef _nc_read_file_entry int _nc_read_file_entry( const char *const filename, - TERMTYPE *ptr) + TERMTYPE2 *ptr) { return(*(int *)0); } -#undef _nc_read_entry -int _nc_read_entry( +#undef _nc_read_entry2 +int _nc_read_entry2( const char *const name, char *const filename, - TERMTYPE *const tp) + TERMTYPE2 *const tp) { return(*(int *)0); } /* ./tinfo/read_termcap.c */ @@ -4206,7 +4200,7 @@ int _nc_remove_string( #undef _nc_trim_sgr0 char *_nc_trim_sgr0( - TERMTYPE *tp) + TERMTYPE2 *tp) { return(*(char **)0); } /* ./unctrl.c */ @@ -4258,7 +4252,7 @@ const char *_nc_viscbuf( #undef _nc_init_entry void _nc_init_entry( - TERMTYPE *const tp) + ENTRY *const tp) { /* void */ } #undef _nc_copy_entry @@ -4279,8 +4273,8 @@ void _nc_wrap_entry( #undef _nc_merge_entry void _nc_merge_entry( - TERMTYPE *const to, - TERMTYPE *const from) + ENTRY *const target, + ENTRY *const source) { /* void */ } /* ./tinfo/captoinfo.c */ @@ -4312,7 +4306,7 @@ char *_nc_tic_expand( #undef _nc_check_termtype2 void (*_nc_check_termtype2)( - TERMTYPE *p1, + TERMTYPE2 *p1, NCURSES_BOOL p2); #undef _nc_check_termtype void (*_nc_check_termtype)( @@ -4395,7 +4389,7 @@ void _nc_panic_mode( #undef _nc_parse_entry int _nc_parse_entry( - struct entry *entryp, + ENTRY *entryp, int literal, NCURSES_BOOL silent) { return(*(int *)0); } @@ -4415,12 +4409,12 @@ void _nc_set_writedir( #undef _nc_write_entry void _nc_write_entry( - TERMTYPE *const tp) + TERMTYPE2 *const tp) { /* void */ } #undef _nc_write_object int _nc_write_object( - TERMTYPE *tp, + TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit) diff --git a/ncurses/llib-lncursestw b/ncurses/llib-lncursestw index 7fde5801..3b9584c5 100644 --- a/ncurses/llib-lncursestw +++ b/ncurses/llib-lncursestw @@ -3719,8 +3719,8 @@ int _nc_add_to_try( #undef _nc_align_termtype void _nc_align_termtype( - TERMTYPE *to, - TERMTYPE *from) + TERMTYPE2 *to, + TERMTYPE2 *from) { /* void */ } #undef _nc_copy_termtype @@ -3729,6 +3729,24 @@ void _nc_copy_termtype( const TERMTYPE *src) { /* void */ } +#undef _nc_copy_termtype2 +void _nc_copy_termtype2( + TERMTYPE2 *dst, + const TERMTYPE2 *src) + { /* void */ } + +#undef _nc_export_termtype2 +void _nc_export_termtype2( + TERMTYPE *dst, + const TERMTYPE2 *src) + { /* void */ } + +#undef _nc_import_termtype2 +void _nc_import_termtype2( + TERMTYPE2 *dst, + const TERMTYPE *src) + { /* void */ } + /* ./codes.c */ #undef _nc_boolcodes @@ -3872,7 +3890,7 @@ ENTRY *_nc_tail; #undef _nc_free_entry void _nc_free_entry( ENTRY *headp, - TERMTYPE *tterm) + TERMTYPE2 *tterm) { /* void */ } #undef _nc_free_entries @@ -3880,18 +3898,17 @@ void _nc_free_entries( ENTRY *headp) { /* void */ } -#undef _nc_delink_entry -ENTRY *_nc_delink_entry( - ENTRY *headp, - TERMTYPE *tterm) - { return(*(ENTRY **)0); } - #undef _nc_leaks_tinfo void _nc_leaks_tinfo(void) { /* void */ } /* ./fallback.c */ +#undef _nc_fallback2 +const TERMTYPE2 *_nc_fallback2( + const char *name) + { return(*(const TERMTYPE2 **)0); } + #undef _nc_fallback const TERMTYPE *_nc_fallback( const char *name) @@ -3904,6 +3921,11 @@ void _nc_free_termtype( TERMTYPE *ptr) { /* void */ } +#undef _nc_free_termtype2 +void _nc_free_termtype2( + TERMTYPE2 *ptr) + { /* void */ } + #undef _nc_user_definable NCURSES_BOOL _nc_user_definable; @@ -4412,7 +4434,7 @@ void _nc_update_screensize( #undef _nc_setup_tinfo int _nc_setup_tinfo( const char *const tn, - TERMTYPE *const tp) + TERMTYPE2 *const tp) { return(*(int *)0); } #undef _nc_tinfo_cmdch @@ -5011,12 +5033,12 @@ void _nc_set_buffer( #undef _nc_init_termtype void _nc_init_termtype( - TERMTYPE *const tp) + TERMTYPE2 *const tp) { /* void */ } #undef _nc_read_termtype int _nc_read_termtype( - TERMTYPE *ptr, + TERMTYPE2 *ptr, char *buffer, int limit) { return(*(int *)0); } @@ -5024,7 +5046,14 @@ int _nc_read_termtype( #undef _nc_read_file_entry int _nc_read_file_entry( const char *const filename, - TERMTYPE *ptr) + TERMTYPE2 *ptr) + { return(*(int *)0); } + +#undef _nc_read_entry2 +int _nc_read_entry2( + const char *const name, + char *const filename, + TERMTYPE2 *const tp) { return(*(int *)0); } #undef _nc_read_entry @@ -5122,7 +5151,7 @@ int _nc_remove_string( #undef _nc_trim_sgr0 char *_nc_trim_sgr0( - TERMTYPE *tp) + TERMTYPE2 *tp) { return(*(char **)0); } /* ./unctrl.c */ @@ -5196,7 +5225,7 @@ const char *_nc_viscbuf( #undef _nc_init_entry void _nc_init_entry( - TERMTYPE *const tp) + ENTRY *const tp) { /* void */ } #undef _nc_copy_entry @@ -5217,8 +5246,8 @@ void _nc_wrap_entry( #undef _nc_merge_entry void _nc_merge_entry( - TERMTYPE *const to, - TERMTYPE *const from) + ENTRY *const target, + ENTRY *const source) { /* void */ } /* ./tinfo/captoinfo.c */ @@ -5250,7 +5279,7 @@ char *_nc_tic_expand( #undef _nc_check_termtype2 void (*_nc_check_termtype2)( - TERMTYPE *p1, + TERMTYPE2 *p1, NCURSES_BOOL p2); #undef _nc_check_termtype void (*_nc_check_termtype)( @@ -5333,7 +5362,7 @@ void _nc_panic_mode( #undef _nc_parse_entry int _nc_parse_entry( - struct entry *entryp, + ENTRY *entryp, int literal, NCURSES_BOOL silent) { return(*(int *)0); } @@ -5353,12 +5382,12 @@ void _nc_set_writedir( #undef _nc_write_entry void _nc_write_entry( - TERMTYPE *const tp) + TERMTYPE2 *const tp) { /* void */ } #undef _nc_write_object int _nc_write_object( - TERMTYPE *tp, + TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit) diff --git a/ncurses/llib-lncursesw b/ncurses/llib-lncursesw index 05732286..e6b459bc 100644 --- a/ncurses/llib-lncursesw +++ b/ncurses/llib-lncursesw @@ -3710,8 +3710,8 @@ int _nc_add_to_try( #undef _nc_align_termtype void _nc_align_termtype( - TERMTYPE *to, - TERMTYPE *from) + TERMTYPE2 *to, + TERMTYPE2 *from) { /* void */ } #undef _nc_copy_termtype @@ -3720,6 +3720,24 @@ void _nc_copy_termtype( const TERMTYPE *src) { /* void */ } +#undef _nc_copy_termtype2 +void _nc_copy_termtype2( + TERMTYPE2 *dst, + const TERMTYPE2 *src) + { /* void */ } + +#undef _nc_export_termtype2 +void _nc_export_termtype2( + TERMTYPE *dst, + const TERMTYPE2 *src) + { /* void */ } + +#undef _nc_import_termtype2 +void _nc_import_termtype2( + TERMTYPE2 *dst, + const TERMTYPE *src) + { /* void */ } + /* ./codes.c */ #undef boolcodes @@ -3858,7 +3876,7 @@ ENTRY *_nc_tail; #undef _nc_free_entry void _nc_free_entry( ENTRY *headp, - TERMTYPE *tterm) + TERMTYPE2 *tterm) { /* void */ } #undef _nc_free_entries @@ -3866,18 +3884,17 @@ void _nc_free_entries( ENTRY *headp) { /* void */ } -#undef _nc_delink_entry -ENTRY *_nc_delink_entry( - ENTRY *headp, - TERMTYPE *tterm) - { return(*(ENTRY **)0); } - #undef _nc_leaks_tinfo void _nc_leaks_tinfo(void) { /* void */ } /* ./fallback.c */ +#undef _nc_fallback2 +const TERMTYPE2 *_nc_fallback2( + const char *name) + { return(*(const TERMTYPE2 **)0); } + #undef _nc_fallback const TERMTYPE *_nc_fallback( const char *name) @@ -3890,6 +3907,11 @@ void _nc_free_termtype( TERMTYPE *ptr) { /* void */ } +#undef _nc_free_termtype2 +void _nc_free_termtype2( + TERMTYPE2 *ptr) + { /* void */ } + #undef _nc_user_definable NCURSES_BOOL _nc_user_definable; @@ -4335,7 +4357,7 @@ void _nc_update_screensize( #undef _nc_setup_tinfo int _nc_setup_tinfo( const char *const tn, - TERMTYPE *const tp) + TERMTYPE2 *const tp) { return(*(int *)0); } #undef _nc_tinfo_cmdch @@ -4898,12 +4920,12 @@ void _nc_set_buffer( #undef _nc_init_termtype void _nc_init_termtype( - TERMTYPE *const tp) + TERMTYPE2 *const tp) { /* void */ } #undef _nc_read_termtype int _nc_read_termtype( - TERMTYPE *ptr, + TERMTYPE2 *ptr, char *buffer, int limit) { return(*(int *)0); } @@ -4911,7 +4933,14 @@ int _nc_read_termtype( #undef _nc_read_file_entry int _nc_read_file_entry( const char *const filename, - TERMTYPE *ptr) + TERMTYPE2 *ptr) + { return(*(int *)0); } + +#undef _nc_read_entry2 +int _nc_read_entry2( + const char *const name, + char *const filename, + TERMTYPE2 *const tp) { return(*(int *)0); } #undef _nc_read_entry @@ -5009,7 +5038,7 @@ int _nc_remove_string( #undef _nc_trim_sgr0 char *_nc_trim_sgr0( - TERMTYPE *tp) + TERMTYPE2 *tp) { return(*(char **)0); } /* ./unctrl.c */ @@ -5083,7 +5112,7 @@ const char *_nc_viscbuf( #undef _nc_init_entry void _nc_init_entry( - TERMTYPE *const tp) + ENTRY *const tp) { /* void */ } #undef _nc_copy_entry @@ -5104,8 +5133,8 @@ void _nc_wrap_entry( #undef _nc_merge_entry void _nc_merge_entry( - TERMTYPE *const to, - TERMTYPE *const from) + ENTRY *const target, + ENTRY *const source) { /* void */ } /* ./tinfo/captoinfo.c */ @@ -5137,7 +5166,7 @@ char *_nc_tic_expand( #undef _nc_check_termtype2 void (*_nc_check_termtype2)( - TERMTYPE *p1, + TERMTYPE2 *p1, NCURSES_BOOL p2); #undef _nc_check_termtype void (*_nc_check_termtype)( @@ -5220,7 +5249,7 @@ void _nc_panic_mode( #undef _nc_parse_entry int _nc_parse_entry( - struct entry *entryp, + ENTRY *entryp, int literal, NCURSES_BOOL silent) { return(*(int *)0); } @@ -5240,12 +5269,12 @@ void _nc_set_writedir( #undef _nc_write_entry void _nc_write_entry( - TERMTYPE *const tp) + TERMTYPE2 *const tp) { /* void */ } #undef _nc_write_object int _nc_write_object( - TERMTYPE *tp, + TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit) diff --git a/ncurses/llib-ltic b/ncurses/llib-ltic index dde89fdd..fe029497 100644 --- a/ncurses/llib-ltic +++ b/ncurses/llib-ltic @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2012-2015,2016 Free Software Foundation, Inc. * + * Copyright (c) 2012-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,7 +37,7 @@ #undef _nc_init_entry void _nc_init_entry( - TERMTYPE *const tp) + ENTRY *const tp) { /* void */ } #undef _nc_copy_entry @@ -58,8 +58,8 @@ void _nc_wrap_entry( #undef _nc_merge_entry void _nc_merge_entry( - TERMTYPE *const to, - TERMTYPE *const from) + ENTRY *const target, + ENTRY *const source) { /* void */ } /* ./tinfo/captoinfo.c */ @@ -91,7 +91,7 @@ char *_nc_tic_expand( #undef _nc_check_termtype2 void (*_nc_check_termtype2)( - TERMTYPE *p1, + TERMTYPE2 *p1, NCURSES_BOOL p2); #undef _nc_check_termtype void (*_nc_check_termtype)( @@ -174,7 +174,7 @@ void _nc_panic_mode( #undef _nc_parse_entry int _nc_parse_entry( - struct entry *entryp, + ENTRY *entryp, int literal, NCURSES_BOOL silent) { return(*(int *)0); } @@ -194,12 +194,12 @@ void _nc_set_writedir( #undef _nc_write_entry void _nc_write_entry( - TERMTYPE *const tp) + TERMTYPE2 *const tp) { /* void */ } #undef _nc_write_object int _nc_write_object( - TERMTYPE *tp, + TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit) diff --git a/ncurses/llib-ltict b/ncurses/llib-ltict index 079ef28e..6677569c 100644 --- a/ncurses/llib-ltict +++ b/ncurses/llib-ltict @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2013-2015,2016 Free Software Foundation, Inc. * + * Copyright (c) 2013-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,7 +37,7 @@ #undef _nc_init_entry void _nc_init_entry( - TERMTYPE *const tp) + ENTRY *const tp) { /* void */ } #undef _nc_copy_entry @@ -58,8 +58,8 @@ void _nc_wrap_entry( #undef _nc_merge_entry void _nc_merge_entry( - TERMTYPE *const to, - TERMTYPE *const from) + ENTRY *const target, + ENTRY *const source) { /* void */ } /* ./tinfo/captoinfo.c */ @@ -91,7 +91,7 @@ char *_nc_tic_expand( #undef _nc_check_termtype2 void (*_nc_check_termtype2)( - TERMTYPE *p1, + TERMTYPE2 *p1, NCURSES_BOOL p2); #undef _nc_check_termtype void (*_nc_check_termtype)( @@ -174,7 +174,7 @@ void _nc_panic_mode( #undef _nc_parse_entry int _nc_parse_entry( - struct entry *entryp, + ENTRY *entryp, int literal, NCURSES_BOOL silent) { return(*(int *)0); } @@ -194,12 +194,12 @@ void _nc_set_writedir( #undef _nc_write_entry void _nc_write_entry( - TERMTYPE *const tp) + TERMTYPE2 *const tp) { /* void */ } #undef _nc_write_object int _nc_write_object( - TERMTYPE *tp, + TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit) diff --git a/ncurses/llib-ltictw b/ncurses/llib-ltictw index dde89fdd..fe029497 100644 --- a/ncurses/llib-ltictw +++ b/ncurses/llib-ltictw @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2012-2015,2016 Free Software Foundation, Inc. * + * Copyright (c) 2012-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,7 +37,7 @@ #undef _nc_init_entry void _nc_init_entry( - TERMTYPE *const tp) + ENTRY *const tp) { /* void */ } #undef _nc_copy_entry @@ -58,8 +58,8 @@ void _nc_wrap_entry( #undef _nc_merge_entry void _nc_merge_entry( - TERMTYPE *const to, - TERMTYPE *const from) + ENTRY *const target, + ENTRY *const source) { /* void */ } /* ./tinfo/captoinfo.c */ @@ -91,7 +91,7 @@ char *_nc_tic_expand( #undef _nc_check_termtype2 void (*_nc_check_termtype2)( - TERMTYPE *p1, + TERMTYPE2 *p1, NCURSES_BOOL p2); #undef _nc_check_termtype void (*_nc_check_termtype)( @@ -174,7 +174,7 @@ void _nc_panic_mode( #undef _nc_parse_entry int _nc_parse_entry( - struct entry *entryp, + ENTRY *entryp, int literal, NCURSES_BOOL silent) { return(*(int *)0); } @@ -194,12 +194,12 @@ void _nc_set_writedir( #undef _nc_write_entry void _nc_write_entry( - TERMTYPE *const tp) + TERMTYPE2 *const tp) { /* void */ } #undef _nc_write_object int _nc_write_object( - TERMTYPE *tp, + TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit) diff --git a/ncurses/llib-lticw b/ncurses/llib-lticw index dde89fdd..fe029497 100644 --- a/ncurses/llib-lticw +++ b/ncurses/llib-lticw @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2012-2015,2016 Free Software Foundation, Inc. * + * Copyright (c) 2012-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,7 +37,7 @@ #undef _nc_init_entry void _nc_init_entry( - TERMTYPE *const tp) + ENTRY *const tp) { /* void */ } #undef _nc_copy_entry @@ -58,8 +58,8 @@ void _nc_wrap_entry( #undef _nc_merge_entry void _nc_merge_entry( - TERMTYPE *const to, - TERMTYPE *const from) + ENTRY *const target, + ENTRY *const source) { /* void */ } /* ./tinfo/captoinfo.c */ @@ -91,7 +91,7 @@ char *_nc_tic_expand( #undef _nc_check_termtype2 void (*_nc_check_termtype2)( - TERMTYPE *p1, + TERMTYPE2 *p1, NCURSES_BOOL p2); #undef _nc_check_termtype void (*_nc_check_termtype)( @@ -174,7 +174,7 @@ void _nc_panic_mode( #undef _nc_parse_entry int _nc_parse_entry( - struct entry *entryp, + ENTRY *entryp, int literal, NCURSES_BOOL silent) { return(*(int *)0); } @@ -194,12 +194,12 @@ void _nc_set_writedir( #undef _nc_write_entry void _nc_write_entry( - TERMTYPE *const tp) + TERMTYPE2 *const tp) { /* void */ } #undef _nc_write_object int _nc_write_object( - TERMTYPE *tp, + TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit) diff --git a/ncurses/llib-ltinfo b/ncurses/llib-ltinfo index 9b8949ac..cf7e3175 100644 --- a/ncurses/llib-ltinfo +++ b/ncurses/llib-ltinfo @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2012-2015,2016 Free Software Foundation, Inc. * + * Copyright (c) 2012-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -88,8 +88,8 @@ int _nc_add_to_try( #undef _nc_align_termtype void _nc_align_termtype( - TERMTYPE *to, - TERMTYPE *from) + TERMTYPE2 *to, + TERMTYPE2 *from) { /* void */ } #undef _nc_copy_termtype @@ -236,7 +236,7 @@ ENTRY *_nc_tail; #undef _nc_free_entry void _nc_free_entry( ENTRY *headp, - TERMTYPE *tterm) + TERMTYPE2 *tterm) { /* void */ } #undef _nc_free_entries @@ -244,12 +244,6 @@ void _nc_free_entries( ENTRY *headp) { /* void */ } -#undef _nc_delink_entry -ENTRY *_nc_delink_entry( - ENTRY *headp, - TERMTYPE *tterm) - { return(*(ENTRY **)0); } - #undef _nc_leaks_tinfo void _nc_leaks_tinfo(void) { /* void */ } @@ -257,9 +251,9 @@ void _nc_leaks_tinfo(void) /* ./fallback.c */ #undef _nc_fallback -const TERMTYPE *_nc_fallback( +const TERMTYPE2 *_nc_fallback( const char *name) - { return(*(const TERMTYPE **)0); } + { return(*(const TERMTYPE2 **)0); } /* ./tinfo/free_ttype.c */ @@ -713,7 +707,7 @@ void _nc_update_screensize( #undef _nc_setup_tinfo int _nc_setup_tinfo( const char *const tn, - TERMTYPE *const tp) + TERMTYPE2 *const tp) { return(*(int *)0); } #undef _nc_tinfo_cmdch @@ -1265,12 +1259,12 @@ void _nc_set_buffer( #undef _nc_init_termtype void _nc_init_termtype( - TERMTYPE *const tp) + TERMTYPE2 *const tp) { /* void */ } #undef _nc_read_termtype int _nc_read_termtype( - TERMTYPE *ptr, + TERMTYPE2 *ptr, char *buffer, int limit) { return(*(int *)0); } @@ -1278,14 +1272,14 @@ int _nc_read_termtype( #undef _nc_read_file_entry int _nc_read_file_entry( const char *const filename, - TERMTYPE *ptr) + TERMTYPE2 *ptr) { return(*(int *)0); } -#undef _nc_read_entry -int _nc_read_entry( +#undef _nc_read_entry2 +int _nc_read_entry2( const char *const name, char *const filename, - TERMTYPE *const tp) + TERMTYPE2 *const tp) { return(*(int *)0); } /* ./tinfo/read_termcap.c */ @@ -1374,7 +1368,7 @@ int _nc_remove_string( #undef _nc_trim_sgr0 char *_nc_trim_sgr0( - TERMTYPE *tp) + TERMTYPE2 *tp) { return(*(char **)0); } /* ./unctrl.c */ diff --git a/ncurses/llib-ltinfot b/ncurses/llib-ltinfot index 517161da..41c92034 100644 --- a/ncurses/llib-ltinfot +++ b/ncurses/llib-ltinfot @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2013-2015,2016 Free Software Foundation, Inc. * + * Copyright (c) 2013-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -88,8 +88,8 @@ int _nc_add_to_try( #undef _nc_align_termtype void _nc_align_termtype( - TERMTYPE *to, - TERMTYPE *from) + TERMTYPE2 *to, + TERMTYPE2 *from) { /* void */ } #undef _nc_copy_termtype @@ -241,7 +241,7 @@ ENTRY *_nc_tail; #undef _nc_free_entry void _nc_free_entry( ENTRY *headp, - TERMTYPE *tterm) + TERMTYPE2 *tterm) { /* void */ } #undef _nc_free_entries @@ -249,12 +249,6 @@ void _nc_free_entries( ENTRY *headp) { /* void */ } -#undef _nc_delink_entry -ENTRY *_nc_delink_entry( - ENTRY *headp, - TERMTYPE *tterm) - { return(*(ENTRY **)0); } - #undef _nc_leaks_tinfo void _nc_leaks_tinfo(void) { /* void */ } @@ -262,9 +256,9 @@ void _nc_leaks_tinfo(void) /* ./fallback.c */ #undef _nc_fallback -const TERMTYPE *_nc_fallback( +const TERMTYPE2 *_nc_fallback( const char *name) - { return(*(const TERMTYPE **)0); } + { return(*(const TERMTYPE2 **)0); } /* ./tinfo/free_ttype.c */ @@ -781,7 +775,7 @@ void _nc_update_screensize( #undef _nc_setup_tinfo int _nc_setup_tinfo( const char *const tn, - TERMTYPE *const tp) + TERMTYPE2 *const tp) { return(*(int *)0); } #undef _nc_tinfo_cmdch @@ -1369,12 +1363,12 @@ void _nc_set_buffer( #undef _nc_init_termtype void _nc_init_termtype( - TERMTYPE *const tp) + TERMTYPE2 *const tp) { /* void */ } #undef _nc_read_termtype int _nc_read_termtype( - TERMTYPE *ptr, + TERMTYPE2 *ptr, char *buffer, int limit) { return(*(int *)0); } @@ -1382,14 +1376,14 @@ int _nc_read_termtype( #undef _nc_read_file_entry int _nc_read_file_entry( const char *const filename, - TERMTYPE *ptr) + TERMTYPE2 *ptr) { return(*(int *)0); } -#undef _nc_read_entry -int _nc_read_entry( +#undef _nc_read_entry2 +int _nc_read_entry2( const char *const name, char *const filename, - TERMTYPE *const tp) + TERMTYPE2 *const tp) { return(*(int *)0); } /* ./tinfo/read_termcap.c */ @@ -1478,7 +1472,7 @@ int _nc_remove_string( #undef _nc_trim_sgr0 char *_nc_trim_sgr0( - TERMTYPE *tp) + TERMTYPE2 *tp) { return(*(char **)0); } /* ./unctrl.c */ diff --git a/ncurses/llib-ltinfotw b/ncurses/llib-ltinfotw index 08c53d46..31376b54 100644 --- a/ncurses/llib-ltinfotw +++ b/ncurses/llib-ltinfotw @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2012-2015,2016 Free Software Foundation, Inc. * + * Copyright (c) 2012-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -88,8 +88,8 @@ int _nc_add_to_try( #undef _nc_align_termtype void _nc_align_termtype( - TERMTYPE *to, - TERMTYPE *from) + TERMTYPE2 *to, + TERMTYPE2 *from) { /* void */ } #undef _nc_copy_termtype @@ -98,6 +98,24 @@ void _nc_copy_termtype( const TERMTYPE *src) { /* void */ } +#undef _nc_copy_termtype2 +void _nc_copy_termtype2( + TERMTYPE2 *dst, + const TERMTYPE2 *src) + { /* void */ } + +#undef _nc_export_termtype2 +void _nc_export_termtype2( + TERMTYPE *dst, + const TERMTYPE2 *src) + { /* void */ } + +#undef _nc_import_termtype2 +void _nc_import_termtype2( + TERMTYPE2 *dst, + const TERMTYPE *src) + { /* void */ } + /* ./codes.c */ #undef _nc_boolcodes @@ -241,7 +259,7 @@ ENTRY *_nc_tail; #undef _nc_free_entry void _nc_free_entry( ENTRY *headp, - TERMTYPE *tterm) + TERMTYPE2 *tterm) { /* void */ } #undef _nc_free_entries @@ -249,18 +267,17 @@ void _nc_free_entries( ENTRY *headp) { /* void */ } -#undef _nc_delink_entry -ENTRY *_nc_delink_entry( - ENTRY *headp, - TERMTYPE *tterm) - { return(*(ENTRY **)0); } - #undef _nc_leaks_tinfo void _nc_leaks_tinfo(void) { /* void */ } /* ./fallback.c */ +#undef _nc_fallback2 +const TERMTYPE2 *_nc_fallback2( + const char *name) + { return(*(const TERMTYPE2 **)0); } + #undef _nc_fallback const TERMTYPE *_nc_fallback( const char *name) @@ -273,6 +290,11 @@ void _nc_free_termtype( TERMTYPE *ptr) { /* void */ } +#undef _nc_free_termtype2 +void _nc_free_termtype2( + TERMTYPE2 *ptr) + { /* void */ } + #undef _nc_user_definable NCURSES_BOOL _nc_user_definable; @@ -781,7 +803,7 @@ void _nc_update_screensize( #undef _nc_setup_tinfo int _nc_setup_tinfo( const char *const tn, - TERMTYPE *const tp) + TERMTYPE2 *const tp) { return(*(int *)0); } #undef _nc_tinfo_cmdch @@ -1380,12 +1402,12 @@ void _nc_set_buffer( #undef _nc_init_termtype void _nc_init_termtype( - TERMTYPE *const tp) + TERMTYPE2 *const tp) { /* void */ } #undef _nc_read_termtype int _nc_read_termtype( - TERMTYPE *ptr, + TERMTYPE2 *ptr, char *buffer, int limit) { return(*(int *)0); } @@ -1393,7 +1415,14 @@ int _nc_read_termtype( #undef _nc_read_file_entry int _nc_read_file_entry( const char *const filename, - TERMTYPE *ptr) + TERMTYPE2 *ptr) + { return(*(int *)0); } + +#undef _nc_read_entry2 +int _nc_read_entry2( + const char *const name, + char *const filename, + TERMTYPE2 *const tp) { return(*(int *)0); } #undef _nc_read_entry @@ -1489,7 +1518,7 @@ int _nc_remove_string( #undef _nc_trim_sgr0 char *_nc_trim_sgr0( - TERMTYPE *tp) + TERMTYPE2 *tp) { return(*(char **)0); } /* ./unctrl.c */ diff --git a/ncurses/llib-ltinfow b/ncurses/llib-ltinfow index 123ed9b8..5b8411c2 100644 --- a/ncurses/llib-ltinfow +++ b/ncurses/llib-ltinfow @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2012-2015,2016 Free Software Foundation, Inc. * + * Copyright (c) 2012-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -88,8 +88,8 @@ int _nc_add_to_try( #undef _nc_align_termtype void _nc_align_termtype( - TERMTYPE *to, - TERMTYPE *from) + TERMTYPE2 *to, + TERMTYPE2 *from) { /* void */ } #undef _nc_copy_termtype @@ -98,6 +98,24 @@ void _nc_copy_termtype( const TERMTYPE *src) { /* void */ } +#undef _nc_copy_termtype2 +void _nc_copy_termtype2( + TERMTYPE2 *dst, + const TERMTYPE2 *src) + { /* void */ } + +#undef _nc_export_termtype2 +void _nc_export_termtype2( + TERMTYPE *dst, + const TERMTYPE2 *src) + { /* void */ } + +#undef _nc_import_termtype2 +void _nc_import_termtype2( + TERMTYPE2 *dst, + const TERMTYPE *src) + { /* void */ } + /* ./codes.c */ #undef boolcodes @@ -236,7 +254,7 @@ ENTRY *_nc_tail; #undef _nc_free_entry void _nc_free_entry( ENTRY *headp, - TERMTYPE *tterm) + TERMTYPE2 *tterm) { /* void */ } #undef _nc_free_entries @@ -244,18 +262,17 @@ void _nc_free_entries( ENTRY *headp) { /* void */ } -#undef _nc_delink_entry -ENTRY *_nc_delink_entry( - ENTRY *headp, - TERMTYPE *tterm) - { return(*(ENTRY **)0); } - #undef _nc_leaks_tinfo void _nc_leaks_tinfo(void) { /* void */ } /* ./fallback.c */ +#undef _nc_fallback2 +const TERMTYPE2 *_nc_fallback2( + const char *name) + { return(*(const TERMTYPE2 **)0); } + #undef _nc_fallback const TERMTYPE *_nc_fallback( const char *name) @@ -268,6 +285,11 @@ void _nc_free_termtype( TERMTYPE *ptr) { /* void */ } +#undef _nc_free_termtype2 +void _nc_free_termtype2( + TERMTYPE2 *ptr) + { /* void */ } + #undef _nc_user_definable NCURSES_BOOL _nc_user_definable; @@ -713,7 +735,7 @@ void _nc_update_screensize( #undef _nc_setup_tinfo int _nc_setup_tinfo( const char *const tn, - TERMTYPE *const tp) + TERMTYPE2 *const tp) { return(*(int *)0); } #undef _nc_tinfo_cmdch @@ -1276,12 +1298,12 @@ void _nc_set_buffer( #undef _nc_init_termtype void _nc_init_termtype( - TERMTYPE *const tp) + TERMTYPE2 *const tp) { /* void */ } #undef _nc_read_termtype int _nc_read_termtype( - TERMTYPE *ptr, + TERMTYPE2 *ptr, char *buffer, int limit) { return(*(int *)0); } @@ -1289,7 +1311,14 @@ int _nc_read_termtype( #undef _nc_read_file_entry int _nc_read_file_entry( const char *const filename, - TERMTYPE *ptr) + TERMTYPE2 *ptr) + { return(*(int *)0); } + +#undef _nc_read_entry2 +int _nc_read_entry2( + const char *const name, + char *const filename, + TERMTYPE2 *const tp) { return(*(int *)0); } #undef _nc_read_entry @@ -1385,7 +1414,7 @@ int _nc_remove_string( #undef _nc_trim_sgr0 char *_nc_trim_sgr0( - TERMTYPE *tp) + TERMTYPE2 *tp) { return(*(char **)0); } /* ./unctrl.c */ diff --git a/ncurses/new_pair.h b/ncurses/new_pair.h index f5153d5b..4df40c6f 100644 --- a/ncurses/new_pair.h +++ b/ncurses/new_pair.h @@ -33,7 +33,7 @@ /* * Common type definitions and macros for new_pair.c, lib_color.c * - * $Id: new_pair.h,v 1.4 2017/03/31 11:32:07 tom Exp $ + * $Id: new_pair.h,v 1.5 2017/04/02 14:46:34 tom Exp $ */ #ifndef NEW_PAIR_H @@ -42,7 +42,6 @@ #define USE_NEW_PAIR NCURSES_EXT_COLORS -#define MAX_OF_TYPE(t) (int)(((unsigned t)(~0))>>1) #define LIMIT_TYPED(n,t) (t)(((t)(n) < 0) ? MAX_OF_TYPE(t) : (n)) #define limit_COLOR(n) LIMIT_TYPED(n,NCURSES_COLOR_T) diff --git a/ncurses/tinfo/MKfallback.sh b/ncurses/tinfo/MKfallback.sh index c0acba4e..4c4f3984 100755 --- a/ncurses/tinfo/MKfallback.sh +++ b/ncurses/tinfo/MKfallback.sh @@ -26,7 +26,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: MKfallback.sh,v 1.17 2017/01/07 16:05:16 tom Exp $ +# $Id: MKfallback.sh,v 1.21 2017/04/12 00:50:50 tom Exp $ # # MKfallback.sh -- create fallback table for entry reads # @@ -89,11 +89,11 @@ EOF for x in $* do echo "/* $x */" - infocmp -E $x + infocmp -E $x | sed -e 's/\/NCURSES_INT2/g' done cat <term_names, name, "|")) { return(tp); @@ -133,8 +134,28 @@ else fi cat < -MODULE_ID("$Id: alloc_entry.c,v 1.58 2013/08/17 19:20:38 tom Exp $") +MODULE_ID("$Id: alloc_entry.c,v 1.59 2017/04/09 23:33:51 tom Exp $") #define ABSENT_OFFSET -1 #define CANCELLED_OFFSET -2 @@ -58,7 +58,7 @@ static char *stringbuf; /* buffer for string capabilities */ static size_t next_free; /* next free character in stringbuf */ NCURSES_EXPORT(void) -_nc_init_entry(TERMTYPE *const tp) +_nc_init_entry(ENTRY * const tp) /* initialize a terminal type data block */ { #if NO_LEAKS @@ -75,7 +75,7 @@ _nc_init_entry(TERMTYPE *const tp) next_free = 0; - _nc_init_termtype(tp); + _nc_init_termtype(&(tp->tterm)); } NCURSES_EXPORT(ENTRY *) @@ -85,7 +85,7 @@ _nc_copy_entry(ENTRY * oldp) if (newp != 0) { *newp = *oldp; - _nc_copy_termtype(&(newp->tterm), &(oldp->tterm)); + _nc_copy_termtype2(&(newp->tterm), &(oldp->tterm)); } return newp; } @@ -126,7 +126,7 @@ _nc_wrap_entry(ENTRY * const ep, bool copy_strings) int useoffsets[MAX_USES]; unsigned i, n; unsigned nuses = ep->nuses; - TERMTYPE *tp = &(ep->tterm); + TERMTYPE2 *tp = &(ep->tterm); if (copy_strings) { next_free = 0; /* clear static storage */ @@ -218,9 +218,11 @@ _nc_wrap_entry(ENTRY * const ep, bool copy_strings) } NCURSES_EXPORT(void) -_nc_merge_entry(TERMTYPE *const to, TERMTYPE *const from) +_nc_merge_entry(ENTRY * const target, ENTRY * const source) /* merge capabilities from `from' entry into `to' entry */ { + TERMTYPE2 *to = &(target->tterm); + TERMTYPE2 *from = &(source->tterm); unsigned i; #if NCURSES_XNAMES @@ -233,18 +235,18 @@ _nc_merge_entry(TERMTYPE *const to, TERMTYPE *const from) if (mergebool == CANCELLED_BOOLEAN) to->Booleans[i] = FALSE; else if (mergebool == TRUE) - to->Booleans[i] = (char) mergebool; + to->Booleans[i] = (NCURSES_SBOOL) mergebool; } } for_each_number(i, from) { if (to->Numbers[i] != CANCELLED_NUMERIC) { - short mergenum = from->Numbers[i]; + int mergenum = from->Numbers[i]; if (mergenum == CANCELLED_NUMERIC) to->Numbers[i] = ABSENT_NUMERIC; else if (mergenum != ABSENT_NUMERIC) - to->Numbers[i] = mergenum; + to->Numbers[i] = (NCURSES_INT2) mergenum; } } diff --git a/ncurses/tinfo/alloc_ttype.c b/ncurses/tinfo/alloc_ttype.c index d0821a30..4a1b6913 100644 --- a/ncurses/tinfo/alloc_ttype.c +++ b/ncurses/tinfo/alloc_ttype.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2013,2016 Free Software Foundation, Inc. * + * Copyright (c) 1999-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: alloc_ttype.c,v 1.28 2016/05/28 23:22:52 tom Exp $") +MODULE_ID("$Id: alloc_ttype.c,v 1.29 2017/04/09 23:15:34 tom Exp $") #if NCURSES_XNAMES /* @@ -94,7 +94,7 @@ find_name(char **table, int length, char *name) to->num = (unsigned short) (to->num + (ext - to->ext)) static void -realign_data(TERMTYPE *to, char **ext_Names, +realign_data(TERMTYPE2 *to, char **ext_Names, int ext_Booleans, int ext_Numbers, int ext_Strings) @@ -119,7 +119,7 @@ realign_data(TERMTYPE *to, char **ext_Names, if (to->ext_Numbers != ext_Numbers) { EXTEND_NUM(num_Numbers, ext_Numbers); - TYPE_REALLOC(short, to->num_Numbers, to->Numbers); + TYPE_REALLOC(NCURSES_INT2, to->num_Numbers, to->Numbers); for (n = to->ext_Numbers - 1, m = ext_Numbers - 1, base = to->num_Numbers - (m + 1); m >= 0; m--) { @@ -151,7 +151,7 @@ realign_data(TERMTYPE *to, char **ext_Names, * Returns the first index in ext_Names[] for the given token-type */ static unsigned -_nc_first_ext_name(TERMTYPE *tp, int token_type) +_nc_first_ext_name(TERMTYPE2 *tp, int token_type) { unsigned first; @@ -176,7 +176,7 @@ _nc_first_ext_name(TERMTYPE *tp, int token_type) * Returns the last index in ext_Names[] for the given token-type */ static unsigned -_nc_last_ext_name(TERMTYPE *tp, int token_type) +_nc_last_ext_name(TERMTYPE2 *tp, int token_type) { unsigned last; @@ -199,7 +199,7 @@ _nc_last_ext_name(TERMTYPE *tp, int token_type) * Lookup an entry from extended-names, returning -1 if not found */ static int -_nc_find_ext_name(TERMTYPE *tp, char *name, int token_type) +_nc_find_ext_name(TERMTYPE2 *tp, char *name, int token_type) { unsigned j; unsigned first = _nc_first_ext_name(tp, token_type); @@ -218,7 +218,7 @@ _nc_find_ext_name(TERMTYPE *tp, char *name, int token_type) * (e.g., Booleans[]). */ static int -_nc_ext_data_index(TERMTYPE *tp, int n, int token_type) +_nc_ext_data_index(TERMTYPE2 *tp, int n, int token_type) { switch (token_type) { case BOOLEAN: @@ -241,7 +241,7 @@ _nc_ext_data_index(TERMTYPE *tp, int n, int token_type) * data. */ static bool -_nc_del_ext_name(TERMTYPE *tp, char *name, int token_type) +_nc_del_ext_name(TERMTYPE2 *tp, char *name, int token_type) { int first; @@ -286,7 +286,7 @@ _nc_del_ext_name(TERMTYPE *tp, char *name, int token_type) * index into the corresponding data array is returned. */ static int -_nc_ins_ext_name(TERMTYPE *tp, char *name, int token_type) +_nc_ins_ext_name(TERMTYPE2 *tp, char *name, int token_type) { unsigned first = _nc_first_ext_name(tp, token_type); unsigned last = _nc_last_ext_name(tp, token_type); @@ -320,7 +320,7 @@ _nc_ins_ext_name(TERMTYPE *tp, char *name, int token_type) case NUMBER: tp->ext_Numbers++; tp->num_Numbers++; - TYPE_REALLOC(short, tp->num_Numbers, tp->Numbers); + TYPE_REALLOC(NCURSES_INT2, tp->num_Numbers, tp->Numbers); for (k = (unsigned) (tp->num_Numbers - 1); k > j; k--) tp->Numbers[k] = tp->Numbers[k - 1]; break; @@ -341,7 +341,7 @@ _nc_ins_ext_name(TERMTYPE *tp, char *name, int token_type) * cancellation of a name that is inherited from another entry. */ static void -adjust_cancels(TERMTYPE *to, TERMTYPE *from) +adjust_cancels(TERMTYPE2 *to, TERMTYPE2 *from) { int first = to->ext_Booleans + to->ext_Numbers; int last = first + to->ext_Strings; @@ -386,7 +386,7 @@ adjust_cancels(TERMTYPE *to, TERMTYPE *from) } NCURSES_EXPORT(void) -_nc_align_termtype(TERMTYPE *to, TERMTYPE *from) +_nc_align_termtype(TERMTYPE2 *to, TERMTYPE2 *from) { int na = (int) NUM_EXT_NAMES(to); int nb = (int) NUM_EXT_NAMES(from); @@ -476,29 +476,80 @@ _nc_align_termtype(TERMTYPE *to, TERMTYPE *from) } #endif -NCURSES_EXPORT(void) -_nc_copy_termtype(TERMTYPE *dst, const TERMTYPE *src) +#define srcINT 1 +#define dstINT 2 + +/* + * TERMTYPE and TERMTYPE2 differ only with regard to the values in Numbers. + * Use 'mode' to decide which to use. + */ +static void +copy_termtype(TERMTYPE2 *dst, const TERMTYPE2 *src, int mode) { -#if NCURSES_XNAMES +#if NCURSES_XNAMES || NCURSES_EXT_NUMBERS unsigned i; #endif +#if NCURSES_EXT_NUMBERS + short *oldptr = 0; + int *newptr = 0; +#endif + DEBUG(2, ("copy_termtype")); *dst = *src; /* ...to copy the sizes and string-tables */ TYPE_MALLOC(NCURSES_SBOOL, NUM_BOOLEANS(dst), dst->Booleans); - TYPE_MALLOC(short, NUM_NUMBERS(dst), dst->Numbers); TYPE_MALLOC(char *, NUM_STRINGS(dst), dst->Strings); memcpy(dst->Booleans, src->Booleans, NUM_BOOLEANS(dst) * sizeof(dst->Booleans[0])); - memcpy(dst->Numbers, - src->Numbers, - NUM_NUMBERS(dst) * sizeof(dst->Numbers[0])); memcpy(dst->Strings, src->Strings, NUM_STRINGS(dst) * sizeof(dst->Strings[0])); +#if NCURSES_EXT_NUMBERS + if ((mode & dstINT) == 0) { + DEBUG(2, ("...convert int ->short")); + TYPE_MALLOC(short, NUM_NUMBERS(dst), oldptr); + ((TERMTYPE *) dst)->Numbers = oldptr; + } else { + DEBUG(2, ("...copy without changing size")); + TYPE_MALLOC(int, NUM_NUMBERS(dst), newptr); + dst->Numbers = newptr; + } + if ((mode == srcINT) && (oldptr != 0)) { + DEBUG(2, ("...copy int ->short")); + for (i = 0; i < NUM_NUMBERS(dst); ++i) { + if (src->Numbers[i] > MAX_OF_TYPE(short)) { + oldptr[i] = MAX_OF_TYPE(short); + } else { + oldptr[i] = (short) src->Numbers[i]; + } + } + } else if ((mode == dstINT) && (newptr != 0)) { + DEBUG(2, ("...copy short ->int")); + for (i = 0; i < NUM_NUMBERS(dst); ++i) { + newptr[i] = ((const short *) (src->Numbers))[i]; + } + } else { + DEBUG(2, ("...copy %s without change", + (mode & dstINT) + ? "int" + : "short")); + memcpy(dst->Numbers, + src->Numbers, + NUM_NUMBERS(dst) * ((mode & dstINT) + ? sizeof(int) + : sizeof(short))); + } +#else + (void) mode; + TYPE_MALLOC(short, NUM_NUMBERS(dst), dst->Numbers); + memcpy(dst->Numbers, + src->Numbers, + NUM_NUMBERS(dst) * sizeof(dst->Numbers[0])); +#endif + /* FIXME: we probably should also copy str_table and ext_str_table, * but tic and infocmp are not written to exploit that (yet). */ @@ -512,3 +563,41 @@ _nc_copy_termtype(TERMTYPE *dst, const TERMTYPE *src) } #endif } + +/* + * This entrypoint is used by tack. + */ +NCURSES_EXPORT(void) +_nc_copy_termtype(TERMTYPE *dst, const TERMTYPE *src) +{ + DEBUG(2, ("_nc_copy_termtype...")); + copy_termtype((TERMTYPE2 *) dst, (const TERMTYPE2 *) src, 0); +} + +#if NCURSES_EXT_NUMBERS +NCURSES_EXPORT(void) +_nc_copy_termtype2(TERMTYPE2 *dst, const TERMTYPE2 *src) +{ + DEBUG(2, ("_nc_copy_termtype2...")); + copy_termtype(dst, src, srcINT | dstINT); +} + +/* + * Use this for exporting the internal TERMTYPE2 to the legacy format used via + * the CUR macro by applications. + */ +NCURSES_EXPORT(void) +_nc_export_termtype2(TERMTYPE *dst, const TERMTYPE2 *src) +{ + DEBUG(2, ("_nc_export_termtype2...")); + copy_termtype((TERMTYPE2 *) dst, src, srcINT); +} + +/* FIXME - this will go away when conversion is complete */ +NCURSES_EXPORT(void) +_nc_import_termtype2(TERMTYPE2 *dst, const TERMTYPE *src) +{ + DEBUG(2, ("_nc_import_termtype2...")); + copy_termtype(dst, (const TERMTYPE2 *) src, dstINT); +} +#endif /* NCURSES_EXT_NUMBERS */ diff --git a/ncurses/tinfo/comp_parse.c b/ncurses/tinfo/comp_parse.c index 9a0ce487..34e62163 100644 --- a/ncurses/tinfo/comp_parse.c +++ b/ncurses/tinfo/comp_parse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2013,2016 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -47,16 +47,12 @@ #include -MODULE_ID("$Id: comp_parse.c,v 1.92 2016/09/10 20:08:32 tom Exp $") +MODULE_ID("$Id: comp_parse.c,v 1.96 2017/04/15 15:36:58 tom Exp $") -static void sanity_check2(TERMTYPE *, bool); -NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanity_check2; +static void sanity_check2(TERMTYPE2 *, bool); +NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2; -/* obsolete: 20040705 */ -static void sanity_check(TERMTYPE *); -NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype) (TERMTYPE *) = sanity_check; - -static void fixup_acsc(TERMTYPE *, int); +static void fixup_acsc(TERMTYPE2 *, int); static void enqueue(ENTRY * ep) @@ -339,11 +335,11 @@ _nc_resolve_uses2(bool fullresolve, bool literal) /* if that didn't work, try to merge in a compiled entry */ if (!foundit) { - TERMTYPE thisterm; + TERMTYPE2 thisterm; char filename[PATH_MAX]; memset(&thisterm, 0, sizeof(thisterm)); - if (_nc_read_entry(lookfor, filename, &thisterm) == 1) { + if (_nc_read_entry2(lookfor, filename, &thisterm) == 1) { DEBUG(2, ("%s: resolving use=%s (compiled)", child, lookfor)); @@ -384,7 +380,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal) */ if (fullresolve) { do { - TERMTYPE merged; + ENTRY merged; keepgoing = FALSE; @@ -410,7 +406,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal) * the merged entry the name field and string * table pointer. */ - _nc_copy_termtype(&merged, &(qp->tterm)); + _nc_copy_termtype2(&(merged.tterm), &(qp->tterm)); /* * Now merge in each use entry in the proper @@ -418,12 +414,12 @@ _nc_resolve_uses2(bool fullresolve, bool literal) */ for (; qp->nuses; qp->nuses--) _nc_merge_entry(&merged, - &qp->uses[qp->nuses - 1].link->tterm); + qp->uses[qp->nuses - 1].link); /* * Now merge in the original entry. */ - _nc_merge_entry(&merged, &qp->tterm); + _nc_merge_entry(&merged, qp); /* * Replace the original entry with the merged one. @@ -434,7 +430,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal) #if NCURSES_XNAMES FreeIfNeeded(qp->tterm.ext_Names); #endif - qp->tterm = merged; + qp->tterm = merged.tterm; _nc_wrap_entry(qp, TRUE); /* @@ -461,54 +457,46 @@ _nc_resolve_uses2(bool fullresolve, bool literal) DEBUG(2, ("RESOLUTION FINISHED")); - if (fullresolve) - if (_nc_check_termtype != 0) { - _nc_curr_col = -1; - for_entry_list(qp) { - _nc_curr_line = (int) qp->startline; - _nc_set_type(_nc_first_name(qp->tterm.term_names)); + if (fullresolve) { + _nc_curr_col = -1; + for_entry_list(qp) { + _nc_curr_line = (int) qp->startline; + _nc_set_type(_nc_first_name(qp->tterm.term_names)); + /* + * tic overrides this function pointer to provide more verbose + * checking. + */ + if (_nc_check_termtype2 != sanity_check2) { + SCREEN *save_SP = SP; + SCREEN fake_sp; + TERMINAL fake_tm; + TERMINAL *save_tm = cur_term; + /* - * tic overrides this function pointer to provide more verbose - * checking. + * Setup so that tic can use ordinary terminfo interface to + * obtain capability information. */ - if (_nc_check_termtype2 != sanity_check2) { - SCREEN *save_SP = SP; - SCREEN fake_sp; - TERMINAL fake_tm; - TERMINAL *save_tm = cur_term; - - /* - * Setup so that tic can use ordinary terminfo interface - * to obtain capability information. - */ - memset(&fake_sp, 0, sizeof(fake_sp)); - memset(&fake_tm, 0, sizeof(fake_tm)); - fake_sp._term = &fake_tm; - fake_tm.type = qp->tterm; - _nc_set_screen(&fake_sp); - set_curterm(&fake_tm); - - _nc_check_termtype2(&qp->tterm, literal); - - _nc_set_screen(save_SP); - set_curterm(save_tm); - } else { - fixup_acsc(&qp->tterm, literal); - } + memset(&fake_sp, 0, sizeof(fake_sp)); + memset(&fake_tm, 0, sizeof(fake_tm)); + fake_sp._term = &fake_tm; + TerminalType(&fake_tm) = qp->tterm; + _nc_set_screen(&fake_sp); + set_curterm(&fake_tm); + + _nc_check_termtype2(&qp->tterm, literal); + + _nc_set_screen(save_SP); + set_curterm(save_tm); + } else { + fixup_acsc(&qp->tterm, literal); } - DEBUG(2, ("SANITY CHECK FINISHED")); } + DEBUG(2, ("SANITY CHECK FINISHED")); + } return (TRUE); } -/* obsolete: 20040705 */ -NCURSES_EXPORT(int) -_nc_resolve_uses(bool fullresolve) -{ - return _nc_resolve_uses2(fullresolve, FALSE); -} - /* * This bit of legerdemain turns all the terminfo variable names into * references to locations in the arrays Booleans, Numbers, and Strings --- @@ -519,7 +507,7 @@ _nc_resolve_uses(bool fullresolve) #define CUR tp-> static void -fixup_acsc(TERMTYPE *tp, int literal) +fixup_acsc(TERMTYPE2 *tp, int literal) { if (!literal) { if (acs_chars == 0 @@ -530,7 +518,7 @@ fixup_acsc(TERMTYPE *tp, int literal) } static void -sanity_check2(TERMTYPE *tp, bool literal) +sanity_check2(TERMTYPE2 *tp, bool literal) { if (!PRESENT(exit_attribute_mode)) { #ifdef __UNUSED__ /* this casts too wide a net */ @@ -586,13 +574,6 @@ sanity_check2(TERMTYPE *tp, bool literal) ANDMISSING(set_color_pair, initialize_pair); } -/* obsolete: 20040705 */ -static void -sanity_check(TERMTYPE *tp) -{ - sanity_check2(tp, FALSE); -} - #if NO_LEAKS NCURSES_EXPORT(void) _nc_leaks_tic(void) diff --git a/ncurses/tinfo/comp_scan.c b/ncurses/tinfo/comp_scan.c index 36674c4b..3ac0b75f 100644 --- a/ncurses/tinfo/comp_scan.c +++ b/ncurses/tinfo/comp_scan.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2013,2016 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -50,7 +50,7 @@ #include #include -MODULE_ID("$Id: comp_scan.c,v 1.103 2016/05/28 23:22:52 tom Exp $") +MODULE_ID("$Id: comp_scan.c,v 1.104 2017/04/08 11:30:52 tom Exp $") /* * Maximum length of string capability we'll accept before raising an error. @@ -668,7 +668,15 @@ _nc_get_token(bool silent) if (numchk == numbuf) _nc_warning("no value given for `%s'", tok_buf); if ((*numchk != '\0') || (ch != separator)) - _nc_warning("Missing separator"); + _nc_warning("Missing separator for `%s'", tok_buf); + if (number < 0) + _nc_warning("value of `%s' cannot be negative", tok_buf); + if (number > MAX_OF_TYPE(NCURSES_INT2)) { + _nc_warning("limiting value of `%s' from %#lx to %#x", + tok_buf, + number, MAX_OF_TYPE(NCURSES_INT2)); + number = MAX_OF_TYPE(NCURSES_INT2); + } } _nc_curr_token.tk_name = tok_buf; _nc_curr_token.tk_valnumber = (int) number; diff --git a/ncurses/tinfo/entries.c b/ncurses/tinfo/entries.c index e84033d4..12674591 100644 --- a/ncurses/tinfo/entries.c +++ b/ncurses/tinfo/entries.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006-2011,2012 Free Software Foundation, Inc. * + * Copyright (c) 2006-2012,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,7 +37,7 @@ #include -MODULE_ID("$Id: entries.c,v 1.21 2012/05/05 20:33:44 tom Exp $") +MODULE_ID("$Id: entries.c,v 1.23 2017/04/13 22:39:57 tom Exp $") /**************************************************************************** * @@ -63,30 +63,8 @@ MODULE_ID("$Id: entries.c,v 1.21 2012/05/05 20:33:44 tom Exp $") NCURSES_EXPORT_VAR(ENTRY *) _nc_head = 0; NCURSES_EXPORT_VAR(ENTRY *) _nc_tail = 0; -NCURSES_EXPORT(void) -_nc_free_entry(ENTRY * headp, TERMTYPE *tterm) -/* free the allocated storage consumed by the given list entry */ -{ - ENTRY *ep; - - if ((ep = _nc_delink_entry(headp, tterm)) != 0) { - free(ep); - } -} - -NCURSES_EXPORT(void) -_nc_free_entries(ENTRY * headp) -/* free the allocated storage consumed by list entries */ -{ - (void) headp; /* unused - _nc_head is altered here! */ - - while (_nc_head != 0) { - _nc_free_termtype(&(_nc_head->tterm)); - } -} - -NCURSES_EXPORT(ENTRY *) -_nc_delink_entry(ENTRY * headp, TERMTYPE *tterm) +static ENTRY * +_nc_delink_entry(ENTRY * headp, TERMTYPE2 *tterm) /* delink the allocated storage for the given list entry */ { ENTRY *ep, *last; @@ -111,6 +89,28 @@ _nc_delink_entry(ENTRY * headp, TERMTYPE *tterm) return ep; } +NCURSES_EXPORT(void) +_nc_free_entry(ENTRY * headp, TERMTYPE2 *tterm) +/* free the allocated storage consumed by the given list entry */ +{ + ENTRY *ep; + + if ((ep = _nc_delink_entry(headp, tterm)) != 0) { + free(ep); + } +} + +NCURSES_EXPORT(void) +_nc_free_entries(ENTRY * headp) +/* free the allocated storage consumed by list entries */ +{ + (void) headp; /* unused - _nc_head is altered here! */ + + while (_nc_head != 0) { + _nc_free_termtype2(&(_nc_head->tterm)); + } +} + NCURSES_EXPORT(void) _nc_leaks_tinfo(void) { @@ -126,6 +126,7 @@ _nc_leaks_tinfo(void) if (TerminalOf(CURRENT_SCREEN) != 0) { del_curterm(TerminalOf(CURRENT_SCREEN)); } + free(_nc_prescreen.allocated); _nc_comp_captab_leaks(); _nc_free_entries(_nc_head); @@ -144,6 +145,7 @@ _nc_leaks_tinfo(void) free(s); #ifdef TRACE + T((T_RETURN(""))); trace(0); _nc_trace_buf(-1, (size_t) 0); #endif diff --git a/ncurses/tinfo/free_ttype.c b/ncurses/tinfo/free_ttype.c index ad056ba4..351cda93 100644 --- a/ncurses/tinfo/free_ttype.c +++ b/ncurses/tinfo/free_ttype.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2010,2011 Free Software Foundation, Inc. * + * Copyright (c) 1999-2011,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -42,25 +42,46 @@ #include -MODULE_ID("$Id: free_ttype.c,v 1.15 2011/02/06 01:08:31 tom Exp $") +MODULE_ID("$Id: free_ttype.c,v 1.17 2017/04/13 01:06:04 tom Exp $") -NCURSES_EXPORT(void) -_nc_free_termtype(TERMTYPE *ptr) +static void +really_free_termtype(TERMTYPE2 *ptr, bool freeStrings) { T(("_nc_free_termtype(%s)", ptr->term_names)); - FreeIfNeeded(ptr->str_table); + if (freeStrings) { + FreeIfNeeded(ptr->str_table); + } FreeIfNeeded(ptr->Booleans); FreeIfNeeded(ptr->Numbers); FreeIfNeeded(ptr->Strings); #if NCURSES_XNAMES - FreeIfNeeded(ptr->ext_str_table); + if (freeStrings) { + FreeIfNeeded(ptr->ext_str_table); + } FreeIfNeeded(ptr->ext_Names); #endif memset(ptr, 0, sizeof(TERMTYPE)); _nc_free_entry(_nc_head, ptr); } +/* + * This entrypoint is used by tack. + */ +NCURSES_EXPORT(void) +_nc_free_termtype(TERMTYPE *ptr) +{ + really_free_termtype((TERMTYPE2 *) ptr, !NCURSES_EXT_NUMBERS); +} + +#if NCURSES_EXT_NUMBERS +NCURSES_EXPORT(void) +_nc_free_termtype2(TERMTYPE2 *ptr) +{ + really_free_termtype(ptr, TRUE); +} +#endif + #if NCURSES_XNAMES NCURSES_EXPORT_VAR(bool) _nc_user_definable = TRUE; diff --git a/ncurses/tinfo/lib_cur_term.c b/ncurses/tinfo/lib_cur_term.c index c583aa7e..a61a6556 100644 --- a/ncurses/tinfo/lib_cur_term.c +++ b/ncurses/tinfo/lib_cur_term.c @@ -39,10 +39,10 @@ #include #include /* ospeed */ -MODULE_ID("$Id: lib_cur_term.c,v 1.36 2017/04/01 17:19:03 tom Exp $") +MODULE_ID("$Id: lib_cur_term.c,v 1.40 2017/04/15 21:35:08 tom Exp $") #undef CUR -#define CUR termp->type. +#define CUR TerminalType(termp). #if USE_REENTRANT @@ -76,7 +76,7 @@ NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0; #endif NCURSES_EXPORT(TERMINAL *) -NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL * termp) +NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL *termp) { TERMINAL *oldterm; @@ -95,19 +95,21 @@ NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL * termp) #ifdef USE_TERM_DRIVER TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) termp; ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate); - if (TCB->drv->isTerminfo && termp->type.Strings) { + if (TCB->drv && + TCB->drv->isTerminfo && + TerminalType(termp).Strings) { PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); } TCB->csp = SP_PARM; #else ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate); - if (termp->type.Strings) { + if (TerminalType(termp).Strings) { PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); } #endif #if !USE_REENTRANT #define MY_SIZE (size_t) (NAMESIZE - 1) - _nc_STRNCPY(ttytype, termp->type.term_names, MY_SIZE); + _nc_STRNCPY(ttytype, TerminalType(termp).term_names, MY_SIZE); ttytype[MY_SIZE] = '\0'; #endif } @@ -119,14 +121,14 @@ NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL * termp) #if NCURSES_SP_FUNCS NCURSES_EXPORT(TERMINAL *) -set_curterm(TERMINAL * termp) +set_curterm(TERMINAL *termp) { return NCURSES_SP_NAME(set_curterm) (CURRENT_SCREEN, termp); } #endif NCURSES_EXPORT(int) -NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL * termp) +NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL *termp) { int rc = ERR; @@ -144,7 +146,10 @@ NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL * termp) #endif ); - _nc_free_termtype(&(termp->type)); +#if NCURSES_EXT_NUMBERS + _nc_free_termtype(&termp->type); +#endif + _nc_free_termtype2(&TerminalType(termp)); if (termp == cur) NCURSES_SP_NAME(set_curterm) (NCURSES_SP_ARGx 0); @@ -158,11 +163,11 @@ NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL * termp) if (TCB->drv) TCB->drv->td_release(TCB); #endif - free(termp); #if NO_LEAKS /* discard memory used in tgetent's cache for this terminal */ _nc_tgetent_leak(termp); #endif + free(termp); rc = OK; } @@ -171,7 +176,7 @@ NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL * termp) #if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -del_curterm(TERMINAL * termp) +del_curterm(TERMINAL *termp) { int rc; diff --git a/ncurses/tinfo/lib_data.c b/ncurses/tinfo/lib_data.c index f1666dff..c1e2911a 100644 --- a/ncurses/tinfo/lib_data.c +++ b/ncurses/tinfo/lib_data.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_data.c,v 1.71 2017/03/31 17:06:34 tom Exp $") +MODULE_ID("$Id: lib_data.c,v 1.72 2017/04/10 08:34:31 tom Exp $") /* * OS/2's native linker complains if we don't initialize public data when @@ -220,6 +220,7 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { #define RIPOFF_0s { RIPOFF_0 } NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { + NULL, /* allocated */ TRUE, /* use_env */ FALSE, /* filter_mode */ A_NORMAL, /* previous_attr */ diff --git a/ncurses/tinfo/lib_options.c b/ncurses/tinfo/lib_options.c index b736d5fc..c8e75a35 100644 --- a/ncurses/tinfo/lib_options.c +++ b/ncurses/tinfo/lib_options.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * + * Copyright (c) 1998-2014,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -46,7 +46,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_options.c,v 1.78 2014/09/27 21:55:24 tom Exp $") +MODULE_ID("$Id: lib_options.c,v 1.79 2017/04/15 22:24:38 tom Exp $") NCURSES_EXPORT(int) idlok(WINDOW *win, bool flag) @@ -87,7 +87,7 @@ NCURSES_SP_NAME(halfdelay) (NCURSES_SP_DCLx int t) { T((T_CALLED("halfdelay(%p,%d)"), (void *) SP_PARM, t)); - if (t < 1 || t > 255 || !IsValidTIScreen(SP_PARM)) + if (t < 1 || t > 255 || !SP_PARM || !IsValidTIScreen(SP_PARM)) returnCode(ERR); NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG); @@ -241,7 +241,7 @@ NCURSES_EXPORT(int) NCURSES_SP_NAME(typeahead) (NCURSES_SP_DCLx int fd) { T((T_CALLED("typeahead(%p, %d)"), (void *) SP_PARM, fd)); - if (IsValidTIScreen(SP_PARM)) { + if (SP_PARM && IsValidTIScreen(SP_PARM)) { SP_PARM->_checkfd = fd; returnCode(OK); } else { diff --git a/ncurses/tinfo/lib_raw.c b/ncurses/tinfo/lib_raw.c index a207fe0d..173b3a36 100644 --- a/ncurses/tinfo/lib_raw.c +++ b/ncurses/tinfo/lib_raw.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2016 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -49,7 +49,7 @@ #include -MODULE_ID("$Id: lib_raw.c,v 1.22 2016/05/28 23:22:52 tom Exp $") +MODULE_ID("$Id: lib_raw.c,v 1.23 2017/04/15 22:24:45 tom Exp $") #if HAVE_SYS_TERMIO_H #include /* needed for ISC */ @@ -112,8 +112,10 @@ NCURSES_SP_NAME(raw) (NCURSES_SP_DCL0) kbdinfo.fsMask |= KEYBOARD_BINARY_MODE; KbdSetStatus(&kbdinfo, 0); #endif - SP_PARM->_raw = TRUE; - SP_PARM->_cbreak = 1; + if (SP_PARM) { + SP_PARM->_raw = TRUE; + SP_PARM->_cbreak = 1; + } termp->Nttyb = buf; } AFTER("raw"); @@ -154,7 +156,9 @@ NCURSES_SP_NAME(cbreak) (NCURSES_SP_DCL0) #endif result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); if (result == OK) { - SP_PARM->_cbreak = 1; + if (SP_PARM) { + SP_PARM->_cbreak = 1; + } termp->Nttyb = buf; } AFTER("cbreak"); @@ -242,8 +246,10 @@ NCURSES_SP_NAME(noraw) (NCURSES_SP_DCL0) kbdinfo.fsMask |= KEYBOARD_ASCII_MODE; KbdSetStatus(&kbdinfo, 0); #endif - SP_PARM->_raw = FALSE; - SP_PARM->_cbreak = 0; + if (SP_PARM) { + SP_PARM->_raw = FALSE; + SP_PARM->_cbreak = 0; + } termp->Nttyb = buf; } AFTER("noraw"); @@ -281,7 +287,9 @@ NCURSES_SP_NAME(nocbreak) (NCURSES_SP_DCL0) #endif result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); if (result == OK) { - SP_PARM->_cbreak = 0; + if (SP_PARM) { + SP_PARM->_cbreak = 0; + } termp->Nttyb = buf; } AFTER("nocbreak"); diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index 2d182622..67a2a0aa 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -48,7 +48,7 @@ #include #endif -MODULE_ID("$Id: lib_setup.c,v 1.174 2017/04/02 14:26:18 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.178 2017/04/11 23:51:32 tom Exp $") /**************************************************************************** * @@ -98,7 +98,7 @@ MODULE_ID("$Id: lib_setup.c,v 1.174 2017/04/02 14:26:18 tom Exp $") * Reduce explicit use of "cur_term" global variable. */ #undef CUR -#define CUR termp->type. +#define CUR TerminalType(termp). /* * Wrap global variables in this module. @@ -270,7 +270,7 @@ use_tioctl(bool f) NCURSES_EXPORT(void) _nc_get_screensize(SCREEN *sp, #ifdef USE_TERM_DRIVER - TERMINAL * termp, + TERMINAL *termp, #endif int *linep, int *colp) /* Obtain lines/columns values from the environment and/or terminfo entry */ @@ -398,8 +398,14 @@ _nc_get_screensize(SCREEN *sp, * Put the derived values back in the screen-size caps, so * tigetnum() and tgetnum() will do the right thing. */ - lines = (short) (*linep); - columns = (short) (*colp); + lines = (NCURSES_INT2) (*linep); + columns = (NCURSES_INT2) (*colp); +#if NCURSES_EXT_NUMBERS +#define OldNumber(termp,name) \ + (termp)->type.Numbers[(&name - (termp)->type2.Numbers)] + OldNumber(termp, lines) = (short) (*linep); + OldNumber(termp, columns) = (short) (*colp); +#endif } T(("screen size is %dx%d", *linep, *colp)); @@ -470,10 +476,10 @@ _nc_update_screensize(SCREEN *sp) * just like tgetent(). */ int -_nc_setup_tinfo(const char *const tn, TERMTYPE *const tp) +_nc_setup_tinfo(const char *const tn, TERMTYPE2 *const tp) { char filename[PATH_MAX]; - int status = _nc_read_entry(tn, filename, tp); + int status = _nc_read_entry2(tn, filename, tp); /* * If we have an entry, force all of the cancelled strings to null @@ -501,7 +507,7 @@ _nc_setup_tinfo(const char *const tn, TERMTYPE *const tp) ** and substitute it in for the prototype given in 'command_character'. */ void -_nc_tinfo_cmdch(TERMINAL * termp, int proto) +_nc_tinfo_cmdch(TERMINAL *termp, int proto) { char *tmp; @@ -580,7 +586,7 @@ _nc_unicode_locale(void) * character set. */ NCURSES_EXPORT(int) -_nc_locale_breaks_acs(TERMINAL * termp) +_nc_locale_breaks_acs(TERMINAL *termp) { const char *env_name = "NCURSES_NO_UTF8_ACS"; const char *env; @@ -611,7 +617,7 @@ _nc_locale_breaks_acs(TERMINAL * termp) } NCURSES_EXPORT(int) -TINFO_SETUP_TERM(TERMINAL ** tp, +TINFO_SETUP_TERM(TERMINAL **tp, NCURSES_CONST char *tname, int Filedes, int *errret, @@ -720,17 +726,17 @@ TINFO_SETUP_TERM(TERMINAL ** tp, } #else #if NCURSES_USE_DATABASE || NCURSES_USE_TERMCAP - status = _nc_setup_tinfo(tname, &termp->type); + status = _nc_setup_tinfo(tname, &TerminalType(termp)); #else status = TGETENT_NO; #endif /* try fallback list if entry on disk */ if (status != TGETENT_YES) { - const TERMTYPE *fallback = _nc_fallback(tname); + const TERMTYPE2 *fallback = _nc_fallback2(tname); if (fallback) { - _nc_copy_termtype(&(termp->type), fallback); + TerminalType(termp) = *fallback; status = TGETENT_YES; } } @@ -743,6 +749,9 @@ TINFO_SETUP_TERM(TERMINAL ** tp, ret_error1(status, "unknown terminal type.\n", tname); } } +#if NCURSES_EXT_NUMBERS + _nc_export_termtype2(&termp->type, &TerminalType(termp)); +#endif #if !USE_REENTRANT #define MY_SIZE (size_t) (NAMESIZE - 1) _nc_STRNCPY(ttytype, termp->type.term_names, MY_SIZE); @@ -827,6 +836,7 @@ new_prescr(void) sp = _nc_alloc_screen_sp(); T(("_nc_alloc_screen_sp %p", (void *) sp)); if (sp != 0) { + _nc_prescreen.allocated = sp; sp->rsp = sp->rippedoff; sp->_filtered = _nc_prescreen.filter_mode; sp->_use_env = _nc_prescreen.use_env; diff --git a/ncurses/tinfo/lib_termcap.c b/ncurses/tinfo/lib_termcap.c index 817f28f7..a8addc6c 100644 --- a/ncurses/tinfo/lib_termcap.c +++ b/ncurses/tinfo/lib_termcap.c @@ -48,7 +48,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_termcap.c,v 1.82 2017/04/01 17:24:07 tom Exp $") +MODULE_ID("$Id: lib_termcap.c,v 1.84 2017/04/11 01:15:11 tom Exp $") NCURSES_EXPORT_VAR(char *) UP = 0; NCURSES_EXPORT_VAR(char *) BC = 0; @@ -175,7 +175,8 @@ NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) if (backspace_if_not_bs != NULL) BC = backspace_if_not_bs; - if ((FIX_SGR0 = _nc_trim_sgr0(&(TerminalOf(SP_PARM)->type))) != 0) { + if ((FIX_SGR0 = _nc_trim_sgr0(&TerminalType(TerminalOf(SP_PARM)))) + != 0) { if (!strcmp(FIX_SGR0, exit_attribute_mode)) { if (FIX_SGR0 != exit_attribute_mode) { free(FIX_SGR0); @@ -236,7 +237,7 @@ NCURSES_SP_NAME(tgetflag) (NCURSES_SP_DCLx NCURSES_CONST char *id) T((T_CALLED("tgetflag(%p, %s)"), (void *) SP_PARM, id)); if (HasTInfoTerminal(SP_PARM) && ValidCap(id)) { - TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + TERMTYPE2 *tp = &TerminalType(TerminalOf(SP_PARM)); struct name_table_entry const *entry_ptr; int j = -1; @@ -288,7 +289,7 @@ NCURSES_SP_NAME(tgetnum) (NCURSES_SP_DCLx NCURSES_CONST char *id) T((T_CALLED("tgetnum(%p, %s)"), (void *) SP_PARM, id)); if (HasTInfoTerminal(SP_PARM) && ValidCap(id)) { - TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + TERMTYPE2 *tp = &TerminalType(TerminalOf(SP_PARM)); struct name_table_entry const *entry_ptr; int j = -1; @@ -340,7 +341,7 @@ NCURSES_SP_NAME(tgetstr) (NCURSES_SP_DCLx NCURSES_CONST char *id, char **area) T((T_CALLED("tgetstr(%s,%p)"), id, (void *) area)); if (HasTInfoTerminal(SP_PARM) && ValidCap(id)) { - TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + TERMTYPE2 *tp = &TerminalType(TerminalOf(SP_PARM)); struct name_table_entry const *entry_ptr; int j = -1; @@ -394,7 +395,7 @@ tgetstr(NCURSES_CONST char *id, char **area) #undef CacheInx #define CacheInx num NCURSES_EXPORT(void) -_nc_tgetent_leak(TERMINAL * termp) +_nc_tgetent_leak(TERMINAL *termp) { if (termp != 0) { int num; diff --git a/ncurses/tinfo/lib_ti.c b/ncurses/tinfo/lib_ti.c index d900737b..b1b7f72c 100644 --- a/ncurses/tinfo/lib_ti.c +++ b/ncurses/tinfo/lib_ti.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2013,2016 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,7 +36,7 @@ #include -MODULE_ID("$Id: lib_ti.c,v 1.31 2016/05/28 23:22:52 tom Exp $") +MODULE_ID("$Id: lib_ti.c,v 1.32 2017/04/11 01:15:42 tom Exp $") #if 0 static bool @@ -57,7 +57,7 @@ NCURSES_SP_NAME(tigetflag) (NCURSES_SP_DCLx NCURSES_CONST char *str) T((T_CALLED("tigetflag(%p, %s)"), (void *) SP_PARM, str)); if (HasTInfoTerminal(SP_PARM)) { - TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + TERMTYPE2 *tp = &TerminalType(TerminalOf(SP_PARM)); struct name_table_entry const *entry_ptr; int j = -1; @@ -102,7 +102,7 @@ NCURSES_SP_NAME(tigetnum) (NCURSES_SP_DCLx NCURSES_CONST char *str) T((T_CALLED("tigetnum(%p, %s)"), (void *) SP_PARM, str)); if (HasTInfoTerminal(SP_PARM)) { - TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + TERMTYPE2 *tp = &TerminalType(TerminalOf(SP_PARM)); struct name_table_entry const *entry_ptr; int j = -1; @@ -149,7 +149,7 @@ NCURSES_SP_NAME(tigetstr) (NCURSES_SP_DCLx NCURSES_CONST char *str) T((T_CALLED("tigetstr(%p, %s)"), (void *) SP_PARM, str)); if (HasTInfoTerminal(SP_PARM)) { - TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + TERMTYPE2 *tp = &TerminalType(TerminalOf(SP_PARM)); struct name_table_entry const *entry_ptr; int j = -1; diff --git a/ncurses/tinfo/parse_entry.c b/ncurses/tinfo/parse_entry.c index 802b520f..d8145948 100644 --- a/ncurses/tinfo/parse_entry.c +++ b/ncurses/tinfo/parse_entry.c @@ -47,7 +47,7 @@ #include #include -MODULE_ID("$Id: parse_entry.c,v 1.82 2017/04/03 09:00:45 tom Exp $") +MODULE_ID("$Id: parse_entry.c,v 1.83 2017/04/06 22:15:54 tom Exp $") #ifdef LINT static short const parametrized[] = @@ -56,8 +56,8 @@ static short const parametrized[] = #include #endif -static void postprocess_termcap(TERMTYPE *, bool); -static void postprocess_terminfo(TERMTYPE *); +static void postprocess_termcap(TERMTYPE2 *, bool); +static void postprocess_terminfo(TERMTYPE2 *); static struct name_table_entry const *lookup_fullname(const char *name); #if NCURSES_XNAMES @@ -66,7 +66,7 @@ static struct name_table_entry const * _nc_extend_names(ENTRY * entryp, char *name, int token_type) { static struct name_table_entry temp; - TERMTYPE *tp = &(entryp->tterm); + TERMTYPE2 *tp = &(entryp->tterm); unsigned offset = 0; unsigned actual; unsigned tindex; @@ -152,7 +152,7 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type) case NUMBER: tp->ext_Numbers++; tp->num_Numbers++; - TYPE_REALLOC(short, tp->num_Numbers, tp->Numbers); + TYPE_REALLOC(NCURSES_INT2, tp->num_Numbers, tp->Numbers); for_each_value(tp->num_Numbers) tp->Numbers[last] = tp->Numbers[last - 1]; break; @@ -206,7 +206,7 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type) #define MAX_NUMBER 0x7fff /* positive shorts only */ NCURSES_EXPORT(int) -_nc_parse_entry(ENTRY *entryp, int literal, bool silent) +_nc_parse_entry(ENTRY * entryp, int literal, bool silent) { int token_type; struct name_table_entry const *entry_ptr; @@ -220,7 +220,7 @@ _nc_parse_entry(ENTRY *entryp, int literal, bool silent) if (token_type != NAMES) _nc_err_abort("Entry does not start with terminal names in column one"); - _nc_init_entry(&entryp->tterm); + _nc_init_entry(entryp); entryp->cstart = _nc_comment_start; entryp->cend = _nc_comment_end; @@ -638,7 +638,7 @@ static const char C_HT[] = "\t"; #define CUR tp-> static void -postprocess_termcap(TERMTYPE *tp, bool has_base) +postprocess_termcap(TERMTYPE2 *tp, bool has_base) { char buf[MAX_LINE * 2 + 2]; string_desc result; @@ -928,7 +928,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) } static void -postprocess_terminfo(TERMTYPE *tp) +postprocess_terminfo(TERMTYPE2 *tp) { /* * TERMINFO-TO-TERMINFO MAPPINGS FOR SOURCE TRANSLATION diff --git a/ncurses/tinfo/read_entry.c b/ncurses/tinfo/read_entry.c index 52255c05..3cb02410 100644 --- a/ncurses/tinfo/read_entry.c +++ b/ncurses/tinfo/read_entry.c @@ -41,7 +41,7 @@ #include -MODULE_ID("$Id: read_entry.c,v 1.142 2017/03/16 08:19:06 tom Exp $") +MODULE_ID("$Id: read_entry.c,v 1.143 2017/04/06 22:19:06 tom Exp $") #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts)) @@ -49,7 +49,7 @@ MODULE_ID("$Id: read_entry.c,v 1.142 2017/03/16 08:19:06 tom Exp $") #if NCURSES_USE_DATABASE static void -convert_shorts(char *buf, short *Numbers, int count) +convert_numbers(char *buf, NCURSES_INT2 *Numbers, int count) { int i; for (i = 0; i < count; i++) { @@ -119,7 +119,7 @@ fake_read(char *src, int *offset, int limit, char *dst, unsigned want) #endif NCURSES_EXPORT(void) -_nc_init_termtype(TERMTYPE *const tp) +_nc_init_termtype(TERMTYPE2 *const tp) { unsigned i; @@ -134,7 +134,7 @@ _nc_init_termtype(TERMTYPE *const tp) if (tp->Booleans == 0) TYPE_MALLOC(NCURSES_SBOOL, BOOLCOUNT, tp->Booleans); if (tp->Numbers == 0) - TYPE_MALLOC(short, NUMCOUNT, tp->Numbers); + TYPE_MALLOC(NCURSES_INT2, NUMCOUNT, tp->Numbers); if (tp->Strings == 0) TYPE_MALLOC(char *, STRCOUNT, tp->Strings); @@ -169,7 +169,7 @@ valid_shorts(char *buffer, int limit) * Return TGETENT_YES if read, TGETENT_NO if not found or garbled. */ NCURSES_EXPORT(int) -_nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) +_nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit) { int offset = 0; int name_size, bool_count, num_count, str_count, str_size; @@ -247,11 +247,11 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) even_boundary(name_size + bool_count); /* grab the numbers */ - if ((ptr->Numbers = TYPE_CALLOC(short, max(NUMCOUNT, num_count))) == 0 + if (!(ptr->Numbers = TYPE_CALLOC(NCURSES_INT2, max(NUMCOUNT, num_count))) || !read_shorts(buf, num_count)) { returnDB(TGETENT_NO); } - convert_shorts(buf, ptr->Numbers, num_count); + convert_numbers(buf, ptr->Numbers, num_count); if ((ptr->Strings = TYPE_CALLOC(char *, max(STRCOUNT, str_count))) == 0) { returnDB(TGETENT_NO); @@ -304,7 +304,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) ptr->num_Strings = UShort(STRCOUNT + ext_str_count); TYPE_REALLOC(NCURSES_SBOOL, ptr->num_Booleans, ptr->Booleans); - TYPE_REALLOC(short, ptr->num_Numbers, ptr->Numbers); + TYPE_REALLOC(NCURSES_INT2, ptr->num_Numbers, ptr->Numbers); TYPE_REALLOC(char *, ptr->num_Strings, ptr->Strings); TR(TRACE_DATABASE, ("extended header is %d/%d/%d(%d:%d)", @@ -328,7 +328,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) returnDB(TGETENT_NO); } TR(TRACE_DATABASE, ("Before converting extended-numbers")); - convert_shorts(buf, ptr->Numbers + NUMCOUNT, ext_num_count); + convert_numbers(buf, ptr->Numbers + NUMCOUNT, ext_num_count); } TR(TRACE_DATABASE, ("READ extended-offsets @%d", offset)); @@ -425,7 +425,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) * table. */ NCURSES_EXPORT(int) -_nc_read_file_entry(const char *const filename, TERMTYPE *ptr) +_nc_read_file_entry(const char *const filename, TERMTYPE2 *ptr) /* return 1 if read, 0 if not found or garbled */ { FILE *fp = 0; @@ -444,7 +444,7 @@ _nc_read_file_entry(const char *const filename, TERMTYPE *ptr) TR(TRACE_DATABASE, ("read terminfo %s", filename)); if ((code = _nc_read_termtype(ptr, buffer, limit)) == TGETENT_NO) { - _nc_free_termtype(ptr); + _nc_free_termtype2(ptr); } } else { code = TGETENT_NO; @@ -616,7 +616,7 @@ _nc_read_tic_entry(char *filename, unsigned limit, const char *const path, const char *name, - TERMTYPE *const tp) + TERMTYPE2 *const tp) { int code = TGETENT_NO; #if USE_HASHED_DB @@ -708,16 +708,12 @@ _nc_read_tic_entry(char *filename, #endif /* NCURSES_USE_DATABASE */ /* - * _nc_read_entry(char *name, char *filename, TERMTYPE *tp) - * - * Find and read the compiled entry for a given terminal type, - * if it exists. We take pains here to make sure no combination - * of environment variables and terminal type name can be used to - * overrun the file buffer. + * Find and read the compiled entry for a given terminal type, if it exists. + * We take pains here to make sure no combination of environment variables and + * terminal type name can be used to overrun the file buffer. */ - NCURSES_EXPORT(int) -_nc_read_entry(const char *const name, char *const filename, TERMTYPE *const tp) +_nc_read_entry2(const char *const name, char *const filename, TERMTYPE2 *const tp) { int code = TGETENT_NO; @@ -755,3 +751,19 @@ _nc_read_entry(const char *const name, char *const filename, TERMTYPE *const tp) } return code; } + +#if NCURSES_EXT_NUMBERS +/* + * This entrypoint is used by tack. + */ +NCURSES_EXPORT(int) +_nc_read_entry(const char *const name, char *const filename, TERMTYPE *const tp) +{ + TERMTYPE2 dummy; + int rc; + rc = _nc_read_entry2(name, filename, &dummy); + if (rc == TGETENT_YES) + _nc_export_termtype2(tp, &dummy); + return rc; +} +#endif diff --git a/ncurses/tinfo/read_termcap.c b/ncurses/tinfo/read_termcap.c index 28512c25..8cc643d6 100644 --- a/ncurses/tinfo/read_termcap.c +++ b/ncurses/tinfo/read_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2013,2016 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -56,7 +56,7 @@ #include #include -MODULE_ID("$Id: read_termcap.c,v 1.90 2016/09/10 20:13:11 tom Exp $") +MODULE_ID("$Id: read_termcap.c,v 1.92 2017/04/13 23:40:02 tom Exp $") #if !PURE_TERMINFO diff --git a/ncurses/tinfo/tinfo_driver.c b/ncurses/tinfo/tinfo_driver.c index 477cbbc2..21004732 100644 --- a/ncurses/tinfo/tinfo_driver.c +++ b/ncurses/tinfo/tinfo_driver.c @@ -28,11 +28,11 @@ /**************************************************************************** * Author: Juergen Pfeifer * - * * + * and: Thomas E. Dickey * ****************************************************************************/ #include -#define CUR ((TERMINAL*)TCB)->type. +#define CUR TerminalType((TERMINAL*)TCB). #include #include /* ospeed */ @@ -51,7 +51,7 @@ # endif #endif -MODULE_ID("$Id: tinfo_driver.c,v 1.47 2017/03/28 09:15:24 tom Exp $") +MODULE_ID("$Id: tinfo_driver.c,v 1.51 2017/04/14 08:19:49 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -115,7 +115,7 @@ drv_Name(TERMINAL_CONTROL_BLOCK * TCB) } static void -get_baudrate(TERMINAL * termp) +get_baudrate(TERMINAL *termp) { int my_ospeed; int result; @@ -161,17 +161,17 @@ drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret) TCB->magic = TCBMAGIC; #if (NCURSES_USE_DATABASE || NCURSES_USE_TERMCAP) - status = _nc_setup_tinfo(tname, &termp->type); + status = _nc_setup_tinfo(tname, &TerminalType(termp)); #else status = TGETENT_NO; #endif /* try fallback list if entry on disk */ if (status != TGETENT_YES) { - const TERMTYPE *fallback = _nc_fallback(tname); + const TERMTYPE2 *fallback = _nc_fallback2(tname); if (fallback) { - termp->type = *fallback; + TerminalType(termp) = *fallback; status = TGETENT_YES; } } @@ -185,6 +185,9 @@ drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret) } } result = TRUE; +#if NCURSES_EXT_NUMBERS + _nc_export_termtype2(&termp->type, &TerminalType(termp)); +#endif #if !USE_REENTRANT #define MY_SIZE (size_t) NAMESIZE - 1 _nc_STRNCPY(ttytype, termp->type.term_names, MY_SIZE); diff --git a/ncurses/tinfo/trim_sgr0.c b/ncurses/tinfo/trim_sgr0.c index ec5e2b78..4cbcb650 100644 --- a/ncurses/tinfo/trim_sgr0.c +++ b/ncurses/tinfo/trim_sgr0.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2005-2010,2012 Free Software Foundation, Inc. * + * Copyright (c) 2005-2012,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,7 +36,7 @@ #include -MODULE_ID("$Id: trim_sgr0.c,v 1.15 2012/12/15 20:57:17 tom Exp $") +MODULE_ID("$Id: trim_sgr0.c,v 1.16 2017/04/05 22:33:07 tom Exp $") #undef CUR #define CUR tp-> @@ -46,7 +46,7 @@ MODULE_ID("$Id: trim_sgr0.c,v 1.15 2012/12/15 20:57:17 tom Exp $") #define L_BRACK '[' static char * -set_attribute_9(TERMTYPE *tp, int flag) +set_attribute_9(TERMTYPE2 *tp, int flag) { const char *value; char *result; @@ -232,7 +232,7 @@ compare_part(const char *part, const char *full) * an error occurs, or the original sgr0 if no change is needed. */ NCURSES_EXPORT(char *) -_nc_trim_sgr0(TERMTYPE *tp) +_nc_trim_sgr0(TERMTYPE2 *tp) { char *result = exit_attribute_mode; diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c index 8a49a2c0..e0a72670 100644 --- a/ncurses/tinfo/write_entry.c +++ b/ncurses/tinfo/write_entry.c @@ -47,7 +47,7 @@ #define TRACE_OUT(p) /*nothing */ #endif -MODULE_ID("$Id: write_entry.c,v 1.98 2017/02/05 01:47:34 tom Exp $") +MODULE_ID("$Id: write_entry.c,v 1.99 2017/04/09 23:35:01 tom Exp $") static int total_written; static int total_parts; @@ -57,7 +57,7 @@ static int make_db_root(const char *); #if !USE_HASHED_DB static void -write_file(char *filename, TERMTYPE *tp) +write_file(char *filename, TERMTYPE2 *tp) { char buffer[MAX_ENTRY_SIZE]; unsigned limit = sizeof(buffer); @@ -248,7 +248,7 @@ _nc_set_writedir(const char *dir) */ NCURSES_EXPORT(void) -_nc_write_entry(TERMTYPE *const tp) +_nc_write_entry(TERMTYPE2 *const tp) { #if USE_HASHED_DB @@ -565,12 +565,34 @@ convert_shorts(unsigned char *buf, short *Numbers, size_t count) } } +#if NCURSES_EXT_NUMBERS +static void +convert_numbers(unsigned char *buf, NCURSES_INT2 *Numbers, size_t count) +{ + size_t i; + for (i = 0; i < count; i++) { + if (Numbers[i] == ABSENT_NUMERIC) { /* HI/LO won't work */ + buf[2 * i] = buf[2 * i + 1] = 0377; + } else if (Numbers[i] == CANCELLED_NUMERIC) { /* HI/LO won't work */ + buf[2 * i] = 0376; + buf[2 * i + 1] = 0377; + } else { + LITTLE_ENDIAN(buf + 2 * i, Numbers[i]); + TRACE_OUT(("put Numbers[%u]=%d", (unsigned) i, Numbers[i])); + } + } +} + +#else +#define convert_numbers(buf,vec,len) convert_shorts(buf,vec,len) +#endif + #define even_boundary(value) \ ((value) % 2 != 0 && Write(&zero, sizeof(char), 1) != 1) #if NCURSES_XNAMES static unsigned -extended_Booleans(TERMTYPE *tp) +extended_Booleans(TERMTYPE2 *tp) { unsigned result = 0; unsigned i; @@ -583,7 +605,7 @@ extended_Booleans(TERMTYPE *tp) } static unsigned -extended_Numbers(TERMTYPE *tp) +extended_Numbers(TERMTYPE2 *tp) { unsigned result = 0; unsigned i; @@ -596,7 +618,7 @@ extended_Numbers(TERMTYPE *tp) } static unsigned -extended_Strings(TERMTYPE *tp) +extended_Strings(TERMTYPE2 *tp) { unsigned short result = 0; unsigned short i; @@ -613,7 +635,7 @@ extended_Strings(TERMTYPE *tp) * clause - discard the unneeded data. */ static bool -extended_object(TERMTYPE *tp) +extended_object(TERMTYPE2 *tp) { bool result = FALSE; @@ -627,7 +649,7 @@ extended_object(TERMTYPE *tp) #endif NCURSES_EXPORT(int) -_nc_write_object(TERMTYPE *tp, char *buffer, unsigned *offset, unsigned limit) +_nc_write_object(TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit) { char *namelist; size_t namelen, boolmax, nummax, strmax; @@ -705,7 +727,7 @@ _nc_write_object(TERMTYPE *tp, char *buffer, unsigned *offset, unsigned limit) TRACE_OUT(("Numerics begin at %04x", *offset)); /* the numerics */ - convert_shorts(buf, tp->Numbers, nummax); + convert_numbers(buf, tp->Numbers, nummax); if (Write(buf, 2, nummax) != nummax) return (ERR); @@ -768,7 +790,7 @@ _nc_write_object(TERMTYPE *tp, char *buffer, unsigned *offset, unsigned limit) TRACE_OUT(("WRITE %d numbers @%d", tp->ext_Numbers, *offset)); if (tp->ext_Numbers) { - convert_shorts(buf, tp->Numbers + NUMCOUNT, (size_t) tp->ext_Numbers); + convert_numbers(buf, tp->Numbers + NUMCOUNT, (size_t) tp->ext_Numbers); if (Write(buf, 2, tp->ext_Numbers) != tp->ext_Numbers) return (ERR); } diff --git a/ncurses/tty/lib_mvcur.c b/ncurses/tty/lib_mvcur.c index 4e285ba6..d75f6948 100644 --- a/ncurses/tty/lib_mvcur.c +++ b/ncurses/tty/lib_mvcur.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -159,7 +159,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mvcur.c,v 1.140 2016/10/01 17:37:33 tom Exp $") +MODULE_ID("$Id: lib_mvcur.c,v 1.141 2017/04/07 00:34:22 tom Exp $") #define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x] /* desired state */ @@ -1280,7 +1280,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) } else if (buf[0] == 'i') { dump_init(NULL, F_TERMINFO, S_TERMINFO, FALSE, 70, 0, 0, FALSE, FALSE, 0); - dump_entry(&cur_term->type, FALSE, TRUE, 0, 0); + dump_entry(&TerminalType(cur_term), FALSE, TRUE, 0, 0); putchar('\n'); } else if (buf[0] == 'o') { if (_nc_optimize_enable & OPTIMIZE_MVCUR) { diff --git a/ncurses/win32con/win_driver.c b/ncurses/win32con/win_driver.c index cc9fd2b2..7f4dc60b 100644 --- a/ncurses/win32con/win_driver.c +++ b/ncurses/win32con/win_driver.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -52,9 +52,9 @@ #define PSAPI_VERSION 2 #include -#define CUR my_term.type. +#define CUR TerminalType(my_term). -MODULE_ID("$Id: win_driver.c,v 1.56 2016/09/17 22:02:44 tom Exp $") +MODULE_ID("$Id: win_driver.c,v 1.58 2017/04/14 09:11:00 tom Exp $") #ifndef __GNUC__ # error We need GCC to compile for MinGW @@ -648,8 +648,11 @@ wcon_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, * This is intentional, to avoid unnecessary breakage of applications * using symbols. */ - if (code && (TCB->term.type.Booleans == 0)) { - _nc_init_termtype(&(TCB->term.type)); + if (code && (TerminalType(&TCB->term).Booleans == 0)) { + _nc_init_termtype(&TerminalType(&TCB->term)); +#if NCURSES_EXT_NUMBERS + _nc_export_termtype2(&TCB->term.type, &TerminalType(&TCB->term)); +#endif } if (!code) { diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index b2710ff9..3c3f9da3 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.0+20170408) unstable; urgency=low +ncurses6 (6.0+20170415) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 02 Apr 2017 06:36:57 -0400 + -- Thomas E. Dickey Sun, 09 Apr 2017 06:43:26 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index b2710ff9..3c3f9da3 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.0+20170408) unstable; urgency=low +ncurses6 (6.0+20170415) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 02 Apr 2017 06:36:57 -0400 + -- Thomas E. Dickey Sun, 09 Apr 2017 06:43:26 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index 29f1d05f..a57b5a1c 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.0+20170408) unstable; urgency=low +ncurses6 (6.0+20170415) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 02 Apr 2017 06:36:57 -0400 + -- Thomas E. Dickey Sun, 09 Apr 2017 06:43:26 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index c0bfb2c0..8f7f2daa 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.206 2017/04/02 10:36:57 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.207 2017/04/09 10:43:26 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "6" !define VERSION_MINOR "0" !define VERSION_YYYY "2017" -!define VERSION_MMDD "0408" +!define VERSION_MMDD "0415" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 73a2bb40..97bb3e28 100644 --- a/package/mingw-ncurses.spec +++ b/package/mingw-ncurses.spec @@ -3,7 +3,7 @@ Summary: shared libraries for terminal handling Name: mingw32-ncurses6 Version: 6.0 -Release: 20170408 +Release: 20170415 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.map b/package/ncurses.map index 6965504e..2d0426b8 100644 --- a/package/ncurses.map +++ b/package/ncurses.map @@ -1,4 +1,4 @@ -# $Id: ncurses.map,v 1.39 2017/03/17 21:40:34 tom Exp $ +# $Id: ncurses.map,v 1.42 2017/04/12 00:09:21 tom Exp $ # script for shared library symbol-versioning using ld # # This file was generated by ncu-mapsyms @@ -835,6 +835,7 @@ NCURSES_TIC_5.9.20150530 { NCURSES_TIC_6.0.current { global: + _nc_read_entry2; _nc_write_object; local: _*; @@ -1177,8 +1178,17 @@ NCURSES_TINFO_5.9.20150530 { use_tioctl; use_tioctl_sp; local: - _*; _nc_comp_error_leaks; _nc_db_iterator_leaks; _nc_setenv_num; } NCURSES_TINFO_5.8.20110226; + +NCURSES_TINFO_6.0.current { + global: + _nc_copy_termtype2; + _nc_export_termtype2; + _nc_fallback2; + _nc_free_termtype2; + local: + _*; +} NCURSES_TINFO_5.9.20150530; diff --git a/package/ncurses.spec b/package/ncurses.spec index b6ca9aa9..5be1fd86 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 6.0 -Release: 20170408 +Release: 20170415 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.sym b/package/ncurses.sym index f805fa5d..5b405b04 100644 --- a/package/ncurses.sym +++ b/package/ncurses.sym @@ -1,4 +1,4 @@ -# $Id: ncurses.sym,v 1.28 2017/03/15 22:12:00 tom Exp $ +# $Id: ncurses.sym,v 1.30 2017/04/11 09:24:03 tom Exp $ # script for shared library symbol-visibility using libtool # # This file was generated by ncu-mapsyms @@ -90,6 +90,7 @@ _nc_check_termtype _nc_check_termtype2 _nc_comp_scan_leaks _nc_copy_termtype +_nc_copy_termtype2 _nc_curr_col _nc_curr_line _nc_db_close @@ -104,7 +105,9 @@ _nc_entry_match _nc_env_access _nc_err_abort _nc_eventlist_timeout +_nc_export_termtype2 _nc_fallback +_nc_fallback2 _nc_find_entry _nc_find_type_entry _nc_first_db @@ -114,6 +117,7 @@ _nc_flush_sp _nc_free_and_exit _nc_free_entries _nc_free_termtype +_nc_free_termtype2 _nc_free_tic _nc_free_tinfo _nc_free_tparm @@ -165,6 +169,7 @@ _nc_putp_flush _nc_putp_flush_sp _nc_putp_sp _nc_read_entry +_nc_read_entry2 _nc_read_entry_source _nc_read_file_entry _nc_read_termtype diff --git a/package/ncursest.map b/package/ncursest.map index 0a9da88d..644d6f6f 100644 --- a/package/ncursest.map +++ b/package/ncursest.map @@ -1,4 +1,4 @@ -# $Id: ncursest.map,v 1.35 2017/03/17 21:40:34 tom Exp $ +# $Id: ncursest.map,v 1.38 2017/04/12 00:11:27 tom Exp $ # script for shared library symbol-versioning using ld # # This file was generated by ncu-mapsyms @@ -107,6 +107,7 @@ NCURSES_TIC_5.9.20150530 { NCURSES_TIC_6.0.current { global: + _nc_read_entry2; _nc_write_object; local: _*; @@ -460,12 +461,21 @@ NCURSES_TINFO_5.9.20150530 { use_tioctl; use_tioctl_sp; local: - _*; _nc_comp_error_leaks; _nc_db_iterator_leaks; _nc_setenv_num; } NCURSES_TINFO_5.8.20110226; +NCURSES_TINFO_6.0.current { + global: + _nc_copy_termtype2; + _nc_export_termtype2; + _nc_fallback2; + _nc_free_termtype2; + local: + _*; +} NCURSES_TINFO_5.9.20150530; + NCURSEST_5.7.20081102 { global: COLOR_PAIR; diff --git a/package/ncursest.sym b/package/ncursest.sym index e3bb77a0..9d0e0e32 100644 --- a/package/ncursest.sym +++ b/package/ncursest.sym @@ -1,4 +1,4 @@ -# $Id: ncursest.sym,v 1.30 2017/03/15 22:12:00 tom Exp $ +# $Id: ncursest.sym,v 1.32 2017/04/11 09:24:03 tom Exp $ # script for shared library symbol-visibility using libtool # # This file was generated by ncu-mapsyms @@ -78,6 +78,7 @@ _nc_capcmp _nc_check_termtype2 _nc_codes_leaks _nc_copy_termtype +_nc_copy_termtype2 _nc_count_outchars _nc_cur_term _nc_curr_col @@ -95,7 +96,9 @@ _nc_entry_match _nc_env_access _nc_err_abort _nc_eventlist_timeout +_nc_export_termtype2 _nc_fallback +_nc_fallback2 _nc_find_entry _nc_find_type_entry _nc_first_db @@ -105,6 +108,7 @@ _nc_flush_sp _nc_free_and_exit _nc_free_entries _nc_free_termtype +_nc_free_termtype2 _nc_free_tic _nc_free_tinfo _nc_freeall @@ -164,6 +168,7 @@ _nc_putp_flush _nc_putp_flush_sp _nc_putp_sp _nc_read_entry +_nc_read_entry2 _nc_read_entry_source _nc_read_file_entry _nc_read_termtype diff --git a/package/ncursestw.map b/package/ncursestw.map index de92ca8f..1ac236d5 100644 --- a/package/ncursestw.map +++ b/package/ncursestw.map @@ -1,4 +1,4 @@ -# $Id: ncursestw.map,v 1.36 2017/03/17 21:40:34 tom Exp $ +# $Id: ncursestw.map,v 1.39 2017/04/12 00:12:38 tom Exp $ # script for shared library symbol-versioning using ld # # This file was generated by ncu-mapsyms @@ -107,6 +107,7 @@ NCURSES_TIC_5.9.20150530 { NCURSES_TIC_6.0.current { global: + _nc_read_entry2; _nc_write_object; local: _*; @@ -466,12 +467,21 @@ NCURSES_TINFO_5.9.20150530 { use_tioctl; use_tioctl_sp; local: - _*; _nc_comp_error_leaks; _nc_db_iterator_leaks; _nc_setenv_num; } NCURSES_TINFO_5.8.20110226; +NCURSES_TINFO_6.0.current { + global: + _nc_copy_termtype2; + _nc_export_termtype2; + _nc_fallback2; + _nc_free_termtype2; + local: + _*; +} NCURSES_TINFO_5.9.20150530; + NCURSESTW_5.7.20081102 { global: COLOR_PAIR; diff --git a/package/ncursestw.sym b/package/ncursestw.sym index 70dde631..863294cf 100644 --- a/package/ncursestw.sym +++ b/package/ncursestw.sym @@ -1,4 +1,4 @@ -# $Id: ncursestw.sym,v 1.28 2017/03/15 22:12:00 tom Exp $ +# $Id: ncursestw.sym,v 1.30 2017/04/11 09:24:03 tom Exp $ # script for shared library symbol-visibility using libtool # # This file was generated by ncu-mapsyms @@ -78,6 +78,7 @@ _nc_capcmp _nc_check_termtype2 _nc_codes_leaks _nc_copy_termtype +_nc_copy_termtype2 _nc_count_outchars _nc_cur_term _nc_curr_col @@ -95,7 +96,9 @@ _nc_entry_match _nc_env_access _nc_err_abort _nc_eventlist_timeout +_nc_export_termtype2 _nc_fallback +_nc_fallback2 _nc_find_entry _nc_find_type_entry _nc_first_db @@ -105,6 +108,7 @@ _nc_flush_sp _nc_free_and_exit _nc_free_entries _nc_free_termtype +_nc_free_termtype2 _nc_free_tic _nc_free_tinfo _nc_freeall @@ -164,6 +168,7 @@ _nc_putp_flush _nc_putp_flush_sp _nc_putp_sp _nc_read_entry +_nc_read_entry2 _nc_read_entry_source _nc_read_file_entry _nc_read_termtype diff --git a/package/ncursesw.map b/package/ncursesw.map index 01e0203b..dae1911d 100644 --- a/package/ncursesw.map +++ b/package/ncursesw.map @@ -1,4 +1,4 @@ -# $Id: ncursesw.map,v 1.41 2017/03/17 21:40:34 tom Exp $ +# $Id: ncursesw.map,v 1.44 2017/04/12 00:14:24 tom Exp $ # script for shared library symbol-versioning using ld # # This file was generated by ncu-mapsyms @@ -116,6 +116,7 @@ NCURSES_TIC_5.9.20150530 { NCURSES_TIC_6.0.current { global: + _nc_read_entry2; _nc_write_object; local: _*; @@ -464,12 +465,21 @@ NCURSES_TINFO_5.9.20150530 { use_tioctl; use_tioctl_sp; local: - _*; _nc_comp_error_leaks; _nc_db_iterator_leaks; _nc_setenv_num; } NCURSES_TINFO_5.8.20110226; +NCURSES_TINFO_6.0.current { + global: + _nc_copy_termtype2; + _nc_export_termtype2; + _nc_fallback2; + _nc_free_termtype2; + local: + _*; +} NCURSES_TINFO_5.9.20150530; + NCURSESW_5.1.20000708 { global: COLORS; diff --git a/package/ncursesw.sym b/package/ncursesw.sym index b9c3458f..2e4191e1 100644 --- a/package/ncursesw.sym +++ b/package/ncursesw.sym @@ -1,4 +1,4 @@ -# $Id: ncursesw.sym,v 1.29 2017/03/15 22:12:00 tom Exp $ +# $Id: ncursesw.sym,v 1.31 2017/04/11 09:24:03 tom Exp $ # script for shared library symbol-visibility using libtool # # This file was generated by ncu-mapsyms @@ -86,6 +86,7 @@ _nc_check_termtype _nc_check_termtype2 _nc_comp_scan_leaks _nc_copy_termtype +_nc_copy_termtype2 _nc_curr_col _nc_curr_line _nc_db_close @@ -100,7 +101,9 @@ _nc_entry_match _nc_env_access _nc_err_abort _nc_eventlist_timeout +_nc_export_termtype2 _nc_fallback +_nc_fallback2 _nc_find_entry _nc_find_type_entry _nc_first_db @@ -110,6 +113,7 @@ _nc_flush_sp _nc_free_and_exit _nc_free_entries _nc_free_termtype +_nc_free_termtype2 _nc_free_tic _nc_free_tinfo _nc_free_tparm @@ -161,6 +165,7 @@ _nc_putp_flush _nc_putp_flush_sp _nc_putp_sp _nc_read_entry +_nc_read_entry2 _nc_read_entry_source _nc_read_file_entry _nc_read_termtype diff --git a/progs/dump_entry.c b/progs/dump_entry.c index db407187..d48016e4 100644 --- a/progs/dump_entry.c +++ b/progs/dump_entry.c @@ -39,7 +39,7 @@ #include "termsort.c" /* this C file is generated */ #include /* so is this */ -MODULE_ID("$Id: dump_entry.c,v 1.149 2017/03/04 20:18:20 tom Exp $") +MODULE_ID("$Id: dump_entry.c,v 1.150 2017/04/05 09:27:40 tom Exp $") #define DISCARD(string) string = ABSENT_STRING #define PRINTF (void) printf @@ -299,7 +299,7 @@ dump_init(const char *version, _nc_progname, width, tversion, outform); } -static TERMTYPE *cur_type; +static TERMTYPE2 *cur_type; static int dump_predicate(PredType type, PredIdx idx) @@ -322,7 +322,7 @@ dump_predicate(PredType type, PredIdx idx) return (FALSE); /* pacify compiler */ } -static void set_obsolete_termcaps(TERMTYPE *tp); +static void set_obsolete_termcaps(TERMTYPE2 *tp); /* is this the index of a function key string? */ #define FNKEY(i) \ @@ -697,7 +697,7 @@ has_params(const char *src) } static char * -fmt_complex(TERMTYPE *tterm, const char *capability, char *src, int level) +fmt_complex(TERMTYPE2 *tterm, const char *capability, char *src, int level) { bool percent = FALSE; bool params = has_params(src); @@ -800,7 +800,7 @@ fmt_complex(TERMTYPE *tterm, const char *capability, char *src, int level) #define EXTRA_CAP 20 int -fmt_entry(TERMTYPE *tterm, +fmt_entry(TERMTYPE2 *tterm, PredFunc pred, int content_only, int suppress_untranslatable, @@ -1188,7 +1188,7 @@ fmt_entry(TERMTYPE *tterm, } static bool -kill_string(TERMTYPE *tterm, char *cap) +kill_string(TERMTYPE2 *tterm, char *cap) { unsigned n; for (n = 0; n < NUM_STRINGS(tterm); ++n) { @@ -1201,7 +1201,7 @@ kill_string(TERMTYPE *tterm, char *cap) } static char * -find_string(TERMTYPE *tterm, char *name) +find_string(TERMTYPE2 *tterm, char *name) { PredIdx n; for (n = 0; n < NUM_STRINGS(tterm); ++n) { @@ -1222,7 +1222,7 @@ find_string(TERMTYPE *tterm, char *name) * make it smaller. */ static int -kill_labels(TERMTYPE *tterm, int target) +kill_labels(TERMTYPE2 *tterm, int target) { int n; int result = 0; @@ -1247,7 +1247,7 @@ kill_labels(TERMTYPE *tterm, int target) * make it smaller. */ static int -kill_fkeys(TERMTYPE *tterm, int target) +kill_fkeys(TERMTYPE2 *tterm, int target) { int n; int result = 0; @@ -1301,7 +1301,7 @@ one_one_mapping(const char *mapping) #define SHOW_WHY PRINTF static bool -purged_acs(TERMTYPE *tterm) +purged_acs(TERMTYPE2 *tterm) { bool result = FALSE; @@ -1348,13 +1348,13 @@ encode_b64(char *target, char *source, unsigned state, int *saved) * Dump a single entry. */ void -dump_entry(TERMTYPE *tterm, +dump_entry(TERMTYPE2 *tterm, int suppress_untranslatable, int limited, int numbers, PredFunc pred) { - TERMTYPE save_tterm; + TERMTYPE2 save_tterm; int len, critlen; const char *legend; bool infodump; @@ -1566,7 +1566,7 @@ show_entry(void) void compare_entry(PredHook hook, - TERMTYPE *tp GCC_UNUSED, + TERMTYPE2 *tp GCC_UNUSED, bool quiet) /* compare two entries */ { @@ -1625,7 +1625,7 @@ compare_entry(PredHook hook, #define CUR tp-> static void -set_obsolete_termcaps(TERMTYPE *tp) +set_obsolete_termcaps(TERMTYPE2 *tp) { #include "capdefaults.c" } @@ -1635,7 +1635,7 @@ set_obsolete_termcaps(TERMTYPE *tp) * unique. */ void -repair_acsc(TERMTYPE *tp) +repair_acsc(TERMTYPE2 *tp) { if (VALID_STRING(acs_chars)) { size_t n, m; diff --git a/progs/dump_entry.h b/progs/dump_entry.h index 0746683c..f93f7aae 100644 --- a/progs/dump_entry.h +++ b/progs/dump_entry.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,7 +33,7 @@ ****************************************************************************/ /* - * $Id: dump_entry.h,v 1.39 2016/10/01 15:24:26 tom Exp $ + * $Id: dump_entry.h,v 1.40 2017/04/05 22:33:07 tom Exp $ * * Dump control definitions and variables */ @@ -68,14 +68,14 @@ typedef void (*PredHook) (PredType, PredIdx, const char *); extern NCURSES_CONST char *nametrans(const char *); extern bool has_params(const char *src); -extern int fmt_entry(TERMTYPE *, PredFunc, int, int, int, int); +extern int fmt_entry(TERMTYPE2 *, PredFunc, int, int, int, int); extern int show_entry(void); -extern void compare_entry(PredHook, TERMTYPE *, bool); -extern void dump_entry(TERMTYPE *, int, int, int, PredFunc); +extern void compare_entry(PredHook, TERMTYPE2 *, bool); +extern void dump_entry(TERMTYPE2 *, int, int, int, PredFunc); extern void dump_init(const char *, int, int, bool, int, int, unsigned, bool, bool, int); extern void dump_uses(const char *, bool); -extern void repair_acsc(TERMTYPE *tp); +extern void repair_acsc(TERMTYPE2 *tp); #define L_CURL "{" #define R_CURL "}" diff --git a/progs/infocmp.c b/progs/infocmp.c index 6035179c..82c48419 100644 --- a/progs/infocmp.c +++ b/progs/infocmp.c @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: infocmp.c,v 1.142 2017/02/18 18:40:18 tom Exp $") +MODULE_ID("$Id: infocmp.c,v 1.143 2017/04/05 09:27:51 tom Exp $") #define MAX_STRING 1024 /* maximum formatted string */ @@ -295,7 +295,7 @@ useeq(ENTRY * e1, ENTRY * e2) } static bool -entryeq(TERMTYPE *t1, TERMTYPE *t2) +entryeq(TERMTYPE2 *t1, TERMTYPE2 *t2) /* are two entries equivalent? */ { unsigned i; @@ -810,7 +810,7 @@ lookup_params(const assoc * table, char *dst, char *src) } static void -analyze_string(const char *name, const char *cap, TERMTYPE *tp) +analyze_string(const char *name, const char *cap, TERMTYPE2 *tp) { char buf2[MAX_TERMINFO_LENGTH]; const char *sp; @@ -1294,7 +1294,7 @@ string_variable(const char *type) /* dump C initializers for the terminal type */ static void -dump_initializers(TERMTYPE *term) +dump_initializers(TERMTYPE2 *term) { unsigned n; const char *str = 0; @@ -1418,7 +1418,7 @@ dump_initializers(TERMTYPE *term) /* dump C initializers for the terminal type */ static void -dump_termtype(TERMTYPE *term) +dump_termtype(TERMTYPE2 *term) { (void) printf("\t%s\n\t\t%s,\n", L_CURL, name_initializer("alias")); (void) printf("\t\t(char *)0,\t/* pointer to string table */\n"); @@ -1833,7 +1833,7 @@ main(int argc, char *argv[]) _nc_progname, tname[termcount]); - status = _nc_read_entry(tname[termcount], + status = _nc_read_entry2(tname[termcount], tfile[termcount], &entries[termcount].tterm); } diff --git a/progs/progs.priv.h b/progs/progs.priv.h index a9d3d048..85d3acc6 100644 --- a/progs/progs.priv.h +++ b/progs/progs.priv.h @@ -30,7 +30,7 @@ * Author: Thomas E. Dickey 1997-on * ****************************************************************************/ /* - * $Id: progs.priv.h,v 1.42 2017/03/18 18:08:25 tom Exp $ + * $Id: progs.priv.h,v 1.43 2017/04/06 23:02:26 tom Exp $ * * progs.priv.h * @@ -213,4 +213,11 @@ extern int optind; #define SIZEOF(v) (sizeof(v)/sizeof(v[0])) +#define NCURSES_EXT_NUMBERS (NCURSES_EXT_COLORS && HAVE_INIT_EXTENDED_COLOR) + +#if NCURSES_EXT_NUMBERS +#else +#define _nc_free_termtype2(t) _nc_free_termtype(t) +#endif + #endif /* PROGS_PRIV_H */ diff --git a/progs/tic.c b/progs/tic.c index ee60e7bc..cfcbc359 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -48,7 +48,7 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.230 2016/12/31 12:24:00 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.232 2017/04/13 09:12:05 tom Exp $") #define STDIN_NAME "" @@ -62,8 +62,8 @@ static bool showsummary = FALSE; static char **namelst = 0; static const char *to_remove; -static void (*save_check_termtype) (TERMTYPE *, bool); -static void check_termtype(TERMTYPE *tt, bool); +static void (*save_check_termtype) (TERMTYPE2 *, bool); +static void check_termtype(TERMTYPE2 *tt, bool); static const char usage_string[] = "\ [-e names] \ @@ -114,6 +114,7 @@ cleanup(void) #if NO_LEAKS free_namelist(namelst); + _nc_leaks_dump_entry(); #endif if (tmp_fp != 0) fclose(tmp_fp); @@ -1088,7 +1089,7 @@ main(int argc, char *argv[]) * Check if the alternate character-set capabilities are consistent. */ static void -check_acs(TERMTYPE *tp) +check_acs(TERMTYPE2 *tp) { if (VALID_STRING(acs_chars)) { const char *boxes = "lmkjtuvwqxn"; @@ -1128,7 +1129,7 @@ check_acs(TERMTYPE *tp) * Check if the color capabilities are consistent */ static void -check_colors(TERMTYPE *tp) +check_colors(TERMTYPE2 *tp) { if ((max_colors > 0) != (max_pairs > 0) || ((max_colors > max_pairs) && (initialize_pair == 0))) @@ -1287,7 +1288,7 @@ check_ansi_cursor(char *list[4]) #define UNEXPECTED(name) if (PRESENT(name)) _nc_warning("unexpected " #name ", for %s", why) static void -check_noaddress(TERMTYPE *tp, const char *why) +check_noaddress(TERMTYPE2 *tp, const char *why) { UNEXPECTED(column_address); UNEXPECTED(cursor_address); @@ -1299,7 +1300,7 @@ check_noaddress(TERMTYPE *tp, const char *why) } static void -check_cursor(TERMTYPE *tp) +check_cursor(TERMTYPE2 *tp) { int count; char *list[4]; @@ -1418,7 +1419,7 @@ check_cursor(TERMTYPE *tp) * is mapped inconsistently. */ static void -check_keypad(TERMTYPE *tp) +check_keypad(TERMTYPE2 *tp) { char show[80]; @@ -1528,7 +1529,7 @@ check_keypad(TERMTYPE *tp) } static void -check_printer(TERMTYPE *tp) +check_printer(TERMTYPE2 *tp) { PAIRED(enter_doublewide_mode, exit_doublewide_mode); PAIRED(enter_italics_mode, exit_italics_mode); @@ -1564,7 +1565,7 @@ uses_SGR_39_49(const char *value) * Check consistency of termcap extensions related to "screen". */ static void -check_screen(TERMTYPE *tp) +check_screen(TERMTYPE2 *tp) { #if NCURSES_XNAMES if (_nc_user_definable) { @@ -1721,7 +1722,7 @@ expected_params(const char *name) * markers. */ static void -check_params(TERMTYPE *tp, const char *name, char *value) +check_params(TERMTYPE2 *tp, const char *name, char *value) { int expected = expected_params(name); int actual = 0; @@ -1941,7 +1942,7 @@ check_1_infotocap(const char *name, NCURSES_CONST char *value, int count) for (k = 1; k <= NUM_PARM; k++) { numbers[k] = count; _nc_SPRINTF(next, - _nc_SLIMIT(sizeof(blob) - (next - blob)) + _nc_SLIMIT(sizeof(blob) - (size_t) (next - blob)) "XYZ%d", count); strings[k] = next; next += strlen(next) + 1; @@ -2095,7 +2096,7 @@ same_ti_tc(const char *ti, const char *tc, bool * embedded) * Check terminfo to termcap translation. */ static void -check_infotocap(TERMTYPE *tp, int i, const char *value) +check_infotocap(TERMTYPE2 *tp, int i, const char *value) { const char *name = ExtStrname(tp, i, strnames); int params = (((i < (int) SIZEOF(parametrized)) && @@ -2270,7 +2271,7 @@ similar_sgr(int num, char *a, char *b) } static char * -check_sgr(TERMTYPE *tp, char *zero, int num, char *cap, const char *name) +check_sgr(TERMTYPE2 *tp, char *zero, int num, char *cap, const char *name) { char *test; @@ -2336,7 +2337,7 @@ typedef struct { } NAME_VALUE; static NAME_VALUE * -get_fkey_list(TERMTYPE *tp) +get_fkey_list(TERMTYPE2 *tp) { NAME_VALUE *result = typeMalloc(NAME_VALUE, NUM_STRINGS(tp) + 1); const struct tinfo_fkeys *all_fkeys = _nc_tinfo_fkeys; @@ -2387,7 +2388,7 @@ show_fkey_name(NAME_VALUE * data) * last one assigned). */ static void -check_conflict(TERMTYPE *tp) +check_conflict(TERMTYPE2 *tp) { bool conflict = FALSE; unsigned j, k; @@ -2483,7 +2484,7 @@ is_sgr_string(char *value) * Check if the given capability contains a given SGR attribute. */ static void -check_sgr_param(TERMTYPE *tp, int code, const char *name, char *value) +check_sgr_param(TERMTYPE2 *tp, int code, const char *name, char *value) { if (VALID_STRING(value)) { int ncv = ((code != 0) ? (1 << (code - 1)) : 0); @@ -2532,7 +2533,7 @@ check_sgr_param(TERMTYPE *tp, int code, const char *name, char *value) * logic that reads a terminfo entry) */ static void -check_termtype(TERMTYPE *tp, bool literal) +check_termtype(TERMTYPE2 *tp, bool literal) { unsigned j; diff --git a/progs/toe.c b/progs/toe.c index 0d299b45..030230dc 100644 --- a/progs/toe.c +++ b/progs/toe.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -44,7 +44,7 @@ #include #endif -MODULE_ID("$Id: toe.c,v 1.74 2013/12/15 01:08:28 tom Exp $") +MODULE_ID("$Id: toe.c,v 1.75 2017/04/05 23:19:24 tom Exp $") #define isDotname(name) (!strcmp(name, ".") || !strcmp(name, "..")) @@ -252,10 +252,10 @@ make_db_name(char *dst, const char *src, unsigned limit) typedef void (DescHook) (int /* db_index */ , int /* db_limit */ , const char * /* term_name */ , - TERMTYPE * /* term */ ); + TERMTYPE2 * /* term */ ); static const char * -term_description(TERMTYPE *tp) +term_description(TERMTYPE2 *tp) { const char *desc; @@ -270,7 +270,7 @@ term_description(TERMTYPE *tp) /* display a description for the type */ static void -deschook(int db_index, int db_limit, const char *term_name, TERMTYPE *tp) +deschook(int db_index, int db_limit, const char *term_name, TERMTYPE2 *tp) { (void) db_index; (void) db_limit; @@ -294,7 +294,7 @@ string_sum(const char *value) } static unsigned long -checksum_of(TERMTYPE *tp) +checksum_of(TERMTYPE2 *tp) { unsigned long result = string_sum(tp->term_names); unsigned i; @@ -313,7 +313,7 @@ checksum_of(TERMTYPE *tp) /* collect data, to sort before display */ static void -sorthook(int db_index, int db_limit, const char *term_name, TERMTYPE *tp) +sorthook(int db_index, int db_limit, const char *term_name, TERMTYPE2 *tp) { TERMDATA *data = new_termdata(); @@ -327,7 +327,7 @@ sorthook(int db_index, int db_limit, const char *term_name, TERMTYPE *tp) static void show_termcap(int db_index, int db_limit, char *buffer, DescHook hook) { - TERMTYPE data; + TERMTYPE2 data; char *next = strchr(buffer, ':'); char *last; char *list = buffer; @@ -424,7 +424,7 @@ typelist(int eargc, char *eargv[], } while ((entry = readdir(entrydir)) != 0) { char *name_2; - TERMTYPE lterm; + TERMTYPE2 lterm; char *cn; int status; @@ -453,7 +453,7 @@ typelist(int eargc, char *eargv[], /* apply the selected hook function */ hook(i, eargc, cn, <erm); } - _nc_free_termtype(<erm); + _nc_free_termtype2(<erm); free(name_2); } closedir(entrydir); @@ -478,7 +478,7 @@ typelist(int eargc, char *eargv[], code = _nc_db_first(capdbp, &key, &data); while (code == 0) { - TERMTYPE lterm; + TERMTYPE2 lterm; int used; char *have; char *cn; diff --git a/test/background.c b/test/background.c index 291851b8..e9f266e1 100644 --- a/test/background.c +++ b/test/background.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2003-2012,2014 Free Software Foundation, Inc. * + * Copyright (c) 2003-2014,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: background.c,v 1.15 2014/08/09 22:31:23 tom Exp $ + * $Id: background.c,v 1.16 2017/04/15 14:13:30 tom Exp $ */ #define NEED_COLOR_CODE 1 @@ -80,19 +80,19 @@ test_background(void) row = 7; mvprintw(row++, 10, "l"); for (chr = 0; chr < 32; ++chr) - addch(' '); + AddCh(' '); printw("x\n"); chr = 32; while (chr < 128) { if ((chr % 32) == 0) mvprintw(row++, 10, "x"); - addch((chtype) ((chr == 127) ? ' ' : chr)); + AddCh((chr == 127) ? ' ' : chr); if ((++chr % 32) == 0) printw("x\n"); } mvprintw(row++, 10, "m"); for (chr = 0; chr < 32; ++chr) - addch(' '); + AddCh(' '); printw("j\n"); getch(); diff --git a/test/blue.c b/test/blue.c index 376a764b..cb088ee8 100644 --- a/test/blue.c +++ b/test/blue.c @@ -36,7 +36,7 @@ *****************************************************************************/ /* - * $Id: blue.c,v 1.48 2017/01/22 00:39:52 tom Exp $ + * $Id: blue.c,v 1.49 2017/04/15 13:36:36 tom Exp $ */ #include @@ -196,7 +196,7 @@ deal_cards(void) static void printcard(int value) { - (void) addch(' '); + AddCh(' '); if (value == NOCARD) { (void) addstr(" "); } else { @@ -206,8 +206,8 @@ printcard(int value) ? RED_ON_WHITE : BLACK_ON_WHITE); - addch(ranks[isuit][0] | (chtype) COLOR_PAIR(BLUE_ON_WHITE)); - addch(ranks[isuit][1] | (chtype) COLOR_PAIR(BLUE_ON_WHITE)); + AddCh(ranks[isuit][0] | (chtype) COLOR_PAIR(BLUE_ON_WHITE)); + AddCh(ranks[isuit][1] | (chtype) COLOR_PAIR(BLUE_ON_WHITE)); #ifdef NCURSES_VERSION (attron) ((int) color); /* quieter compiler warnings */ @@ -222,7 +222,7 @@ printcard(int value) addwstr(values); } #else - addch((chtype) suits[which]); + AddCh(suits[which]); #endif #ifdef NCURSES_VERSION (attroff) ((int) color); @@ -230,7 +230,7 @@ printcard(int value) attroff(color); #endif } - (void) addch(' '); + AddCh(' '); } static void @@ -348,7 +348,7 @@ play_game(void) (void) addstr(buf); move(PROMPTROW, (int) strlen(buf)); clrtoeol(); - (void) addch(' '); + AddCh(' '); } while (((c = (char) getch()) < 'a' || c > 'd') && (c != 'r') diff --git a/test/bs.c b/test/bs.c index cb9a333b..e529e278 100644 --- a/test/bs.c +++ b/test/bs.c @@ -34,7 +34,7 @@ * v2.0 featuring strict ANSI/POSIX conformance, November 1993. * v2.1 with ncurses mouse support, September 1995 * - * $Id: bs.c,v 1.65 2017/04/08 21:06:16 tom Exp $ + * $Id: bs.c,v 1.66 2017/04/15 13:38:13 tom Exp $ */ #include @@ -307,7 +307,7 @@ placeship(int b, ship_t * ss, int vis) board[b][newx][newy] = ss->symbol; if (vis) { pgoto(newy, newx); - (void) addch((chtype) ss->symbol); + AddCh(ss->symbol); } } ss->hits = 0; @@ -372,14 +372,14 @@ initgame(void) if (has_colors()) attron(COLOR_PAIR(COLOR_BLUE)); #endif /* A_COLOR */ - (void) addch(' '); + AddCh(' '); for (j = 0; j < BWIDTH; j++) (void) addstr(" . "); #ifdef A_COLOR (void) attrset(0); #endif /* A_COLOR */ - (void) addch(' '); - (void) addch((chtype) (i + 'A')); + AddCh(' '); + AddCh(i + 'A'); } MvAddStr(PYBASE + BDEPTH, PXBASE - 3, numbers); MvAddStr(CYBASE - 2, CXBASE + 7, "Hit/Miss Board"); @@ -390,14 +390,14 @@ initgame(void) if (has_colors()) attron(COLOR_PAIR(COLOR_BLUE)); #endif /* A_COLOR */ - (void) addch(' '); + AddCh(' '); for (j = 0; j < BWIDTH; j++) (void) addstr(" . "); #ifdef A_COLOR (void) attrset(0); #endif /* A_COLOR */ - (void) addch(' '); - (void) addch((chtype) (i + 'A')); + AddCh(' '); + AddCh(i + 'A'); } MvAddStr(CYBASE + BDEPTH, CXBASE - 3, numbers); @@ -774,13 +774,13 @@ hitship(int x, int y) if (has_colors()) attron(COLOR_PAIR(COLOR_GREEN)); #endif /* A_COLOR */ - (void) addch(MARK_MISS); + AddCh(MARK_MISS); #ifdef A_COLOR (void) attrset(0); #endif /* A_COLOR */ } else { pgoto(y1, x1); - (void) addch(SHOWSPLASH); + AddCh(SHOWSPLASH); } } } @@ -793,14 +793,14 @@ hitship(int x, int y) hits[turn][x1][y1] = ss->symbol; if (turn % 2 == PLAYER) { cgoto(y1, x1); - (void) addch((chtype) (ss->symbol)); + AddCh(ss->symbol); } else { pgoto(y1, x1); #ifdef A_COLOR if (has_colors()) attron(COLOR_PAIR(COLOR_RED)); #endif /* A_COLOR */ - (void) addch(SHOWHIT); + AddCh(SHOWHIT); #ifdef A_COLOR (void) attrset(0); #endif /* A_COLOR */ @@ -842,7 +842,7 @@ plyturn(void) attron(COLOR_PAIR(COLOR_GREEN)); } #endif /* A_COLOR */ - (void) addch((chtype) hits[PLAYER][curx][cury]); + AddCh(hits[PLAYER][curx][cury]); #ifdef A_COLOR (void) attrset(0); #endif /* A_COLOR */ @@ -890,7 +890,7 @@ sgetc(const char *s) for (s1 = s; *s1 && ch != *s1; ++s1) continue; if (*s1) { - (void) addch((chtype) ch); + AddCh(ch); (void) refresh(); return (ch); } @@ -975,7 +975,7 @@ cpufire(int x, int y) attron(COLOR_PAIR(COLOR_GREEN)); } #endif /* A_COLOR */ - (void) addch((chtype) (hit ? SHOWHIT : SHOWSPLASH)); + AddCh((hit ? SHOWHIT : SHOWSPLASH)); #ifdef A_COLOR (void) attrset(0); #endif /* A_COLOR */ @@ -1128,7 +1128,7 @@ playagain(void) for (ss = cpuship; ss < cpuship + SHIPTYPES; ss++) for (j = 0; j < ss->length; j++) { cgoto(ss->y + j * yincr[ss->dir], ss->x + j * xincr[ss->dir]); - (void) addch((chtype) ss->symbol); + AddCh(ss->symbol); } if (awinna()) diff --git a/test/chgat.c b/test/chgat.c index 919b5c9e..1a605fdd 100644 --- a/test/chgat.c +++ b/test/chgat.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006-2010,2012 Free Software Foundation, Inc. * + * Copyright (c) 2006-2012,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,12 +26,13 @@ * authorization. * ****************************************************************************/ /* - * $Id: chgat.c,v 1.12 2012/11/18 01:55:35 tom Exp $ + * $Id: chgat.c,v 1.15 2017/04/16 00:47:55 tom Exp $ * * test-driver for chgat/wchgat/mvchgat/mvwchgat */ #include +#include #if HAVE_CHGAT @@ -200,7 +201,7 @@ init_status(WINDOW *win, STATUS * sp) static void show_help(WINDOW *win) { - static const char *table[] = + static const char *msgs[] = { "Basic commands:" ,"Use h/j/k/l or arrow keys to move the cursor." @@ -214,19 +215,10 @@ show_help(WINDOW *win) ,"= resets count to zero." ,"- negates count." ,"? shows this help-window" - ,"" - ,"" + ,0 }; - int y_max, x_max; - int row; - - getmaxyx(win, y_max, x_max); - for (row = 0; row < (int) SIZEOF(table) && row < y_max; ++row) { - MvWPrintw(win, row, 0, "%.*s", x_max, table[row]); - } - while (wgetch(win) != 'q') - beep(); + popup_msg(win, msgs); } static void @@ -280,8 +272,8 @@ update_status(WINDOW *win, STATUS * sp) sp->count = -(sp->count); show_status(win, sp); break; - case '?': - do_subwindow(win, sp, show_help); + case HELP_KEY_1: + show_help(win); break; default: if (isdigit(sp->ch)) { diff --git a/test/clip_printw.c b/test/clip_printw.c index 7f575c9c..ef55954e 100644 --- a/test/clip_printw.c +++ b/test/clip_printw.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2008-2014,2016 Free Software Foundation, Inc. * + * Copyright (c) 2008-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,12 +26,13 @@ * authorization. * ****************************************************************************/ /* - * $Id: clip_printw.c,v 1.12 2016/09/10 21:21:44 tom Exp $ + * $Id: clip_printw.c,v 1.14 2017/04/15 17:28:10 tom Exp $ * * demonstrate how to use printw without wrapping. */ #include +#include #ifdef HAVE_VW_PRINTW @@ -231,7 +232,7 @@ init_status(WINDOW *win, STATUS * sp) static void show_help(WINDOW *win) { - static const char *table[] = + static const char *msgs[] = { "Basic commands:" ,"Use h/j/k/l or arrow keys to move the cursor." @@ -240,21 +241,13 @@ show_help(WINDOW *win) ,"Other commands:" ,"space toggles through the set of video attributes and colors." ,"t touches (forces repaint) of the current line." - ,". calls clip_wprintw at the current position with the given count." + ,". calls vw_printw at the current position with the given count." ,"= resets count to zero." ,"? shows this help-window" - ,"" + ,0 }; - int y_max, x_max; - int row; - - getmaxyx(win, y_max, x_max); - for (row = 0; row < (int) SIZEOF(table) && row < y_max; ++row) { - MvWPrintw(win, row, 0, "%.*s", x_max, table[row]); - } - while (wgetch(win) != 'q') - beep(); + popup_msg(win, msgs); } static void @@ -304,8 +297,8 @@ update_status(WINDOW *win, STATUS * sp) sp->count = 0; show_status(win, sp); break; - case '?': - do_subwindow(win, sp, show_help); + case HELP_KEY_1: + show_help(win); break; default: if (isdigit(sp->ch)) { diff --git a/test/demo_defkey.c b/test/demo_defkey.c index 05914718..39b8f292 100644 --- a/test/demo_defkey.c +++ b/test/demo_defkey.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: demo_defkey.c,v 1.26 2017/01/21 22:07:43 tom Exp $ + * $Id: demo_defkey.c,v 1.27 2017/04/09 23:57:56 tom Exp $ * * Demonstrate the define_key() function. * Thomas Dickey - 2002/11/23 @@ -272,7 +272,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) break; } endwin(); - ExitProgram(EXIT_FAILURE); + ExitProgram(EXIT_SUCCESS); } #else int diff --git a/test/demo_forms.c b/test/demo_forms.c index f891b040..e3a11122 100644 --- a/test/demo_forms.c +++ b/test/demo_forms.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2003-2014,2016 Free Software Foundation, Inc. * + * Copyright (c) 2003-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: demo_forms.c,v 1.52 2016/09/10 21:14:55 tom Exp $ + * $Id: demo_forms.c,v 1.53 2017/04/10 00:28:54 tom Exp $ * * Demonstrate a variety of functions from the form library. * Thomas Dickey - 2003/4/26 @@ -227,7 +227,7 @@ make_field(const char *label, int frow, int fcol, int rows, int cols) } static void -display_form(FORM * f) +display_form(FORM *f) { WINDOW *w; int rows, cols; @@ -250,7 +250,7 @@ display_form(FORM * f) } static void -erase_form(FORM * f) +erase_form(FORM *f) { WINDOW *w = form_win(f); WINDOW *s = form_sub(f); @@ -273,7 +273,7 @@ show_insert_mode(bool insert_mode) #define O_SELECTABLE (O_ACTIVE | O_VISIBLE) static FIELD * -another_field(FORM * form, FIELD * field) +another_field(FORM *form, FIELD *field) { FIELD **f = form_fields(form); FIELD *result = 0; @@ -290,7 +290,7 @@ another_field(FORM * form, FIELD * field) } static int -my_form_driver(FORM * form, int c) +my_form_driver(FORM *form, int c) { static bool insert_mode = TRUE; FIELD *field; @@ -337,7 +337,7 @@ my_form_driver(FORM * form, int c) } static void -show_current_field(WINDOW *win, FORM * form) +show_current_field(WINDOW *win, FORM *form) { FIELD *field; FIELDTYPE *type; @@ -559,8 +559,7 @@ demo_forms(void) free_form(form); } for (c = 0; f[c] != 0; c++) { - void *ptr = field_userptr(f[c]); - free(ptr); + free_edit_field(f[c]); free_field(f[c]); } noraw(); diff --git a/test/demo_keyok.c b/test/demo_keyok.c index 8724d981..ea9604ef 100644 --- a/test/demo_keyok.c +++ b/test/demo_keyok.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2003,2006 Free Software Foundation, Inc. * + * Copyright (c) 2002-2006,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: demo_keyok.c,v 1.5 2006/11/04 20:09:51 tom Exp $ + * $Id: demo_keyok.c,v 1.6 2017/04/10 00:37:08 tom Exp $ * * Demonstrate the keyok() function. * Thomas Dickey - 2002/11/23 @@ -39,6 +39,7 @@ int main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) { int lastch = ERR; + int prior = ERR; int ch; WINDOW *win; @@ -57,6 +58,9 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) while ((ch = wgetch(win)) != ERR) { const char *name = keyname(ch); + if (ch == ESCAPE && prior == ch) + break; + prior = ch; wprintw(win, "Keycode %d, name %s\n", ch, name != 0 ? name : ""); diff --git a/test/demo_new_pair.c b/test/demo_new_pair.c index a0d069c0..1070c06a 100644 --- a/test/demo_new_pair.c +++ b/test/demo_new_pair.c @@ -26,13 +26,14 @@ * authorization. * ****************************************************************************/ /* - * $Id: demo_new_pair.c,v 1.11 2017/04/08 21:48:53 tom Exp $ + * $Id: demo_new_pair.c,v 1.13 2017/04/15 17:36:00 tom Exp $ * * Demonstrate the alloc_pair() function. */ #include #include +#include #if HAVE_ALLOC_PAIR && USE_WIDEC_SUPPORT @@ -118,24 +119,6 @@ next_color(int now) return result; } -static void -show_help(const char **help) -{ - WINDOW *mywin = newwin(LINES, COLS, 0, 0); - int n; - - wmove(mywin, 1, 1); - for (n = 0; help[n] != 0; ++n) { - wmove(mywin, 1 + n, 2); - wprintw(mywin, "%.*s\n", COLS - 4, help[n]); - } - box(mywin, 0, 0); - wgetch(mywin); - delwin(mywin); - touchwin(stdscr); - refresh(); -} - static time_t now(void) { @@ -272,8 +255,8 @@ main(int argc, char *argv[]) int my_pair; switch (getch()) { - case '?': - show_help(help); + case HELP_KEY_1: + popup_msg(stdscr, help); break; case 'p': /* step-by-page */ @@ -349,6 +332,7 @@ main(int argc, char *argv[]) ++current; } endwin(); + fclose(output); printf("%.1f cells/second\n", (double) (total_cells) / (double) (now() - start)); diff --git a/test/demo_panels.c b/test/demo_panels.c index e72ac475..d2859251 100644 --- a/test/demo_panels.c +++ b/test/demo_panels.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007-2014,2016 Free Software Foundation, Inc. * + * Copyright (c) 2007-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: demo_panels.c,v 1.39 2016/09/04 20:38:33 tom Exp $ + * $Id: demo_panels.c,v 1.41 2017/04/15 18:39:29 tom Exp $ * * Demonstrate a variety of functions from the panel library. */ @@ -479,7 +479,7 @@ show_panels(PANEL * px[MAX_PANELS + 1]) " m - move the panel (M for continuous move)", " r - resize the panel", " s - show the panel", - " b - put the panel on the top of the stack" + " t - put the panel on the top of the stack" }; struct { @@ -655,7 +655,7 @@ get_command(PANEL * px[MAX_PANELS + 1], char *buffer, int limit) wrefresh(curscr); } else if (ch == '\n' || ch == KEY_ENTER) { break; - } else if (ch == '?') { + } else if (ch == HELP_KEY_1) { show_panels(px); } else if (length + 3 < limit) { if (ch >= KEY_MIN) { diff --git a/test/demo_termcap.c b/test/demo_termcap.c index e6322fdc..134e9e2c 100644 --- a/test/demo_termcap.c +++ b/test/demo_termcap.c @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey * - * $Id: demo_termcap.c,v 1.53 2017/04/08 19:08:42 tom Exp $ + * $Id: demo_termcap.c,v 1.54 2017/04/13 09:12:40 tom Exp $ * * A simple demo of the termcap interface. */ @@ -884,7 +884,7 @@ main(int argc, char *argv[]) show_number("PC", PC); show_string("UP", UP); show_string("BC", BC); - show_number("ospeed", ospeed); + show_number("ospeed", (int) ospeed); } #endif diff --git a/test/dots_curses.c b/test/dots_curses.c index c344280a..b3713888 100644 --- a/test/dots_curses.c +++ b/test/dots_curses.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2014 Free Software Foundation, Inc. * + * Copyright (c) 2014,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey * - * $Id: dots_curses.c,v 1.3 2014/08/09 22:28:42 tom Exp $ + * $Id: dots_curses.c,v 1.4 2017/04/15 14:13:30 tom Exp $ * * A simple demo of the curses interface used for comparison with termcap. */ @@ -142,7 +142,7 @@ main(int argc GCC_UNUSED, napms(1); } } - addch((chtype) p); + AddCh(p); refresh(); ++total_chars; } diff --git a/test/dots_termcap.c b/test/dots_termcap.c index 9918e368..53829e24 100644 --- a/test/dots_termcap.c +++ b/test/dots_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2013 Free Software Foundation, Inc. * + * Copyright (c) 2013,2014 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey * - * $Id: dots_termcap.c,v 1.8 2014/09/25 09:00:56 tom Exp $ + * $Id: dots_termcap.c,v 1.9 2014/09/25 09:00:56 tom Exp $ * * A simple demo of the termcap interface. */ diff --git a/test/echochar.c b/test/echochar.c index b2cf99bb..75916ba7 100644 --- a/test/echochar.c +++ b/test/echochar.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: echochar.c,v 1.11 2017/04/08 21:53:51 tom Exp $ + * $Id: echochar.c,v 1.13 2017/04/15 13:38:37 tom Exp $ * * Demonstrate the echochar function (compare to dots.c). * Thomas Dickey - 2006/11/4 @@ -149,7 +149,7 @@ main(int argc GCC_UNUSED, } } if (opt_r) { - addch(UChar(p)); + AddCh(UChar(p)); refresh(); } else { echochar(UChar(p)); @@ -157,5 +157,6 @@ main(int argc GCC_UNUSED, ++total_chars; } cleanup(); + free(my_pairs); ExitProgram(EXIT_SUCCESS); } diff --git a/test/edit_field.c b/test/edit_field.c index 8c58cd6a..f1a2ced4 100644 --- a/test/edit_field.c +++ b/test/edit_field.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2003-2013,2014 Free Software Foundation, Inc. * + * Copyright (c) 2003-2014,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: edit_field.c,v 1.24 2014/09/05 08:39:52 tom Exp $ + * $Id: edit_field.c,v 1.27 2017/04/15 17:57:40 tom Exp $ * * A wrapper for form_driver() which keeps track of the user's editing changes * for each field, and makes the resulting length available as a @@ -40,6 +40,7 @@ #if USE_LIBFORM #include +#include static struct { int code; @@ -169,123 +170,43 @@ static struct { } }; -static WINDOW *old_window; - -static void -begin_popup(void) -{ - doupdate(); - old_window = dupwin(curscr); -} - -static void -end_popup(void) -{ - touchwin(old_window); - wnoutrefresh(old_window); - doupdate(); - delwin(old_window); -} - /* * Display a temporary window listing the keystroke-commands we recognize. */ void help_edit_field(void) { - int x0 = 4; - int y0 = 2; - int y1 = 0; - int y2 = 0; - int wide = COLS - ((x0 + 1) * 2); - int high = LINES - ((y0 + 1) * 2); - WINDOW *help = newwin(high, wide, y0, x0); - WINDOW *data = newpad(2 + SIZEOF(commands), wide - 4); + int used = 0; unsigned n; - int ch = ERR; + char **msgs = typeCalloc(char *, 2 + SIZEOF(commands)); - begin_popup(); - - keypad(help, TRUE); - keypad(data, TRUE); - waddstr(data, "Defined form edit/traversal keys:\n"); + msgs[used++] = strdup("Defined form edit/traversal keys:"); for (n = 0; n < SIZEOF(commands); ++n) { + char *msg; const char *name; + const char *code = keyname(commands[n].code); + size_t need = 5; #ifdef NCURSES_VERSION if ((name = form_request_name(commands[n].result)) == 0) #endif name = commands[n].help; - wprintw(data, "%s -- %s\n", - keyname(commands[n].code), - name != 0 ? name : commands[n].help); + need = 5 + strlen(code) + strlen(name); + msg = typeMalloc(char, need); + sprintf(msg, "%s -- %s", code, name); + msgs[used++] = msg; } - waddstr(data, "Arrow keys move within a field as you would expect."); - y2 = getcury(data); - - do { - switch (ch) { - case KEY_HOME: - y1 = 0; - break; - case KEY_END: - y1 = y2; - break; - case KEY_PREVIOUS: - case KEY_PPAGE: - if (y1 > 0) { - y1 -= high / 2; - if (y1 < 0) - y1 = 0; - } else { - beep(); - } - break; - case KEY_NEXT: - case KEY_NPAGE: - if (y1 < y2) { - y1 += high / 2; - if (y1 >= y2) - y1 = y2; - } else { - beep(); - } - break; - case CTRL('P'): - case KEY_UP: - if (y1 > 0) - --y1; - else - beep(); - break; - case CTRL('N'): - case KEY_DOWN: - if (y1 < y2) - ++y1; - else - beep(); - break; - default: - beep(); - break; - case ERR: - break; - } - werase(help); - box(help, 0, 0); - wnoutrefresh(help); - pnoutrefresh(data, y1, 0, y0 + 1, x0 + 1, high, wide); - doupdate(); - } while ((ch = wgetch(data)) != ERR && ch != QUIT && ch != ESCAPE); - werase(help); - wrefresh(help); - delwin(help); - delwin(data); - - end_popup(); + msgs[used++] = + strdup("Arrow keys move within a field as you would expect."); + msgs[used] = 0; + popup_msg2(stdscr, msgs); + for (n = 0; msgs[n] != 0; ++n) { + free(msgs[n]); + } + free(msgs); } static int -offset_in_field(FORM * form) +offset_in_field(FORM *form) { FIELD *field = current_field(form); int currow, curcol; @@ -295,25 +216,25 @@ offset_in_field(FORM * form) } static void -inactive_field(FIELD * f) +inactive_field(FIELD *f) { set_field_back(f, field_attrs(f)->background); } FieldAttrs * -field_attrs(FIELD * f) +field_attrs(FIELD *f) { return (FieldAttrs *) field_userptr(f); } static int -buffer_length(FIELD * f) +buffer_length(FIELD *f) { return field_attrs(f)->row_lengths[0]; } static void -set_buffer_length(FIELD * f, int length) +set_buffer_length(FIELD *f, int length) { field_attrs(f)->row_lengths[0] = length; } @@ -323,7 +244,7 @@ set_buffer_length(FIELD * f, int length) * keeping track of the actual lengths of lines in a multiline field. */ void -init_edit_field(FIELD * f, char *value) +init_edit_field(FIELD *f, char *value) { char empty[1]; FieldAttrs *ptr = field_attrs(f); @@ -348,7 +269,7 @@ init_edit_field(FIELD * f, char *value) } int -edit_field(FORM * form, int *result) +edit_field(FORM *form, int *result) { int ch = wgetch(form_win(form)); int status; @@ -494,6 +415,16 @@ edit_field(FORM * form, int *result) inactive_field(before); return status; } + +void +free_edit_field(FIELD *f) +{ + FieldAttrs *ptr = field_attrs(f); + if (ptr != 0) { + free(ptr->row_lengths); + free(ptr); + } +} #else extern void no_edit_field(void); diff --git a/test/edit_field.h b/test/edit_field.h index 3c5b80ec..f0c83156 100644 --- a/test/edit_field.h +++ b/test/edit_field.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2003-2008,2013 Free Software Foundation, Inc. * + * Copyright (c) 2003-2013,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: edit_field.h,v 1.9 2013/06/08 15:46:01 tom Exp $ + * $Id: edit_field.h,v 1.10 2017/04/10 00:28:55 tom Exp $ * * Interface of edit_field.c */ @@ -49,9 +49,10 @@ typedef struct { int *row_lengths; } FieldAttrs; -extern FieldAttrs *field_attrs(FIELD * field); -extern void init_edit_field(FIELD * field, char *value); +extern FieldAttrs *field_attrs(FIELD *field); +extern void init_edit_field(FIELD *field, char *value); extern void help_edit_field(void); -extern int edit_field(FORM * form, int *result); +extern int edit_field(FORM *form, int *result); +extern void free_edit_field(FIELD *field); #endif /* EDIT_FORM_H_incl */ diff --git a/test/extended_color.c b/test/extended_color.c index 72064911..437ed568 100644 --- a/test/extended_color.c +++ b/test/extended_color.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: extended_color.c,v 1.9 2017/04/02 14:30:26 tom Exp $ + * $Id: extended_color.c,v 1.10 2017/04/15 21:40:50 tom Exp $ */ #include @@ -85,6 +85,8 @@ do_init_color(SCREEN *sp, int color, int adjust) } else { i = extended_color_content(color, &r, &g, &b); } + if (i != OK) + failed("color_content"); r = (adjust + 1000 + r) % 1000; g = (adjust + 1000 + g) % 1000; diff --git a/test/form_driver_w.c b/test/form_driver_w.c index 3e928af8..868ca702 100644 --- a/test/form_driver_w.c +++ b/test/form_driver_w.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2013,2014 Free Software Foundation, Inc. * + * Copyright (c) 2013-2014,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,15 +31,14 @@ ****************************************************************************/ /* - * $Id: form_driver_w.c,v 1.13 2014/08/02 17:24:55 tom Exp $ + * $Id: form_driver_w.c,v 1.15 2017/04/15 20:41:35 tom Exp $ * * Test form_driver_w (int, int, wchar_t), a wide char aware * replacement of form_driver. */ -#include - #include +#include #if USE_WIDEC_SUPPORT && USE_LIBFORM && (defined(NCURSES_VERSION_PATCH) && NCURSES_VERSION_PATCH >= 20131207) @@ -48,9 +47,22 @@ int main(void) { - FIELD *field[3]; + static const char *help[] = + { + "Commands:", + " ^D,^Q,ESC - quit program", + " , - move to next field", + " , - move to previous field", + 0 + }; + +#define NUM_FIELDS 3 +#define MyRow(n) (4 + (n) * 2) +#define MyCol(n) 10 + FIELD *field[NUM_FIELDS + 1]; FORM *my_form; bool done = FALSE; + int n; setlocale(LC_ALL, ""); @@ -61,32 +73,34 @@ main(void) keypad(stdscr, TRUE); /* Initialize the fields */ - field[0] = new_field(1, 10, 4, 18, 0, 0); - field[1] = new_field(1, 10, 6, 18, 0, 0); - field[2] = NULL; - - /* Set field options */ - set_field_back(field[0], A_UNDERLINE); /* Print a line for the option */ - field_opts_off(field[0], O_AUTOSKIP); /* Don't go to next field when this */ - /* Field is filled up */ - set_field_back(field[1], A_UNDERLINE); - field_opts_off(field[1], O_AUTOSKIP); + for (n = 0; n < NUM_FIELDS; ++n) { + field[n] = new_field(1, 10, MyRow(n), 18, 0, 0); + set_field_back(field[n], A_UNDERLINE); + /* Print a line for the option */ + field_opts_off(field[n], O_AUTOSKIP); + /* Don't go to next field when this is filled */ + } + field[n] = NULL; /* Create the form and post it */ my_form = new_form(field); post_form(my_form); refresh(); - mvprintw(4, 10, "Value 1:"); - mvprintw(6, 10, "Value 2:"); - refresh(); + for (n = 0; n < NUM_FIELDS; ++n) { + mvprintw(MyRow(n), MyCol(n), "Value %d:", n + 1); + } /* Loop through to get user requests */ while (!done) { wint_t ch; int ret = get_wch(&ch); - mvprintw(8, 10, "Got %d (%#x), type: %s", (int) ch, (int) ch, + mvprintw(MyRow(NUM_FIELDS), + MyCol(NUM_FIELDS), + "Got %d (%#x), type: %s", + (int) ch, + (int) ch, (ret == KEY_CODE_YES) ? "KEY_CODE_YES" : ((ret == OK) @@ -106,6 +120,7 @@ main(void) /* Leaves nicely at the last character */ form_driver_w(my_form, KEY_CODE_YES, REQ_END_LINE); break; + case KEY_BTAB: case KEY_UP: /* Go to previous field */ form_driver_w(my_form, KEY_CODE_YES, REQ_PREV_FIELD); @@ -122,6 +137,13 @@ main(void) case ESCAPE: done = TRUE; break; + case '\t': + form_driver_w(my_form, KEY_CODE_YES, REQ_NEXT_FIELD); + form_driver_w(my_form, KEY_CODE_YES, REQ_END_LINE); + break; + case HELP_KEY_1: + popup_msg(form_win(my_form), help); + break; default: form_driver_w(my_form, OK, (wchar_t) ch); break; @@ -133,8 +155,9 @@ main(void) /* Un post form and free the memory */ unpost_form(my_form); free_form(my_form); - free_field(field[0]); - free_field(field[1]); + for (n = 0; n < NUM_FIELDS; ++n) { + free_field(field[n]); + } endwin(); ExitProgram(EXIT_SUCCESS); diff --git a/test/hashtest.c b/test/hashtest.c index 84992217..65868154 100644 --- a/test/hashtest.c +++ b/test/hashtest.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,7 +30,7 @@ * * Generate timing statistics for vertical-motion optimization. * - * $Id: hashtest.c,v 1.32 2013/04/27 19:50:17 tom Exp $ + * $Id: hashtest.c,v 1.33 2017/04/15 14:13:40 tom Exp $ */ #include @@ -82,7 +82,7 @@ genlines(int base) move(0, 0); for (i = 0; i < head_lines; i++) for (j = 0; j < COLS; j++) - addch(UChar((j % 8 == 0) ? ('A' + j / 8) : '-')); + AddCh(UChar((j % 8 == 0) ? ('A' + j / 8) : '-')); move(head_lines, 0); for (i = head_lines; i < LINES - foot_lines; i++) { @@ -90,13 +90,13 @@ genlines(int base) + LO_CHAR); int hi = (extend_corner || (i < LINES - 1)) ? COLS : COLS - 1; for (j = 0; j < hi; j++) - addch(c); + AddCh(c); } for (i = LINES - foot_lines; i < LINES; i++) { move(i, 0); for (j = 0; j < (extend_corner ? COLS : COLS - 1); j++) - addch(UChar((j % 8 == 0) ? ('A' + j / 8) : '-')); + AddCh(UChar((j % 8 == 0) ? ('A' + j / 8) : '-')); } scrollok(stdscr, TRUE); diff --git a/test/inch_wide.c b/test/inch_wide.c index 3d31f178..82e95f80 100644 --- a/test/inch_wide.c +++ b/test/inch_wide.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007,2010 Free Software Foundation, Inc. * + * Copyright (c) 2007-2010,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: inch_wide.c,v 1.7 2010/05/01 19:13:46 tom Exp $ + * $Id: inch_wide.c,v 1.8 2017/04/15 18:52:39 tom Exp $ */ /* int in_wch(cchar_t *wcval); @@ -44,6 +44,7 @@ */ #include +#include #if USE_WIDEC_SUPPORT @@ -59,6 +60,17 @@ Quit(int ch) static int test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) { + static const char *help[] = + { + "Test input from screen using inch(), etc., in a moveable viewport.", + "", + "Commands:", + " ESC/^Q - quit", + " h,j,k,l (and arrow-keys) - move viewport", + " w - recur to new window", + 0 + }; + WINDOW *txtbox = 0; WINDOW *txtwin = 0; FILE *fp; @@ -148,6 +160,9 @@ test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) wnoutrefresh(txtwin); } break; + case HELP_KEY_1: + popup_msg(txtwin, help); + break; default: beep(); break; diff --git a/test/inchs.c b/test/inchs.c index be3aab86..55ab8bab 100644 --- a/test/inchs.c +++ b/test/inchs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007-2010,2012 Free Software Foundation, Inc. * + * Copyright (c) 2007-2012,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: inchs.c,v 1.12 2012/11/18 01:58:15 tom Exp $ + * $Id: inchs.c,v 1.13 2017/04/15 18:52:10 tom Exp $ * * Author: Thomas E Dickey */ @@ -46,6 +46,7 @@ */ #include +#include #define BASE_Y 7 #define MAX_COLS 1024 @@ -69,6 +70,16 @@ Quit(int ch) static int test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) { + static const char *help[] = + { + "Test input from screen using inch(), etc., in a moveable viewport.", + "", + "Commands:", + " ESC/^Q - quit", + " h,j,k,l (and arrow-keys) - move viewport", + " w - recur to new window", + 0 + }; WINDOW *txtbox = 0; WINDOW *txtwin = 0; FILE *fp; @@ -159,6 +170,9 @@ test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) wnoutrefresh(txtwin); } break; + case HELP_KEY_1: + popup_msg(txtwin, help); + break; default: beep(); break; diff --git a/test/insdelln.c b/test/insdelln.c index 34fb388d..84fc9996 100644 --- a/test/insdelln.c +++ b/test/insdelln.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2008-2012,2014 Free Software Foundation, Inc. * + * Copyright (c) 2008-2014,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,12 +26,13 @@ * authorization. * ****************************************************************************/ /* - * $Id: insdelln.c,v 1.9 2014/08/02 23:09:32 tom Exp $ + * $Id: insdelln.c,v 1.10 2017/04/15 17:40:11 tom Exp $ * * test-driver for deleteln, wdeleteln, insdelln, winsdelln, insertln, winsertln */ #include +#include #define SHOW(n) ((n) == ERR ? "ERR" : "OK") #define COLOR_DEFAULT (-1) @@ -217,19 +218,10 @@ show_help(WINDOW *win) ,"q quit" ,"= resets count to zero." ,"? shows this help-window" - ,"" - ,"" + ,0 }; - int y_max, x_max; - int row; - - getmaxyx(win, y_max, x_max); - for (row = 0; row < (int) SIZEOF(table) && row < y_max; ++row) { - MvWPrintw(win, row, 0, "%.*s", x_max, table[row]); - } - while (wgetch(win) != 'q') - beep(); + popup_msg(win, table); } static void @@ -279,8 +271,8 @@ update_status(WINDOW *win, STATUS * sp) sp->count = 0; show_status(win, sp); break; - case '?': - do_subwindow(win, sp, show_help); + case HELP_KEY_1: + show_help(win); break; default: if (isdigit(sp->ch)) { diff --git a/test/knight.c b/test/knight.c index ae9d2234..878c113d 100644 --- a/test/knight.c +++ b/test/knight.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,7 +33,7 @@ * Eric S. Raymond July 22 1995. Mouse support * added September 20th 1995. * - * $Id: knight.c,v 1.36 2013/02/16 19:53:08 tom Exp $ + * $Id: knight.c,v 1.37 2017/04/15 17:43:11 tom Exp $ */ #include @@ -734,7 +734,7 @@ play(void) case 'x': goto dropout; - case '?': + case HELP_KEY_1: show_help(&keyhelp); break; diff --git a/test/modules b/test/modules index 119982ef..710842a9 100644 --- a/test/modules +++ b/test/modules @@ -1,4 +1,4 @@ -# $Id: modules,v 1.57 2017/03/31 13:01:31 tom Exp $ +# $Id: modules,v 1.61 2017/04/15 19:30:34 tom Exp $ ############################################################################## # Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. # # # @@ -36,15 +36,15 @@ background progs $(srcdir) $(HEADER_DEPS) blue progs $(srcdir) $(HEADER_DEPS) bs progs $(srcdir) $(HEADER_DEPS) cardfile progs $(srcdir) $(HEADER_DEPS) ../include/panel.h ../include/form.h -chgat progs $(srcdir) $(HEADER_DEPS) -clip_printw progs $(srcdir) $(HEADER_DEPS) +chgat progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h +clip_printw progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h color_set progs $(srcdir) $(HEADER_DEPS) demo_altkeys progs $(srcdir) $(HEADER_DEPS) demo_defkey progs $(srcdir) $(HEADER_DEPS) demo_forms progs $(srcdir) $(HEADER_DEPS) $(srcdir)/edit_field.h demo_keyok progs $(srcdir) $(HEADER_DEPS) demo_menus progs $(srcdir) $(HEADER_DEPS) ../include/menu.h -demo_new_pair progs $(srcdir) $(HEADER_DEPS) +demo_new_pair progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h demo_panels progs $(srcdir) $(HEADER_DEPS) ../include/panel.h demo_termcap progs $(srcdir) $(HEADER_DEPS) demo_terminfo progs $(srcdir) $(HEADER_DEPS) @@ -54,33 +54,34 @@ dots_curses progs $(srcdir) $(HEADER_DEPS) dots_mvcur progs $(srcdir) $(HEADER_DEPS) dots_termcap progs $(srcdir) $(HEADER_DEPS) echochar progs $(srcdir) $(HEADER_DEPS) -edit_field progs $(srcdir) $(HEADER_DEPS) $(srcdir)/edit_field.h +edit_field progs $(srcdir) $(HEADER_DEPS) $(srcdir)/edit_field.h $(srcdir)/popup_msg.h extended_color progs $(srcdir) $(HEADER_DEPS) filter progs $(srcdir) $(HEADER_DEPS) firework progs $(srcdir) $(HEADER_DEPS) firstlast progs $(srcdir) $(HEADER_DEPS) foldkeys progs $(srcdir) $(HEADER_DEPS) -form_driver_w progs $(srcdir) $(HEADER_DEPS) +form_driver_w progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h gdc progs $(srcdir) $(HEADER_DEPS) hanoi progs $(srcdir) $(HEADER_DEPS) hashtest progs $(srcdir) $(HEADER_DEPS) -inch_wide progs $(srcdir) $(HEADER_DEPS) -inchs progs $(srcdir) $(HEADER_DEPS) +inch_wide progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h +inchs progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h ins_wide progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h -insdelln progs $(srcdir) $(HEADER_DEPS) +insdelln progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h inserts progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h key_names progs $(srcdir) $(HEADER_DEPS) keynames progs $(srcdir) $(HEADER_DEPS) knight progs $(srcdir) $(HEADER_DEPS) list_keys progs $(srcdir) $(HEADER_DEPS) lrtest progs $(srcdir) $(HEADER_DEPS) -movewindow progs $(srcdir) $(HEADER_DEPS) +movewindow progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h ncurses progs $(srcdir) $(HEADER_DEPS) ../include/panel.h ../include/menu.h ../include/form.h newdemo progs $(srcdir) $(HEADER_DEPS) +popup_msg progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h railroad progs $(srcdir) $(HEADER_DEPS) -rain progs $(srcdir) $(HEADER_DEPS) -redraw progs $(srcdir) $(HEADER_DEPS) -savescreen progs $(srcdir) $(HEADER_DEPS) +rain progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h +redraw progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h +savescreen progs $(srcdir) $(HEADER_DEPS) $(srcdir)/popup_msg.h sp_tinfo progs $(srcdir) $(HEADER_DEPS) tclock progs $(srcdir) $(HEADER_DEPS) test_add_wchstr progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h @@ -100,7 +101,7 @@ test_vidputs progs $(srcdir) $(HEADER_DEPS) testaddch progs $(srcdir) $(HEADER_DEPS) testcurs progs $(srcdir) $(HEADER_DEPS) testscanw progs $(srcdir) $(HEADER_DEPS) -view progs $(srcdir) $(HEADER_DEPS) $(srcdir)/widechars.h +view progs $(srcdir) $(HEADER_DEPS) $(srcdir)/widechars.h $(srcdir)/popup_msg.h worm progs $(srcdir) $(HEADER_DEPS) xmas progs $(srcdir) $(HEADER_DEPS) diff --git a/test/movewindow.c b/test/movewindow.c index 91c7266a..d1e8dee8 100644 --- a/test/movewindow.c +++ b/test/movewindow.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: movewindow.c,v 1.40 2017/04/08 23:01:47 tom Exp $ + * $Id: movewindow.c,v 1.42 2017/04/15 18:37:42 tom Exp $ * * Demonstrate move functions for windows and derived windows from the curses * library. @@ -46,6 +46,7 @@ TODO: #include #include +#include #ifdef HAVE_XCURSES #undef derwin @@ -637,7 +638,7 @@ show_help(WINDOW *current) int key; CONST_FMT char * msg; } help[] = { - { '?', "Show this screen" }, + { HELP_KEY_1, "Show this screen" }, { 'b', "Draw a box inside the current window" }, { 'c', "Create a new window" }, { 'd', "Create a new derived window" }, @@ -654,20 +655,18 @@ show_help(WINDOW *current) }; /* *INDENT-ON* */ - WINDOW *mywin = newwin(LINES, COLS, 0, 0); - int row; + char **msgs = typeCalloc(char *, SIZEOF(help) + 1); + size_t n; - for (row = 0; row < LINES - 2 && row < (int) SIZEOF(help); ++row) { - wmove(mywin, row + 1, 1); - wprintw(mywin, "%s", keyname(help[row].key)); - wmove(mywin, row + 1, 20); - wprintw(mywin, "%s", help[row].msg); + for (n = 0; n < SIZEOF(help); ++n) { + msgs[n] = typeMalloc(char, 21 + strlen(help[n].msg)); + sprintf(msgs[n], "%-20s%s", keyname(help[n].key), help[n].msg); } - box_inside(mywin); - wmove(mywin, 1, 1); - wgetch(mywin); - delwin(mywin); - refresh_all(current); + popup_msg2(current, msgs); + for (n = 0; n < SIZEOF(help); ++n) { + free(msgs[n]); + } + free(msgs); } int @@ -695,7 +694,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) getyx(current_win, y, x); switch (ch) { - case '?': + case HELP_KEY_1: show_help(current_win); break; case 'b': diff --git a/test/ncurses.c b/test/ncurses.c index 21305727..bb343c59 100644 --- a/test/ncurses.c +++ b/test/ncurses.c @@ -40,7 +40,7 @@ AUTHOR Author: Eric S. Raymond 1993 Thomas E. Dickey (beginning revision 1.27 in 1996). -$Id: ncurses.c,v 1.447 2017/03/11 23:20:12 Petr.Vanek Exp $ +$Id: ncurses.c,v 1.449 2017/04/15 18:53:50 tom Exp $ ***************************************************************************/ @@ -1575,7 +1575,7 @@ attr_getc(int *skip, case CTRL('L'): Repaint(); break; - case '?': + case HELP_KEY_1: if ((helpwin = newwin(LINES - 1, COLS - 2, 0, 0)) != 0) { box(helpwin, 0, 0); attr_legend(helpwin); @@ -1925,7 +1925,7 @@ wide_attr_getc(int *skip, case CTRL('L'): Repaint(); break; - case '?': + case HELP_KEY_1: if ((helpwin = newwin(LINES - 1, COLS - 2, 0, 0)) != 0) { box_set(helpwin, 0, 0); attr_legend(helpwin); @@ -2387,7 +2387,7 @@ color_test(void) } } break; - case '?': + case HELP_KEY_1: if ((helpwin = newwin(LINES - 1, COLS - 2, 0, 0)) != 0) { box(helpwin, 0, 0); color_legend(helpwin, FALSE); @@ -2623,7 +2623,7 @@ wide_color_test(void) } } break; - case '?': + case HELP_KEY_1: if ((helpwin = newwin(LINES - 1, COLS - 2, 0, 0)) != 0) { box(helpwin, 0, 0); color_legend(helpwin, TRUE); @@ -2928,7 +2928,7 @@ color_edit(void) change_color((NCURSES_PAIRS_T) current, field, value, 0); break; - case '?': + case HELP_KEY_1: erase(); P(" RGB Value Editing Help"); P(""); @@ -3172,7 +3172,7 @@ slk_test(void) case 's': MvPrintw(SLK_WORK, 0, "Press Q to stop the scrolling-test: "); while ((c = Getchar()) != 'Q' && (c != ERR)) - addch((chtype) c); + AddCh(c); break; case 'd': @@ -3292,7 +3292,7 @@ wide_slk_test(void) case 's': MvPrintw(SLK_WORK, 0, "Press Q to stop the scrolling-test: "); while ((c = Getchar()) != 'Q' && (c != ERR)) - addch((chtype) c); + AddCh(c); break; case 'd': @@ -3424,7 +3424,7 @@ show_256_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair) int col = (int) (5 * (code % 16)); IGNORE_RC(mvaddch(row, col, colored_chtype(code, attr, pair))); for (count = 1; count < repeat; ++count) { - addch(colored_chtype(code, attr, pair)); + AddCh(colored_chtype(code, attr, pair)); } } @@ -3468,7 +3468,7 @@ show_upper_chars(int base, int pagesize, int repeat, attr_t attr, NCURSES_PAIRS_ if (C1) { /* (yes, this _is_ crude) */ while ((reply = Getchar()) != ERR) { - addch(UChar(reply)); + AddCh(UChar(reply)); napms(10); } nodelay(stdscr, FALSE); @@ -3513,7 +3513,7 @@ show_pc_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair) */ break; default: - addch(colored_chtype(code, A_ALTCHARSET | attr, pair)); + AddCh(colored_chtype(code, A_ALTCHARSET | attr, pair)); break; } } while (--count > 0); @@ -3562,7 +3562,7 @@ show_1_acs(int n, int repeat, const char *name, chtype code) MvPrintw(row, col, "%*s : ", COLS / 4, name); do { - addch(code); + AddCh(code); } while (--repeat > 0); return n + 1; } @@ -3796,7 +3796,7 @@ show_paged_widechars(int base, setcchar(&temp, codes, attr, pair, 0); move(row, col); if (wcwidth(code) == 0 && code != 0) { - addch((chtype) space | + AddCh((chtype) space | (A_REVERSE ^ attr) | (attr_t) COLOR_PAIR(pair)); } @@ -3843,7 +3843,7 @@ show_upper_widechars(int first, int repeat, int space, attr_t attr, NCURSES_PAIR * the display. */ if (wcwidth(code) == 0) { - addch((chtype) space | + AddCh((chtype) space | (A_REVERSE ^ attr) | (attr_t) COLOR_PAIR(pair)); } @@ -5372,8 +5372,8 @@ panner(WINDOW *pad, erase(); /* FALLTHRU */ - case '?': - if (c == '?') + case HELP_KEY_1: + if (c == HELP_KEY_1) show_panner_legend = !show_panner_legend; panner_legend(LINES - 4); panner_legend(LINES - 3); @@ -6850,7 +6850,7 @@ overlap_test(void) state = overlap_help(state, flavor); break; - case '?': + case HELP_KEY_1: state = overlap_help(state, flavor); break; @@ -6883,7 +6883,7 @@ show_string_setting(const char *name, const char *value) addstr(""); attroff(A_REVERSE); } - addch('\n'); + AddCh('\n'); } static void @@ -6897,7 +6897,7 @@ show_number_setting(const char *name, int value) printw("%d", value); attroff(A_REVERSE); } - addch('\n'); + AddCh('\n'); } static void @@ -6911,7 +6911,7 @@ show_boolean_setting(const char *name, int value) printw("%d", value); attroff(A_REVERSE); } - addch('\n'); + AddCh('\n'); } static void diff --git a/test/popup_msg.c b/test/popup_msg.c new file mode 100644 index 00000000..0b151feb --- /dev/null +++ b/test/popup_msg.c @@ -0,0 +1,169 @@ +/**************************************************************************** + * Copyright (c) 2017 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ +/* + * $Id: popup_msg.c,v 1.7 2017/04/15 19:16:41 tom Exp $ + * + * Show a multi-line message in a window which may extend beyond the screen. + * + * Thomas Dickey - 2017/4/15. + */ + +#include + +#include + +static WINDOW *old_window; + +static void +begin_popup(void) +{ + doupdate(); + old_window = dupwin(curscr); +} + +static void +end_popup(void) +{ + touchwin(old_window); + wnoutrefresh(old_window); + doupdate(); + delwin(old_window); +} + +/* + * Display a temporary window, e.g., to display a help-message. + */ +void +popup_msg(WINDOW *parent, const char *const *msg) +{ + int x0 = 4; + int y0 = 2; + int y1 = 0; + int y2 = 0; + int wide = getmaxx(parent) - ((x0 + 1) * 2); + int high = getmaxy(parent) - ((y0 + 1) * 2); + WINDOW *help; + WINDOW *data; + int n; + int width = 0; + int length; + int last_y; + int ch = ERR; + + for (n = 0; msg[n] != 0; ++n) { + int check = (int) strlen(msg[n]); + if (width < check) + width = check; + } + length = n; + + if ((help = newwin(high, wide, y0, x0)) == 0) + return; + if ((data = newpad(length + 1, width)) == 0) + return; + + begin_popup(); + + keypad(data, TRUE); + + for (n = 0; n < length; ++n) { + waddstr(data, msg[n]); + if ((n + 1) < length) { + waddch(data, '\n'); + } + } + y2 = getcury(data); + last_y = (y2 - (high - 3)); + + do { + switch (ch) { + case KEY_HOME: + y1 = 0; + break; + case KEY_END: + y1 = last_y; + break; + case KEY_PREVIOUS: + case KEY_PPAGE: + if (y1 > 0) { + y1 -= high / 2; + if (y1 < 0) + y1 = 0; + } else { + beep(); + } + break; + case KEY_NEXT: + case KEY_NPAGE: + if (y1 < last_y) { + y1 += high / 2; + if (y1 > last_y) + y1 = last_y; + } else { + beep(); + } + break; + case CTRL('P'): + case KEY_UP: + if (y1 > 0) + --y1; + else + beep(); + break; + case CTRL('N'): + case KEY_DOWN: + if (y1 < last_y) + ++y1; + else + beep(); + break; + default: + beep(); + break; + case ERR: + break; + } + werase(help); + box(help, 0, 0); + wnoutrefresh(help); + pnoutrefresh(data, y1, 0, y0 + 1, x0 + 1, high, wide); + doupdate(); + } while ((ch = wgetch(data)) != ERR && ch != QUIT && ch != ESCAPE); + werase(help); + wrefresh(help); + delwin(help); + delwin(data); + + end_popup(); +} + +void +popup_msg2(WINDOW *parent, char **msg) +{ + popup_msg(parent, (const char *const *) msg); +} diff --git a/test/popup_msg.h b/test/popup_msg.h new file mode 100644 index 00000000..1b0ef1ed --- /dev/null +++ b/test/popup_msg.h @@ -0,0 +1,42 @@ +/**************************************************************************** + * Copyright (c) 2003-2013,2017 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ +/* + * $Id: popup_msg.h,v 1.3 2017/04/15 19:16:35 tom Exp $ + * + * Interface of edit_field.c + */ + +#ifndef POPUP_MSG_H_incl +#define POPUP_MSG_H_incl 1 + +#include + +extern void popup_msg(WINDOW *parent, const char *const *msg); +extern void popup_msg2(WINDOW *parent, char **msg); + +#endif /* POPUP_MSG_H_incl */ diff --git a/test/programs b/test/programs index 5e24f6b8..2120cc79 100644 --- a/test/programs +++ b/test/programs @@ -1,4 +1,4 @@ -# $Id: programs,v 1.30 2017/03/31 13:01:52 tom Exp $ +# $Id: programs,v 1.34 2017/04/15 19:29:33 tom Exp $ ############################################################################## # Copyright (c) 2006-2016,2017 Free Software Foundation, Inc. # # # @@ -34,15 +34,15 @@ background $(LDFLAGS_CURSES) $(LOCAL_LIBS) background blue $(LDFLAGS_CURSES) $(LOCAL_LIBS) blue bs $(LDFLAGS_CURSES) $(LOCAL_LIBS) bs cardfile $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) cardfile -chgat $(LDFLAGS_CURSES) $(LOCAL_LIBS) chgat -clip_printw $(LDFLAGS_CURSES) $(LOCAL_LIBS) clip_printw +chgat $(LDFLAGS_CURSES) $(LOCAL_LIBS) chgat popup_msg +clip_printw $(LDFLAGS_CURSES) $(LOCAL_LIBS) clip_printw popup_msg color_set $(LDFLAGS_CURSES) $(LOCAL_LIBS) color_set demo_altkeys $(LDFLAGS_CURSES) $(LOCAL_LIBS) demo_altkeys demo_defkey $(LDFLAGS_CURSES) $(LOCAL_LIBS) demo_defkey -demo_forms $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_forms edit_field +demo_forms $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_forms edit_field popup_msg demo_keyok $(LDFLAGS_CURSES) $(LOCAL_LIBS) demo_keyok demo_menus $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_menus -demo_new_pair $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_new_pair +demo_new_pair $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_new_pair popup_msg demo_panels $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_panels demo_termcap $(LDFLAGS_TINFO) $(LOCAL_LIBS) demo_termcap demo_terminfo $(LDFLAGS_TINFO) $(LOCAL_LIBS) demo_terminfo @@ -57,27 +57,27 @@ filter $(LDFLAGS_CURSES) $(LOCAL_LIBS) filter firework $(LDFLAGS_CURSES) $(LOCAL_LIBS) firework firstlast $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) firstlast foldkeys $(LDFLAGS_CURSES) $(LOCAL_LIBS) foldkeys -form_driver_w $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) form_driver_w +form_driver_w $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) form_driver_w popup_msg gdc $(LDFLAGS_CURSES) $(LOCAL_LIBS) gdc hanoi $(LDFLAGS_CURSES) $(LOCAL_LIBS) hanoi hashtest $(LDFLAGS_CURSES) $(LOCAL_LIBS) hashtest -inch_wide $(LDFLAGS_CURSES) $(LOCAL_LIBS) inch_wide -inchs $(LDFLAGS_CURSES) $(LOCAL_LIBS) inchs +inch_wide $(LDFLAGS_CURSES) $(LOCAL_LIBS) inch_wide popup_msg +inchs $(LDFLAGS_CURSES) $(LOCAL_LIBS) inchs popup_msg ins_wide $(LDFLAGS_CURSES) $(LOCAL_LIBS) ins_wide -insdelln $(LDFLAGS_CURSES) $(LOCAL_LIBS) insdelln +insdelln $(LDFLAGS_CURSES) $(LOCAL_LIBS) insdelln popup_msg inserts $(LDFLAGS_CURSES) $(LOCAL_LIBS) inserts key_names $(LDFLAGS_CURSES) $(LOCAL_LIBS) key_names keynames $(LDFLAGS_CURSES) $(LOCAL_LIBS) keynames knight $(LDFLAGS_CURSES) $(LOCAL_LIBS) knight list_keys $(LDFLAGS_TINFO) $(LOCAL_LIBS) list_keys lrtest $(LDFLAGS_CURSES) $(LOCAL_LIBS) lrtest -movewindow $(LDFLAGS_CURSES) $(LOCAL_LIBS) movewindow +movewindow $(LDFLAGS_CURSES) $(LOCAL_LIBS) movewindow popup_msg ncurses $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) ncurses newdemo $(LDFLAGS_CURSES) $(LOCAL_LIBS) newdemo railroad $(LDFLAGS_TINFO) $(LOCAL_LIBS) railroad -rain $(LDFLAGS_THREADS) $(LOCAL_LIBS) rain -redraw $(LDFLAGS_CURSES) $(LOCAL_LIBS) redraw -savescreen $(LDFLAGS_CURSES) $(LOCAL_LIBS) savescreen +rain $(LDFLAGS_THREADS) $(LOCAL_LIBS) rain popup_msg +redraw $(LDFLAGS_CURSES) $(LOCAL_LIBS) redraw popup_msg +savescreen $(LDFLAGS_CURSES) $(LOCAL_LIBS) savescreen popup_msg sp_tinfo $(LDFLAGS_TINFO) $(LOCAL_LIBS) sp_tinfo tclock $(LDFLAGS_CURSES) $(LOCAL_LIBS) tclock test_add_wchstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_add_wchstr @@ -97,7 +97,7 @@ test_vidputs $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_vidputs testaddch $(LDFLAGS_CURSES) $(LOCAL_LIBS) testaddch testcurs $(LDFLAGS_CURSES) $(LOCAL_LIBS) testcurs testscanw $(LDFLAGS_CURSES) $(LOCAL_LIBS) testscanw -view $(LDFLAGS_CURSES) $(LOCAL_LIBS) view +view $(LDFLAGS_CURSES) $(LOCAL_LIBS) view popup_msg worm $(LDFLAGS_THREADS) $(LOCAL_LIBS) worm xmas $(LDFLAGS_CURSES) $(LOCAL_LIBS) xmas diff --git a/test/rain.c b/test/rain.c index 0f123ba8..f5ec33ac 100644 --- a/test/rain.c +++ b/test/rain.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. * + * Copyright (c) 1998-2014,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,9 +26,10 @@ * authorization. * ****************************************************************************/ /* - * $Id: rain.c,v 1.41 2014/08/02 17:24:07 tom Exp $ + * $Id: rain.c,v 1.42 2017/04/15 19:32:33 tom Exp $ */ #include +#include /* rain 11/3/1980 EPS/CITHEP */ @@ -292,6 +293,16 @@ int main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) { + static const char *help[] = + { + "Commands:", + " q/Q exit the program", + " s do single-step", + " undo single-step", + "", + 0 + }; + bool done = FALSE; DATA drop; #ifndef USE_PTHREADS @@ -373,6 +384,11 @@ main(int argc GCC_UNUSED, case (KEY_RESIZE): break; #endif + case HELP_KEY_1: + popup_msg(stdscr, help); + break; + default: + beep(); } napms(50); } diff --git a/test/redraw.c b/test/redraw.c index 9cb0de95..b74c6e53 100644 --- a/test/redraw.c +++ b/test/redraw.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006-2011,2012 Free Software Foundation, Inc. * + * Copyright (c) 2006-2012,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,13 +26,14 @@ * authorization. * ****************************************************************************/ /* - * $Id: redraw.c,v 1.8 2012/12/08 20:46:02 tom Exp $ + * $Id: redraw.c,v 1.9 2017/04/15 19:57:47 tom Exp $ * * Demonstrate the redrawwin() and wredrawln() functions. * Thomas Dickey - 2006/11/4 */ #include +#include static void trash(int beg_x, int max_x, int cur_x) @@ -53,11 +54,30 @@ trash(int beg_x, int max_x, int cur_x) for (x = max_x; x > cur_x; --x) { putchar('\b'); } + fflush(stdout); } static void test_redraw(WINDOW *win) { + static const char *help[] = + { + "Commands:", + " ^Q/ESC/q - quit", + " w - recur in a new window", + " ! - overwrite current line using stdio outside curses.", +#ifdef NCURSES_VERSION + " @ - run \"date\" command, to put its output on screen.", +#endif + " ^L - call redrawwin() for current window.", + " ^W - call wredrawln() for current line/current window.", + " arrow-keys - move cursor on the screen", + "", + "Other control characters are added to the screen in printable form.", + "Other printable characters are added to the screen as is.", + 0 + }; + WINDOW *win1; WINDOW *win2; bool done = FALSE; @@ -77,6 +97,7 @@ test_redraw(WINDOW *win) switch (ch) { case 'q': /* FALLTHRU */ + case QUIT: case ESCAPE: done = TRUE; break; @@ -146,9 +167,14 @@ test_redraw(WINDOW *win) wmove(win, y, x + 1); break; + case HELP_KEY_1: + popup_msg(win, help); + break; + default: if (ch > KEY_MIN) { waddstr(win, keyname(ch)); + waddch(win, '\n'); } else { waddstr(win, unctrl(UChar(ch))); } diff --git a/test/savescreen.c b/test/savescreen.c index 3b8ef47e..9ace6a70 100644 --- a/test/savescreen.c +++ b/test/savescreen.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007-2011,2015 Free Software Foundation, Inc. * + * Copyright (c) 2007-2015,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,13 +26,14 @@ * authorization. * ****************************************************************************/ /* - * $Id: savescreen.c,v 1.28 2015/08/22 22:40:22 tom Exp $ + * $Id: savescreen.c,v 1.32 2017/04/15 17:33:50 tom Exp $ * * Demonstrate save/restore functions from the curses library. * Thomas Dickey - 2007/7/14 */ #include +#include #if HAVE_SCR_DUMP @@ -50,9 +51,28 @@ # endif #endif +#if defined(__hpux) +#define MyMarker 'X' +#else +#define MyMarker ACS_DIAMOND +#endif + static bool use_init = FALSE; static bool keep_dumps = FALSE; +#if USE_WIDEC_SUPPORT +/* In HPUX curses, cchar_t is opaque; other implementations are not */ +static wchar_t +BaseChar(cchar_t data) +{ + wchar_t my_wchar[sizeof(cchar_t)]; + attr_t my_attr; + short my_pair; + getcchar(&data, my_wchar, &my_attr, &my_pair, NULL); + return my_wchar[0]; +} +#endif + static int fexists(const char *name) { @@ -148,24 +168,6 @@ get_command(int which, int last) return ch; } -static void -show_help(const char **help) -{ - WINDOW *mywin = newwin(LINES, COLS, 0, 0); - int n; - - box(mywin, 0, 0); - wmove(mywin, 1, 1); - for (n = 0; help[n] != 0; ++n) { - wmove(mywin, 1 + n, 2); - wprintw(mywin, "%.*s", COLS - 4, help[n]); - } - wgetch(mywin); - delwin(mywin); - touchwin(stdscr); - refresh(); -} - static void editor_help(void) { @@ -183,8 +185,9 @@ editor_help(void) " a toggle between '#' and graphic symbol for drawing", " c change color drawn by line to next in palette", " h,j,k,l or arrows to move around the screen, drawing", + 0 }; - show_help(msgs); + popup_msg(stdscr, msgs); } static void @@ -199,8 +202,9 @@ replay_help(void) " q quit", " load the next screen", " load the previous screen", + 0 }; - show_help(msgs); + popup_msg(stdscr, msgs); } static void @@ -358,7 +362,7 @@ main(int argc, char *argv[]) if (++which > last) which = 0; break; - case '?': + case HELP_KEY_1: replay_help(); break; default: @@ -421,7 +425,7 @@ main(int argc, char *argv[]) wmove(stdscr, cy, cx); #if USE_WIDEC_SUPPORT if (win_wch(curscr, &mycc) != ERR) { - myxx = wcwidth(mycc.chars[0]); + myxx = wcwidth(BaseChar(mycc)); if (myxx > 0) { wadd_wchnstr(stdscr, &mycc, 1); cx += (myxx - 1); @@ -463,7 +467,7 @@ main(int argc, char *argv[]) case 'c': color = (color + 1) % COLORS; break; - case '?': + case HELP_KEY_1: editor_help(); break; default: @@ -472,9 +476,9 @@ main(int argc, char *argv[]) } if (!done) { attr_t attr = (A_REVERSE | (attr_t) COLOR_PAIR(color * COLORS)); - chtype ch2 = (altchars ? ACS_DIAMOND : '#'); + chtype ch2 = (altchars ? MyMarker : '#'); move(y, x); - addch(ch2 | attr); + AddCh(ch2 | attr); move(y, x); } } diff --git a/test/sp_tinfo.c b/test/sp_tinfo.c index 8e42ad32..fdc64257 100644 --- a/test/sp_tinfo.c +++ b/test/sp_tinfo.c @@ -27,7 +27,7 @@ ****************************************************************************/ /* - * $Id: sp_tinfo.c,v 1.17 2017/04/02 01:03:30 tom Exp $ + * $Id: sp_tinfo.c,v 1.18 2017/04/13 21:35:31 tom Exp $ * * TOTO: add option for non-sp-funcs interface */ @@ -267,7 +267,9 @@ cleanup(MYDATA * data) { set_curterm(data->term); del_curterm(data->term); +#if !NO_LEAKS free(data->sp); /* cannot use delscreen in tinfo */ +#endif free(data); } diff --git a/test/test.priv.h b/test/test.priv.h index ae0eb6bb..a5790358 100644 --- a/test/test.priv.h +++ b/test/test.priv.h @@ -29,7 +29,7 @@ /**************************************************************************** * Author: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: test.priv.h,v 1.141 2017/03/31 13:09:31 tom Exp $ */ +/* $Id: test.priv.h,v 1.143 2017/04/15 17:19:47 tom Exp $ */ #ifndef __TEST_PRIV_H #define __TEST_PRIV_H 1 @@ -558,6 +558,9 @@ extern int optind; #define KEY_MIN 256 /* not defined in Solaris 8 */ #endif +#define HELP_KEY_1 '?' +#define HELP_KEY_2 KEY_F(1) + /* from nc_string.h, to make this stand alone */ #if HAVE_BSD_STRING_H #include @@ -913,17 +916,19 @@ extern char *tgoto(char *, int, int); /* available, but not prototyped */ #define Trace2(p) /* nothing */ -#define MvAddCh (void) mvaddch -#define MvWAddCh (void) mvwaddch -#define MvAddStr (void) mvaddstr -#define MvWAddStr (void) mvwaddstr -#define MvWAddChStr (void) mvwaddchstr -#define MvPrintw (void) mvprintw -#define MvWPrintw (void) mvwprintw -#define MvHLine (void) mvhline -#define MvWHLine (void) mvwhline -#define MvVLine (void) mvvline -#define MvWVLine (void) mvwvline +#define AddCh(c) (void) addch((chtype)(c)) +#define WAddCh(w,c) (void) waddch((w),(chtype)(c)) +#define MvAddCh(y,x,c) (void) mvaddch((y),(x),(chtype)(c)) +#define MvWAddCh(w,y,x,c) (void) mvwaddch((w),(y),(x),(chtype)(c)) +#define MvAddStr(y,x,s) (void) mvaddstr((y),(x),(s)) +#define MvWAddStr(w,y,x,s) (void) mvwaddstr((w),(y),(x),(s)) +#define MvWAddChStr(w,y,x,s) (void) mvwaddchstr((w),(y),(x),(s)) +#define MvPrintw (void) mvprintw +#define MvWPrintw (void) mvwprintw +#define MvHLine (void) mvhline +#define MvWHLine (void) mvwhline +#define MvVLine (void) mvvline +#define MvWVLine (void) mvwvline /* * The macro likely uses unsigned values, while X/Open prototype uses int. diff --git a/test/test_add_wchstr.c b/test/test_add_wchstr.c index 58ff87d5..3e7f1baf 100644 --- a/test/test_add_wchstr.c +++ b/test/test_add_wchstr.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_add_wchstr.c,v 1.23 2017/04/08 23:10:35 tom Exp $ + * $Id: test_add_wchstr.c,v 1.26 2017/04/15 15:15:25 tom Exp $ * * Demonstrate the waddwchstr() and wadd_wch functions. * Thomas Dickey - 2009/9/12 @@ -48,18 +48,24 @@ #define WIDE_LINEDATA #include +#undef AddCh #undef MvAddCh #undef MvAddStr #undef MvWAddCh +#undef MvWAddChStr #undef MvWAddStr +#undef WAddCh -/* definitions to make it simpler to compare with test_addstr.c */ +/* + * redefinitions to simplify comparison between test_*str programs + */ #define AddNStr add_wchnstr #define AddStr add_wchstr #define MvAddNStr (void) mvadd_wchnstr #define MvAddStr (void) mvadd_wchstr #define MvWAddNStr (void) mvwadd_wchnstr #define MvWAddStr (void) mvwadd_wchstr +#define MvWAddChStr(w,y,x,s) (void) mvwadd_wchstr((w),(y),(x),(s)) #define WAddNStr wadd_wchnstr #define WAddStr wadd_wchstr @@ -291,7 +297,7 @@ AddCh(chtype ch) #define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n))) static void -test_add_wchstr(int level) +recursive_test(int level) { static bool first = TRUE; @@ -306,8 +312,12 @@ test_add_wchstr(int level) WINDOW *work = 0; WINDOW *show = 0; int margin = (2 * MY_TABSIZE) - 1; - Options option = ((m_opt ? oMove : oDefault) - | ((w_opt || (level > 0)) ? oWindow : oDefault)); + Options option = (Options) ((unsigned) (m_opt + ? oMove + : oDefault) + | (unsigned) ((w_opt || (level > 0)) + ? oWindow + : oDefault)); if (first) { static char cmd[80]; @@ -352,8 +362,8 @@ test_add_wchstr(int level) MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2); limit /= 2; - (void) mvwadd_wchstr(work, 1, 2, ChStr("String")); - (void) mvwadd_wchstr(work, limit + 1, 2, ChStr("Chars")); + MvWAddChStr(work, 1, 2, ChStr("String")); + MvWAddChStr(work, limit + 1, 2, ChStr("Chars")); wnoutrefresh(work); buffer[length = 0] = '\0'; @@ -370,7 +380,7 @@ test_add_wchstr(int level) wmove(work, row, margin + 1); switch (ch) { case key_RECUR: - test_add_wchstr(level + 1); + recursive_test(level + 1); if (look) touchwin(look); @@ -583,7 +593,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) if (optind < argc) usage(); - test_add_wchstr(0); + recursive_test(0); endwin(); #if NO_LEAKS free(temp_buffer); diff --git a/test/test_addchstr.c b/test/test_addchstr.c index 29bf9d5e..4bcc25b8 100644 --- a/test/test_addchstr.c +++ b/test/test_addchstr.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_addchstr.c,v 1.20 2017/04/08 23:11:55 tom Exp $ + * $Id: test_addchstr.c,v 1.21 2017/04/15 14:09:14 tom Exp $ * * Demonstrate the waddchstr() and waddch functions. * Thomas Dickey - 2009/9/12 @@ -36,6 +36,9 @@ #include +/* + * redefinitions to simplify comparison between test_*str programs + */ #undef MvAddStr #undef MvWAddStr @@ -48,9 +51,6 @@ #define WAddNStr waddchnstr #define WAddStr waddchstr -#define AddCh addch -#define WAddCh waddch - #define MY_TABSIZE 8 typedef enum { @@ -207,7 +207,7 @@ ColOf(char *buffer, int length, int margin) #define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n))) static void -test_adds(int level) +recursive_test(int level) { static bool first = TRUE; @@ -293,7 +293,7 @@ test_adds(int level) wmove(work, row, margin + 1); switch (ch) { case key_RECUR: - test_adds(level + 1); + recursive_test(level + 1); if (look) touchwin(look); @@ -513,7 +513,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) if (optind < argc) usage(); - test_adds(0); + recursive_test(0); endwin(); #if NO_LEAKS free(temp_buffer); diff --git a/test/test_addstr.c b/test/test_addstr.c index c553d23f..cc5c89fe 100644 --- a/test/test_addstr.c +++ b/test/test_addstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2009-2012,2016 Free Software Foundation, Inc. * + * Copyright (c) 2009-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_addstr.c,v 1.11 2016/09/10 21:28:20 tom Exp $ + * $Id: test_addstr.c,v 1.13 2017/04/15 14:56:27 tom Exp $ * * Demonstrate the waddstr() and waddch functions. * Thomas Dickey - 2009/9/12 @@ -36,6 +36,9 @@ #include +/* + * redefinitions to simplify comparison between test_*str programs + */ #define AddNStr addnstr #define AddStr addstr #define MvAddNStr (void) mvaddnstr @@ -43,9 +46,6 @@ #define WAddNStr waddnstr #define WAddStr waddstr -#define AddCh addch -#define WAddCh waddch - #define MY_TABSIZE 8 typedef enum { @@ -129,7 +129,7 @@ ColOf(char *buffer, int length, int margin) #define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n))) static void -test_adds(int level) +recursive_test(int level) { static bool first = TRUE; @@ -212,7 +212,7 @@ test_adds(int level) wmove(work, row, margin + 1); switch (ch) { case key_RECUR: - test_adds(level + 1); + recursive_test(level + 1); if (look) touchwin(look); @@ -424,7 +424,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) if (optind < argc) usage(); - test_adds(0); + recursive_test(0); endwin(); ExitProgram(EXIT_SUCCESS); } diff --git a/test/test_addwstr.c b/test/test_addwstr.c index f836a78e..75a100dd 100644 --- a/test/test_addwstr.c +++ b/test/test_addwstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2009-2014,2016 Free Software Foundation, Inc. * + * Copyright (c) 2009-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_addwstr.c,v 1.13 2016/09/10 21:27:59 tom Exp $ + * $Id: test_addwstr.c,v 1.16 2017/04/15 15:08:03 tom Exp $ * * Demonstrate the waddwstr() and wadd_wch functions. * Thomas Dickey - 2009/9/12 @@ -48,12 +48,16 @@ #define WIDE_LINEDATA #include +#undef AddCh #undef MvAddCh #undef MvAddStr #undef MvWAddCh #undef MvWAddStr +#undef WAddCh -/* definitions to make it simpler to compare with inserts.c */ +/* + * redefinitions to simplify comparison between test_*str programs + */ #define AddNStr addnwstr #define AddStr addwstr #define MvAddNStr (void) mvaddnwstr @@ -103,8 +107,7 @@ legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length) wprintw(win, "down-arrow or ^N to repeat on next line, ^W for inner window, ESC to exit.\n"); wclrtoeol(win); - wprintw(win, "Level %d,%s inserted %d characters <", level, - showstate, length); + wprintw(win, "Level %d,%s added %d characters <", level, showstate, length); waddwstr(win, buffer); waddstr(win, ">"); } @@ -218,7 +221,7 @@ AddCh(chtype ch) #define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n))) static void -test_inserts(int level) +recursive_test(int level) { static bool first = TRUE; @@ -233,9 +236,12 @@ test_inserts(int level) WINDOW *work = 0; WINDOW *show = 0; int margin = (2 * MY_TABSIZE) - 1; - Options option = (Options) ((int) (m_opt ? oMove : oDefault) - | (int) ((w_opt || (level > 0)) - ? oWindow : oDefault)); + Options option = (Options) ((unsigned) (m_opt + ? oMove + : oDefault) + | (unsigned) ((w_opt || (level > 0)) + ? oWindow + : oDefault)); if (first) { static char cmd[80]; @@ -250,7 +256,7 @@ test_inserts(int level) keypad(stdscr, TRUE); /* - * Show the characters inserted in color, to distinguish from those that + * Show the characters added in color, to distinguish from those that * are shifted. */ if (has_colors()) { @@ -298,7 +304,7 @@ test_inserts(int level) wmove(work, row, margin + 1); switch (ch) { case key_RECUR: - test_inserts(level + 1); + recursive_test(level + 1); if (look) touchwin(look); @@ -368,7 +374,7 @@ test_inserts(int level) break; } - /* do the corresponding single-character insertion */ + /* do the corresponding single-character add */ row2 = limit + row; for (col = 0; col < length; ++col) { col2 = ColOf(buffer, col, margin); @@ -423,7 +429,7 @@ test_inserts(int level) break; } - /* do the corresponding single-character insertion */ + /* do the corresponding single-character add */ switch (option) { case oDefault: if (move(limit + row, col) != ERR) { @@ -464,12 +470,12 @@ usage(void) { static const char *tbl[] = { - "Usage: inserts [options]" + "Usage: test_addwstr [options]" ,"" ,"Options:" ," -f FILE read data from given file" - ," -n NUM limit string-inserts to NUM bytes on ^N replay" - ," -m perform wmove/move separately from insert-functions" + ," -n NUM limit string-adds to NUM bytes on ^N replay" + ," -m perform wmove/move separately from add-functions" ," -w use window-parameter even when stdscr would be implied" }; unsigned n; @@ -509,7 +515,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) if (optind < argc) usage(); - test_inserts(0); + recursive_test(0); endwin(); ExitProgram(EXIT_SUCCESS); } diff --git a/test/test_arrays.c b/test/test_arrays.c index e4b9fb1d..9cdeb0c4 100644 --- a/test/test_arrays.c +++ b/test/test_arrays.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2007-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_arrays.c,v 1.5 2010/11/13 19:57:57 tom Exp $ + * $Id: test_arrays.c,v 1.6 2010/11/13 19:57:57 tom Exp $ * * Author: Thomas E Dickey * diff --git a/test/test_get_wstr.c b/test/test_get_wstr.c index dc01b0e6..a3037b1b 100644 --- a/test/test_get_wstr.c +++ b/test/test_get_wstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007-2009,2011 Free Software Foundation, Inc. * + * Copyright (c) 2007-2011,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_get_wstr.c,v 1.8 2011/01/15 18:15:11 tom Exp $ + * $Id: test_get_wstr.c,v 1.9 2017/04/15 14:14:25 tom Exp $ * * Author: Thomas E Dickey * @@ -134,7 +134,7 @@ ShowFlavor(WINDOW *strwin, WINDOW *txtwin, int flavor, int limit) } static int -test_get_wstr(int level, char **argv, WINDOW *strwin) +recursive_test(int level, char **argv, WINDOW *strwin) { WINDOW *txtbox = 0; WINDOW *txtwin = 0; @@ -225,7 +225,7 @@ test_get_wstr(int level, char **argv, WINDOW *strwin) break; case 'w': - test_get_wstr(level + 1, argv, strwin); + recursive_test(level + 1, argv, strwin); if (txtbox != 0) { touchwin(txtbox); wnoutrefresh(txtbox); @@ -349,7 +349,7 @@ main(int argc, char *argv[]) strwin = derwin(chrbox, 4, COLS - 2, 1, 1); - test_get_wstr(1, argv, strwin); + recursive_test(1, argv, strwin); endwin(); ExitProgram(EXIT_SUCCESS); diff --git a/test/test_getstr.c b/test/test_getstr.c index 3f64c77b..4c243092 100644 --- a/test/test_getstr.c +++ b/test/test_getstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007-2009,2012 Free Software Foundation, Inc. * + * Copyright (c) 2007-2012,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_getstr.c,v 1.10 2012/07/07 18:22:49 tom Exp $ + * $Id: test_getstr.c,v 1.11 2017/04/15 14:14:37 tom Exp $ * * Author: Thomas E Dickey * @@ -141,7 +141,7 @@ ShowFlavor(WINDOW *strwin, WINDOW *txtwin, int flavor, int limit) } static int -test_getstr(int level, char **argv, WINDOW *strwin) +recursive_test(int level, char **argv, WINDOW *strwin) { WINDOW *txtbox = 0; WINDOW *txtwin = 0; @@ -233,7 +233,7 @@ test_getstr(int level, char **argv, WINDOW *strwin) break; case 'w': - test_getstr(level + 1, argv, strwin); + recursive_test(level + 1, argv, strwin); if (txtbox != 0) { touchwin(txtbox); wnoutrefresh(txtbox); @@ -356,7 +356,7 @@ main(int argc, char *argv[]) strwin = derwin(chrbox, 4, COLS - 2, 1, 1); - test_getstr(1, argv, strwin); + recursive_test(1, argv, strwin); endwin(); ExitProgram(EXIT_SUCCESS); diff --git a/test/test_instr.c b/test/test_instr.c index e203cc65..fa33076c 100644 --- a/test/test_instr.c +++ b/test/test_instr.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_instr.c,v 1.6 2017/04/08 23:21:53 tom Exp $ + * $Id: test_instr.c,v 1.7 2017/04/15 14:08:40 tom Exp $ * * Author: Thomas E Dickey * @@ -68,7 +68,7 @@ showmore(WINDOW *win, int line, char *buffer) } static int -test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) +recursive_test(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) { WINDOW *txtbox = 0; WINDOW *txtwin = 0; @@ -151,7 +151,7 @@ test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) beep(); break; case 'w': - test_inchs(level + 1, argv, chrwin, strwin); + recursive_test(level + 1, argv, chrwin, strwin); if (txtbox != 0) { touchwin(txtbox); wnoutrefresh(txtbox); @@ -254,7 +254,7 @@ main(int argc, char *argv[]) chrwin = derwin(chrbox, 2, COLS - 2, 1, 1); strwin = derwin(chrbox, 2, COLS - 2, 3, 1); - test_inchs(1, argv, chrwin, strwin); + recursive_test(1, argv, chrwin, strwin); endwin(); ExitProgram(EXIT_SUCCESS); diff --git a/test/test_inwstr.c b/test/test_inwstr.c index 3d2656f3..5bd46c9a 100644 --- a/test/test_inwstr.c +++ b/test/test_inwstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007,2010 Free Software Foundation, Inc. * + * Copyright (c) 2007-2010,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_inwstr.c,v 1.4 2010/05/01 19:13:46 tom Exp $ + * $Id: test_inwstr.c,v 1.5 2017/04/15 14:14:48 tom Exp $ * * Author: Thomas E Dickey * @@ -70,7 +70,7 @@ showmore(WINDOW *win, int line, wchar_t *buffer) } static int -test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) +recursive_test(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) { WINDOW *txtbox = 0; WINDOW *txtwin = 0; @@ -151,7 +151,7 @@ test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) beep(); break; case 'w': - test_inchs(level + 1, argv, chrwin, strwin); + recursive_test(level + 1, argv, chrwin, strwin); if (txtbox != 0) { touchwin(txtbox); wnoutrefresh(txtbox); @@ -254,7 +254,7 @@ main(int argc, char *argv[]) chrwin = derwin(chrbox, 2, COLS - 2, 1, 1); strwin = derwin(chrbox, 2, COLS - 2, 3, 1); - test_inchs(1, argv, chrwin, strwin); + recursive_test(1, argv, chrwin, strwin); endwin(); ExitProgram(EXIT_SUCCESS); diff --git a/test/view.c b/test/view.c index 5d94cda0..da073151 100644 --- a/test/view.c +++ b/test/view.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -50,11 +50,12 @@ * scroll operation worked, and the refresh() code only had to do a * partial repaint. * - * $Id: view.c,v 1.97 2016/09/10 21:05:46 tom Exp $ + * $Id: view.c,v 1.101 2017/04/15 20:14:01 tom Exp $ */ #include #include +#include #include @@ -227,6 +228,28 @@ ch_dup(char *src) int main(int argc, char *argv[]) { + static const char *help[] = + { + "Commands:", + " q,^Q,ESC - quit this program", + "", + " p, - scroll the viewport up by one row", + " n, - scroll the viewport down by one row", + " l, - scroll the viewport left by one column", + " r, - scroll the viewport right by one column", + "", + " h, - scroll the viewport to top of file", + " e, - scroll the viewport to end of file", + "", + " ^L - repaint using redrawwin()", + "", + " 0 through 9 - enter digits for count", + " s - use entered count for halfdelay() parameter", + " - if no entered count, stop nodelay()", + " - begin nodelay()", + 0 + }; + int MAXLINES = 1000; FILE *fp; char buf[BUFSIZ]; @@ -473,6 +496,8 @@ main(int argc, char *argv[]) break; case 'q': + case QUIT: + case ESCAPE: done = TRUE; break; @@ -499,6 +524,9 @@ main(int argc, char *argv[]) if (!my_delay) napms(50); break; + case HELP_KEY_1: + popup_msg(stdscr, help); + break; default: beep(); break; @@ -571,7 +599,7 @@ show_all(const char *tag) "%.20s (%3dx%3d) col %d ", tag, LINES, COLS, shift); i = (int) strlen(temp); if ((i + 7) < (int) sizeof(temp)) { - _nc_SPRINTF(temp + i, _nc_SLIMIT(sizeof(temp) - i) + _nc_SPRINTF(temp + i, _nc_SLIMIT(sizeof(temp) - (size_t) i) "view %.*s", (int) (sizeof(temp) - 7 - (size_t) i), fname); diff --git a/test/worm.c b/test/worm.c index 5f645ac6..365266af 100644 --- a/test/worm.c +++ b/test/worm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2013,2016 Free Software Foundation, Inc. * + * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -61,7 +61,7 @@ Options: traces will be dumped. The program stops and waits for one character of input at the beginning and end of the interval. - $Id: worm.c,v 1.67 2017/04/09 00:27:42 tom Exp $ + $Id: worm.c,v 1.68 2017/04/15 14:15:00 tom Exp $ */ #include