]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.0 - patch 20170415
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 16 Apr 2017 01:08:25 +0000 (01:08 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 16 Apr 2017 01:08:25 +0000 (01:08 +0000)
+ 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.

141 files changed:
Ada95/README
Ada95/include/MKncurses_def.sh
Ada95/samples/rain.ads
Ada95/samples/sample-curses_demo-attributes.adb
Ada95/samples/sample-curses_demo-attributes.ads
Ada95/samples/sample-curses_demo-mouse.ads
Ada95/samples/sample-curses_demo.ads
Ada95/samples/sample-form_demo.ads
Ada95/samples/sample-header_handler.ads
Ada95/samples/sample-keyboard_handler.ads
Ada95/samples/sample-manifest.ads
Ada95/samples/sample-menu_demo.ads
Ada95/samples/sample-text_io_demo.ads
Ada95/samples/sample.ads
Ada95/samples/status.adb
Ada95/samples/status.ads
Ada95/samples/tour.adb
Ada95/samples/tour.ads
Ada95/src/library.gpr
Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads
Ada95/src/terminal_interface-curses-putwin.adb
Ada95/src/terminal_interface-curses-putwin.ads
Ada95/src/terminal_interface-curses-termcap.ads
Ada95/src/terminal_interface-curses-terminfo.ads
MANIFEST
NEWS
VERSION
configure
configure.in
dist.mk
include/MKncurses_def.sh
include/MKterm.h.awk.in
include/term_entry.h
include/termcap.h.in
man/term_variables.3x
misc/shlib
misc/tdlint
ncurses/SigAction.h
ncurses/base/MKkeyname.awk
ncurses/base/lib_set_term.c
ncurses/curses.priv.h
ncurses/llib-lncurses
ncurses/llib-lncursest
ncurses/llib-lncursestw
ncurses/llib-lncursesw
ncurses/llib-ltic
ncurses/llib-ltict
ncurses/llib-ltictw
ncurses/llib-lticw
ncurses/llib-ltinfo
ncurses/llib-ltinfot
ncurses/llib-ltinfotw
ncurses/llib-ltinfow
ncurses/new_pair.h
ncurses/tinfo/MKfallback.sh
ncurses/tinfo/alloc_entry.c
ncurses/tinfo/alloc_ttype.c
ncurses/tinfo/comp_parse.c
ncurses/tinfo/comp_scan.c
ncurses/tinfo/entries.c
ncurses/tinfo/free_ttype.c
ncurses/tinfo/lib_cur_term.c
ncurses/tinfo/lib_data.c
ncurses/tinfo/lib_options.c
ncurses/tinfo/lib_raw.c
ncurses/tinfo/lib_setup.c
ncurses/tinfo/lib_termcap.c
ncurses/tinfo/lib_ti.c
ncurses/tinfo/parse_entry.c
ncurses/tinfo/read_entry.c
ncurses/tinfo/read_termcap.c
ncurses/tinfo/tinfo_driver.c
ncurses/tinfo/trim_sgr0.c
ncurses/tinfo/write_entry.c
ncurses/tty/lib_mvcur.c
ncurses/win32con/win_driver.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.map
package/ncurses.spec
package/ncurses.sym
package/ncursest.map
package/ncursest.sym
package/ncursestw.map
package/ncursestw.sym
package/ncursesw.map
package/ncursesw.sym
progs/dump_entry.c
progs/dump_entry.h
progs/infocmp.c
progs/progs.priv.h
progs/tic.c
progs/toe.c
test/background.c
test/blue.c
test/bs.c
test/chgat.c
test/clip_printw.c
test/demo_defkey.c
test/demo_forms.c
test/demo_keyok.c
test/demo_new_pair.c
test/demo_panels.c
test/demo_termcap.c
test/dots_curses.c
test/dots_termcap.c
test/echochar.c
test/edit_field.c
test/edit_field.h
test/extended_color.c
test/form_driver_w.c
test/hashtest.c
test/inch_wide.c
test/inchs.c
test/insdelln.c
test/knight.c
test/modules
test/movewindow.c
test/ncurses.c
test/popup_msg.c [new file with mode: 0644]
test/popup_msg.h [new file with mode: 0644]
test/programs
test/rain.c
test/redraw.c
test/savescreen.c
test/sp_tinfo.c
test/test.priv.h
test/test_add_wchstr.c
test/test_addchstr.c
test/test_addstr.c
test/test_addwstr.c
test/test_arrays.c
test/test_get_wstr.c
test/test_getstr.c
test/test_instr.c
test/test_inwstr.c
test/view.c
test/worm.c

index be8425969de98da6208e4f97020fcca5020e4a29..ea9ae80e761dc94aa484180d9563b3144eca5d7b 100644 (file)
@@ -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             --
index 4aac86554b55822d693d88a85c1f7858555e48c9..1740bccb8c08b04b2203d8abf5cda9e8bca2438a 100755 (executable)
@@ -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"), #
index 3ad1912c5e4951bea968f0d39143f6d793413917..9c7242e9b3a31eb919ed3c271a29c1f1757d03c9 100644 (file)
@@ -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 <pautet@gnat.com>
 --  Modified by:  Juergen Pfeifer, 1997
 --  Version Control
---  $Revision: 1.6 $
+--  $Revision: 1.7 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 --                                                                          --
index c49f37d6024638d171c8862f1c2c6e1a09fbf3dc..b0f60d4a3465691d332d3063f444c262747a25e8 100644 (file)
@@ -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;
index 6d9b4e8df80fbcdfe65745a0132ec69af6b494c4..d1032d99aed1cad1f407a84874006feb931d5dc0 100644 (file)
@@ -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
index ad78d0d0a750a42921dd46861f9edf8d8b26aaa2..e48834dfe75dd283d3dea222f343b5e920e99db4 100644 (file)
@@ -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
index ed4ad0f019f8eb2e6bfe0f7531e0a73e6d543084..2ee0d9d240951c6dbc0aae3a5677e080ab3af31c 100644 (file)
@@ -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
index bd33f578750d2de6f311306a187aeabc8a69abbe..ebdb0d42bba88e7981e52bc4667becfbee24cbe2 100644 (file)
@@ -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
index aa0a0c29e9f1eea2b62a0fb32bfaeb6c6c855758..a81379dc8c1944a4f2b5ad31e73890618b043087 100644 (file)
@@ -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;
index ac5b1399db0143b1cda3a24ebb2db5b867b621aa..9ad9535fd9457114a63082218e1577acf0b484db 100644 (file)
@@ -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;
index bb76c4cba78c0380c4f5785c7aa3559af69ff00a..331cffc87d30b2ab42cbc6d35692c71177ec32ae 100644 (file)
@@ -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;
index b071afc8277d23da9b0ef7d61f5d1e2ca2fbc97a..87537aac43adac890dc6ac7cc852ac032324a005 100644 (file)
@@ -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
index d3f5a188baf00d635a5b317c898b47a90e5759ec..3bbc1b2ce41e82817cf5ac241c2324d3d546f3a5 100644 (file)
@@ -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
index 9d0647dad78de23872cbd8de629f63dcb9782e37..791c33ae9fb2964ace476191999554c423581a43 100644 (file)
@@ -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
index e6581317f40178754503741013ae2a2c0542272a..5da9a92290c86d86a03a9f100ca0ceb974ce5d45 100644 (file)
@@ -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 <pautet@gnat.com>
 --  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 <pautet@gnat.com>   --
index e9e3ee8b350107b917bbeee33db70d9927ada5a3..37ad5f1c1b9ddf63d42cb10fa0456427cbda35cb 100644 (file)
@@ -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 <pautet@gnat.com>
 --  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 <pautet@gnat.com>   --
index 1cc91c15d7407f61aab7d9d0d3ebf9ec15fc93f4..e71310bf6fb60cadad8a7714570361901c6ae290 100644 (file)
@@ -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;
index 8888169160a47d334450b558bf6e5264dab1fa94..3f9ce30cecf8207944f0d1b055508570057eb58b 100644 (file)
@@ -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;
index dc31103a1bf169ba2ea758d772c0c49d4dcf7921..a05b2c1054c617d84cb46b878ccd2980a41a7335 100644 (file)
@@ -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
index 48fad09c2f252ce71991028d317dad867fb39293..198071cf01c51320cf9651a7030f6e9063355f46 100644 (file)
@@ -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
index 986cd6b9bd6ca6d20c44990a1bcb77a90cab8dd3..c5724d1187054e79568471cc5d6eb6ceeee9956e 100644 (file)
@@ -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;
index d302bdcec452415541ce7923e4b9e7972bc96bf3..24d05063e1cdc00b362e87c86058d104cbdb92f7 100644 (file)
@@ -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;
index dd01396e8b0b177567f7254bd627d0eba40937ed..e5f19f658e5d38d9654d3be24b799e1d714dae18 100644 (file)
@@ -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
 ------------------------------------------------------------------------------
 
index fb39bf1ed6f1820f2c823e6a1e65485a842dd210..67f951d08f55d1cafc239b2835ce89635f5fcb32 100644 (file)
@@ -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
 ------------------------------------------------------------------------------
 
index a2511d165acc1521f7ffbadd96005fe655fdfe03..742c5a206165019e320e1e1aea3b7a0283c525a5 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
 ./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 acd629940c2b6a541dc07157220ee2ebb11d9733..93932ab8730ac49e5d2d347d6f14b3a9933dbde6 100644 (file)
--- 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 dd3f3e10413e85d45d1e6a14da7388a60b78be60..c5e6d9695a01ae66fe32b32208ecf97b3cbdea48 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:9  6.0     20170408
+5:0:9  6.0     20170415
index 06f014d2746f89275f5b251026b0fb1b9cb3ed41..679e5ad7ece48a476dc5e36112f69f28d537e93e 100755 (executable)
--- 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;}
index 04e09bf3e024fee38c78b2993b295dba62fa7627..c3cf1fbe754e83d0de47028dccdc4b4ca29aaafc 100644 (file)
@@ -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 95d78c39c46dc5a56f54ea611c86d7220d633438..ff78c86255b2573c0262118837c1582b7c8508d3 100644 (file)
--- 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)
index 4aac86554b55822d693d88a85c1f7858555e48c9..1740bccb8c08b04b2203d8abf5cda9e8bca2438a 100755 (executable)
@@ -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"), #
index 3146ee8ded811ba7b993d559e8d4e357885575a4..c6dbccc8013678559a3b12283a52e784459c9ee4 100644 (file)
@@ -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  ""
index c0222d057d41898fd6f3d958702f3cec4be0e991..b97cc12bea8fc4d4bdfed9b059b74774788ec7bb 100644 (file)
@@ -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 *);
index 6adc3122206495fc0a7a1bacac9a5d3bd942015c..457a5c78f9e384c0a6591d4d52404d8e35536b13 100644 (file)
@@ -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 <esr@snark.thyrsus.com>                         *
  ****************************************************************************/
 
