From 3ec8f79f3ceda990461c80de2f96d66b886e00d5 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 6 May 2007 00:26:41 +0000 Subject: [PATCH 1/1] ncurses 5.6 - patch 20070505 + fix a bug in Ada95/samples/ncurses which caused a variable to become uninitialized in the "b" test. + fix Ada95/gen/Makefile.in adahtml rule to account for recent movement of files, fix a few incorrect manpage references in the generated html. + add Ada95 binding to _nc_freeall() as Curses_Free_All to help with memory-checking. + correct some functions in Ada95 binding which were using return value from C where none was returned: idcok(), immedok() and wtimeout(). + amend recent changes for Ada95 binding to make it build with Cygwin's linker, e.g., with configure options --enable-broken-linker --with-ticlib --- Ada95/gen/Makefile.in | 13 +- Ada95/gen/gen.c | 4 +- .../terminal_interface-curses-menus.ads.m4 | 6 +- Ada95/gen/terminal_interface-curses.adb.m4 | 36 +- Ada95/gen/terminal_interface-curses.ads.m4 | 12 +- Ada95/samples/ncurses2-attr_test.adb | 11 +- Ada95/samples/ncurses2-m.adb | 5 +- Ada95/samples/rain.adb | 4 +- Ada95/samples/sample.adb | 4 +- NEWS | 16 +- configure | 6 +- configure.in | 6 +- dist.mk | 4 +- doc/html/ada/funcs/B.htm | 4 +- doc/html/ada/funcs/C.htm | 19 +- doc/html/ada/funcs/D.htm | 14 +- doc/html/ada/funcs/E.htm | 6 +- doc/html/ada/funcs/F.htm | 4 +- doc/html/ada/funcs/G.htm | 9 +- doc/html/ada/funcs/H.htm | 10 +- doc/html/ada/funcs/I.htm | 18 +- doc/html/ada/funcs/K.htm | 8 +- doc/html/ada/funcs/L.htm | 6 +- doc/html/ada/funcs/M.htm | 16 +- doc/html/ada/funcs/N.htm | 22 +- doc/html/ada/funcs/O.htm | 4 +- doc/html/ada/funcs/P.htm | 8 +- doc/html/ada/funcs/Q.htm | 2 +- doc/html/ada/funcs/R.htm | 12 +- doc/html/ada/funcs/S.htm | 48 +- doc/html/ada/funcs/T.htm | 8 +- doc/html/ada/funcs/U.htm | 8 +- doc/html/ada/funcs/W.htm | 89 +- doc/html/ada/table.html | 334 +- .../terminal_interface-curses-menus__ads.htm | 24 +- .../terminal_interface-curses-mouse__adb.htm | 12 +- ...erminal_interface-curses-terminfo__adb.htm | 4 +- ...inal_interface-curses-text_io-aux__adb.htm | 4 +- ...terminal_interface-curses-text_io__adb.htm | 34 +- .../ada/terminal_interface-curses__adb.htm | 2898 ++++++++--------- .../ada/terminal_interface-curses__ads.htm | 842 +++-- include/tic.h | 4 +- ncurses/base/lib_freeall.c | 6 +- ncurses/tinfo/init_keytry.c | 4 +- ncurses/tty/hashmap.c | 6 +- ncurses/tty/lib_mvcur.c | 4 +- 46 files changed, 2330 insertions(+), 2288 deletions(-) diff --git a/Ada95/gen/Makefile.in b/Ada95/gen/Makefile.in index 82c7284a..f56871af 100644 --- a/Ada95/gen/Makefile.in +++ b/Ada95/gen/Makefile.in @@ -28,7 +28,7 @@ # # Author: Juergen Pfeifer, 1996 # -# $Id: Makefile.in,v 1.56 2007/04/07 21:45:46 tom Exp $ +# $Id: Makefile.in,v 1.58 2007/05/05 19:54:57 tom Exp $ # .SUFFIXES: @@ -434,9 +434,14 @@ adahtml: @mkdir -p $(HTML_DIR) cp -p ../src/*.ad[sb] . && chmod +w *.ad[sb] ln -sf ../src/*.ali . - for f in $(GEN_SRC); do \ + @echo "Filtering generated files" + @for f in $(GEN_SRC); do \ + h=`basename $$f` ;\ g=`basename $$f .ads.m4` ;\ - $(M4) $(M4FLAGS) -DM4MACRO=html.m4 $$f | $(DEL_ADAMODE) > $$g.ads ;\ + if test "$$g" != "$$h" ; then \ + $(M4) $(M4FLAGS) -DM4MACRO=html.m4 $$f | $(DEL_ADAMODE) > $$g.ads ;\ + echo "... $$g.ads" ;\ + fi \ done @-rm -f $(HTML_DIR)/$(ALIB)*.htm* $(GNATHTML) -d -f $(ALIB)*.ads @@ -449,7 +454,7 @@ adahtml: sed -e 's/3X/3x/g' |\ sed -e 's/$$\([ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxz0123456789_]*:.*\)\$$/@\1@/' |\ sed -e 's%</A>%%g' > $$a.tmp ;\ - mv $$a.tmp $$f ;\ + mv $$a.tmp $$f ;\ done @rm -f *.ad[sb] *.ali *.tmp @for f in funcs.htm main.htm ; do \ diff --git a/Ada95/gen/gen.c b/Ada95/gen/gen.c index 86cfd0e1..3394aa4c 100644 --- a/Ada95/gen/gen.c +++ b/Ada95/gen/gen.c @@ -32,7 +32,7 @@ /* Version Control - $Id: gen.c,v 1.47 2007/04/07 22:29:23 tom Exp $ + $Id: gen.c,v 1.48 2007/05/05 17:24:36 tom Exp $ --------------------------------------------------------------------------*/ /* This program generates various record structures and constants from the @@ -775,7 +775,7 @@ gen_acs(void) { printf(" type C_ACS_Map is array (Character'Val (0) .. Character'Val (127))\n"); printf(" of Attributed_Character;\n"); -#if USE_REENTRANT +#if USE_REENTRANT || BROKEN_LINKER printf(" type C_ACS_Ptr is access C_ACS_Map;\n"); printf(" function ACS_Map return C_ACS_Ptr;\n"); printf(" pragma Import (C, ACS_Map, \"_nc_acs_map\");\n"); diff --git a/Ada95/gen/terminal_interface-curses-menus.ads.m4 b/Ada95/gen/terminal_interface-curses-menus.ads.m4 index 7b87274c..17993e1f 100644 --- a/Ada95/gen/terminal_interface-curses-menus.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-menus.ads.m4 @@ -38,8 +38,8 @@ include(M4MACRO)dnl ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.26 $ --- $Date: 2006/06/25 14:30:22 $ +-- $Revision: 1.27 $ +-- $Date: 2007/05/05 20:20:52 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Menu_Base_Defs') @@ -360,7 +360,7 @@ include(`Item_Rep')dnl -- Implemented as function pragma Inline (Mark); - -- MANPAGE(`menu_attribs.3x') + -- MANPAGE(`menu_attributes.3x') -- ANCHOR(`set_menu_fore()',`Set_Foreground') procedure Set_Foreground diff --git a/Ada95/gen/terminal_interface-curses.adb.m4 b/Ada95/gen/terminal_interface-curses.adb.m4 index c1234106..31654592 100644 --- a/Ada95/gen/terminal_interface-curses.adb.m4 +++ b/Ada95/gen/terminal_interface-curses.adb.m4 @@ -37,8 +37,8 @@ include(M4MACRO)---------------------------------------------------------------- ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.2 $ --- $Date: 2007/03/31 23:02:22 $ +-- $Revision: 1.4 $ +-- $Date: 2007/05/05 20:09:10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System; @@ -913,7 +913,7 @@ package body Terminal_Interface.Curses is Mode : in Timeout_Mode; Amount : in Natural) is - function Wtimeout (Win : Window; Amount : C_Int) return C_Int; + procedure Wtimeout (Win : Window; Amount : C_Int); pragma Import (C, Wtimeout, "wtimeout"); Time : C_Int; @@ -927,9 +927,7 @@ package body Terminal_Interface.Curses is end if; Time := C_Int (Amount); end case; - if Wtimeout (Win, Time) = Curses_Err then - raise Curses_Exception; - end if; + Wtimeout (Win, Time); end Set_Timeout_Mode; procedure Set_Escape_Timer_Mode @@ -993,12 +991,10 @@ package body Terminal_Interface.Curses is (Win : in Window := Standard_Window; Do_Idc : in Boolean := True) is - function IDC_Ok (W : Window; Flag : Curses_Bool) return C_Int; + procedure IDC_Ok (W : Window; Flag : Curses_Bool); pragma Import (C, IDC_Ok, "idcok"); begin - if IDC_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idc))) = Curses_Err then - raise Curses_Exception; - end if; + IDC_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idc))); end Use_Insert_Delete_Character; procedure Leave_Cursor_After_Update @@ -1017,12 +1013,10 @@ package body Terminal_Interface.Curses is (Win : in Window := Standard_Window; Mode : in Boolean := False) is - function Immedok (Win : Window; Mode : Curses_Bool) return C_Int; + procedure Immedok (Win : Window; Mode : Curses_Bool); pragma Import (C, Immedok, "immedok"); begin - if Immedok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then - raise Curses_Exception; - end if; + Immedok (Win, Curses_Bool (Boolean'Pos (Mode))); end Immediate_Update_Mode; procedure Allow_Scrolling @@ -2406,6 +2400,20 @@ include(`Public_Variables') begin return Fill_String (Result); end Curses_Version; +------------------------------------------------------------------------------ + procedure Curses_Free_All is + procedure curses_freeall; + pragma Import (C, curses_freeall, "_nc_freeall"); + begin + -- Use this only for testing: you cannot use curses after calling it, + -- so it has to be the "last" thing done before exiting the program. + -- This will not really free ALL of memory used by curses. That is + -- because it cannot free the memory used for stdout's setbuf. The + -- _nc_free_and_exit() procedure can do that, but it can be invoked + -- safely only from C - and again, that only as the "last" thing done + -- before exiting the program. + curses_freeall; + end Curses_Free_All; ------------------------------------------------------------------------------ function Use_Extended_Names (Enable : Boolean) return Boolean is diff --git a/Ada95/gen/terminal_interface-curses.ads.m4 b/Ada95/gen/terminal_interface-curses.ads.m4 index afe65f43..4abc55eb 100644 --- a/Ada95/gen/terminal_interface-curses.ads.m4 +++ b/Ada95/gen/terminal_interface-curses.ads.m4 @@ -37,8 +37,8 @@ include(M4MACRO)---------------------------------------------------------------- ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.39 $ --- $Date: 2007/03/31 23:36:32 $ +-- $Revision: 1.41 $ +-- $Date: 2007/05/05 20:33:52 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Base_Defs') @@ -1474,7 +1474,7 @@ include(`ACS_Map')dnl -- Window or if you pass the Null_Window as argument. -- We don't inline this procedure - -- MANPAGE(`dft_fgbg.3x') + -- MANPAGE(`default_colors.3x') -- ANCHOR(`use_default_colors()',`Use_Default_Colors') procedure Use_Default_Colors; @@ -1498,6 +1498,12 @@ include(`ACS_Map')dnl function Use_Extended_Names (Enable : Boolean) return Boolean; -- AKA + -- MANPAGE(`curs_trace.3x') + + -- ANCHOR(`_nc_freeall()',`Curses_Free_All') + procedure Curses_Free_All; + -- AKA + -- MANPAGE(`curs_scr_dump.3x') -- ANCHOR(`scr_dump()',`Screen_Dump_To_File') diff --git a/Ada95/samples/ncurses2-attr_test.adb b/Ada95/samples/ncurses2-attr_test.adb index 20a653a7..c5fbc2c1 100644 --- a/Ada95/samples/ncurses2-attr_test.adb +++ b/Ada95/samples/ncurses2-attr_test.adb @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Eugene V. Melaragno 2000 -- Version Control --- $Revision: 1.7 $ --- $Date: 2007/03/31 23:45:22 $ +-- $Revision: 1.8 $ +-- $Date: 2007/05/05 21:28:18 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; @@ -56,7 +56,7 @@ procedure ncurses2.attr_test is attr : Character_Attribute_Set; name : String; once : Boolean) return Line_Position; - procedure attr_getc (skip : out Integer; + procedure attr_getc (skip : in out Integer; fg, bg : in out Color_Number; result : out Boolean); @@ -233,8 +233,9 @@ procedure ncurses2.attr_test is return row + 2; end show_attr; - procedure attr_getc (skip : out Integer; fg, bg : in out Color_Number; - result : out Boolean) is + procedure attr_getc (skip : in out Integer; + fg, bg : in out Color_Number; + result : out Boolean) is ch : constant Key_Code := Getchar; nc : constant Color_Number := Color_Number (Number_Of_Colors); begin diff --git a/Ada95/samples/ncurses2-m.adb b/Ada95/samples/ncurses2-m.adb index 20ab7213..13a3199a 100644 --- a/Ada95/samples/ncurses2-m.adb +++ b/Ada95/samples/ncurses2-m.adb @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Eugene V. Melaragno 2000 -- Version Control --- $Revision: 1.6 $ --- $Date: 2006/06/25 14:24:40 $ +-- $Revision: 1.7 $ +-- $Date: 2007/05/05 18:02:40 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- TODO use Default_Character where appropriate @@ -442,6 +442,7 @@ package body ncurses2.m is exit when command = 'q'; end loop; + Curses_Free_All; return 0; -- TODO ExitProgram(EXIT_SUCCESS); end main; diff --git a/Ada95/samples/rain.adb b/Ada95/samples/rain.adb index c576f3f3..a2a86a6c 100644 --- a/Ada95/samples/rain.adb +++ b/Ada95/samples/rain.adb @@ -36,7 +36,8 @@ -- Author: Laurent Pautet -- Modified by: Juergen Pfeifer, 1997 -- Version Control --- $Revision: 1.6 $ +-- $Revision: 1.7 $ +-- $Date: 2007/05/05 18:54:03 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- -- @@ -158,5 +159,6 @@ begin Visibility := Normal; Set_Cursor_Visibility (Visibility); End_Windows; + Curses_Free_All; end Rain; diff --git a/Ada95/samples/sample.adb b/Ada95/samples/sample.adb index 962963ed..0d509a1d 100644 --- a/Ada95/samples/sample.adb +++ b/Ada95/samples/sample.adb @@ -35,7 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.14 $ +-- $Revision: 1.15 $ +-- $Date: 2007/05/05 18:46:21 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Text_IO; @@ -204,6 +205,7 @@ package body Sample is -- We have some fixed key throughout this sample Main_Menu; End_Windows; + Curses_Free_All; exception when Event : others => diff --git a/NEWS b/NEWS index bcaa2740..a2c32ca6 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.1121 2007/04/28 19:06:11 tom Exp $ +-- $Id: NEWS,v 1.1124 2007/05/05 21:31:43 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,20 @@ 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. +20070505 + + fix a bug in Ada95/samples/ncurses which caused a variable to + become uninitialized in the "b" test. + + fix Ada95/gen/Makefile.in adahtml rule to account for recent + movement of files, fix a few incorrect manpage references in the + generated html. + + add Ada95 binding to _nc_freeall() as Curses_Free_All to help with + memory-checking. + + correct some functions in Ada95 binding which were using return value + from C where none was returned: idcok(), immedok() and wtimeout(). + + amend recent changes for Ada95 binding to make it build with + Cygwin's linker, e.g., with configure options + --enable-broken-linker --with-ticlib + 20070428 + add a configure check for gcc's options for inlining, use that to quiet a warning message where gcc's default behavior changed from diff --git a/configure b/configure index 2608d0cb..0b659325 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1.418 . +# From configure.in Revision: 1.419 . # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52.20061216. # @@ -11492,7 +11492,7 @@ if test "${cf_cv_gcc_inline+set}" = set; then else cf_save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS --param max-inline-insns-single=500" + CFLAGS="$CFLAGS --param max-inline-insns-single=1200" cat >conftest.$ac_ext <<_ACEOF #line 11497 "configure" #include "confdefs.h" @@ -11536,7 +11536,7 @@ cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= -for cf_add_cflags in --param max-inline-insns-single=500 +for cf_add_cflags in --param max-inline-insns-single=1200 do case $cf_fix_cppflags in no) diff --git a/configure.in b/configure.in index ff7de3cc..30e76600 100644 --- a/configure.in +++ b/configure.in @@ -28,14 +28,14 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: configure.in,v 1.418 2007/04/28 18:54:05 tom Exp $ +dnl $Id: configure.in,v 1.419 2007/05/05 15:45:26 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.13.20020210) -AC_REVISION($Revision: 1.418 $) +AC_REVISION($Revision: 1.419 $) AC_INIT(ncurses/base/lib_initscr.c) AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) @@ -1137,7 +1137,7 @@ CF_SYS_TIME_SELECT ### checks for compiler characteristics AC_LANG_C AC_C_CONST -CF_C_INLINE(NCURSES_INLINE,500) +CF_C_INLINE(NCURSES_INLINE,1200) CF_SIG_ATOMIC_T if test $NCURSES_CHTYPE = auto ; then diff --git a/dist.mk b/dist.mk index f894cf5f..3c7eb78b 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.591 2007/04/26 19:32:38 tom Exp $ +# $Id: dist.mk,v 1.592 2007/05/05 15: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 = 5 NCURSES_MINOR = 6 -NCURSES_PATCH = 20070428 +NCURSES_PATCH = 20070505 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/doc/html/ada/funcs/B.htm b/doc/html/ada/funcs/B.htm index a090bf40..dc182cc9 100644 --- a/doc/html/ada/funcs/B.htm +++ b/doc/html/ada/funcs/B.htm @@ -4,8 +4,8 @@

Functions - B

[index] diff --git a/doc/html/ada/funcs/C.htm b/doc/html/ada/funcs/C.htm index c99df903..66bead8f 100644 --- a/doc/html/ada/funcs/C.htm +++ b/doc/html/ada/funcs/C.htm @@ -4,24 +4,25 @@

Functions - C

[index] diff --git a/doc/html/ada/funcs/D.htm b/doc/html/ada/funcs/D.htm index 4e2a0285..d3317d21 100644 --- a/doc/html/ada/funcs/D.htm +++ b/doc/html/ada/funcs/D.htm @@ -4,19 +4,19 @@

Functions - D

[index] diff --git a/doc/html/ada/funcs/E.htm b/doc/html/ada/funcs/E.htm index 4800730f..8eee5be2 100644 --- a/doc/html/ada/funcs/E.htm +++ b/doc/html/ada/funcs/E.htm @@ -4,7 +4,7 @@

Functions - E

[index] diff --git a/doc/html/ada/funcs/F.htm b/doc/html/ada/funcs/F.htm index 0c367dc1..d3a605f4 100644 --- a/doc/html/ada/funcs/F.htm +++ b/doc/html/ada/funcs/F.htm @@ -17,11 +17,11 @@
  • Field_Pad
  • Field_Status
  • Field_Userptr -
  • Flash +
  • Flash
  • Fld_Info
  • Flush - terminal_interface-curses-text_io.ads:65
  • Flush - terminal_interface-curses-text_io.ads:66 -
  • Flushinp +
  • Flushinp
  • Form_Opts
  • Form_Opts_Off
  • Form_Opts_On diff --git a/doc/html/ada/funcs/G.htm b/doc/html/ada/funcs/G.htm index 130388ff..a342b547 100644 --- a/doc/html/ada/funcs/G.htm +++ b/doc/html/ada/funcs/G.htm @@ -8,7 +8,15 @@
  • Generic_Field_Check
  • Generic_Next
  • Generic_Prev +
  • GetBegX +
  • GetBegY +
  • GetCurX +
  • GetCurY +
  • GetMaxX +
  • GetMaxY
  • Getmouse +
  • GetParX +
  • GetParY
  • getwin
  • Get_Arg
  • Get_Entry @@ -16,7 +24,6 @@
  • Get_Fieldtype
  • Get_Flag - terminal_interface-curses-termcap.ads:63
  • Get_Flag - terminal_interface-curses-terminfo.ads:64 -
  • Get_Flag - terminal_interface-curses.adb:93
  • Get_Itemindex
  • Get_Menu_Mark - terminal_interface-curses-menus.adb:532
  • Get_Menu_Mark - terminal_interface-curses-menus.adb:540 diff --git a/doc/html/ada/funcs/H.htm b/doc/html/ada/funcs/H.htm index 7f829f5c..fcedda80 100644 --- a/doc/html/ada/funcs/H.htm +++ b/doc/html/ada/funcs/H.htm @@ -4,11 +4,11 @@

    Functions - H

    [index] diff --git a/doc/html/ada/funcs/I.htm b/doc/html/ada/funcs/I.htm index d36acfaa..e5f516e5 100644 --- a/doc/html/ada/funcs/I.htm +++ b/doc/html/ada/funcs/I.htm @@ -4,16 +4,18 @@

    Functions - I

    [index]