-/* $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
index 14fa7e9ae62d8700971eb1e705cbac991e6f1a2e..2644e15ac49132702ac8ef6c72efebbe5e716d2a 100644 (file)
 .\" 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
index a3ed8101d1927c5ffe20fe0706fcfcd1a59c2139..f0eb2afcf9cc5317388ad0aecd3ed415052394ef 100755 (executable)
@@ -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 <dickey@clark.net> 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,
index c0e652b6f44ff1dee98cfc8e5b9575db85aafce7..4a5a05cfb2ff91134c7851a440114d6304990735 100755 (executable)
@@ -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 <dickey@clark.net> 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.
index 5dfde643f6a125853024b3edb6a81d10cb084da8..4467fc6289d29d6f0f83caa9774245626157e073 100644 (file)
@@ -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 <unistd.h>,
  * and usually no sigaction() nor <termios.h>
index 89cacb28b479395a62e4c5cccc82b23a84a67a8b..e133858f28352331046b774fe6ef4e56ec2b990c 100644 (file)
@@ -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() */"
index 854270bc211a44adeb7c793a2283545135ce269d..6cbf36ec60687f67d2fa0deac4a7ff229d9a466e 100644 (file)
 #include <curses.priv.h>
 #include <tic.h>
 
-#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++;
index d01109c5dcd4833917bfbee64093ccd8604cfca1..fe17d45cc7f7ff2e598a868722e37539be67a8d1 100644 (file)
@@ -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 <nc_panel.h>
 
+#include <term.h>
+#include <nc_termios.h>
+
 #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 <term.h>
-#include <nc_termios.h>
+/*
+ * 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 <new_pair.h>
 
 /*
@@ -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);
index 41f1e6dbaceec07fe4073c154459b67ccec7b816..ebd3b5281869708116e408424393ff080f7f6785 100644 (file)
@@ -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)
index b88c9426bf94c60fdaf85165286327cd1fa97fa2..04255bae474168ca73bef0faa54a6b74f8dc1c5d 100644 (file)
@@ -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)
index 7fde5801e71e42b6f4ef10fdd3d77b05f6436fa9..3b9584c526fa6bbd605968102f34514916ef0815 100644 (file)
@@ -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)
index 057322866cd2a658fe2ed91d495bc16c2c7ec4b7..e6b459bc8ed5ba3d6d522f95eb57d692538c66c3 100644 (file)
@@ -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)
index dde89fdda7125e600192c1877519bd814afe2ca0..fe02949770849eb65d7904dea998d767e16258d3 100644 (file)
@@ -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)
index 079ef28e503891358034e4e3c1df962cb6da6f54..6677569c1d3a5021f146bdb668d3c4c075d88cc7 100644 (file)
@@ -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)
index dde89fdda7125e600192c1877519bd814afe2ca0..fe02949770849eb65d7904dea998d767e16258d3 100644 (file)
@@ -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)
index dde89fdda7125e600192c1877519bd814afe2ca0..fe02949770849eb65d7904dea998d767e16258d3 100644 (file)
@@ -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)
index 9b8949ac60d4c1cca957d90dc45408ec26a071f9..cf7e31756ed0d7a306f22d7cd7a6a1cef25c9264 100644 (file)
@@ -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 */
index 517161da17e6f222e967a84867947db568ad9429..41c9203418ef8ae2a905e334034035250774c580 100644 (file)
@@ -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 */
index 08c53d460373ee36a7c92942fe4ff053d4ba5a10..31376b54854c1010e4c5af848dea44f5da8943e6 100644 (file)
@@ -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 */
index 123ed9b82911f726f5711de14e962986230bee5d..5b8411c2260a1c1e0bfca6ff7258e37363589bd1 100644 (file)
@@ -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 */
index f5153d5b947b9a76f318511fea92b37ea8348058..4df40c6fcd14aa99eabacae7c7b91627f4d4c5c3 100644 (file)
@@ -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)
index c0acba4e32712cfa98295e84b59142893939ec01..4c4f39844d315faeb5bc680d453a1e0ee19b4359 100755 (executable)
@@ -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/\<short\>/NCURSES_INT2/g'
        done
 
        cat <<EOF
-static const TERMTYPE fallbacks[$#] =
+static const TERMTYPE2 fallbacks[$#] =
 {
 EOF
        comma=""
@@ -111,17 +111,18 @@ EOF
 fi
 
 cat <<EOF
-NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *name GCC_UNUSED)
+NCURSES_EXPORT(const TERMTYPE2 *)
+_nc_fallback2 (const char *name GCC_UNUSED)
 {
 EOF
 
 if [ "$*" ]
 then
        cat <<EOF
-    const TERMTYPE     *tp;
+    const TERMTYPE2    *tp;
 
     for (tp = fallbacks;
-        tp < fallbacks + sizeof(fallbacks)/sizeof(TERMTYPE);
+        tp < fallbacks + sizeof(fallbacks)/sizeof(TERMTYPE2);
         tp++) {
        if (_nc_name_match(tp->term_names, name, "|")) {
            return(tp);
@@ -133,8 +134,28 @@ else
 fi
 
 cat <<EOF
-    return((TERMTYPE *)0);
+    return((const TERMTYPE2 *)0);
 }
+
+#if NCURSES_EXT_NUMBERS
+#undef _nc_fallback
+
+/*
+ * This entrypoint is used by tack.
+ */
+NCURSES_EXPORT(const TERMTYPE *)
+_nc_fallback (const char *name)
+{
+    const TERMTYPE2 *tp = _nc_fallback2(name);
+    const TERMTYPE *result = 0;
+    if (tp != 0) {
+       static TERMTYPE temp;
+       _nc_export_termtype2(&temp, tp);
+       result = &temp;
+    }
+    return result;
+}
+#endif
 EOF
 
 if test -n "$tmp_info" ; then
index 14ea391188378882b7b7587dffb326b27337ae08..13bb3a020161498f00c3e6dd2b0765cbc01724b8 100644 (file)
@@ -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            *
@@ -47,7 +47,7 @@
 
 #include <tic.h>
 
-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;
        }
     }
 
index d0821a3050d0e9d951cb02a1baaa2fc3f5388777..4a1b691382c86fb6551f9c2d8063342d7c3fb18e 100644 (file)
@@ -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 <tic.h>
 
-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 */
index 9a0ce487b167b38c6e8e31e46c5f8420bb117c23..34e62163ceece0b87ce003125b4aec63dc8b2b63 100644 (file)
@@ -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            *
 
 #include <tic.h>
 
-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)
index 36674c4bb6b6e4555215bdb1afdcad3b56a12fed..3ac0b75f9822c9ef83fc44a821cea2504a0a4483 100644 (file)
@@ -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 <ctype.h>
 #include <tic.h>
 
-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;
index e84033d47f1d527519b459d2a49a693d87d9431a..12674591bdd6d163771c9527dca28c796f3f62b0 100644 (file)
@@ -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 <tic.h>
 
-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
index ad056ba4545b55feb9d9254ff17fe30f970d0aeb..351cda933c7539347c08e1cceadfb36e0ddb3620 100644 (file)
@@ -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            *
 
 #include <tic.h>
 
-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;
 
index c583aa7edaf5afc14b143114637bf357c9c368e6..a61a65561bbf83fb62dc29067636842291b7abdf 100644 (file)
 #include <curses.priv.h>
 #include <termcap.h>           /* 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;
 
index f1666dfff3b0ebaf32f60403230863e23ac3fc92..c1e2911af91996f7d38ea57e772ebff86f8ee93b 100644 (file)
@@ -42,7 +42,7 @@
 
 #include <curses.priv.h>
 
-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 */
index b736d5fcab40c065840705d1705bec03863e9da3..c8e75a3599f5b14f1d3ba27df4609152b0452fe7 100644 (file)
@@ -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 {
index a207fe0d920c5ee1e9dc17045e4c476f177c736e..173b3a36551a9525eacc67a49e1e001f62d78199 100644 (file)
@@ -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 <curses.priv.h>
 
-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 <sys/termio.h>                /* 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");
index 2d182622d100c86d90df7901f567246eb09529c6..67a2a0aa828eafcbfd29efc59fd950154ad76ac2 100644 (file)
@@ -48,7 +48,7 @@
 #include <locale.h>
 #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;
index 817f28f7f8354d566fdcc816da9545b8f698baf7..a8addc6c5e10bd018263e3024f04bd366968a991 100644 (file)
@@ -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;
index d900737b76372abe9d7d292d8f5da20df0f052f1..b1b7f72c902c0fd1f7a92a245df3ff96c728ff5f 100644 (file)
@@ -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 <tic.h>
 
-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;
 
index 802b520fa55dd2b7eb2078b47bd58fe5c83aa93f..d814594854aa44c1f5ac018c0a198a33f1b0d294 100644 (file)
@@ -47,7 +47,7 @@
 #include <ctype.h>
 #include <tic.h>
 
-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 <parametrized.h>
 #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
index 52255c05bf3f131525e3b69ec1661a3dc39d8bdd..3cb0241095dd622e117b6fd5ec6d9a7031fef4d2 100644 (file)
@@ -41,7 +41,7 @@
 
 #include <tic.h>
 
-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
index 28512c252e2a4161a129df7d9efe99e1b2aca0df..8cc643d6989d9fc0e2a28304624bba2ef9352877 100644 (file)
@@ -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 <sys/types.h>
 #include <tic.h>
 
-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
 
index 477cbbc24f37221b5742c954660a4990bc8fa8c2..21004732068a0a2f55b3c1d5fe79ebf371e04591 100644 (file)
 
 /****************************************************************************
  *  Author: Juergen Pfeifer                                                 *
- *                                                                          *
+ *     and: Thomas E. Dickey                                                *
  ****************************************************************************/
 
 #include <curses.priv.h>
-#define CUR ((TERMINAL*)TCB)->type.
+#define CUR TerminalType((TERMINAL*)TCB).
 #include <tic.h>
 #include <termcap.h>           /* 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);
index ec5e2b78dbf0344ebaf7530001fa649f6a4d6eac..4cbcb6506772c21a9fdd67398b952422be7b19a0 100644 (file)
@@ -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 <tic.h>
 
-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;
 
index 8a49a2c0d7f4b005f740f0a03b456a72ddd7631d..e0a72670e8c6c225d9bf21afb6e76cefe1c4ae22 100644 (file)
@@ -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);
        }
index 4e285ba66796ad70251c4d22d680e0787adb882b..d75f694823db490f13ba85dbc0624b207d4b0d6c 100644 (file)
@@ -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            *
 #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) {
index cc9fd2b293ee137a47a32f3725378d91985243c4..7f4dc60bb0f9a84783080958cc79f1369cb1babd 100644 (file)
@@ -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 <psapi.h>
 
-#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 <term.h> 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) {
index b2710ff97fb2920c5d0180e85ba08e93be6deebd..3c3f9da3503c5503a4e247c4d39b3ecca55323cd 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20170408) unstable; urgency=low
+ncurses6 (6.0+20170415) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 02 Apr 2017 06:36:57 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 09 Apr 2017 06:43:26 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index b2710ff97fb2920c5d0180e85ba08e93be6deebd..3c3f9da3503c5503a4e247c4d39b3ecca55323cd 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20170408) unstable; urgency=low
+ncurses6 (6.0+20170415) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 02 Apr 2017 06:36:57 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 09 Apr 2017 06:43:26 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 29f1d05f416c818621c2a9dfd018d66bb9918fc0..a57b5a1ca3dec0b288faa76f569a89257e0e4706 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20170408) unstable; urgency=low
+ncurses6 (6.0+20170415) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 02 Apr 2017 06:36:57 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 09 Apr 2017 06:43:26 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index c0bfb2c0da69885d83cb6cadc258ccb4485a311a..8f7f2daad560657031cfdf8327812590e47f4bf9 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.206 2017/04/02 10:36:57 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.207 2017/04/09 10:43:26 tom Exp $\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "0"\r
 !define VERSION_YYYY  "2017"\r
-!define VERSION_MMDD  "0408"\r
+!define VERSION_MMDD  "0415"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 73a2bb4058900ef873e768a9975a8974072467e0..97bb3e28d2059b5e0b1957d690f70762642aeb9e 100644 (file)
@@ -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
index 6965504e1f3a557b9c566430c088cf0794f19570..2d0426b854c141d18d8f6e2d80b33b0afbdabcb1 100644 (file)
@@ -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;
index b6ca9aa940bdf77575c0633aa6ed4d9199f8aadd..5be1fd860bc5df1f5862e8781d41daf64d8c2cba 100644 (file)
@@ -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
index f805fa5d0ebbb61ac152545b9f8d3c2d1c155128..5b405b04c01944fe6ab538f4867b2131bfbfa110 100644 (file)
@@ -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
index 0a9da88d05d14fe98151a009cfb2ad79db4e37a8..644d6f6f4938409bc4e4259b8c60886fca3c7e0c 100644 (file)
@@ -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;
index e3bb77a03c5569f388e4b4366b61aa630218ec9b..9d0e0e3266571842b6b1dce8019a2225e711331e 100644 (file)
@@ -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
index de92ca8fc343348e6927b3c0a18b529570bc1932..1ac236d50d8ae06a4b96c0afb9e777ddd96275b8 100644 (file)
@@ -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;
index 70dde631b2e56e5288c2971898b503c9387f9ded..863294cf42e37c13bb311fdf293509cc3791b6f9 100644 (file)
@@ -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
index 01e0203b856309ac644fed3de5117448dd46d85f..dae1911d751e877062fdd28b8a9f4991ca695b97 100644 (file)
@@ -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;
index b9c3458f44286a30ae2cd1eb79f22f04043909f4..2e4191e192d4897627ebac047cf742c024bbbb85 100644 (file)
@@ -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
index db4071877a3cd3dfd577d36992741c8c8816d426..d48016e4813003f51f9494282dfcbec479612432 100644 (file)
@@ -39,7 +39,7 @@
 #include "termsort.c"          /* this C file is generated */
 #include <parametrized.h>      /* 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;
index 0746683ca605e29d38279ab6d19e4bb704891d0b..f93f7aae52d479057e3fc36485151c3685fcfc9a 100644 (file)
@@ -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 "}"
index 6035179ca508640bcb5c3b19f49e86149bf3b6e6..82c48419a047f6ddce2ff02d350c103b604b7ad7 100644 (file)
@@ -42,7 +42,7 @@
 
 #include <dump_entry.h>
 
-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);
            }
index a9d3d0489a676e75e6442bdab9ba63a4a31546dc..85d3acc6524054dde251b7715c1dc075e6d8d8a0 100644 (file)
@@ -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 */
index ee60e7bc4158930ca2f928ed9ea229b59206b59b..cfcbc359152653a5f315400f86d91c1c1b362425 100644 (file)
@@ -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 <parametrized.h>
 #include <transform.h>
 
-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 "<stdin>"
 
@@ -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;
 
index 0d299b457dfb9d61c555cef71897f8f04325a076..030230dcea31061e68b23f564c4c77403afbd4b6 100644 (file)
@@ -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 <hashed_db.h>
 #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, &lterm);
                    }
-                   _nc_free_termtype(&lterm);
+                   _nc_free_termtype2(&lterm);
                    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;
index 291851b80e8b595841d382f280d5f0206d0e2e47..e9f266e17f92133e3c23e6eb7dc6da87f4e24e4d 100644 (file)
@@ -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();
 
index 376a764b6d10d0214789bd8767ca4f283c977a7c..cb088ee830d65e08caccc37f68174e1b764cf37f 100644 (file)
@@ -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 <test.priv.h>
@@ -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')
index cb9a333bff0d72bb0f3f265a99599ccef7bd636a..e529e2783ed8347bb7d7e6e7b9258318988e66ed 100644 (file)
--- 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 <test.priv.h>
@@ -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())
index 919b5c9e3b98a2fcf6b0b9eff7b6bcdf1d95d6ab..1a605fdd569723f748a3d52fcdfa3134e84bc6ec 100644 (file)
@@ -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            *
  * 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 <test.priv.h>
+#include <popup_msg.h>
 
 #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)) {
index 7f575c9c3f3c16cb7ef79fc48d5c4816f7f328f2..ef55954ee99d4f55779c3a600e381d4912ce9c86 100644 (file)
@@ -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            *
  * 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 <test.priv.h>
+#include <popup_msg.h>
 
 #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)) {
index 05914718ff79a7609d74f2480895c2c9f67711ac..39b8f292dfedf23656359917d97f1ed1e266d74c 100644 (file)
@@ -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
index f891b0407b85ed0067164af9c1c438aaf1317989..e3a11122b8c15a6d170161b5f903611a3a0f66fc 100644 (file)
@@ -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();
index 8724d9819ea05ab51af3a34beff13a9b55b098f1..ea9604efe8d2f6b2c80baff1f8410bc158977287 100644 (file)
@@ -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 : "<null>");
index a0d069c06011cd6349d934e7c2796bc507a6c072..1070c06ae2290ad91e5806b8eb0d2ad243cf5cb4 100644 (file)
  * 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 <test.priv.h>
 #include <time.h>
+#include <popup_msg.h>
 
 #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));
index e72ac475205acf819ddd409a1ebe08f101db5756..d28592511c835fe20aac3afed38b0907967ec74a 100644 (file)
@@ -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) {
index e6322fdcc20e82f2505a5f4f968348ff6c2d359d..134e9e2cacea186cecd1013b064eaade580806ae 100644 (file)
@@ -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
 
index c344280a9c51fa8cccdf1a8db491975bba8307ae..b3713888a3cf97c5136ff9e56551402cb5a33c6f 100644 (file)
@@ -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;
     }
index 9918e368c564ca059fc923a72f0bf4ab01e7e007..53829e246012e97230af66f855abfca3e7db2097 100644 (file)
@@ -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.
  */
index b2cf99bbef78f73accb2f7e0fb8f62c1607b1bbd..75916ba76f29f57b64d48248ae213e65eaa2a5e5 100644 (file)
@@ -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);
 }
index 8c58cd6a6bf5d25ef503ad1bf3e0c34aab68eb78..f1a2ced48421fbb78e40e03f584f0f1e90d4b66d 100644 (file)
@@ -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 <edit_field.h>
+#include <popup_msg.h>
 
 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);
index 3c5b80ec12ea08dc348380adca86ec2b9c318e31..f0c8315619c0a55a19b3abac80c77be4ca7db3ce 100644 (file)
@@ -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 */
index 72064911bf72147391bab0d952385dad0a97b2e3..437ed5683e2460347d718d5dea3dba1fc004bde7 100644 (file)
@@ -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 <test.priv.h>
@@ -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;
index 3e928af8cc5692aebdff82265b574e5968a04cec..868ca70291229896ca032b234a56baa47349da57 100644 (file)
@@ -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            *
  ****************************************************************************/
 
 /*
- * $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 <locale.h>
-
 #include <test.priv.h>
+#include <popup_msg.h>
 
 #if USE_WIDEC_SUPPORT && USE_LIBFORM && (defined(NCURSES_VERSION_PATCH) && NCURSES_VERSION_PATCH >= 20131207)
 
 int
 main(void)
 {
-    FIELD *field[3];
+    static const char *help[] =
+    {
+       "Commands:",
+       "  ^D,^Q,ESC           - quit program",
+       "  <Tab>,<Down>        - move to next field",
+       "  <BackTab>,<Up>      - 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);
index 849922173c8f43877d8262fc6a5beceeb8232d2c..658681540fd19c7075e3d368e6ece49978920bd2 100644 (file)
@@ -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 <test.priv.h>
@@ -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);
index 3d31f1787fa2e84b645698b8c01b5e8f1c2da678..82e95f80ac8738466087b89261c7ddc5920223ef 100644 (file)
@@ -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 <test.priv.h>
+#include <popup_msg.h>
 
 #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;
index be3aab86f57829499c1b4d4156414023868dd040..55ab8bab9aa4f93f9277c9eadc8aba2194fbc045 100644 (file)
@@ -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 <test.priv.h>
+#include <popup_msg.h>
 
 #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;
index 34fb388db7f60fe5e75f87e8e4d71c9ef055734a..84fc9996dcca36a48dd6c833cd26b1b3c7a826a6 100644 (file)
@@ -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            *
  * 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 <test.priv.h>
+#include <popup_msg.h>
 
 #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)) {
index ae9d223441bfbc0ab3d1e14f0fcf1e550e72f53c..878c113dc53b1caab2feb42e9d497d7afdce9b2a 100644 (file)
@@ -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 <esr@snark.thyrsus.com> 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 <test.priv.h>
@@ -734,7 +734,7 @@ play(void)
            case 'x':
                goto dropout;
 
-           case '?':
+           case HELP_KEY_1:
                show_help(&keyhelp);
                break;
 
index 119982efc5bc8bbbda532cf1c673b7be556ba8d3..710842a97337f613cb77adf3342b73cab2819bff 100644 (file)
@@ -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)
 
index 91c7266ad77998834cfe1b499303638342fc08a4..d1e8dee8b7848f739c09ec733e4ae3f679b177ec 100644 (file)
@@ -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 <test.priv.h>
 #include <stdarg.h>
+#include <popup_msg.h>
 
 #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':
index 2130572735aff1f18d139ff006755c2eff659c4c..bb343c593a1d559b4766fa668414f5dd3ddf463d 100644 (file)
@@ -40,7 +40,7 @@ AUTHOR
    Author: Eric S. Raymond <esr@snark.thyrsus.com> 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("<NULL>");
        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 (file)
index 0000000..0b151fe
--- /dev/null
@@ -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 <test.priv.h>
+
+#include <popup_msg.h>
+
+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 (file)
index 0000000..1b0ef1e
--- /dev/null
@@ -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 <test.priv.h>
+
+extern void popup_msg(WINDOW *parent, const char *const *msg);
+extern void popup_msg2(WINDOW *parent, char **msg);
+
+#endif /* POPUP_MSG_H_incl */
index 5e24f6b86d29d8eabe8d865d418fcded34ea2ddd..2120cc798201f9ca5a82908049410802a21d194e 100644 (file)
@@ -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
 
index 0f123ba87b51f522e7220c09618a2ff60c2e3beb..f5ec33ac74aaff25d0da6d249bee633b568da92d 100644 (file)
@@ -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            *
  * 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 <test.priv.h>
+#include <popup_msg.h>
 
 /* 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",
+       " <space>    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);
     }
index 9cb0de95a809a3e66845e559648668dacf8f51f7..b74c6e53739c9ec6d141c3794d9df89656ac8106 100644 (file)
@@ -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            *
  * 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 <test.priv.h>
+#include <popup_msg.h>
 
 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)));
            }
index 3b8ef47ec8a326f43e7d1b6268af66e8734a2ed7..9ace6a701fe99cee6e47e2f56260c361592a480d 100644 (file)
@@ -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            *
  * 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 <test.priv.h>
+#include <popup_msg.h>
 
 #if HAVE_SCR_DUMP
 
 # 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",
        "   <space>     load the next screen",
        "   <backspace> 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);
            }
        }
index 8e42ad32fdd508557d3962bb37f1d54bca8e219c..fdc6425714d25e6d3ebf9d35f6bd619c5f1bd2de 100644 (file)
@@ -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);
 }
 
index ae0eb6bb12b46e6a93b6928cb0e8214f496f24c5..a57903580d09f697c7f15fc9a3cd260e6ae12037 100644 (file)
@@ -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 <bsd/string.h>
@@ -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.
index 58ff87d5af212b0e9a1517ad63a76222ab1404eb..3e7f1bafcd80ab1b5a56db5a278b7811c778be78 100644 (file)
@@ -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
 #define WIDE_LINEDATA
 #include <linedata.h>
 
+#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);
index 29bf9d5ecef7e3c5890751995a0b005dfc936a8c..4bcc25b8ff23d12edb9e1b2204be34c90dd5e0a0 100644 (file)
@@ -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 <linedata.h>
 
+/*
+ * 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);
index c553d23f06955395561752d2e2d3afe36b172fa5..cc5c89fe789a27c042b0a6f0c0394b636b017f17 100644 (file)
@@ -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 <linedata.h>
 
+/*
+ * 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);
 }
index f836a78ea89a9944dbca66fa9c71c6788df209f9..75a100dd0266fac14f175245272fc7ee65833207 100644 (file)
@@ -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
 #define WIDE_LINEDATA
 #include <linedata.h>
 
+#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);
 }
index e4b9fb1d391a013f65e0dd4c3a44cd679f40d8b3..9cdeb0c496c9a0247f28e08fc1cda8af12a527e8 100644 (file)
@@ -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
  *
index dc01b0e69c07b325a056ce81047cfc53a5abfb6e..a3037b1bf61d331136d48ef972019c9675ce0579 100644 (file)
@@ -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);
index 3f64c77b4858cb20931a0f62d85d10606bb58892..4c243092b75460ec9c2d63ba4e12d060548752c8 100644 (file)
@@ -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);
index e203cc6594780b1eccb3ae60b547e122c25a2894..fa33076cda1082b13ff822de04aebf9c5a0c5ffd 100644 (file)
@@ -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);
index 3d2656f3aeae0909952bc771300ca3f0abcc75a3..5bd46c9a310fc5832cff185a5181398f67b99bd1 100644 (file)
@@ -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);
index 5d94cda05751a7a841c66f9700fa465215cea2d6..da073151e3fb98d0225938f4bc4426ac203e1f04 100644 (file)
@@ -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            *
  * 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 <test.priv.h>
 #include <widechars.h>
+#include <popup_msg.h>
 
 #include <time.h>
 
@@ -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,<Up>         - scroll the viewport up by one row",
+       "  n,<Down>       - scroll the viewport down by one row",
+       "  l,<Left>       - scroll the viewport left by one column",
+       "  r,<Right>      - scroll the viewport right by one column",
+       "",
+       "  h,<Home>       - scroll the viewport to top of file",
+       "  e,<End>        - 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()",
+       "  <space>        - 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);
index 5f645ac6d7bea71044a9c04f41657715da217ade..365266af8da2431ee77e432e5546edfcfb43eb0e 100644 (file)
@@ -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 <test.priv.h>